Solved

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

akkyyyy
Shopify Partner
14 4 4

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 Expert
3477 461 515

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 or marking it as a solution.

For B2B solutions and custom pricing, check out B2B Solution & Custom Pricing |
For adding product labels/badges, visit Product Labels by BSS

BSS Commerce - Shopify Apps & Store Development Service Provider

Hire a Shopify expert | Shopify Plus Store Development

View solution in original post

Replies 3 (3)

BSS-Commerce
Shopify Expert
3477 461 515

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 or marking it as a solution.

For B2B solutions and custom pricing, check out B2B Solution & Custom Pricing |
For adding product labels/badges, visit Product Labels by BSS

BSS Commerce - Shopify Apps & Store Development Service Provider

Hire a Shopify expert | Shopify Plus Store Development

akkyyyy
Shopify Partner
14 4 4

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 4

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