How do I change store based on location? I need to have different prices for same products based on country. I was advised to use Price list module and to have different store per each country and I did that.
I.e. I have Swiss store and Serbian store.
For Swiss store for supported billing countries I selected only Switzerland and for Serbian store only Serbia.
Swiss is default one and prices in product variations are defined in CHF. Now I'm trying to override prices for Serbian store (in RSD).
So, I created Serbian price list and added alternative prices for products. Problem is that those alternative prices are used only if I include also Swiss store for that Serbian price list (so price list is active also for Swiss store). If I select only Serbian store, as it suppose to be, then price list is not used (I see default prices in CHF).
I read here: https://drupalcommerce.org/blog/42419/commerce-2x-stories-stores
.. that stores are actually representing billing locations. But that confuses me because product and their prices are displayed before customer enters billing address?!?
What I'm missing here? Why Serbian store is not automatically active if I'm testing from Serbia? Do I need some GEO IP module or something? Even when I'm testing as a logged user (location entered before) I still use default Swiss store instead of local Serbian store.
Configuring the stores is one thing, determining which one is used for any given page request is another. One store is configured to be your default, and absent any other code, that store will always be used for the current page request, influencing visible products, pricing, carts, etc. If you want to make the current store something other than the default, you have to write a store resolver.
An example module you can reference is the Commerce Store Domain module, which resolves the current store based on the current domain. You can do something similar using the GeoIP module. I'm not aware of any existing contrib that integrates that as of yet.