iamdharmesh / featured-image-by-url

This plugin allows to use an external URL Images as Featured Image for your post, page & custom post types like WooCommerce Product. Includes support for Product Gallery (WooCommerce).
https://wordpress.org/plugins/featured-image-by-url/
GNU General Public License v2.0
34 stars 11 forks source link

Not working with Rest Api #13

Open zhdishaq opened 6 years ago

zhdishaq commented 6 years ago

I cannot use with rest api

iamdharmesh commented 6 years ago

Hello @zhdishaq,

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

Thanks, Dharmesh

sunil11475 commented 5 years ago

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!

fernandogiacomino commented 2 years ago

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.