/** * @param RenderLayered $subject * @param \Closure $proceed * @param string $attributeCode * @param int $optionId * @return string * * @todo: build URL with option label */ public function aroundBuildUrl(RenderLayered $subject, \Closure $proceed, $attributeCode, $optionId) { if ($this->canBeSubstituted()) { $result = $this->urlHelper->getOptionUrl($this->eavAttribute, $optionId); } else { $result = $proceed($attributeCode, $optionId); } return $result; }
/** * @param FilterItem $subject * @param \Closure $proceed * @return string * @throws \Magento\Framework\Exception\LocalizedException * * @see \Magento\Catalog\Model\Layer\Filter\Item::getUrl() */ public function aroundGetUrl(FilterItem $subject, \Closure $proceed) { $this->filter = $subject->getFilter(); $this->eavAttribute = $this->filter->getAttributeModel(); if ($this->canBeSubstituted()) { $result = $this->urlHelper->getOptionUrl($this->eavAttribute, $subject->getValue()); } else { $result = $proceed(); } return $result; }