Is there any chance that money metafield type will be able to support multiple currencies?
Working with B2B and Markets; being able to create a variant metafield for RRP (Recommended Retail Price) either translatable (with currency switch) or simply having a metafield per currency with each of their currency codes, would be nice. Currently we do it with number/string fields, which is kinda meh.
In the admin it’s currently not possible, while the API seems to be somewhat ready for it, as it requires a currency_code value, but only accepts the base currency.
"userErrors": [
{
"field": [
"metafields",
"0",
"value"
],
"message": "Value must match shop currency: DKK.",
"code": "INVALID_VALUE"
}
]
If I remove currency_code from the input, or even just write "value": 250, I get the following. Which indeed makes sense, as the support is now, but yeah.
"message": "Value must be a stringified JSON object with amount (numeric) and currency_code (string matching the shop's currency) fields.",
"code": "INVALID_VALUE"
I’ve previously been able to do this through the Translate & Adapt app, when translating for a specific market.
Have you tried “translating” the field via. the API with a market specified, where the currency is set to EUR?
The cool thing about this is, that for markets with multiple currencies enabled, it automatically calculates the value of the money field - just like with the product prices (unless anything else is specified of course).
@shopwithstefan that is pretty nice for sure, and covers some scenarios (products as an example). But let’s say I want to do a B2B Credit Limit function, and have a money field on my company location. This value cannot be translated to my knowledge.
In this scenario, I’d like to store the credit limit value, in the same currency as the company catalog, which will differ per company in an international store.
Then it becomes a bit more hacky or compromised solution.
@livit, Thanks for the clarification. I just tested this out on a development store, and it seems like we’re able to translate the money metafield on Company Location, the trick is to make it as a Market-specific localization.
There would be some requirements for the store however, first of all the catalog currency and market currency must match (I’m quite unsure how this will work with the newer markets etc.).
The market must have a base currency set (Which is the one you’re able to “translate” the value into).
So we’re still not looking at a 100% smooth solution, but this metafield value should then be returned with the correct currency + value when queried from the function.
Thank you for looking further into it. I foresee some edges cases already, but would need to look further into it to specify.
Even tho, it’s quite clumsy, and API dependent.
So as with most use cases - it can be done, but with limitations
If we compare to how Shopify solves the Weight type metafield, I’d say there’s room for improvement to solve it more natively.
100% agree that this is suboptimal, and especially with the new markets — which I still have to explore, there might be more edge cases than first foreseen.
I tested this a while back, where I utilised the presentmentCurrencyRate on the Cart Input however this seems to be based on the Shop currency, and in fact not the base currency of the market.