1
votes

Magento 1.7 in the code below I'm trying to get the product attribute "Minimum Qty Allowed in Shopping Cart" to display to the front end. What am I missing? Thanks

<dl class="product-sku">
                    <dt><?php echo $this->__('Product SKU') ?>:</dt>
                    <dd><?php echo $_helper->productAttribute($_product, $_product->getSKU(), 'sku') ?></dd>

                    <dt><?php echo $this->__('Dimensions') ?>:</dt>
                    <dd><?php echo $_helper->productAttribute($_product, $_product->getDimensions(), 'dimensions') ?></dd>

                    <dt><?php echo $this->__('Configuration') ?>:</dt>
                    <dd><?php echo $_helper->productAttribute($_product, $_product->getConfiguration(), 'configuration') ?></dd>

                    <dt><?php echo $this->__('Minimum Purchase Quantity') ?>:</dt>
                    <dd><?php echo $_helper->productAttribute($_product, $_product->getMinSaleQty(), 'min_sale_qty') ?></dd>
                </dl>    
2

2 Answers

13
votes

This should work:

$productQuantity = Mage::getModel("cataloginventory/stock_item")
->loadByProduct($_product->getId());

And your minimun qty its here....

$productQuantity->getMinSaleQty();
0
votes

A loaded product model contains Mage_CatalogInventory_Model_Stock_Item Object which handles the stock and inventory information. The way I like to handle this is:

$minsale = $_product->getStockItem()->getMinSaleQty();