Skip to content

Commit 2e24716

Browse files
committed
Merge branch 'master' of github.com:judgej/wc-api-custom-meta
2 parents 4393831 + d63d408 commit 2e24716

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,24 @@ and you can set any meta fields you like.
3636

3737
I have not tested this with anything other than strings, so be wary that the behaviour storing other data structures
3838
in metafields are *undefined* at present.
39+
40+
## Returning Product Meta
41+
42+
When retrieving a product, the custom product meta fields will be put into the "meta" field as an array when
43+
retrieving a product through the API. This only works for capability 'manage_woocommerce' to help prevent
44+
leakage of secure data.
45+
46+
The field will look something like this:
47+
48+
"meta": [
49+
50+
{
51+
"test custom field": "Hi There!",
52+
"pv_commission_rate": "",
53+
"ISBN": "1234567890-1"
54+
}
55+
]
56+
57+
Both visibla and hidden ("_" prefixed) fields will be included in the list. All raw WooCommerce fields that
58+
are already present in some form in the product data will be filtered out, leaving only fields added by
59+
third-party plugins or manually by the shop manager.

0 commit comments

Comments
 (0)