From 4a4d8ebf105a70b092b114f2821528804e942347 Mon Sep 17 00:00:00 2001 From: Enrico Falappa Date: Tue, 29 Nov 2022 23:43:28 +0100 Subject: [PATCH] getStockStatusBySku websiteId --- Model/Product.php | 3 ++- composer.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Model/Product.php b/Model/Product.php index 9c4063b..6943e47 100644 --- a/Model/Product.php +++ b/Model/Product.php @@ -170,7 +170,8 @@ public function getStockBySku($sku) { //$storeId = $this->_storeManager->getStore()->getId(); $storeId = (int)$this->configData->getStoreId(); - $stockStatus = $this->stockRegistry->getStockStatusBySku($sku, $storeId); + $websiteId = $this->_storeManager->getStore($storeId)->getWebsiteId(); + $stockStatus = $this->stockRegistry->getStockStatusBySku($sku, $websiteId); $stockData = $stockStatus->getStockItem()->getData(); if ($this->configData->getSalableQuantity($storeId)) { diff --git a/composer.json b/composer.json index 819d3c6..bb14b60 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "nooe/module-connector", "description": "Nooe Magento 2 Connector", "type": "magento2-module", - "version": "1.1.3", + "version": "1.1.4", "minimum-stability": "stable", "license": "proprietary", "require": {