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(); ?>
This code solved my problem because I use quantity increments:
$productData = Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product); $qtyIncrements = $productData->getQtyIncrements();
$_stock_data = $product->getStockItem()->getData(); $_qtde_min = (intval($_stock_data['min_sale_qty'])) ? intval($_stock_data['min_sale_qty']) : 1;
<?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!
Source: https://habr.com/ru/post/1392858/More articles:Shutter UIImagePickerController - iosWhat is the [Android] Java equivalent of the VB.NET static keyword? - javaData structure for storing data and calculating average - data-structuresSending mail not working in Spring / Maven / Java 6 - javaHow to start myBatis implementation using spring? - springHow to find the location of a barcode in an image - imageWhat is faster for writing C # (.NET) or PERL files? - performanceIncorrect jquery custom error messages - jqueryjavac compiler inconsistencies - javaHow to complete a task when a user closes an Eclipse application - javaAll Articles