binshops / prestashop-rest

PrestaShop REST API module to expose your PrestaShop website's REST endpoints

Home Page:https://www.binshops.com/prestashop-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibility to switch country for anonymous visitors to calculate locale taxes

Zielgestalt opened this issue · comments

commented

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!