diff --git a/src/module-elasticsuite-swatches/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php b/src/module-elasticsuite-swatches/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php index e54c15635..b0e8d26b1 100644 --- a/src/module-elasticsuite-swatches/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php +++ b/src/module-elasticsuite-swatches/Block/Plugin/Adminhtml/Product/Attribute/Edit/Tab/FrontPlugin.php @@ -30,22 +30,22 @@ class FrontPlugin private $registry; /** - * @var \Magento\Swatches\Model\SwatchAttributeType + * @var \Magento\Swatches\Helper\Data */ - private $swatchAttributeType; + private $swatchHelper; /** * FrontPlugin constructor. * - * @param \Magento\Framework\Registry $registry Registry - * @param \Magento\Swatches\Model\SwatchAttributeType $swatchAttributeType Swatch Attribute Type + * @param \Magento\Framework\Registry $registry Registry + * @param \Magento\Swatches\Helper\Data $swatchHelper Swatch Attribute Helper */ public function __construct( \Magento\Framework\Registry $registry, - \Magento\Swatches\Model\SwatchAttributeType $swatchAttributeType + \Magento\Swatches\Helper\Data $swatchHelper ) { - $this->registry = $registry; - $this->swatchAttributeType = $swatchAttributeType; + $this->registry = $registry; + $this->swatchHelper = $swatchHelper; } /** @@ -57,7 +57,7 @@ public function __construct( */ public function afterSetForm(\Magento\Catalog\Block\Adminhtml\Product\Attribute\Edit\Tab\Front $subject) { - if ($this->getAttribute() && $this->swatchAttributeType->isSwatchAttribute($this->getAttribute())) { + if ($this->getAttribute() && $this->swatchHelper->isSwatchAttribute($this->getAttribute())) { if ($subject->getForm() && $subject->getForm()->getElement('facet_max_size')) { $subject->getForm()->getElement('facet_max_size')->setDisabled(true); } diff --git a/src/module-elasticsuite-swatches/Plugin/Layer/Filter/SwatchAttribute.php b/src/module-elasticsuite-swatches/Plugin/Layer/Filter/SwatchAttribute.php index c4686cd59..71a29dc55 100644 --- a/src/module-elasticsuite-swatches/Plugin/Layer/Filter/SwatchAttribute.php +++ b/src/module-elasticsuite-swatches/Plugin/Layer/Filter/SwatchAttribute.php @@ -22,18 +22,18 @@ class SwatchAttribute { /** - * @var \Magento\Swatches\Model\SwatchAttributeType + * @var \Magento\Swatches\Helper\Data */ - private $swatchAttributeType; + private $swatchHelper; /** - * ProductAttribute constructor. + * FrontPlugin constructor. * - * @param \Magento\Swatches\Model\SwatchAttributeType $swatchAttributeType Swatch Attribute Type + * @param \Magento\Swatches\Helper\Data $swatchHelper Swatch Attribute Helper */ - public function __construct(\Magento\Swatches\Model\SwatchAttributeType $swatchAttributeType) + public function __construct(\Magento\Swatches\Helper\Data $swatchHelper) { - $this->swatchAttributeType = $swatchAttributeType; + $this->swatchHelper = $swatchHelper; } /** @@ -48,7 +48,7 @@ public function beforeAddFacetToCollection( \Smile\ElasticsuiteCatalog\Model\Layer\Filter\Attribute $subject, $config = [] ) { - if ($this->swatchAttributeType->isSwatchAttribute($subject->getAttributeModel())) { + if ($this->swatchHelper->isSwatchAttribute($subject->getAttributeModel())) { $config['size'] = 0; }