-
-
Notifications
You must be signed in to change notification settings - Fork 312
Product Images
Joshua Harms edited this page Dec 20, 2023
·
1 revision
Product Images represent the various different images for a product. All product images are tied to an owner product, and therefore you'll need to pass that product's id to each product image method.
var service = new ProductImageService(myShopifyUrl, shopAccessToken);
var image = await service.CreateAsync(productId, new ProductImage()
{
Metafields = new List<MetaField>()
{
new MetaField()
{
Key = "alt",
Value = "new alt tag content",
ValueType = "string",
Namespace = "tags"
}
},
Src = "https://placekitten.com/200/300"
});
var service = new ProductImageService(myShopifyUrl, shopAccessToken);
var image = await service.GetAsync(productId, imageId);
var service = new ProductImageService(myShopifyUrl, shopAccessToken);
var count = await service.CountAsync(productId);
var service = new ProductImageService(myShopifyUrl, shopAccessToken);
var images = await service.ListAsync(productId);
var service = new ProductImageService(myShopifyUrl, shopAccessToken);
var image = await service.UpdateAsync(productId, imageId, new Image()
{
Position = 2
});
var service = new ProductImageService(myShopifyUrl, shopAccessToken);
await service.DeleteAsync(productId, imageId);