Magento-在产品清单上显示库存指示器

问题描述

| 如何在Magento产品清单上显示库存指示器? 非常感谢。     

解决方法

要显示剩余的物品数量,请使用以下方法:
<?php echo (int) Mage::getModel(\'cataloginventory/stock_item\')->loadByProduct($_product)->getQty(); ?>
    

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...