How can I get the minimum amount of product in the product list?

When I tried the following code, it just prints an empty line. How can I get the product sales quantity on this page?

/ Product Catalog /list.phtml

<?php echo $_product->getStockItem()->getMinSaleQty(); ?> 
+4
source share
3 answers

This code solved my problem because I use quantity increments:

 $productData = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product); $qtyIncrements = $productData->getQtyIncrements(); 
+9
source
 $_stock_data = $product->getStockItem()->getData(); $_qtde_min = (intval($_stock_data['min_sale_qty'])) ? intval($_stock_data['min_sale_qty']) : 1; 
+1
source
 <?php $loadProduct = Mage::getModel('catalog/product')->load( $_product->getId() ); ?> <label for="qty"><?php echo $this->__('Minimum Quantity:') ?><span class="h1"> <?php echo $this->getMinimalQty($loadProduct); ?></span>Piece/s </label> 

This code works 100% OK!

0
source

Source: https://habr.com/ru/post/1392858/


All Articles