So, you're using Ubercart for Drupal, and you've probably discovered that while Ubercart can manage stock, and send you a warning that an item is out of stock... it'll keep selling the item regardless of just how much you have in stock!
This obviously, simply will not fly for items that are limited runs, or for items that simply can not be purchased again in unlimited quantities! So, how do you fix it?
Well... there aren't many options out there, but here is the easiest one to impliment if you know how to do advanced themeing.
You'll want to edit node-product.tpl.php, and where you render the add to cart button, you'll want to write something like this:
It's quite simple, but I'll walk you through the process anyways. First you get the quantity in stock from the uc_stock_level module. Then you check if stock is greater than zero. If it is, you render the add to cart button, and how many are in stock. If isn't, you simply render the out of stock option!
Pretty basic, but sometimes all it takes is a simple fix!
Post new comment