• Resolved Henry

    (@henrybaum)


    This snippet used to work to remove “Billing” from the checkout error message, but doesn’t seem to with PayPal Commerce:

    function customize_wc_errors( $error ) {
    if ( strpos( $error, 'Billing ' ) !== false ) {
    $error = str_replace("Billing ", "", $error);
    }
    return $error;
    }
    add_filter( 'woocommerce_add_error', 'customize_wc_errors' );

    Is there a new filter besides woocommerce_add_error?

    There are also new error messages such as, “Unable to create the order due to below errors.” Is there a way to change/remove those with a functions snippet, rather than translation?

Viewing 1 replies (of 1 total)
  • Plugin Support Kader Ibrahim S. a11n

    (@kaderibrahim)

    Hello @henrybaum,

    Thank you for reaching out to WooCommerce support. woocommerce_add_error is indeed the correct filter to override messages in WooCommerce notices. However, please note that this filter will work only when the wc_print_notice is used to print the error messages.

    If a plugin uses a different function to add an error notice, this filter may not be helpful. Can you please let us know the PayPal plugin you are using? I can take a look at what is the function that this plugin is using to print errors.

Viewing 1 replies (of 1 total)
  • The topic ‘Change Error Message’ is closed to new replies.