diff --git a/CHANGELOG.md b/CHANGELOG.md index 5903df032..9bfd94bcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ All notable changes to this project will be documented in this file. This project adheres to Semantic Versioning. +### 5.4.1 +* Fix product availability building for products with OOS threshold + ### 5.4.0 * Add functionality to send disabled products to Nosto * Add ttl for nosto_product_cache diff --git a/Model/Product/Builder.php b/Model/Product/Builder.php index 4c0dec017..c40f162a4 100644 --- a/Model/Product/Builder.php +++ b/Model/Product/Builder.php @@ -38,6 +38,7 @@ use Exception; use Magento\Catalog\Model\Product; +use Magento\Catalog\Model\Product\Attribute\Source\Status as ProductStatus; use Magento\Catalog\Model\Product\Gallery\ReadHandler as GalleryReadHandler; use Magento\Framework\Event\ManagerInterface; use Magento\Store\Model\Store; @@ -405,7 +406,7 @@ private function buildAvailability(Product $product, Store $store) $isInStock = $this->availabilityService->isInStock($product, $store); if (!$product->isVisibleInSiteVisibility() || (!$this->availabilityService->isAvailableInStore($product, $store) && $isInStock) - || !$product->isSalable() + || ($product->getStatus() == ProductStatus::STATUS_DISABLED) ) { $availability = ProductInterface::INVISIBLE; } elseif ($isInStock diff --git a/composer.json b/composer.json index 4c49deb38..4b94d82f8 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nosto/module-nostotagging", "description": "Increase your conversion rate and average order value by delivering your customers personalized product recommendations throughout their shopping journey.", "type": "magento2-module", - "version": "5.4.0", + "version": "5.4.1", "require-dev": { "phpmd/phpmd": "^2.5", "sebastian/phpcpd": "*", diff --git a/etc/module.xml b/etc/module.xml index 1e3e26c7b..6365acc32 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -37,5 +37,5 @@ - +