Home Forums WoodMart support forum Variation Hide If Combinations are not Available

Variation Hide If Combinations are not Available

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #262049

    Felisha_Media11
    Participant

    How 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=30127176843317

    #262144

    Hello,

    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

    #262288

    Felisha_Media11
    Participant

    As 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.
    #262489

    Hello,

    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

    #262539

    Felisha_Media11
    Participant

    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.
    #262543

    Felisha_Media11
    Participant

    Updated wp-admin credentails.

    #262669

    Hello,

    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

    #262861

    Felisha_Media11
    Participant
    #263005

    Hello,

    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

    #263135

    Felisha_Media11
    Participant

    I 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.
    #263315

    Hello,

    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

    #263767

    Felisha_Media11
    Participant

    I 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.

    #263969

    Hello,

    Thank you very much for sharing your code.

    If you have any questions please feel free to contact us.

    Best Regards

Viewing 13 posts - 1 through 13 (of 13 total)