pkarsai / show-out-of-stock-products-magento2

This module makes Magento 2 display out-of-stock configurations for configurable products when the relevant option is set to Yes in the back end.
MIT License
13 stars 8 forks source link

Out of stock product isn't showing as crossed out #1

Open thomas-harding opened 5 years ago

thomas-harding commented 5 years ago

Using Magento 2.2.5

I've enabled this module and it works well. However, the out of stock swatch doesn't show any indication of it being unavailable (not crossed out).

When I attempt to add to cart, it returns with a message saying it was out of stock.

Out of stock option:

<div class="swatch-option text" id="option-label-eliquid_strength-199-item-68" aria-checked="false" aria-describedby="option-label-eliquid_strength-199" tabindex="0" option-type="0" option-id="68" option-label="0.0%" aria-label="0.0%" option-tooltip-thumb="" option-tooltip-value="0" role="option">0</div>

In stock option:

<div class="swatch-option text" id="option-label-eliquid_strength-199-item-69" aria-checked="false" aria-describedby="option-label-eliquid_strength-199" tabindex="0" option-type="0" option-id="69" option-label="0.3%" aria-label="0.3%" option-tooltip-thumb="" option-tooltip-value="3" role="option">3</div>

The markup is the same.

pkarsai commented 5 years ago

Are you sure that the module is properly installed and working?

What is your Magento Framework version? This module requires a Magento Framework version at least 101.0.7 and I think that comes with Magento 2.2.7.

The classes for the out of stock option should also contain the disabled class. The module should be adding that in case the configuration is out of stock.

medjabir commented 4 years ago

Hello Peter,

I'am using Magento 2.3.4, and came across the same issue, I am thinking about fetching isInStock and pass it in getJsonSwatchConfig() method to add the disabled class.

I don't know if this solution is feasible! But I would love your insights about how Magento passes this class to out of stock products.

Your module is highly appreciated. Thank you