I wanted to get a way that i could get the quantity if a item that has been added to cart and display in the success message to prompt the user about a promotion. The site i'm working on has Any 3 items for £15.

So if a customer was to order a quantity of 2 for a item, i want something dynamic that looks at the quantity added and in the success page to say order 1 more to get "Any 3 items for £15".

1 Answer 1


or if you want qty for every item in cart separately

$cart = Mage::getModel('checkout/cart')->getQuote();
foreach ($cart->getAllItems() as $item) {
    $qty = $item->getQty();

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.