From 34c67af1f621786e4315bfb7e05240710614045d Mon Sep 17 00:00:00 2001 From: pratner-ch <116172438+pratner-ch@users.noreply.github.com> Date: Mon, 31 Oct 2022 13:56:46 +0400 Subject: [PATCH] Fix backorder check --- Helper/Payment.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Helper/Payment.php b/Helper/Payment.php index 0a217105..82f6a86c 100644 --- a/Helper/Payment.php +++ b/Helper/Payment.php @@ -226,13 +226,13 @@ public function isAffirmAvailableForProduct(Product $product = null) $associatedProducts = $product->getTypeInstance()->getAssociatedProducts($product); foreach ($associatedProducts as $associatedProduct) { $stockItem = $this->stockRegistry->getStockItem($associatedProduct->getId()); - if ($stockItem->getBackorders() && ($stockItem->getQty() < 1)) { + if ($stockItem->getManageStock() && $stockItem->getBackorders() && ($stockItem->getQty() < 1)) { $check = false; } } } else { $stockItem = $this->stockRegistry->getStockItem($product->getId()); - if ($stockItem->getBackorders() && ($stockItem->getQty() < 1)) { + if ($stockItem->getManageStock() && $stockItem->getBackorders() && ($stockItem->getQty() < 1)) { $check = false; } }