Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Emran Ahmed

    (@emranahmed)

    WooCommerce has a filter “woocommerce_get_script_data” for all data sent to JavaScript including translated texts. So this is the proper way to change this text:

    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'] = __( 'Your new alert text', 'domain' );
    
        return $params;
    }
    Thread Starter masrem

    (@masrem)

    HI @emranahmed ,
    I have tried that. But did not work.
    Here, I have tried to put it into CSS custom:
    https://snipboard.io/x8nIFf.jpg
    https://snipboard.io/hjuH30.jpg

    And there are several red alerts from your code.
    Pls help!

    • This reply was modified 2 years, 4 months ago by masrem.
    Plugin Author Emran Ahmed

    (@emranahmed)

    This is PHP code and you tried it on CSS file which won’t work. try it on functions.php file on your theme.

    Thread Starter masrem

    (@masrem)

    Thank you @emranahmed
    it is solved!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘pop up alert: please select variation edit message’ is closed to new replies.