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

Send MetaData via api

Open begininvoke opened this issue 4 years ago • 1 comments

hi i can not send url link by api example : metadata aded : _knawatfibu_wcgallary = https://text.com/image.jpg?x-oss-process=image/resize,h_1600,https://text.com/image.jpg?x-oss-process=image/resize,h_1600 after submitting splitted ',' links for example , it shows incorrectly

image one = https://text.com/image.jpg?x-oss-process=image/resize image two = h_1600 image three = https://text.com/image.jpg?x-oss-process=image/resize image four = h_1600 because in the event that : image one = https://text.com/image.jpg?x-oss-process=image/resize,h_1600

and special thanks for this plugin

begininvoke avatar Sep 18 '20 22:09 begininvoke

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, "manage_stock": true, (...) "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