Collection and Collect API Feature Requests

Shopify Partner
18 0 0

@hcmlopes this is true however this is also not however a complete solution.

 

Take for instance a disjunctive (OR rules) smart collection which has 2 or more rules, for arguments sake lets say any product less than $5 OR any product more than $10

 

There is absolutely no way to independently add a product to a store and guarantee the automatic exclusion from all smart collections while maintaining the integrity of their rules. Hence there should be a way to exclude a product from smart collections entirely either at a high level or on each smart collection regardless of its disjunctive or conjunctive state.

 

Maybe the alternative here is to allow BOTH; DISJUNCTIVE (logical OR) and CONJUNCTIVE (logical AND) rules on smart collections. The way I see this working is having an expression containing disjunctive rules and then another expression which is evaluated on the resulting set which can be either conjunctive or disjunctive. (i.e exclude the products we wish to exclude here in conjunction with the expression containing the disjunctive rules). 

 

However it seems simpler to be able to exclude a product from the visible store whilst still having it published so it can be sold (my specific use case requires this - at the moment my app prompts merchants to change each of their smart collections individually which is not ideal).

 


@hcmlopes wrote:

I like this idea but I think it may be easier for most users to use a tag system by including a Product Tag is not equal to condition.


@AlexanderCollin wrote:

A sensible request for the Collect and Collections API;

Allow exclusion of a Product from ANY smart collection based on some metafield, regardless of if that product satisfies a smart collection rule. That is, one could create a Product with a metafield attribute such that it would never appear in any smart collection, or possibly, not appear in any collection at all. 






0 Likes
Shopify Partner
17 0 0

A SKU end point  for the ProductVariant and InventoryLevels API. A SKU by definition is a unique identifier for a product and one that will always be in an external system that would desire to sync with Shopify, without having to store an additional surrogate key value. 

 

Variants

GET /admin/variants/#{sku}.json
PUT /admin/variants/#{sku}.json
{
  "variant": {
    "sku": "SKUA",
    "option1": "Not Pink",
    "price": "99.00"
  }
}

Inventory Levels

GET https://{store}.myshopify.com/admin/inventory_levels.json?location_id=6884556842&skus={SKUA, SKUB, etc}

 

Set Inventory Levels

{
  "location_id": 6884556842,
  "sku": SKUA,
  "available": 1
}

 Adjust Inventory Levels

{
  "location_id": 6884556842,
  "sku": SKUA,
  "available_adjustment": 1
}

 

 

Chad Richardson
Mozzo Software - Modular Software that grows with you from solopreneur to a 200 person mega team. Why keep outgrowing your Shopify Apps? Start with us, and just use the modules you need, then add more as you grow. http://MozzoERP.com
0 Likes
Shopify Partner
1841 170 481

@MozzoERP GraphQL Admin API would be useful here and you can do most of that (haven't checked whether all, but will write some tests later out of curiosity). For instance:

 

query {
  productVariants(first: 1, query:"sku:US-WA2-310004") {
    edges {
      node {
        title
      }
    }
  }
}

I know it's not the REST API, which is why I always say use both ;-)

I turn coffee in to code - since 1998
0 Likes
Shopify Partner
17 0 0

Thanks for the option. I'll have to look at all scenarios...i.e. can you update inventory by SKU using graph, etc. But, probably storing the shopify product id in an Xref table is easier than creating a graph integration.

Chad Richardson
Mozzo Software - Modular Software that grows with you from solopreneur to a 200 person mega team. Why keep outgrowing your Shopify Apps? Start with us, and just use the modules you need, then add more as you grow. http://MozzoERP.com
0 Likes
Shopify Partner
1841 170 481

Yes "you can update" inventory by SKU so to speak using GraphQL - so to speak. Actually, answered a question exactly about that earlier today.

 

Of course, I understand introducing GraphQL would be quite time and resource intensive. I'd definitely keep my eyes peeled for it though because it's quite worth it IMO (not just in terms of Shopify).

I turn coffee in to code - since 1998
0 Likes
Shopify Partner
4 0 0

@phannigan Why not instead make a webhook to products and see which collection they are in. If that is possible in your case, will be way better than having to make so many api calls.

0 Likes
Shopify Partner
6 0 2

@Marslan it seems from other threads on this forum and Stack Overflow that "product updated" webhooks don't fire reliably depending on how a product is added/removed to/from a collection (ie whenever a Collect is created/deleted). For example, a product can be added to a collection from the collection page, the product page, or due to the rules of a SmartCollection being changed or suddenly matching a product at some point in time... and not all of these things would cause a "product updated" webhook to fire.

 

If you've seen different behaviour or I'm missing something here, please let me know. I would love to get a usable solution working!

 

Patrick

1 Like