Esempio n. 1
0
 /**
  * Assemble recalculate order event: Add coupons data
  *
  * @param \XLite\Model\Order $order Order
  *
  * @return array
  */
 protected function assembleRecalculateOrderEvent(\XLite\Model\Order $order)
 {
     $result = parent::assembleRecalculateOrderEvent($order);
     $coupons = array();
     foreach ($order->getUsedCoupons() as $coupon) {
         $coupons[$coupon->getCode()] = abs($coupon->getValue());
     }
     if ($coupons) {
         $result['coupons'] = $coupons;
     }
     return $result;
 }