I am working on a Magento 2.1.9 website. I have created an attribute which is being used in layered navigation as well. So what I want is that when I click on a button on home page, this attribute should get selected automatically to a value.

For example : name of this attribute is Company and values are - google, stack-overflow, apple etc. so when I click on a button/link called "google" from homepage, then this attribute "company" should choose an option "google" in layered navigation.


You can easily do it by using the Id of attribute value, for example your attribute is Company and and value is google, then just check the Id of google from layer navigation and prepare url in home page like,


Where 58 is google Id and company is attribute code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.