php - Mangento - How to get total discount amount of Coupon Code for all items in the cart -


i'm using magento 1.9.0.1 , here code on working on:

     $quote2 = mage::getsingleton('checkout/session')->getquote();          foreach ($quote2->getallitems() $item){               $discounttotal = $item->getdiscountamount();          } 

this code giving me amount discounted coupon code of first item in cart current session.

the problem code giving me amount discounted first item not items in cart current session.

so have 2 questions:

  1. how can total discount amount items cart current session ?
  2. how can total discount amount completed order ?

thanks in advance!


Comments

Popular posts from this blog

python - Mongodb How to add addtional information when aggregating? -

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

ruby - Net::HTTP extremely slow responses for HTTPS requests -