Skip to content

Markets and currencies #826

@lucalbert

Description

@lucalbert

Hello,

We now use markets (and Shopify Payments) to allow our customers to pay in their local currency.

We had already integrated the possibility of retrieving the translated content of the store by setting up the client:

const client = ShopifyBuy.buildClient({
  domain: shopify.domain,
  storefrontAccessToken: shopify.token,
  language: shopify.language
})

How is it possible to set the currency (or market country)?

When the customer adds a product to the cart and proceeds to payment, the local currency is displayed correctly only when he has entered his delivery address (step 2).
Is it possible to also force the opening of the cart in a certain currency (other than the base currency of the store)?

(we also had to adapt the script to force the language of the shopping cart because the configuration of the language at the client level was not sufficient:

cart: {
  events: {
    beforeInit(cart) {
      const actualOpen = cart.checkout.open
      cart.checkout.open = function (url) {
        const newUrl = new URL(url)
        newUrl.searchParams.set('locale', shopify.language)

        let finalUrl = newUrl.toString()
        actualOpen.call(this, finalUrl)
      }
    }
  }
}

)

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions