On variable products, I would like to remove the reset variation button that appears on my WooCommerce product page when selecting variations (ex. Size, colour), that allows to reset all the choices that have been made.
This pop-up, even when not displayed yet, modifies the display of the Variation tab. Last variation tab is not aligned with the other tabs (because some space is needed for the pop-up to appear).
What should I do to not call this function at all (so no space is needed for the pop-up and the variation tabs display correctly) ?
I've tried to make it invisible, but it is not enough. I would like to not call it at all.
<a class="reset_variations" href="#" style="visibility: visible; display: block;">Reset</a>
On the "click" event a javascript is called.
I expect the javascript not to be called so that the variation tab displays correctly.
The following will disable the reset variation button on variable products:
add_filter('woocommerce_reset_variations_link', '__return_empty_string');
Code goes in function.php file of your active child theme (or active theme). Tested and works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With