Skip to content

Commit

Permalink
Merge branch 'v3' into develop
Browse files Browse the repository at this point in the history
# Conflicts:
#	CHANGELOG.md
#	composer.json
#	src/base/ShippingMethod.php
  • Loading branch information
lukeholder committed Oct 19, 2023
2 parents 1c604c5 + bc11b8a commit fc50df2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/adjusters/Shipping.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function adjust(Order $order): array

foreach ($lineItems as $item) {
$purchasable = $item->getPurchasable();
if ($purchasable && !Plugin::getInstance()->getPurchasables()->isPurchasableShippable($purchasable)) {
if ($purchasable && !Plugin::getInstance()->getPurchasables()->isPurchasableShippable($purchasable, $order)) {
$nonShippableItems[$item->id] = $item->id;
}
}
Expand Down Expand Up @@ -129,7 +129,7 @@ public function adjust(Order $order): array
}

$freeShippingFlagOnProduct = $item->purchasable->hasFreeShipping();
$shippable = Plugin::getInstance()->getPurchasables()->isPurchasableShippable($item->getPurchasable());
$shippable = Plugin::getInstance()->getPurchasables()->isPurchasableShippable($item->getPurchasable(), $order);
if (!$freeShippingFlagOnProduct && !$hasFreeShippingFromDiscount && $shippable) {
$adjustment = $this->_createAdjustment($shippingMethod, $rule);

Expand Down
2 changes: 1 addition & 1 deletion src/base/ShippingMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getPriceForOrder(Order $order): float

foreach ($lineItems as $item) {
$purchasable = $item->getPurchasable();
if ($purchasable && !Plugin::getInstance()->getPurchasables()->isPurchasableShippable($purchasable)) {
if ($purchasable && !Plugin::getInstance()->getPurchasables()->isPurchasableShippable($purchasable, $order)) {
$nonShippableItems[$item->id] = $item->id;
}
}
Expand Down

0 comments on commit fc50df2

Please sign in to comment.