Skip to content

Commit

Permalink
Additional check on shippingOverride
Browse files Browse the repository at this point in the history
  • Loading branch information
alecritson committed Oct 27, 2023
1 parent 86ff74d commit 24835c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/Pipelines/Cart/ApplyShipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function handle(Cart $cart, Closure $next)
$shippingSubTotal = $shippingOption->price->value;
$shippingTotal = $shippingSubTotal;

if ($cart->shippingAddress) {
if ($cart->shippingAddress && ! $cart->shippingBreakdown) {
$cart->shippingAddress->shippingTotal = new Price($shippingTotal, $cart->currency, 1);
$cart->shippingAddress->shippingSubTotal = new Price($shippingOption->price->value, $cart->currency, 1);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/core/src/Pipelines/Cart/CalculateTax.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ public function handle(Cart $cart, Closure $next)

$taxTotal += $shippingTaxTotal?->value;

if ($cart->shippingAddress) {
if ($cart->shippingAddress && ! $cart->shippingOptionOverride) {
$cart->shippingAddress->taxBreakdown = $shippingTax;
$cart->shippingAddress->shippingTaxTotal = $shippingTaxTotal;
}

$taxBreakDownAmounts = $taxBreakDownAmounts->merge(
$shippingTax->amounts
);
Expand Down

0 comments on commit 24835c0

Please sign in to comment.