nevercrox.com

WooCommerce Change “Choose Some Product Options” Text

Pre-Requisites

There are no pre-requisites for this code snippet to work. Keep in mind this solution consists of two code snippets, one to display the content and one to style it.

How To Implement This Solution?

Add these two code snippets as separate entries in either your active child theme’s functions.php file or the Code Snippets plugin.

About The Snippet

Users often skip the attribute drop-down on a variable product page and head straight for the add-to-cart button. If they do this without selecting an option, a window alert will appear saying, “Choose Some Product Options.” This generic message isn’t very user-friendly and doesn’t cater to your product range. By customizing these messages, you can improve the user experience, helping customers understand what they need to do to proceed. Adding a product to the cart should be simple! This quick guide will show you how to change the alert message to something more specific to your product range.

Code Snippet 1 (Paste This Code In functions.php or Code Snippets )
/**
* Snippet Name:     Change the "Choose some product options" text on WooCommerce variable product drop-downs.
* Snippet Author:   Nevercrox Solutions
*/

add_filter( 'woocommerce_get_script_data', 'change_alert_text', 10, 2 );
function change_alert_text( $params, $handle ) {
    if ( $handle === 'wc-add-to-cart-variation' ) {
        $params['i18n_make_a_selection_text'] = __( 'Please select a date first', 'domain' );
    }
    return $params;
}

 

Just Added Blogs

Need A Specifc Blog ?

Request A Blog

Check Out More Related Snippets

0
Would love your thoughts, please comment.x
()
x