diff --git a/src/adjusters/Shipping.php b/src/adjusters/Shipping.php index c4b6f034b9..f475de4ef7 100644 --- a/src/adjusters/Shipping.php +++ b/src/adjusters/Shipping.php @@ -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; } } @@ -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); diff --git a/src/base/ShippingMethod.php b/src/base/ShippingMethod.php index 1aa0b90d39..92ec375bb9 100644 --- a/src/base/ShippingMethod.php +++ b/src/base/ShippingMethod.php @@ -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; } }