-
-
Notifications
You must be signed in to change notification settings - Fork 312
Collects
Joshua Harms edited this page Dec 20, 2023
·
1 revision
A Collect
is an object that connects a product to a custom collection.
var service = new CollectService(myShopifyUrl, shopAccessToken);
var collect = new Collect()
{
CollectionId = collectionId,
ProductId = productId
}
collect = await service.CreateAsync(collect);
var service = new CollectService(myShopifyUrl, shopAccessToken);
var collect = await service.GetAsync(collectId);
var service = new CollectService(myShopifyUrl, shopAccessToken);
await service.DeleteAsync(collectId);
var service = new CollectService(myShopifyUrl, shopAccessToken);
int collectCount = await service.CountAsync();
//Optionally filter the count to only those collects for a certain product or collection
int filteredCollectCount = await service.CountAsync(new CollectFilterOptions()
{
ProductId = productId,
CollectionId = collectionId
});
var service = new CollectService(myShopifyUrl, shopAccessToken);
var collects = await service.ListAsync();
//Optionally filter the list to only those collects for a certain product or collection
var filteredCollects = await service.CountAsync(new CollectFilterOptions()
{
ProductId = productId,
CollectionId = collectionId
});