Open harunthuo opened 9 years ago
Same issue on V2. Have also raised a ticket.
@aggrogg @harunthuo In write mode you need to send category IDs.
Thanks Jack- let's hope it's released soon.
I have posted a temp workaround to add categories / tags.
http://wordpress.stackexchange.com/questions/137501/how-to-add-product-in-woocommerce-with-php-code
Just directly update the post in the database i.e.
update_post_meta( $post_id, 'post_category', array('foo') );
Seems there is no endpoint to create categories by API. I would need it too
@mikylucky check out this thread:
https://github.com/woothemes/woocommerce-rest-api-docs/issues/20#issuecomment-146188582
Cool, thanks!
Looks like the new V3 does not allow creating of product categories and tags when creating a product using the api:
print_r( $client->products->create( array( 'title' => 'product_name','sku' => 'sku_value', 'type' => 'simple', 'regular_price' => '1000', 'short_description'=>'short description', 'categories' => Array ('category1','category2','category3' ), 'tags'=> array('product_tag'))));
all the other properties are still created but not categories and tags. returns an empty array:
["categories"]=> array(0) { } ["tags"]=> array(0) { }
so question is: how are categories and tags created using the REST api V3?