0

In the magento API how can I retrieve the "Maximum Qty Allowed in Shopping Cart" for a specific product?

I know for the min qty allowed its $_product->getStockItem()->getMinSaleQty(); I tried getMaxSaleQty but that doesn't appear to be it.

1
  • try to print upto var_dump($_product->getStockItem()->getData())
    – sivakumar
    Nov 14, 2014 at 17:53

2 Answers 2

1

Turns out

$_product->getStockItem()->getMaxSaleQty();

was correct. I had an issue elsewhere.

1
  • so issue solved?
    – sivakumar
    Nov 14, 2014 at 17:54
0

on [ce-1.5.1.0] getStockItem() doesn't return an object. However Mage::getModel('cataloginventory/stock_item')->loadByProduct($magentoProductModel)->getMaxSaleQty(); does work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.