This module allows uc_stock to act as an inventory manager for Inventory API. This allows the prevention of people to add a product to the cart when it is out of stock.
| Preview | Attachment | Size |
|---|---|---|
| uc_stockstub.zip | 2.44 KB |
|
Ubercart |
|
|
|
||
This is an excellent module. However, it doesn't work as 'smoothly' as it could when using a product that has multiple attributes. When you create a product, a "Main SKU" is created for the product. However, the "Add to Cart" button is only replaced with a "out of Stock" badge when the Main SKU reaches zero stock. Although you can disable stocking checking of the "Main SKU" to prevent this, the "out of stock" badge will no longer appear when the "attribute SKUs" reach zero stock. In such an instance, the module DOES prevent purchase of the out of stock attributes. However, the customer only sees the out of stock message when they try to add an attribute to cart. This creates a slight usability issue, as the customer may end up trying to add every attribute to the cart before realizing that none of them are in stock. Is there anyway to overcome this? I guess the best way would be if the "Main SKU" stock level was automatically adjusted to reflect the total number of "Attribute SKUs" in stock. Is there anyway of doing this? Sweet Webmasterkai, if this takes off where the Inventory API stopped, then poeple here are going to be very happy. I only deal with 1 main product of each, so am not to worried about the last point, but yes, that is an issue. All attribute stoick items should be included. Will check it out. Wow, brilliant idea! I made the API but didn't think of making a wrapper Manager for the new uc_stock module, but i guess that was the point of the API separated from the actually stock tracking logic. Still I'm amazed that the API is working OK with all the changes that happened to UC up to version 1.0. Good work old man! Hi. The module seems only to 'check availability' for products that have attributes. For products that do not have attributes, and that are out of stock, the button still reads 'add to cart' instead of saying 'not available'. Not sure if I am missing something? Any ideas? Am using uc 1.3 See also http://www.ubercart.org/contrib/132 ... Fixes availability of button "Add to cart" for product node You can simply find this strings in uc_inventory_api.module : if(!uc_inventory_api_can_add($product->model, $form['qty']['#value']))And replace it with this one : if(!uc_inventory_api_can_add($product->model, $form['qty']['#value'] + 1))
This module works great for all my projects. There's just one thing I'm trying to modify without any luck. I have one site that's doing paid classes that use the paid events module. Right now when the classes are full, which is set by the stock levels, it says "Out of stock". That's fine for now, but I would love to figure out how to have it know when it's an event, say something like "Classes are full" instead. I've been trying to do this from the template.php file, but haven't had any luck. Ya, I might be revising that module as I intend to integrate with a third party stock tracking system so this will go in my notes. I want to integrate with the 'Acions' in Drupal 6 so it will be for UC2. you can use the strings override module for that - http://drupal.org/project/stringoverrides. I think I found a problem with this module. When the inventory reaches 0, the out of stock button is not displaying on my site. As I understand the below function, if a case where $amount=0 and (integer)$stock_level also is 0, it returns true. If 0=0, that's true and with CAN_BUY, we'd want to return false if amount@0=stock@0. OLD code: function uc_stockstub_inventory_can_buy($sku, $amount = 0)NEW code: function uc_stockstub_inventory_can_buy($sku, $amount = 0)After making this change in my site uc_stockstub.module, the "Add to cart" button is now properly changing to "Out of stock" when inventory reaches 0. I hope this will fix this condition and others will benefit from this information. This is the fix for comment #41 above: in uc_inventory_api.module changed line 181 My site was breaking due to this misspelling. It appeared as if there was no closing div for the form. |
|
Works great!
I'm running RC4.
Which version of uc_inventory_api are you using?
I used 1.5 by Cpill.
I think TR may have a newer version. See post: http://www.ubercart.org/comment/11193/Re-Ryan-said-I-know-CpILL
Cheers.