/** * @param Mage_Sales_Model_Order $order * * @return array */ protected function _getExtraCost($order) { $result = array(); /** * shipping */ $shippingCostAmount = $order->getShippingAmount(); if ($shippingCostAmount > 0) { $extraCost = new ShopgateExternalOrderExtraCost(); $extraCost->setAmount($shippingCostAmount); $extraCost->setType(ShopgateExternalOrderExtraCost::TYPE_SHIPPING); $extraCost->setTaxPercent(Mage::helper('shopgate')->calculateTaxRate($shippingCostAmount, $order->getShippingTaxAmount())); $result[] = $extraCost; } /** * payment */ $shopgatePaymentFee = $order->getShopgatePaymentFee(); if ($shopgatePaymentFee > 0) { $extraCost = new ShopgateExternalOrderExtraCost(); $extraCost->setAmount($shopgatePaymentFee); $extraCost->setType(ShopgateExternalOrderExtraCost::TYPE_PAYMENT); $result[] = $extraCost; } $codPaymentFee = $order->getCodFee(); if ($codPaymentFee > 0) { $extraCost = new ShopgateExternalOrderExtraCost(); $extraCost->setAmount($codPaymentFee); $extraCost->setType(ShopgateExternalOrderExtraCost::TYPE_PAYMENT); $extraCost->setTaxPercent(Mage::helper('shopgate')->calculateTaxRate($codPaymentFee, $order->getCodTaxAmount())); $result[] = $extraCost; } return $result; }
/** * @param OrderCore $orderCore * * @return array */ protected function _getExtraCost($orderCore) { $result = array(); if ($orderCore->total_shipping_tax_excl > 0) { $extraCost = new ShopgateExternalOrderExtraCost(); $extraCost->setType('shipping'); $extraCost->setAmount($orderCore->total_shipping_tax_excl); $extraCost->setTaxPercent($orderCore->carrier_tax_rate); $result[] = $extraCost; } return $result; }