Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Coding_Field's avatar

Help with showing prices in local currency based on Geo-location

Hi

What would be the best approach to have laravel application to show different prices based on Geo-location and also setup the payment gateway such as stripe to charge in that currency.

For example:

if a customer is from Europe he will be shown price in Euro and charged in Euro If a customer is from the USA he be shown price in USD and charged in USD.

The price will be fixed and we will not use API for price conversation.

Thank you

0 likes
2 replies
martinbean's avatar

@coding_field You’ll need some middleware that picks up the user’s location somehow if not already set. Could be based on IP address or some other signal. Whatever you do though, always let the user override the locale preference in case they’re using a VPN or their location is otherwise incorrectly detected.

As for the pricing, if you’re going to price products manually then you’ll need to set up your product model to have many prices. Each price model should specify the currency and amount. You then need to decide what happens if a product doesn’t have a price is the currency for the current locale, i.e. if the locale is detected as GB but your product has no GBP price.

This also introduces another complexity: you need to associate currencies with locales. For example, DE (Germany) uses euro as their currency, but the euro is also the current of lots of other countries. So you’re going to need to set up a locale-to-currency pivot table if you want the currency picked up from the locale.

Finally, for the checkout, again you need to make a decision. Can a user buy products in multiple currencies? If not, then you need to set the currency on the cart when the users adds their first product, and then only allow them to add subsequent products with a price in the same currency. When the user goes to check out, you can pick the currency to charge from the cart.

As you can see, all in all you’re setting yourself up for a lot of complexity.

1 like
Coding_Field's avatar

@martinbean thank you for your reply and highlighting important points such as localisation for different European countries.

Please or to participate in this conversation.