Incorret number in liquid's inventory quantity

or-wedev
Shopify Partner
4 0 2

Hello, 

I have a bundle product with quantity of 18 (it consists of 2 products, each product has 6 stock in 3 locations, thus 18 total available)

 

I have a problem in the liquid code that if I write "

{{product.selected_or_first_available_variant.inventory_quantity}}" I get the number "12" instead of "18".
 
Untitled 2.png
 
Untitled.png

Although the bundle's product page clearly specified the quantity is 18

orwedev_0-1715601955488.png

 

Does anyone else have that liquid issue? is it a known issue?

Replies 5 (5)

MaxDesign
Shopify Expert
213 15 83

Hi there,

Just in case, have you configured "fulfillable inventory" to only sell within configured shipping zones? In that case, the inventory that is available to the customer is limited to the market he is in, and not to the total inventory available. This is used to prevent over-selling when some warehouse can't ship to some regions. If you don't see what I'm talking about, check out this doc: https://help.shopify.com/en/manual/shipping/setting-up-and-managing-your-shipping/fulfillable-invent...

If your store is selling from all locations to all shipping zones, then it must be something else, but I don't have another guess right now.

Reach out to me at admin@maxdesign.expert
or-wedev
Shopify Partner
4 0 2

Hi, 

 

It wasn't it, the fulfillable inventory is currently set to "Sell from all locations to all shipping zones"

MaxDesign
Shopify Expert
213 15 83

Have you tried to krank up the quantities in cart anyways? Krank it up above 18, and see what error message the checkout displays (it should tell you that you have reach max quantities, and adjust total quantities to maximum available).

Then do the same test with a quantity between 12 and 18, say 15, and go to checkout to see if it displays any error message. This should give you an idea if the problem is linked to how the invenotry is managed in the backoffice, or if the problem is linked to how the inventory is displayed in the storefront.

Reach out to me at admin@maxdesign.expert
or-wedev
Shopify Partner
4 0 2

Yeah I tried that and all my tests were on the stock dawn theme.

I can add 18 units of the bundle. When I try to add the 19th I get an error. When I go to checkout with 18 items I see the cart as expected with 18 of the bundle which consists of 18 from each item.

 

The problem is with the storefront. It's a bug with the liquid command

MaxDesign
Shopify Expert
213 15 83

In 5+ years playing around with liquid, I've seen some weird stuff with liquid filters, but never a liquid command has returned a wrong value. At this stage, unless someone else come up with an idea, you may have to hire someone to check your code directly. You can pm me and I can have a glance at your store at no charge, I'm just getting curious now.

Reach out to me at admin@maxdesign.expert