Downloads
This is an Inventory API, which hooks into Ubercart and provide a User Interface for inventory management while protect 'Inventor Manager' (business logic) which can be ether 3rd party or other Drupal modules, from changes in the UC code base. Included is a fully functional example IInventor Manager I've called 'Simple Stock Levels' which does basic stock level tracking.
The Simple Stock Levels module allows you to associate a 'quantity' with an SKU (tracking number, serial etc) and stops the purchase of products with that SKU if the quantity drops to zero. There is also 'Is Tracked' on/off switch for each product so you can turn tracking on and off for a product easily. Updates adjusts the stock levels when the order is updated in the admin backend.
Simple Stock Levels Manager isn't meant to cover all possible situations thats why I separated the business logic from the interface API. If the Simple Stock Levels Manager doesn't do exactly what you want you can modify it and then choose your custom manager to handle changes in stock. This is ideal id=f you have an external system that you want to integrate with Ubercart via SOAP or XML-RPC say.
The Inventory API does on-the-fly availability checking via Javascript (Ajax) that asks the chosen Inventor Manager if the current user (given their current cart contents) can add more of a given product to their cart and disables the 'Add to cart' button if they aren't. This allows the Inventor Manager to retain all the custom business logic needed to make this decision and so allow for more consistent behavior and simpler code design (its hoped).
Quick start guide
After Übercart is installed:
1. Install the "Inventory API" and optionally the "Simple Stock Levels" Inventory Manager module at 'admin/build/modules' and which are grouped under 'Ubercart - Inventory'. If you have a custom Inventory Manager then install that instead of "Simple Stock Levels".
2. Select which Inventory Manager you will be using at 'admin/store/settings/inventory'
3. Create/Edit a product and you should get a 'Stock levels' panel on this form. If the product has attributes then you can enable tracking and set the quantity in stock on that products Adjustments tab.
Done.
Change Log
- 1.11
- Fixed a bug which was not updating products without atributes when they submitted their the edit product form.
- 1.10
- Fixed the Ajax for IE6&7. Again.
- 1.9
- Fixed the Ajax for IE6&7.
- Added code to Simple Stock Level which removes stock level data when the product (node) is deleted (untested)
- 1.8
- Fixed a bug for product without attributes. The "add to cart" button gets disabled and says "Out of stock" now.
- Fixed a spelling mistake

- 1.7
- Simple Stock Levels Manager now updates the stock levels when an order updated or deleted in the administration backend interface.
- 1.6
- Made sure the fixes in 1.5 were uploaded
- 1.5
- Fixed a dependency bug that assumed the uc_attribute module was active.
- Fixed a HTML bug which forgot to close a DIV around the add to cart form
- 1.4
- Bug fix for default value thanks to c0psrul3
- Reworked Ajax status checking for products with attributes
- Intergration with the CSV Import module
- 1.3
- Fixed bug where the quantities were not getting decremented properly thanks to jetskier79 for posting a solution.
- 1.2
- Removed dependence on the "uc_attributes" module.
- Fixed an Ajax bug that was related to sites setup not in the root of the domain.
Development
| Preview | Attachment | Size |
|---|---|---|
| uc_inventory_api_v11.zip | 30.01 KB |



