Skip to content

Conversation

sebastienhouzet
Copy link

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"));

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"));
@tareqtms
Copy link
Contributor

@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.

@joeyhub joeyhub mentioned this pull request Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants