Home › Forums › WoodMart support forum › Variable product combinations displaying when they are not available
Variable product combinations displaying when they are not available
- This topic has 8 replies, 3 voices, and was last updated 4 years ago by FrancoMarini.
-
AuthorPosts
-
October 23, 2020 at 2:37 pm #235659
ToriTori38ParticipantHi there,
We have a variable product where people can select product “size” and “colour”. Not all product sizes come in all colours. However on the frontend, when you select a size, it shows all the colour variations (not just the colours available in that size). This is not standard WooCommerce behaiour. Usually WooCommerce only shows the colours available (it hides variables which are not possible combinations).
It’s very annoying from a user perspective as you have no idea which product variations are posisble, without trying each one.
Is there a way to hide the product variations which are not available (like is usually standard with WooCommerce)? Many thanks
October 23, 2020 at 7:46 pm #235695
Elise NoromitMemberHello,
Please test this on the default Attribute filter and you will see that when you select a size, the result will show all the products having this size, regardless of the colors. Our theme does not influence the Woocommerce functionality. WoodMart widgets just expand a bit the default filter attribute.
Best Regards
October 26, 2020 at 8:51 am #236128
ToriTori38ParticipantHi there. This was nothing to do with where I setup the attributes. WooCommerce by default hides unavailable variations in products. However, this is limited to only 20 product variations β that was the problem!
Now I found that out, I have added a snippet to fix it. You can close this ticket.
October 26, 2020 at 12:10 pm #236191
Elise NoromitMemberOk. If you have any questions please feel free to contact us.
Best Regards
November 19, 2020 at 8:44 am #242806
FrancoMariniParticipantHo ToriTori. You are a genius. How do you fin it?
Can you explain like βto a chiliβ? Im not a programmer and i donβt know how ti do it.Please please 😀
November 19, 2020 at 8:48 am #242810
ToriTori38ParticipantIt’s your lucky day π This snippet will save you a lot of time and headaches and will solve your problem:
function custom_wc_ajax_variation_threshold( $qty, $product ) { return 50; } add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );
November 19, 2020 at 12:58 pm #242900
FrancoMariniParticipantHi Man!!!
thanks a lot.. a very very lot!!! π
Itry but i think is working with first and second variant.
If I have 4 variant I have to change the snippet?this is my page test
https://www.conkrea.shop/v1/?post_type=product&p=9069November 19, 2020 at 1:22 pm #242913
ToriTori38ParticipantGlad to help but I am afraid I cannot offer you any support past that! I’m not a developer myself. Best of luck π
November 19, 2020 at 1:36 pm #242915
FrancoMariniParticipantok thanks a lot! π
-
AuthorPosts
- You must be logged in to create new topics. Login / Register