Skip to content

Commit

Permalink
Pass $websiteId as a parameter instead of $storeId
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexander-aleman authored Feb 14, 2019
1 parent d1ce6a4 commit f53d78d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f53d78d

Please sign in to comment.