From 95a510c5eaef4c886239eea4a0bc83748175b56a Mon Sep 17 00:00:00 2001 From: Bob Olde Hampsink <378974+boboldehampsink@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:08:56 +0200 Subject: [PATCH] Add order context to isPurchasableShippable in class ShippingMethod --- src/base/ShippingMethod.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base/ShippingMethod.php b/src/base/ShippingMethod.php index 487aa5966d..1aa0b90d39 100644 --- a/src/base/ShippingMethod.php +++ b/src/base/ShippingMethod.php @@ -176,7 +176,7 @@ public function getPriceForOrder(Order $order): float $amount = $shippingRule->getBaseRate(); foreach ($order->getLineItems() as $item) { - if ($item->getPurchasable() && !$item->purchasable->hasFreeShipping() && Plugin::getInstance()->getPurchasables()->isPurchasableShippable($item->getPurchasable())) { + if ($item->getPurchasable() && !$item->purchasable->hasFreeShipping() && Plugin::getInstance()->getPurchasables()->isPurchasableShippable($item->getPurchasable(), $order)) { $percentageRate = $shippingRule->getPercentageRate($item->shippingCategoryId); $perItemRate = $shippingRule->getPerItemRate($item->shippingCategoryId); $weightRate = $shippingRule->getWeightRate($item->shippingCategoryId);