judgej / wc-api-custom-meta

WordPress/WooCommerce plugin to support custom meta fields through the product API
32 stars 12 forks source link

Posting array data #7

Open davidkeatscroft opened 9 years ago

davidkeatscroft commented 9 years ago

Whilst testing using PostMan, we're trying to post values to an array stored in custom meta using the following:

{ "product": { "custom_meta" : { "_price_custom": { "price": "20", "break": "5", "break_price": "15" } } } }

Unfortunately it's not playing ball - I know you mention that the structure is currently defined, but is there a way of still doing this?

Thanks

judgej commented 9 years ago

I should be getting back to this in a few weeks, and can look at this then. In the meantime, you may just have to serialise the array at one end and unserialise it at the other end (using json_encode/json_decode).