Skip to content

Commit

Permalink
Fixed checkout not loading when shipping has tax #5
Browse files Browse the repository at this point in the history
  • Loading branch information
soppafisk committed Jul 4, 2019
1 parent 84c32d0 commit 4f5433b
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions app/code/community/Svea/Checkout/Model/Checkout/Api/BuildOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit 4f5433b

Please sign in to comment.