Question

I create one product attribute which name "country" type drop-down.
in that i add two country there US and CA
now at front-end , front header show custom drop-down with that product option . like US and CA ,
       - when select CA then in category page display product which country option is "CA" .
       - when select US then in category page display product which country option is "US" .
- by default US selected.

any one can guide me how can i do this !

enter image description here

Was it helpful?

Solution

I am sharing the idea how you can achieve this thing.

Make sure country attribute is filterable so that you can filter products by this parameter on category page.

Now in the header panel you need to dynamically generate the URL for US and CA according to current category or current browser url and add query parameter for country attribute. For example,

https://www.example.com/xyz-category.html?country=us

In order to set by default US you need to append query parameter to every category page on load.

I hope it will help you to understand the efforts required.

Thanks!

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top