Home Forums WoodMart support forum Attributes display issue

Attributes display issue

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #191602

    simontayler
    Participant

    Hi there,
    On some of my products, the attributes that are out of stock are ‘greyed out’.
    Like this: https://staging.bushido.ca/product/drako-competition-judogi/

    On others, it is not. For example on this page, select Yellow & Size 00.
    It shows out of stock, but is not greyed out
    https://staging.bushido.ca/product/drako-single-wrap-belt/

    #191674

    Artem Temos
    Keymaster

    Hello,

    Yes, WooCommerce handles attributes differently when your product has a lot of variations (more than 40). If you want, you can increase this threshold to any number by adding the following code snippet to the functions.php file in your child theme

    function custom_wc_ajax_variation_threshold( $qty, $product ) {
    	return 10;
    }
    
    add_filter( 'woocommerce_ajax_variation_threshold', 'custom_wc_ajax_variation_threshold', 10, 2 );

    Regards

    #191867

    simontayler
    Participant

    Hi,
    Thanks I’ll get on to this.

    Another question I have is that when a ‘colour’ attribute is out of stock it goes a shade lighter. So that red actually looks pink. Is there a way to have a line through it or an X over it? It’s a little confusing.

    Attachments:
    You must be logged in to view attached files.
    #191915

    simontayler
    Participant

    Sorry one more thing. In the code snippet above, what number should I increase?

    #191959

    Artem Temos
    Keymaster

    You need to increase this part return 10; to 100 for example.

    Here is a code snippet that you need to add to the Custom CSS section in Theme Settings to add a line for disabled variation

    .woodmart-swatch.swatch-with-bg.swatch-disabled {
      opacity: 1;
    }
    .woodmart-swatch.swatch-with-bg.swatch-disabled:before {
      content: "";
      width: 100%;
      height: 1px;
      background-color: black;
      top: calc(50% - 1px);
      left: 0;
      position: absolute;
    }

Tagged: 

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