Development discussions around Shopify APIs
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)
https://checkout.shopify.com/10190495/checkouts/6e63cfb3922db5ded985e63084293394?api_key=dd956ac8aca422ce0fc3ee14e92f418d&locale=fr
So, what i need is to customize the generated buy button code to launch whatever locale I choose.
Hope that makes sense?
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
Thilo
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.
cart.checkout.open(checkoutUrl);
};
},
},
Wow, I was looking for this kind of code for months! Thank you
Connect your PayPal account to allow your customers to checkout using the PayPal gateway a...
ByYour online store speed can enhance your store’s discoverability, boost conversion rates a...
ByShopping is at our fingertips with mobile devices. Is your theme optimized to be user-frie...
By