1

I often have customers try to add a greater amount of inventory than what is available. So, if there is 2 left in stock, they might try to add 10.

I'd like to control this by displaying "amount available" in the cart page, so they can see what's left.

As far as I can tell, {total_stock} is not available to the {items} {/items} loop in the Checkout Tag.

Whats the best way to go about this? Or, better yet, is there error handling for updating quantities?

Thanks. Lisa

1 Answer 1

1

There's total_stock variable:

{if total_stock} In Stock {if:else} Out of Stock {/if}

But that doesn't work if you have modifiers. Then there's an odd approach to using style classes: https://exp-resso.com/docs/store/product_tag.html#dynamic_product_variables:

store_product_stock
store_product_in_stock
store_product_out_of_stock

But that only works for single or no modifiers.

Alternatively, drop me an email on peter@peteralewis.com and I'll send you a beta version of my store_options plugin which can output everything relevant to the modifiers (single or multiple), options, in stock/out of stock and their stock levels.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.