Have your say in Community Polls: What was/is your greatest motivation to start your own business?

Re: I have inventory, but it's showing as 'out of stock'

Solved

I have inventory, but it's showing as 'out of stock'

akkyyyy
Shopify Partner
14 4 5

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
            }
        }
    }
}
}

 

Accepted Solution (1)

BSS-Commerce
Shopify Partner
3477 463 547

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


BSS Commerce - Full-service eCommerce Agency

View solution in original post

Replies 3 (3)

BSS-Commerce
Shopify Partner
3477 463 547

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


BSS Commerce - Full-service eCommerce Agency
akkyyyy
Shopify Partner
14 4 5

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.

akkyyyy
Shopify Partner
14 4 5

Thank you for Reply.According to my research, that was correct.