Uploading an image to custom fields and not show as product image using rest api

Uploading an image to custom fields and not show as product image using rest api

inuar
Shopify Partner
14 0 1

I am trying to add a file definition to a custom field, then I need to upload an image that I will only use for a specific purpose and I do not want to show this image on Products page.

I managed to get something closer to it, I upload the image to 

$response = $api->rest("POST", "/admin/products/123/images.json", $imagePayload);

then I get the response and save into custom field 

$response = $api->rest('POST', '/admin/products/123/metafields.json', [
"metafield" => [
"namespace" => "product",
"key" => "description_image",
"value" => trim($image['src']),
"type" => "url"
]
]);

The issue is that this shows the image on the products page along with other images. 

Nei Santos
nei@inuartech.com
Reply 1 (1)

ThePixelEdge
Shopify Partner
164 16 18

Hello @inuarYour requirement entails custom development, which necessitates paid services. Please inform us if you are open to discussing this further.

If helpful then please Like and Accept Solution .
Buy me A Coffee

Whatsapp :- For Shopify Design Changes | Shopify Custom Coding | Custom Modifications


Connect with Us in Our DMs | teampixeledge@gmail.com