Personalized checkout and custom promotions with Shopify Scripts
using the shopify api,
i can add product variant like this $product->variants = [ [ "option1" => "color" "price" => "1.23", "sku" => "abc" ] ]; $shopify->Product->post($p);
But how can i add image to the same variant, i tried with
"image" => $p->image
"images" => $p->image
"imageSrc" => $p->image
"attachment" => base64_encode($r)
but no one is working
Thanks
Seem that the only way is to add the image to a product then get it's imageId and update the variant image_id.
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025