Home Forums WoodMart support forum Issue with wd-swatch not being disabled for variations out of stock

Issue with wd-swatch not being disabled for variations out of stock

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #628540

    voltraider
    Participant

    I am currently experiencing an issue with the wd-swatch feature on my WooCommerce store using the Woodmart theme. When a variation is out of stock (stock = 0), the corresponding swatch is not being disabled or visually distinguished (e.g., grayed out or made transparent).

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

    Hello,

    Navigate to WooCommerce -> Settings -> Products -> Inventory -> turn off the “Hide out of stock items from the catalog” option.. https://prnt.sc/9uZ_w7CTuRDm and check the issue.

    Best Regards

    #628676

    voltraider
    Participant

    This is disabled. It doesn’t help.

    #628677

    voltraider
    Participant

    When I enabled this option to hide out-of-stock items, I see that it worked. But I don’t want to hide out-of-stock items, as the store should have the Notify about availability option. Is it possible to configure this without it?

    #628831

    Hello,

    Sorry to say, I am not able to log in or access the WP backend because you have activated the maintenance mode and the WP admin login URL redirects me to the maintenance page. So please send the WP admin login URL so i will further check on your site and give you a possible solution.

    Best Regards.

    #628850

    voltraider
    Participant

    I already found a solution. I added the file woocommerce/single-product/add-to-cart/variable.php to the child volume. I added a check there in the code on line 284:

    $variation_in_stock = false;

    foreach ( $available_variations as $variation ) {
    if ( isset( $variation[‘attributes’][ ‘attribute_’ . $attribute_name ] ) &&
    $variation[‘attributes’][ ‘attribute_’ . $attribute_name ] === $term->slug &&
    $variation[‘is_in_stock’]
    ) {
    $variation_in_stock = true;
    break;
    }
    }

    if ( !$variation_in_stock ) {
    $class .= ‘ wd-variation-out-of-stock’;
    }

    I also added the CSS style in style.css:
    .single-product .wd-swatch.wd-variation-out-of-stock {
    opacity: 0.5;
    }

    Please check this on your side and make it possible for swatches to become semi-transparent (wd-disabled) if the product is not available, but the products that are not available are not hidden on the site.

    #628967

    Hello,

    Sorry but there is no option in Theme Settings available for that.

    It requires customizations and this is beyond our limitations and support policy.

    Regards.
    Xtemos Studios

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