Example #1
0
 /**
  * @param ShopgateCartBase $order
  * @throws ShopgateLibraryException
  */
 protected function _getSimpleShopgateCoupons(ShopgateCartBase $order)
 {
     if ($order instanceof ShopgateOrder) {
         foreach ($order->getItems() as $item) {
             /** @var ShopgateOrderItem $item */
             if (!$item->isSgCoupon()) {
                 continue;
             }
             if ($this->useTaxClasses) {
                 $itemAmount = $item->getUnitAmount();
             } else {
                 $itemAmount = $item->getUnitAmountWithTax();
             }
             $obj = new Varien_Object();
             $obj->setName($item->getName());
             $obj->setItemNumber($item->getItemNumber());
             $obj->setUnitAmountWithTax($itemAmount);
             $obj->setQty($item->getQuantity());
             $this->_virtualObjectStack[] = $obj;
         }
     }
 }