featured-image-by-url icon indicating copy to clipboard operation
featured-image-by-url copied to clipboard

Not working with Rest Api

Open zhdishaq opened this issue 6 years ago • 3 comments

I cannot use with rest api

zhdishaq avatar Oct 22 '18 21:10 zhdishaq

Hello @zhdishaq,

Thanks for report issue. Yes its not working with REST API yet. we will add support for it soon..

Thanks, Dharmesh

iamdharmesh avatar Oct 30 '18 04:10 iamdharmesh

Insert Product with variation : Works well with REST API - version 'wc/v2' using class-wc-api-client.php

Using - $woocommerce->products->create($data); https://github.com/helpforfitness/WooCommerce-REST-API-Client-Library-v2

Above library doesn't support "create categories" which you need to call separately using rest API V3 Library -

$woocommerce->post('products/categories', $cdata);

Hope above information will help somebody. Try to figure out how to insert URL for categories using featured-image-by-url.

Have a nice day!

sunil11475 avatar Dec 16 '18 13:12 sunil11475

I was able to update "image_by_url" meta data from WC api, the structure is something like this:

msg.payload= { "name": $product_name, "type": "simple", "sku": $product_sku, "regular_price": $product_price, (...) "meta_data": [{ "key": "_knawatfibu_url", "value": $image_url1 }, { "key": "_knawatfibu_wcgallary", "value": [$image_url2, $image_url3, $image_url4]}] };

"_knawatfibu_url" is the metadata key for featured image, and "_knawatfibu_wcgallary" must be an array of url strings.

fernandogiacomino avatar Dec 01 '21 20:12 fernandogiacomino