public function setOrderItem(Ess_M2ePro_Model_Orders_OrderItem $orderItem)
 {
     if (is_null($orderItem->getId())) {
         throw new Exception('Item does not exist.');
     }
     $this->_orderItem = $orderItem;
     return $this;
 }
示例#2
0
 protected function getPrice(Ess_M2ePro_Model_Orders_OrderItem $item)
 {
     $order = $this->getOrder();
     $orderTaxPercent = (double) $order->getData('sales_tax_percent');
     $itemPrice = (double) $item->getData('price');
     if ($orderTaxPercent > 0) {
         if ($this->isConfigPriceIncludesTax() && $order->hasTax()) {
             $taxAmount = $this->getTaxCalculator()->calcTaxAmount($itemPrice, $orderTaxPercent, false, false);
             $itemPrice += $taxAmount;
         }
         if (!$this->isConfigPriceIncludesTax() && $order->hasVat()) {
             $taxAmount = $this->getTaxCalculator()->calcTaxAmount($itemPrice, $orderTaxPercent, true, false);
             $itemPrice -= $taxAmount;
         }
     }
     return round($itemPrice / $this->_currencyConvertRate, 2);
 }