By default, ubercart doesnâ€™t prevent the purchase of out of stock items. However, there are three contributed solutions that offer such functionality.
Version tested: 1
+ Replaces the "add to cart" button with an "out of stock" badge when the primary SKU is out of stock. This is very handy, as customers instantly know which products cannot be purchased.
+ If a product has attributes, an out of stock message will appear when a customer selects a sold-out attribute. [The message also blocks purchases].
- The out of stock badge is controlled by the main SKU and will only appear if the main SKU is at zero, regardless if the other attributes are in stock or not. As a result, it is best to disable stock tracking of the main SKU when selling a product with multiple attributes.
- When all attributes have sold out, the out-of-stock badge does not appear, although the customer will receive the out of stock message each time they try to add an attribute to the cart. Although this stops them from ordering sold-out goods, it creates a usability issue, as the customer has to add every attribute to the cart before realizing that none of them are in stock. (As a work around, you can manually enable the main SKU and set its stock to zero to make the badge appear, but this obviously isnâ€™t convent for large product catalogues).
Version tested: 1
+ Displays out of stock message, when the customer tries to purchase a main SKU or an attribute that is out of stock.
+ Unlike uc_stockstub customers can still purchase attributes that are in stock even if the main SKU is at zero.
- Unlike uc_stockstub, there is no out of stock badge. Customers have to add the product to cart before being informed that it is out of stock. This creates a usability issue.
- Like uc_stockstub, there is no message to alert the user when all attributes have sold out, which creates the same usability issue.
qrios' stock display script http://www.ubercart.org/forum/support/4037/stock_level_product_page
+ Allows customers to instantly see which attributes are in stock (The quantity of â€˜in stockâ€™ items are displayed as a table). This avoids the usability problems of uc_stockstub and uc_multi_stock.
- Doesnâ€™t prevent purchase of sold-out products.
- Although it can be used in conjunction with one of the above modules to prevent purchase of sold-out goods, doing so will create a usability issue: The above modules mark a product as out of stock when it is added to a shopping cart. qriosâ€™ script, however, considers products to be sold out when the order has been completed. Hence, this could create a situation where qriosâ€™s script displays a product as in stock, but one of the above modules display it as out of stock.
- If no attributes are in stock, no table is rendered, which is confusing to the end user.
Ubercart Out of stock AJAX Notification sounds promising, but untested by me. Uses ajax and jquery and asks the server for available stock and replaces the 'Add to cart' button with some configurable HTML.
Overall uc_stockstub and uc_multi_stock are more-or-less equal. From a customersâ€™ point of view, uc_stockstub is very slightly better due to its â€œout of stockâ€ badge. This, however, is only a slight improvement, as the badge is solely controlled by the main SKU, which creates a usability issue for products with multiple attributes.
Either module can be used with qrios' stock display script to partly overcome their shortcomings.
On the whole though, both modules would suit the needs of most stores, so you can't go wrong with either.
- uc_stockstub requires installation of the Inventory API. You do NOT need to enable Simple stock levels, which comes with the API.
- Be sure to disable uc_stockstub and Inventory API (from the modules menu) before installing uc_multi_stock, or your site may become inaccessible due a fatal error.
- qrios' stock display script may be a bit tricky for PHP noobs to install. The easiest way to use it, is to download and install contemplate. Create a new template for Product and paste qrios' code at the top of the template. Next, paste â€œ<? php print $stock_html; ?>â€ in the place where you want the table to appear. Contemplate is really easy to use, but if you get stuck, check out this video.
- You can improve the usability of qrios' stock display script by wrapping the table in fieldset tags For example:
<fieldset class="collapsible collapsed"> <legend> < a href="#">HEADING</a></legend> < ?php print $stock_html; ?> </ fieldset>)