Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
In the case where a product has multiple SKUs, and there is only one SKU with 'out of stock' while the rest have available stock, it should be displayed as 'in stock,' but it is showing as 'out of stock.'
Why is this happening?
<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 } } } } }
Solved! Go to the solution
This is an accepted solution.
Hi @akkyyyy ,
In the GraphQL query section, you applied the "available" filter to the product with the status true. This status is applied to the product itself, not the SKU. So maybe if there is an 'out of stock' SKU, the product will also change to 'out of stock' according to the filter.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
This is an accepted solution.
Hi @akkyyyy ,
In the GraphQL query section, you applied the "available" filter to the product with the status true. This status is applied to the product itself, not the SKU. So maybe if there is an 'out of stock' SKU, the product will also change to 'out of stock' according to the filter.
If our suggestions are useful, please let us know by giving it a like, marking it as a solution, or donating here ☕.
B2B Solution & Custom Pricing | Product Labels by BSS
Need help from our expert? Kindly share your request with us via community@bsscommerce.com
Thank you for Reply.
I don't think the item would be marked as out of stock if even one SKU is sold out. It turns out that my query for investigation was incorrect, and in the app, products were still retrievable even if one of the SKUs was sold out. Thank you for your response.
Thank you for Reply.According to my research, that was correct.
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