General

Remove clear(reset) link from variation Products

Pinterest LinkedIn Tumblr

Maybe you want to remove the clear button from variations for various reasons like indicate the buy button better. This article tells how to do it. Besides removing, also we tell how to change its text.

Before reading the solution, to be sure about what is the issue exactly, you should look at the below image. We will remove the “clear” button.

If you are okay to solve it, the solution is so simple. Copy and paste the below snippet to your function.php.That’s it!

add_filter("woocommerce_reset_variations_link", "__return_false" );

Change “clear” text

The below snippet changes the “clear” text with your custom text. Usage is so simple. Change “Custom clear text” with your custom text. Then, paste the snippet to your function.php.

add_action( 'woocommerce_reset_variations_link' , 'wf_custom_clear_text', 15 );
function wf_custom_clear_text() {
    echo esc_html__( 'Custom Clear Text', 'woocommerce' );
}

Look at WooFocus for other usefull Tutorials & Tricks!

Write A Comment