Hi!
I was wondering if the
mutation StoreCurrencyFormattingUpdate($input: CurrencyFormatsInput!) {
shopGeneralSettingsUpdate(input: {currencyFormats: $input}) {
mutation, or at least part of it, will be available for app developers.
Specifically, I’m interested in updating the values of moneyFormat and moneyWithCurrencyFormat.
Hi Elia,
Where did you see this mutation?
Hi @Liam-Shopify!
Thank you for getting back to me.
The mutation is called by shopify admin.
- Shopify Settings → General
- Under Store defaults, click the three dots next to Currency display and select Change currency formatting.
You can see the following call is being made:
curl --location 'https://admin.shopify.com/api/shopify/STOREID?operation=StoreCurrencyFormattingUpdate&type=mutation' \
--header 'Content-Type: application/json' \
--data '{"query":"mutation StoreCurrencyFormattingUpdate($input: CurrencyFormatsInput!) {\n shopGeneralSettingsUpdate(input: {currencyFormats: $input}) {\n shop {\n id\n ...GeneralSettings\n __typename\n }\n userErrors {\n field\n message\n __typename\n }\n __typename\n }\n}\n\nfragment GeneralSettings on Shop {\n id\n plan {\n name\n trial\n __typename\n }\n billingAddress {\n id\n address1\n address2\n city\n countryCodeV2\n company\n phone\n provinceCode\n zip\n __typename\n }\n currencyCode\n currencyFormats {\n moneyFormat\n moneyInEmailsFormat\n moneyWithCurrencyFormat\n moneyWithCurrencyInEmailsFormat\n __typename\n }\n email\n features {\n capitalPaymentsSettingsLocked\n __typename\n }\n ianaTimezone\n supportedTimezone\n name\n orderNumberFormatPrefix\n orderNumberFormatSuffix\n primaryDomain {\n id\n host\n provider\n __typename\n }\n unitSystem\n weightUnit\n timezoneOffset\n shopIdentificationSettings {\n code\n internalName\n logoImage {\n id\n url\n mediaId\n __typename\n }\n __typename\n }\n __typename\n}\n","variables":{"input":{"moneyFormat":"<span class=\"myClass\">€{{amount_with_comma_separator}}</span>","moneyInEmailsFormat":"€{{amount_with_comma_separator}}","moneyWithCurrencyFormat":"<span class=\"myClass\">{{amount_with_comma_separator}} EUR</span>","moneyWithCurrencyInEmailsFormat":"€{{amount_with_comma_separator}} EUR"}}}'
So, I was wondering, will this ever become part of the official GQL?
Best regards
Elia
I see what you mean Elia - it does look like this is a internal-only mutation. There’s currently no plan to expose this publicly, what use-case would you need this for?
Hi @Liam-Shopify.
It could help modifying price display without the need of modifying the liquids.
One could wrap it in a span with custom class and manipulate it later via app extensions.
Best
Elia