Daric
Daric

Reputation: 16789

How do I get the product attribute Minimum Qty Allowed in Shopping Cart

I need this in Cart model.

If you go in Checkout/Model/Cart.php there is a function updateItems I want to do something here with Minimum Qty Allowed attribute value of product.

How do I get this value here?

Upvotes: 5

Views: 5726

Answers (1)

Joe Mastey
Joe Mastey

Reputation: 27119

Try this example, taken directly from Mage_Checkout_Model_Cart:

$minimumQty = $product->getStockItem()->getMinSaleQty();

The stock system is a bit obtuse, I'm not surprised it was hard to find. Hope that helps!

Thanks, Joe

Upvotes: 12

Related Questions