wc-api-custom-meta icon indicating copy to clipboard operation
wc-api-custom-meta copied to clipboard

More detailed README

Open woutercouvaras opened this issue 8 years ago • 2 comments

Hi @judgej,

Firstly, I know how much work open source can be, so thanks for the efforts!

I'm a little stuck...

I've really tried to figure this out on my own, so as not to burden you with this, but I'm not a Wordpress/Woocommerce guy, so I'm really flying a little blind.

I've installed your plugin and I'm doing POST requests to: www.domain.com/wp-json/wc/v1/products. At the moment, I'm simply using Postman to test. I've tried several formats of JSON - e.g.:

{
	"name": "My Product",
  	"type": "simple",
  	"regular_price": "13.99",
  	"custom_meta": [
  		{
  			"custom_one": "value one"
  		},
  		{
  	    	        "custom_two": "value two"	
  		}
  	]
}

I've tried the above and just about every other conceivable format, yet when I do a GET request, none of my meta fields are present. It is my understanding from the docs that nothing else is needed, though, the "capability 'manage_woocommerce'" has me stumped. I've looked through settings to see if I can find this, but can't (as I say, I'm not a woo guy). I'm guessing this is a perm of some sort?

I'm sure I'm missing something obvious, but I've exhausted everything I can think of (apart from diving into Wordpress/Woocommerce code), but I'm trying to avoid that, hence the use of a plugin.

If there is anything you could add to the README that might be enlightening for none Wordpress/Woocommerce people such as myself, it would be greatly appreciated!

Are there perhaps additional steps that need to be taken, apart from installing your plugin?

woutercouvaras avatar Jan 19 '17 13:01 woutercouvaras

I've started reading through the woocommerce api docs and I've just noticed that the wc api is on v1, and that their own api (which I'm guessing your plugin relates to, based on the reference to V2 in your readme) has been deprecated...

I then noticed a pull request by @psopacua, which I was hoping would solve my problems, but I still don't see the custom_meta data pulling through:(

woutercouvaras avatar Jan 20 '17 14:01 woutercouvaras

Use the new v2 REST API (WC 3.x) instead of this plugin. It now does everything this plugin does out of the box. The README gives some examples of how you would manage the metadata fields.

judgej avatar Aug 02 '17 15:08 judgej