Localized Key names in CustomValuesXML for Purchase Order Number?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
7 years ago
In SQL, we were trying to get the PO Number from orders, and figured out it was stored in CustomValuesXML. However, we noticed that the key name is being localized (through resource plugins.payment.purchaseorder.purchaseordernumber). This seems wrong. You shouldn't need to use different spoken languages to extract a value or use a key name that can be changed by users by changing strings, breaking code (this is a user changeable prompt, intended to localize the UI, not the code). Plugins and SQL code looking for the PO Number should be able to find it regardless of the language selected by the customer (and even if the store owner changes the prompt later on).

It's like with MS Office, when they had localized Macros, so you couldn't run the same macro or formula across different locales of Office, it was a nightmare (one thing was to localize entry, another not to "translate" formulas that were already entered on an existing file). I think they fixed (by using neutral names internally), displaying the localized name depending on the version opening the file, but I'm not sure (I still avoid using international versions, and macros and formulas are used much less than before, so it doesn't come up as often as it used to, but the lesson applies - nopC shouldn't be locale dependent in code related functionality).

Is CustomValuesXML also being used to store checkout attributes? Then the problem is even worse.

If we're going to use XML or other dynamic content, something so common as the PO Number should be stored under a predictable key name.

In fact, Checkout attributes should probably have a SystemName property, so we can refer to them in code, and use such name for the key in the XML, regardless of the localization of its prompt.
7 years ago
Checkout attributes are stored in their own [CheckoutAttributesXml] field.  They have IDs = e.g.
<CheckoutAttribute ID="1">


RE: "...breaking code (this is a user changeable prompt, intended to localize the UI, not the code)"

Yes, 'localize the UI'.  The CustomValuesXML is a serialized Dictionary.  The Keys and the Values are displayed to the Customer (on Order page, Invoice PDF, etc.)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.