Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Cap Order Quantity to Max Qty Available


Recommended Posts



I'm having trouble with my "allow checkout of oos goods" in the core package, I guess at some point some code must have been changed which is now causing it to error (nothing will check out when turned on).


SO.... I have a workaround.


I have a contrib installed that won't show the buy button if an item is out of stock (at 0 qty) BUT this has a flaw - if a user visits the cart for an item where say 3 is in stock, and orders 5 (therefore a qty of 2 unavailable) it will still them them over-order and checkout.

I can't enable the core "dont allow oos checkout" as I explained above it won't let anything check out because of a bug I don't know where :(


I can't find a contrib that fixes this, but think I know what would need to be done. It's the doing it I am having problems with :)....


Can anyone help with getting the $stock_available number to show in the "order quantity" input field on the cart?

This way I can do an if statement that if the $stock_available is more than order qty, show normal input field, or if $stock_available less than order quantity show modified input field where the number in the field reads the same as $stock_available.


Here is the contrib "Only This Many Available". Seems simple, but I can't for the life of me get the number ("2") part of "Only 2 Available" to show, which is what I need!!!


Please help me someone, I beg you! :blush:

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...