Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Need help with code
 
tapebrothers
Sr. Member
 
Total Posts:  96
Joined:  2008-05-14
 

I am using this code to show stock qty on front end But i only want it to show the qty from 99 items and down so if i have 1000 pieces of an item i don’t want it to show until the number get down to 99 pieces Can any one Help?

This is the code :

<?php echo $this->__('Inventory Status')?>
<?php echo<?
=(int)(Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty()) ?>

Thank You shock

 
Magento Community Magento Community
Magento Community
Magento Community
 
laurent
Member
 
Total Posts:  75
Joined:  2007-08-31
Paris, France
 

Should be something like:

<?php $qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty ?>
<?php 
if ($qty 100) echo $qty ?>
 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top