php-shopify icon indicating copy to clipboard operation
php-shopify copied to clipboard

Add ProductImage

Open sebastienhouzet opened this issue 6 years ago • 1 comments

Hello

Add ProductImage on $resources to add images on product

$product_image_info = array( 'src' => $image->link ); $image_shopify = $shopify->ProductImage->post($product_image_info,$shopify->Product->generateUrl(array(),$product_shopify['id']."/images"));

sebastienhouzet avatar Jul 25 '19 01:07 sebastienhouzet

@sebastienhouzet ProductImage is a child resource of Product. So the ideal way of doing this should be like

$product_image_info = array(
    'src' => $image->link
);
$image_shopify = $shopify->Product($product_shopify['id'])->Image->post($product_image_info));

Please let me know if you are having any issues with that way.

tareqtms avatar Aug 16 '19 03:08 tareqtms