From f53d78df6dbcdc1233acd89991579d40d07fd045 Mon Sep 17 00:00:00 2001 From: alexander-aleman <35915533+alexander-aleman@users.noreply.github.com> Date: Thu, 14 Feb 2019 08:21:17 +0100 Subject: [PATCH] Pass $websiteId as a parameter instead of $storeId The method getProductPriceData expects $websiteId as a parameter, but $storeId was given. It should be $websiteId since prices are website specific. Also see \Magento\Elasticsearch\Elasticsearch5\Model\Adapter\DataMapper\ProductDataMapper where a similar method exists and $websiteId is used. --- .../Model/Adapter/BatchDataMapper/PriceFieldsProvider.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/PriceFieldsProvider.php b/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/PriceFieldsProvider.php index 875d384a20596..56c84593256be 100644 --- a/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/PriceFieldsProvider.php +++ b/app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/PriceFieldsProvider.php @@ -72,13 +72,15 @@ public function __construct( */ public function getFields(array $productIds, $storeId) { + $websiteId = $this->storeManager->getStore($storeId)->getWebsiteId(); + $priceData = $this->dataProvider->getSearchableAttribute('price') ? $this->resourceIndex->getPriceIndexData($productIds, $storeId) : []; $fields = []; foreach ($productIds as $productId) { - $fields[$productId] = $this->getProductPriceData($productId, $storeId, $priceData); + $fields[$productId] = $this->getProductPriceData($productId, $websiteId, $priceData); } return $fields;