FROM CACHE - en_header

Pass Locale parameter using Buy Button

9 0 5

Is it possible to pass the locale using the buy button?

For example, here is the same checkout page with the string "&locale=“ to the end of the link which displays the same page but in different languages.

EN: (English)


FR: (French)

So, what i need is to customize the generated buy button code to launch whatever locale I choose.

Hope that makes sense?

Replies 3 (3)
New Member
1 0 0

Hey, I have the same question. I noticed that if I append '&locale=fr' to the checkout url, the checkout is loaded with French gui. BUT, how to add this to my Buy Button code?

Thank you so much

14 1 3

Anyone found a solution for this?


Found it (not mine solution)


I needed to add a local parameter to the checkout URL and I manage to do it. Here's what I did.
On the cart object, I added an event :


events: {
	afterInit: (cart) => {
		cart.onCheckout = () => {
			const checkoutUrl = cart.model.webUrl + '&locale=en';
			// we dynamically change the checkout function.;
New Member
1 0 0

Wow, I was looking for this kind of code for months! Thank you