cancel
Showing results for 
Search instead for 
Did you mean: 

Create link to category with attribute filter on product page

Create link to category with attribute filter on product page

There are 2 main categories in which there are goods. Goods have attributes (color, collection). How to make a link to the category with filtering by attribute in the product page?

 

Now i use:

public  function getCategory()
{
$category = $this->categoryRepository->get(3, $this->storeManager->getStore()->getId());

return $category->getUrl();
}