Magento - get rule from coupon code

前端 未结 3 2043
粉色の甜心
粉色の甜心 2020-12-29 10:55

I have to retrieve the rule associated to a coupon code in order to display in quote the discount percentage of that rule. the simplest way is to calculate directly from quo

3条回答
  •  半阙折子戏
    2020-12-29 11:24

    First get the coupon code

    $orderNumber = 100000105; //order number with coupon code
    
    $order = Mage::getModel('sales/order')->loadByIncrementId($orderNumber);
    
    $orderDetails = $order->getData();
    
    $couponCode = $orderDetails['coupon_code'];
    

    Then use solution by Jürgen Thelen.

提交回复
热议问题