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?

0

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.

  • Did it helped.? If yes then can you please mark this answer as accepted.? Thanks – Muhammad Mannan Masood Dec 26 '18 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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