Skip to content

Commit

Permalink
Merge pull request #155 from kamilkawasw/PERF-57
Browse files Browse the repository at this point in the history
adjust to Magento 2.4.7 changes
  • Loading branch information
AleksandrsKondratjevs authored Jul 14, 2024
2 parents 1da826c + c668f4d commit a1bfd80
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
20 changes: 12 additions & 8 deletions src/Model/Resolver/Aggregations.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
namespace ScandiPWA\CatalogGraphQl\Model\Resolver;

use Magento\CatalogGraphQl\Model\Resolver\Aggregations as AggregationsBase;
use Magento\CatalogGraphQl\Model\Resolver\Layer\DataProvider\Filters;
use Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\LayerBuilder;
use Magento\Directory\Model\PriceCurrency;
use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\Framework\Exception\LocalizedException;
use Magento\Store\Api\Data\StoreInterface;
use Magento\CatalogGraphQl\DataProvider\Product\LayeredNavigation\Builder\Aggregations\Category;
use Magento\Catalog\Model\CategoryRepository;
use Magento\Catalog\Model\ResourceModel\Eav\Attribute;

class Aggregations extends AggregationsBase {
class Aggregations extends AggregationsBase
{
/**
* @var Attribute
*/
Expand Down Expand Up @@ -52,15 +52,19 @@ class Aggregations extends AggregationsBase {
* @inheritdoc
*/
public function __construct(
Filters $filtersDataProvider,
LayerBuilder $layerBuilder,
Attribute $attribute,
CategoryRepository $categoryRepository
CategoryRepository $categoryRepository,
PriceCurrency $priceCurrency = null,
Category\IncludeDirectChildrenOnly $includeDirectChildrenOnly = null

)
{
parent::__construct(
$filtersDataProvider,
$layerBuilder
$layerBuilder,
$priceCurrency,
$includeDirectChildrenOnly

);

$this->attribute = $attribute;
Expand Down
12 changes: 9 additions & 3 deletions src/Model/Resolver/Product/PriceRange.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Magento\Store\Api\Data\StoreInterface;
use Magento\CatalogGraphQl\Model\Resolver\Product\PriceRange as CorePriceRange;
use Magento\ConfigurableProduct\Model\Product\Type\Configurable;
use Magento\CatalogGraphQl\Model\PriceRangeDataProvider;

/**
* Format product's pricing information for price_range field
Expand Down Expand Up @@ -62,6 +63,11 @@ class PriceRange extends CorePriceRange
*/
protected $taxHelper;

/**
* @var PriceRangeDataProvider
*/
private PriceRangeDataProvider $priceRangeDataProvider;

/**
* @param PriceProviderPool $priceProviderPool
* @param Discount $discount
Expand All @@ -71,12 +77,12 @@ public function __construct(
Discount $discount,
PriceCurrencyInterface $priceCurrency,
ScopeConfigInterface $scopeConfig,
TaxHelper $taxHelper
TaxHelper $taxHelper,
PriceRangeDataProvider $priceRangeDataProvider
)
{
parent::__construct(
$priceProviderPool,
$discount
$priceRangeDataProvider,
);

$this->priceProviderPool = $priceProviderPool;
Expand Down

0 comments on commit a1bfd80

Please sign in to comment.