Possibility to switch country for anonymous visitors to calculate locale taxes
Zielgestalt opened this issue · comments
I have a shop where the vat is calculated based on the shipping address of the user. So when I have a logged in user and he has a default address in a country different than the default country in the default tax zone, I can use the set address endpoint and this user gets updated gross prices and taxes for products back. That's great.
But this is a bit annoying for anonymous users that they only see their 'real' prices at checkout. It would be great if there is a possibility that a anonymous website visitor can select one of the available countries in the frontend and after that he gets the updated taxes and gross prices for the tax zone of his country. This might also be interesting e.g. for geolocating customers.
Is there any possibility to make this possible? I know how to create a custom rest route with your pro module. But I don't know how to set countries/tax zones in Prestashop. I was thinking about creating 'default addresses' for all countries and let the user set them, but that's not very pretty and leads to problems when there are different address IDs for local and production environments. Maybe it could be a plan B or so.
Any thoughts or maybe hints to guide me in the right direction? Thanks!