diff --git a/app/code/Magento/Swatches/Block/LayeredNavigation/RenderLayered.php b/app/code/Magento/Swatches/Block/LayeredNavigation/RenderLayered.php index fc13372520945..d22910791ac81 100644 --- a/app/code/Magento/Swatches/Block/LayeredNavigation/RenderLayered.php +++ b/app/code/Magento/Swatches/Block/LayeredNavigation/RenderLayered.php @@ -56,6 +56,13 @@ class RenderLayered extends Template */ protected $mediaHelper; + /** + * Html pager block + * + * @var \Magento\Theme\Block\Html\Pager + */ + private $htmlPagerBlock; + /** * @param Template\Context $context * @param Attribute $eavAttribute @@ -70,12 +77,14 @@ public function __construct( AttributeFactory $layerAttribute, \Magento\Swatches\Helper\Data $swatchHelper, \Magento\Swatches\Helper\Media $mediaHelper, + \Magento\Theme\Block\Html\Pager $htmlPagerBlock, array $data = [] ) { $this->eavAttribute = $eavAttribute; $this->layerAttribute = $layerAttribute; $this->swatchHelper = $swatchHelper; $this->mediaHelper = $mediaHelper; + $this->htmlPagerBlock = $htmlPagerBlock; parent::__construct($context, $data); } @@ -132,7 +141,10 @@ public function getSwatchData() */ public function buildUrl($attributeCode, $optionId) { - $query = [$attributeCode => $optionId]; + $query = [ + $attributeCode => $optionId, + $this->htmlPagerBlock->getPageVarName() => null + ]; return $this->_urlBuilder->getUrl('*/*/*', ['_current' => true, '_use_rewrite' => true, '_query' => $query]); }