Parameter to set the shopify checkout language
First of all, its projects like this that make me really appreciate javascript, I absolutely love it.
But as a developer and part store owner, I imagine the shopify support is just creating tickets that the dev team has 10000 of in the backlog? Thats why I came here directly to ask the question.
Im wondering whether there are any plans to integrate a language parameter to the javascript object (the create component thing), where the attribute would be set to like "en-us, de-ger " etc to determine which language the checkout is in? As of now, this isnt possible, and it makes having multilingual sites with one shopify portal a nightmare.
Yes please, we need this!
You can set the checkout language like this:
var shopifyClient = ShopifyBuy.buildClient({});
var shopifyBuyUI = ShopifyBuy.UI.init(shopifyClient);
shopifyBuyUI.createComponent("", {
options: {
cart: {
events: {
beforeInit: function (cart) {
var actualOpen = cart.checkout.open;
cart.checkout.open = function (url) {
var newUrl = new URL(url);
newUrl.searchParams.set("locale", "es-UY");
actualOpen.call(this, newUrl.toString());
};
}
}
}
}
});