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.
Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024In today’s interview, we sat down with @BSS-Commerce to discuss practical strategies f...
By JasonH Nov 13, 2024