-
-
Notifications
You must be signed in to change notification settings - Fork 312
Custom Collections
Joshua Harms edited this page Dec 20, 2023
·
1 revision
A custom collection is a grouping of products that a shop owner can create to make their shops easier to browse. A shop owner creates a custom collection and then selects the products that will go into it.
var service = new CustomCollectionService(myShopifyUrl, shopAccessToken);
var collection = await service.CreateAsync(new CustomCollection()
{
Title = "My Custom Collection",
Published = true,
PublishedAt = DateTime.UtcNow,
Image = new CustomCollectionImage()
{
Src = "https://placekitten.com/250/250"
}
});
var service = new CustomCollectionService(myShopifyUrl, shopAccessToken);
var collection = await service.GetAsync(collectionId);
var service = new CustomCollectionService(myShopifyUrl, shopAccessToken);
var count = await service.CountAsync();
var service = new CustomCollectionService(myShopifyUrl, shopAccessToken);
var collections = await service.ListAsync();
var service = new CustomCollectionService(myShopifyUrl, shopAccessToken);
var collection = await service.UpdateAsync(collectionId, new Collection()
{
Title = "My new collection title"
});
var service = new CustomCollectionService(myShopifyUrl, shopAccessToken);
await service.DeleteAsync(collectionId);