Home › Forums › WoodMart support forum › Variation Hide If Combinations are not Available
Variation Hide If Combinations are not Available
- This topic has 12 replies, 2 voices, and was last updated 3 years, 10 months ago by Elise Noromit.
-
AuthorPosts
-
January 28, 2021 at 11:01 am #262049
Felisha_Media11ParticipantHow can I hide unavailable combination from product page?
If I have one product having color and size
Red color having xl, xxl and black color having S, M
If visitor select Red color then S, M will be hide and if visitor select black color then xl, xxl will be hide.
How can I add custom size as in variation if visitor select custom then under size two text box will be display to enter length & breadth (in inches) as as below example link.
For example:
https://www.snugandsleep.com/products/firm-mattresses-online?variant=30127176843317January 28, 2021 at 2:20 pm #262144
Elise NoromitMemberHello,
Thank you very much for choosing our theme and for contacting us.
You can disable a variation, please enter the variation on the product page and find the option: https://gyazo.com/972ae8a08288e51ea750ae6f4b4dc8d2
Best Regards
January 29, 2021 at 3:59 am #262288
Felisha_Media11ParticipantAs per your instruction I have disabled one variation, but that is still showing.
Kindly check screenshots.
Attachments:
You must be logged in to view attached files.January 29, 2021 at 7:05 pm #262489
Elise NoromitMemberHello,
When you disable the variation, the buyer cannot choose it and add it to the cart, the swatch itself at the same time remains.
Please add this custom CSS to hide:
body .swatch-on-single.swatch-disabled { display:none; }
Please add this code to the Theme Settings > Custom CSS > Global.
Best Regards
January 30, 2021 at 3:53 am #262539
Felisha_Media11ParticipantI have done as per you instruction but still I can see disable product and I can also able to select disable products. Check attached screenshot and you can also check live on product URL
This is the product URL: http://sowell.in/new/product/buy-eurotop-foam-mattress/
I have given you wp-admin access kindly check and do the needful if I am making any mistake.
Attachments:
You must be logged in to view attached files.January 30, 2021 at 4:11 am #262543
Felisha_Media11ParticipantUpdated wp-admin credentails.
January 30, 2021 at 6:21 pm #262669
Elise NoromitMemberHello,
I have provided the custom CSS for swatches. This code would not work for the drop-down. Please provide me product URL with the searches I will double-check, the URL you have provided, is 404.
Best Regards
February 1, 2021 at 3:57 am #262861
Felisha_Media11ParticipantFebruary 1, 2021 at 2:15 pm #263005
Elise NoromitMemberHello,
The product URL you have provided does not have any disabled swatches, disable and check with the code I have provided below.
If it does not work, advise what variation you have disabled I will check again.
Best Regards
February 2, 2021 at 4:11 am #263135
Felisha_Media11ParticipantI have already provided you screenshot that I have disable products but still it is showing. Kindly check my reply #262539
I have done as per you instruction but still I can see disable product and I can also able to select disable products. Check attached screenshot and you can also check live on product URL
This is the product URL: http://sowell.in/new/product/buy-eurotop-foam-mattress/
I have given you wp-admin access kindly check and do the needful if I am making any mistake.
Attachments:
You must be logged in to view attached files.February 2, 2021 at 3:40 pm #263315
Elise NoromitMemberHello,
The code I have provided is workable for variable products based on one attribute. If the variable product is based on two or more attributes, it is not possible to hide the swatches. You see one and the same swatch (attribute) may be used in two variations: disabled and enabled one. Hiding such kind of variation would require a complicated Woocommerce сustomization that is not covered by our theme support.
Best Regards
February 4, 2021 at 5:25 am #263767
Felisha_Media11ParticipantI have reached on it and resolve this issue by my own, posting here to help others if anyone one facing same issue.
I have placed and below code in function.php in my child theme.
function lets_increase_the_variation_threshold( $threshold ) { return 100; } add_filter( 'woocommerce_ajax_variation_threshold','lets_increase_the_variation_threshold' );
Thanks a lot for trying to resolve my issue and your efforts.
February 4, 2021 at 4:33 pm #263969
Elise NoromitMemberHello,
Thank you very much for sharing your code.
If you have any questions please feel free to contact us.
Best Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register