Hi,
Through programming I want when all the associated simple products are out of stock and because of that shows a message in frontend on configurable product 'Out Of Stock'. In place of showing the 'Out of stock' message on configurable product page I want to hide the configurable product when all it's associated simple products are out of stock.
Thank You!
Under System->Configuration->Catalog->Stock Options there is an option to "Display Out of Stock Products". Make sure to set that to no. You'll probably have to clear your cache to get the changes to appear.
Oh and keep in mind it's a global option, so it'll be global across all your stores.
Thanks for your reply, but I already set that option as 'No' and it's not working accordingly and I want to hide the configurable products only.
I use this programming logic and now it's working great.
<?php if ($_product->isConfigurable() && !$_product->isAvailable()): ?>
<?php $simples = $_product->getTypeInstance(true)->getUsedProducts(null, $_product) ?>
<?php foreach($simples as $simpleProduct): ?>
<?php if (!$simpleProduct->isAvailable()) : ?>
<?php $this->setData('status',Mage_Catalog_Model_Product_Status:TATUS_DISABLED) ?>
<p class="availability nostock"><?php echo $this->__('Configurable Product is Out of Stock') ?></p>
<?php endif; ?>
<?php return $this->getData('status') ?>
<?php endforeach; ?>
<?php else: ?>
<?php $this->setData('status',Mage_Catalog_Model_Product_Status:TATUS_ENABLED) ?>
<?php endif; ?>
Hope this logic will help someone.