fbpx
Want To Add Extra Images Per Product Variation? Download This Free Plugin

Remove the “empty” function – Product Page

Fabio Neo

Hi

How can I remove the “empty” function on the product page?

For now we don’t need this function. We would like to always keep a variant enabled, the goal is to remove the uncheck variant function and remove “Clear”.

Thank you!
Fabio

Golam Kibria

Hi Fabio,

I hope that you are doing great.

Do you want to remove this clear button?

Please add the following snippet to your child theme’s functions.php file:

add_action( 'woocommerce_reset_variations_link' , function(){
return false;
}, 15 );

You can also use the Code Snippets plugin.

Let me know if this helps.

Thank You

Fabio Neo

Hi Golam,

Yes correct, currently only the “Empty” field is gone.

Is it possible to completely remove the functionality of even deselecting the variant?

Because if I try to click on the selected variant again, the empty function intervenes by removing the product price.

Thank you!

Golam Kibria

Hi Fabio,

Could you record the issue using a tool like this? https://www.useloom.com

It helps me figure out the issue and squash it quickly.

Thank you