Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I'm filtering products, but the counts for "in stock" and "out of stock" don't match. In the response, filters.count shows "in stock = 2" and "out of stock = 12," but when I check the number of products associated with the collection in the display, "out of stock" should be 10. Is this a Shopify bug? Or does available=false refer to the number of products, excluding archived ones, rather than out of stock? If anyone has information, please share your knowledge.
<query>
query getProductsByCollection( \$limit: Int = 10 \$afterCursor: String \$sortKey: ProductCollectionSortKeys \$reverse: Boolean ) { collection(id: "gid://shopify/Collection/460299993388") { products( first: \$limit sortKey: \$sortKey reverse: \$reverse after: \$afterCursor filters:[ { available : true }, ] ) { edges { node { id title variants(first: 1) { edges { node { id title availableForSale } } } } } filters { values { count id input label } } } } }
<responce>
"filters": [ { "values": [ { "count": 2, "id": "filter.v.availability.1", "input": "{\"available\":true}", "label": "in stock" }, { "count": 12, "id": "filter.v.availability.0", "input": "{\"available\":false}", "label": "out of stock" } ] } ]
Solved! Go to the solution
This is an accepted solution.
This is an accepted solution.
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025