1

Magento default behavior: With option System > Configuration > Inventory > Display Out of Stock Products enabled, when configurable product has at least 1 associated simple product In Stock, then the rest simple products that are Out of Stock are "grayed out" but still visible.

In case when all simple products under the configurable are out of stock, no options(swatches) are shown whatsoever.

I would like to display all associated simple products, even if all of them are out of stock.

The same question has already been asked here, and I have tried it -

Showing Out of Stock variants(simple) when all variants are out of stock?

But the answer provided was at least incomplete, I get the same result as the author of the question in his comments. Any suggestions?

1 Answer 1

1

First copy app/code/core/Mage/Catalog/Block/Product/View/Type/Configurable.php

To app/code/local/Mage/Catalog/Block/Product/View/Type/Configurable.php

And Add this

Mage::helper('catalog/product')->setSkipSaleableCheck(true);

Right Above

$skipSaleableCheck = Mage::helper('catalog/product')->getSkipSaleableCheck();

in getAllowProducts() function defination at app/code/local/Mage/Catalog/Block/Product/View/Type/Configurable.php

Also replace this code

<?php if ($_product->isSaleable() && $this->hasOptions()): ?>
       <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif; ?>

With

<?php if ($this->hasOptions()): ?>
       <?php echo $this->getChildChildHtml('container2', '', true, true) ?>
<?php endif; ?>

in your-theme/template/catalog/product/view.phtml

And you will start seeing all the options.

2
  • 1
    Did it helped.? If yes then can you please mark this answer as accepted.? Thanks Dec 26, 2018 at 15:42
  • 1
    It works. Don't know why people doesn't bother marking an answer.
    – Vic85
    Apr 24, 2020 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.