Home Forums WoodMart support forum swatches style

swatches style

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #489546

    kontakt-3113
    Participant

    Hi,

    when my product is out of stock, swatch with size attribute doesn’t change.

    I have variation products, with sizes from 34 to 48, and one size is out of stock. Customers can’t see which size is out of stock.

    #489659

    Hello,

    Go to Products > Attributes > edit attribute > Choose the Disabled swatch style.

    The Disabled Swatch style is for the variants of the Products which are disabled not for the Out of Stock variants. So, you need to have the variant of the Product not checked with the Enable option on it and then the Disabled Swatch style will work accordingly. See these images for reference:
    https://snipboard.io/BMehIF.jpg
    https://snipboard.io/NbOzfP.jpg

    Best Regards.

    #489666

    kontakt-3113
    Participant

    So if one of my variants will be sold out, the customer won’t see that this variant is not avaiable? I have to manualy disable variant?

    #489742

    Hello,

    When the product variation is out of stock then customers will not be able to select the variation.

    And if you want to hide this variation try to add the custom css code in the Theme Settings > Custom CSS:

    [class*="wd-swatches"].wd-dis-style-2 .wd-swatch.wd-disabled {
    	display: none !important;
    }

    Best Regards.

    #489748

    kontakt-3113
    Participant

    Is it possible to automatically disable variant when it’s out of stock?

    I want my clients to see, that some sizes are available and some not, without clicking on all variations just to check that they are not available

    #489794

    Hello,

    In the ‘Product Data’ section, select the ‘Variations’ tab.
    You’ll see a list of variations with their attributes and stock statuses.
    You need to deactivate the variation you want.

    But in the previous reply I gave you a custom css. When your variation is out of stock it is not visible.
    Please try to add this code and check the issue.

    Best Regards.

    #496897

    kontakt-3113
    Participant

    Hi, unfortunately that CSS don’t work 🙁

    Out of stock variation is still visible.

    #497001

    Hello,

    Can you please share the page url where the out of stock variation is showing. Also share the wp logins detail i will check and give you a possible solution.

    Best Regards.

    #497837

    kontakt-3113
    Participant

    Yes, details in a private content below:

    #497927

    Hello,

    This code is working fine on your site. I have visited your site and edited the “Bluza damska pastelowo różowa” product. Click on variation and uncheck the option enabled.
    https://ibb.co/whsfx5n
    And on the product page the variation is not showing:
    https://ibb.co/jTn6LhG

    Best Regards.

    #497937

    kontakt-3113
    Participant

    Yes, but i need to manualy disable variations that are out of stock.

    I will have 300 products in my shop, with 5 variations per product. Its 1500 variations total (!).

    Example:

    I have a tshirt with 5 sizes (xs, s, m, l , xl). When any size is out of stock, i want it to be hidden OR marked as out of stock. RIght now i can see that some size is out of stock, but only if i click on that size on the product page.

    #498060

    Hello,

    Sorry to say it is not possible in theme settings to be available for that. It requires customization and beyond our support policy. You need to uncheck the option enabled and it will work for you.

    Best Regards.

    #498800

    kontakt-3113
    Participant

    For those who need the solution, here’s a simple php code to do that:

    function ace_grey_out_variations_when_out_of_stock( $is_active, $variation ) {
    if ( ! $variation->is_in_stock() ) {
    $is_active = false;
    }

    return $is_active;
    }
    add_filter( ‘woocommerce_variation_is_active’, ‘ace_grey_out_variations_when_out_of_stock’, 10, 2 );

    #499009

    Hello,

    You are Most Welcome.

    We are glad that you managed to solve the problem yourself. You are Great!!!

    Let us know if there’s anything else we can do for you! You can always reach us at any time. We are always here to help you.

    Have a wonderful day.

    Topic Closed.
    Best Regards.

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

The topic ‘swatches style’ is closed to new replies.