From 4f5433b70b040c8bb77a930b6a18ed656480855b Mon Sep 17 00:00:00 2001 From: Jens Pettersson Date: Thu, 4 Jul 2019 15:38:31 +0000 Subject: [PATCH] Fixed checkout not loading when shipping has tax #5 --- .../Model/Checkout/Api/BuildOrder.php | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/app/code/community/Svea/Checkout/Model/Checkout/Api/BuildOrder.php b/app/code/community/Svea/Checkout/Model/Checkout/Api/BuildOrder.php index 1845a63..069e1f1 100644 --- a/app/code/community/Svea/Checkout/Model/Checkout/Api/BuildOrder.php +++ b/app/code/community/Svea/Checkout/Model/Checkout/Api/BuildOrder.php @@ -467,28 +467,13 @@ protected function _addShipping($quote, $sveaOrder, $noSave) $methodTitle = $shippingAddress->getShippingDescription(); - - if ($noSave) { - $ratesCollection = $shippingAddress->getShippingRatesCollection(); - foreach ($ratesCollection as $rate) { - if ($rate->getCode() == $method) { - $methodTitle = $rate->getCarrierTitle() . ' - ' . $rate->getData('method_title'); - $didNotLoadFromQuote = true; - $fallbackPrice = $rate->getPrice(); - } - } - } - //Add shipping to SveaOrder. - $shipping = $quote->getShippingAddress(); $vatPercent = 0; $shippingTitle = ($methodTitle) ? mb_substr($methodTitle, 0, 40) : Mage::helper('sveacheckout')->__('Shipping'); - $shippingPrice = ($didNotLoadFromQuote) - ? $fallbackPrice - : $shipping->getShippingInclTax(); - $appliedTaxes = $shipping->getAppliedTaxes(); + $shippingPrice = $shippingAddress->getShippingInclTax(); + $appliedTaxes = $shippingAddress->getAppliedTaxes(); $appliedTaxes = reset($appliedTaxes); if (isset($appliedTaxes['percent'])) { $vatPercent = $appliedTaxes['percent'];