Skip to content

Commit ba1bd4e

Browse files
author
Oleksandr Iegorov
committed
MC-43176: GraphQL returns the price ranges of a simple product on another store
1 parent ab815b5 commit ba1bd4e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/code/Magento/CatalogGraphQl/Model/Resolver/Product/PriceRange.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
*/
2424
class PriceRange implements ResolverInterface
2525
{
26+
private const STORE_FILTER_CACHE_KEY = '_cache_instance_store_filter';
27+
2628
/**
2729
* @var Discount
2830
*/
@@ -93,6 +95,8 @@ public function resolve(
9395
*/
9496
private function getMinimumProductPrice(SaleableInterface $product, StoreInterface $store): array
9597
{
98+
// add store filter for the product
99+
$product->setData(self::STORE_FILTER_CACHE_KEY, $store);
96100
$priceProvider = $this->priceProviderPool->getProviderByProductType($product->getTypeId());
97101
$regularPrice = $priceProvider->getMinimalRegularPrice($product)->getValue();
98102
$finalPrice = $priceProvider->getMinimalFinalPrice($product)->getValue();

0 commit comments

Comments
 (0)