Product variant available

Hi,
I’m having an issue with the product.variant.available value.

According to the Liquid documentation, it should return true if any of the listed conditions are met.

However, even though my variant meets those conditions (as shown in the screenshot), the value of available is still false, which causes the button to display “Sold Out.”

This issue only occurs on a few stores — most other stores work fine.

Could you please help me check why this might be happening?

Thank for help.

The first sceenshot shows the inventory policy being set to DENY so its correct that the variant is showing as unavailable.

If you think this isn’t correct still, I’d advise testing this out on the latest version of the Horizon theme.

Since Inventory not tracked, I don’t think that’s the cause of the issue (this pass inventory_management condition). The logic for disabling the button varies across themes, so I could intervene and fix it for the client. However, I don’t want to do that. I’d prefer to understand the root cause of this issue.

Hi there,

Can you provide information on the following so I can investigate please:

  • Is it happening specifically with bundle products on the product page of the bundle parent?
  • Do the affected products have any options and variants?
  • What is the behavior on a new Horizon theme?
  • Have you identified any similarities in the affected products?

I’ve found the cause. For stores with multiple locations, when creating a product via the Admin GraphQL API, it only adds inventory to the default location. However, there’s no option to specify a location during creation. My product doesn’t have any variants (it uses the default variant).

Right now, I can use the inventoryActivate mutation to add the product to a location after creating it.

Is there a quick way to add or assign the location?
I’d be happy if you could suggest a better way to handle this.

Look at using productSet instead which allows you to specify quantities while also setting the locationId

1 Like

Thanks for this solution. But locationId in variant.inventoryQuantities field. My product is not tracked and this make inventoryQuantities is not used and my product use default variant
This approach will make the code a bit messy ~~