Mukesh
Mukesh

Reputation: 7788

How to find if a bundle product is out of stock?

I am setting a bundle product out of stock in inventory (Stock Availability option) in magento admin.

Still I am getting message as inn stock for that bundle product on product detail page.

In app\design\frontend\default\rfg\template\bundle\catalog\product\view\type\bundle.phtml

we have following code

<?php if ($_product->isAvailable()): ?>         
    <p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>           
<?php endif; ?>

Why this code does not work for the bundle product?

I want to show out of stock message if the product is itself not in stock(It should not be dependent on bundle items )

Upvotes: 0

Views: 3568

Answers (2)

nishitmakadia334
nishitmakadia334

Reputation: 1

Go to the Manage Product Page and select your product and then go to the inventory and set qty as "0" (Zero) then clears catch and indexes.

i hope this answer is working for you.

Upvotes: 0

Alex Shchur
Alex Shchur

Reputation: 751

Try to replace

<?php if ($_product->isAvailable()): ?>         
    <p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>           
<?php endif; ?>

by

<?php if ($_product->isAvailable() && $_product->getStockItem()->getIsInStock()): ?>         
    <p class="availability in-stock"><span><?php echo $this->__('In stock') ?></span></p>           
<?php endif; ?>

And reindex all

Upvotes: 1

Related Questions