Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

API - woocommerce_currency should return separate field for symbol #2

Closed
mikejolley opened this issue May 31, 2017 · 1 comment
Closed
Assignees

Comments

@mikejolley
Copy link
Member

When using the wc-api to get general settings /wc/v2/settings/general, the woocommerce_currency object has an options array that has the following format:

{AED: "United Arab Emirates dirham (د.إ)"}

This results in having to use a regex to separate the country and currency name from the currency symbol.

I propose that the options object should take this format:

{ AED: { country: "United Arab Emirates", currency: "dirham", symbol: "د.إ" } }

It may be good to look into a data endpoint instead/in addition, since this is a setting, not a way to get the correct symbol.

From woocommerce/woocommerce#15101

@belcherj
Copy link

belcherj commented Jun 1, 2017

When showing a dropdown in settings a user may not want to show the full country plus the symbol. Calling a second endpoint to get just the symbols seems needless. Breaking out the data into fields makes the API more flexible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants