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

Impossible to click the variations both on the shop and the single product

Nelly EYOUM

Hello,

I am facing an issue with my website.

I can’t click on the variations to add a product in the cart.

I have deactivated the plugins one by one to see what might cause that but I can’t seem to find.

Could you please help ? My site is still on production.

Best regards !

Nelly EYOUM

Is it because I don’t have to pro version of the plugin ?
if ( $this->is_pro_active() ) {
// Register
wp_register_script( ‘woo-variation-swatches’, $this->assets_uri( “/js/frontend{$suffix}.js” ), array(
‘jquery’,
‘wp-util’,
‘underscore’,
‘wc-add-to-cart-variation’
), $this->version(), ! $is_defer );

I saw someone saying this 👇🏽 :

I found a partial fix (v 1.1.17) by editing the free plugin file, woo-variation-swatches.php around line 362.
There is an IF statement with a comment saying “If defer enable…” but the IF statement is actually just checking if the pro version is active – I suspect this is the bug. My temporary fix was to comment out that whole first block of the IF statement and just use the wp_enqueue_script in the ELSE block.

Part of the issue is wp_localize_script won’t register the handle woo-variation-swatches as it hasn’t been set yet.

I still have a minor issue on archive pages which I’ll work through but it at least works on the product pages now. Hopefully they can fix this before their next version otherwise any fix will need to be applied again.

Tanvirul Haque

Hi Nelly EYOUM,

Could you please tell me how you enable swatches on the shop page https://prnt.sc/1613mfi with the pro version but all codes are copied from our swatches plugin?

Thank you

Nelly EYOUM

Hello,

I don’t have the pro version. I have just downloaded it from the dashboard.

Is there anyway to fix it please ?

The website was supposed to be online on Friday but due to this bug I couldn’t release it.

Best regards,

Tanvirul Haque

Hi Nelly,

It’s a development local site, please login here and setup your theme. And try to reproduce your issue here.

https://wptestbox.com/91000/wp-admin/

Username: admin

Password: png5jA3FX8#GJPew^6

Thank You

Nelly EYOUM

Hello,

I don’t understand what you mean by “try to reproduce your issue here”

The theme is setup as you required.

Best regards

Nelly EYOUM

I have tried to import a demo but see what happened 

Tanvirul Haque

Hello Nelly EYOUM,

I don’t understand what you mean by “try to reproduce your issue here”

Replicate the issue on our dev test site exactly what on you site so that we can investigate on that.

Thanks

Nelly EYOUM

Hello,

I won’t have the time to do that since I am launching the site today.

I will just use another plugin.

Best regards

Tanvirul Haque

Hi Nelly,

We are sorry for the inconvenience. Hopefully, we can help you next time.

Thank You