1
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

0

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!

5
  • okay got it let me i try this one
    – Jay Parmar
    May 10 '21 at 6:55
  • Okay. Good luck :) May 10 '21 at 6:59
  • 1
    @JayParmar is it worked for you? May 11 '21 at 4:25
  • yes that working and i also used cookie for default selected us
    – Jay Parmar
    May 11 '21 at 5:40
  • Can you upvote? May 11 '21 at 6:54

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.