简体   繁体   English

如何在Magento中获得当前会话订单的优惠券代码折扣金额

[英]How to get the coupon code discount amount for the current session order in Magento

I'm trying to find a code that will give me the discount amount for the current session order when I discount code is used. 我正在尝试找到一个代码,当我使用折扣代码时,该代码将为我提供当前会话订单的折扣金额。

Here is what I have right now but it is not working: 这是我现在拥有的东西,但是它不起作用:

        $coupon = Mage::getModel('salesrule/rule');
        $couponCollection = $coupon->getCollection();
        foreach($couponCollection as $c){
            $CouponDiscount = $c->getDiscountAmount();
        }
        echo $CouponDiscount;

How can I get the amount of the discount used in the current session order ? 如何获得当前会话订单中使用的折扣金额?

To get the current discount amount for your customers quote please see here: 要获取当前客户报价的折扣金额,请参见此处:

https://magento.stackexchange.com/a/33761 https://magento.stackexchange.com/a/33761

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM