swatch not working on 2 specific products
-
Hi,
I have 2 specific products that show the swatch on the grid but doesnt show on the product page (links in private) I think its because they have 30+ variants, Can this be fixed with a code or anything? please make sure you are logged in to see them (login info in private)
Thanks.
Hello,
WooCommerce system doesnβt provide frontend with all variations if their number is bigger than 40. And because of that images for some variations are not available in the template file. You can fix it by adding the following line to the file woodmart/woocommerce/single-products/add-to-cart/variable.php
between lines #28 and #30
$available_variations = $product->get_available_variations();
Best Regards
Hi,
I just did it, the code line ended up showing over my variants and it didnt fix the problem π
check private content to see how it looks.
Thanks.
Hello,
Please remove the code to lines #28 and #30, please.
Best Regards
Excellent!!
I moved it between 28 and 30 but it didnt work, so I moved it before line #28 and it worked!
here’s how it should look if anyone needed it π
https://gyazo.com/0263154e186ae9e86625031bc125a0b4
Thanks a lot Elise π
Hello,
Thank you for the feedback. If you have any questions please feel free to contact us.
Best Regards
The topic ‘swatch not working on 2 specific products’ is closed to new replies.