fbpx
Enjoy Year-End Sale: 50% Off All Plugins! Coupon Code: NewYear2025

incorrect formatting on “clear” button on single product page

Hi

I’m testing your upgrade and noticed inconsistencies when upgrading.

The “clear” button on single product page has changed. It is now formatted differently since the upgrade. It looks like it is using CSS from my theme as the “clear” button (It’s not actually a button)  is now formatted like my theme buttons (Like add to cart, for example)

Please see the before and after screenshots

cheers, Bruce

 

Hakik Zaman

Hi Watersports SA,

Thanks for reaching out to us.

Unfortunately, displaying the clear button is not a feature of our plugin, it is a feature of the WooCommerce itself.

Can you please temporarily deactivate our Swatches plugin and check whether it displays correctly or not?

Hope to hear from you soon.

Thank You

Hi Hakik

You are correct, it’s not you. The p[roblem persists when I deactivate your pro and std plugin…

Presumably a woocommerce issue?

 

regards, Bruce

Hakik Zaman

Hi Watersports SA,

Perhaps recently WooCommerce changed the clear markup from <a> to <button>.

The style comes from the theme as they added CSS for the <button> markup.

I hope it will clear up your confusion.

Thank You

Hi Hakik

“Perhaps recently WooCommerce changed the clear markup from <a> to <button>.” – correct, that’s what they have done. However they have not committed to fixing / undoing the change.  There code looks really bad, and even if I restyle with CSS is still can’t get the button to be nice, and lined up correctly.

I’m thinking of hiding their button (which is easy with CSS), and creating my own button, using the old <a> version which I can presumably position correctly,  and style correctly.

Does this make sense, and sound achievable??

 

regards, Bruce

 

Hakik Zaman

Hi Watersports SA,

You can add the following snippet using a plugin called Code Snippets:

add_filter( 'woocommerce_reset_variations_link', function( $markup ){
return sprintf( '<a class="reset_variations" href="#">%s</a>', esc_html__( 'Clear', 'woocommerce' ) );
}, 10, 1);

You can also add the above snippet inside your current theme’s functions.php file.

Note: It is recommended to add the Custom Code to the child theme’s functions.php file, to avoid any data loss while updating the Parent Theme.

It will revert to the old markup of WooCommerce for the clear button.

Hope to hear from you soon.

Thank You

Hi

That works 100%. Thank you so much for your help. Your assistance was absolutely great

 

thanks, Bruce

Hakik Zaman

Hi Watersports SA,

Thank you so much for your appreciation.

I am changing the status of this ticket to Resolved.

Please feel free to open a new ticket if you encounter any issues with our plugin.

Have a nice day!

Thank You