Skip to content

Commit f53d78d

Browse files
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.
1 parent d1ce6a4 commit f53d78d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/code/Magento/Elasticsearch/Model/Adapter/BatchDataMapper/PriceFieldsProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,15 @@ public function __construct(
7272
*/
7373
public function getFields(array $productIds, $storeId)
7474
{
75+
$websiteId = $this->storeManager->getStore($storeId)->getWebsiteId();
76+
7577
$priceData = $this->dataProvider->getSearchableAttribute('price')
7678
? $this->resourceIndex->getPriceIndexData($productIds, $storeId)
7779
: [];
7880

7981
$fields = [];
8082
foreach ($productIds as $productId) {
81-
$fields[$productId] = $this->getProductPriceData($productId, $storeId, $priceData);
83+
$fields[$productId] = $this->getProductPriceData($productId, $websiteId, $priceData);
8284
}
8385

8486
return $fields;

0 commit comments

Comments
 (0)