Inventory API & Simple Stock Levels

Contrib type: 
Module
Status: 
Abandoned

Downloads

Latest version: 
1.11
Compatibility: 
Ubercart 1.x

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 Sticking out tongue
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.

PreviewAttachmentSize
uc_inventory_api_v11.zip30.01 KB
jetskier79's picture
Offline
Joined: 08/15/2007
Juice: 14
Re: Inventory API & Simple Stock Levels

I wondered about the possibility of not displaying attributes for any attributes that might be out of stock. IE, If you have a site of shirts, and Black / Mediums are out....Don't allow the combination of black / medium.

Ultimately, it seems like this would be faster overall than using the ajax check each time a new attribute combination is chosen.

catorghans@drupal.org's picture
Offline
Joined: 08/16/2007
Juice: 72
minor bug

in uc_stocklevels.module
in function _uc_stocklevels_get_details

I replaced
$result = db_query('SELECT * FROM {uc_stocklevels} WHERE model = \''.$sku.'\'');

with

$result = db_query("SELECT * FROM {uc_stocklevels} WHERE model = '%s'", $sku);

works better IF you have a ' in the sku's (and is more secure as well)

francishsu's picture
Offline
Joined: 09/11/2007
Juice: 8
Attributes module dependency

I didn't have the Attributes module enabled and got SQL errors that table uc_product_adjustments didn't exist. The Attributes module should be a dependency for enabling the module I think.

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
@jetskier79 I suppose its

@jetskier79

I suppose its possible but more complex as you have to refresh the list on each change of the attributes, which means you copy a 'n' dimensional matrix for all the combinations of all the attributes and their stock levels (which I have done on a big site). If you have more than 2 attribute combination the problem becomes very ugly.

The other reason behind the Ajax check was so that 3rd party inventory managers, with their own business logic, could be integrated and this logic kept in one place, simplifying the design. The whole front end could be changed to accommodate this but I think the UI needs to be rethought first.

@catorghans@drual

thanks for that. I should change all the SQL calls like that, I was just being sloppy

@francishsu

I thought I'd fixed the attributes module dependency? I'll have another look, but which screen did you get this error on, and are you using 1.4?

Uberdevelopment www.tsd.net.au/blog

francishsu's picture
Offline
Joined: 09/11/2007
Juice: 8
Re: @jetskier79 I suppose its

Actually I'm using 1.3. Is 1.4 available for download elsewhere? Looks like you have already addressed the issue in version 1.4.

As far as the screens where I got the error, it was basically things like the Product administration screen and browsing through the catalog.

jcoffland's picture
Offline
Joined: 09/12/2007
Juice: 13
Attributes

FYI, it seems the Inventory API & Simple Stock Levels REQUIRE product attributes to be enabled.

CyberRanger's picture
Offline
Bug FinderCool profile pic award.
Joined: 09/13/2007
Juice: 57
How should the attributes work for in stock amount?

I can't seem to get the quantity in stock to work right when using the adjustments tab for a product. Let's say I have a hat in my inventory. It comes in red, one hat, and blue, three hats.

On the product tab, I put 4 in for "Number in Stock". When I go to the adjustment tab, both red and blue have a 4 for "Quantity". If I put a 1 for Red and a 3 for blue, after I click submit both "Quantity" fields come back as a 1 and the "Number in Stock" changes to 1.

If I add the red hat to my cart, then try adding the blue hat, I'm told the hats are out of stock.

Seems like the attributes don't really get tracked separately? Am I missing something?

I'm on ubercart Alpha7c using the v1.3 of the Inventory API and Simple Stock Levels.

catorghans@drupal.org's picture
Offline
Joined: 08/16/2007
Juice: 72
Re: How should the attributes work for in stock amount?

All SKU's (model) have to be unique.

By default, the options get the same SKU as the product.
If you make them different and then adjust the qty, it will work.

CyberRanger's picture
Offline
Bug FinderCool profile pic award.
Joined: 09/13/2007
Juice: 57
Re: Re: How should the attributes work for in stock amount?

Ah ... of course! Working wonderfully!

flaminhoon@yahoo.co.uk's picture
Offline
Joined: 09/19/2007
Juice: 21
Sold out items

I have a weird problem, items that are sold out are still available for sale, however if I put a products view in a block the "none left" button shows properly.

Once I've fixed this problem what I really need is a way to remove items completely that are sold out.
Any ideas?

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: Sold out items

Don't know about the first problem. Check all the usual: 'is tracking' is set, SKU is set and unique, etc (I should make an FAQ for this).

The second issue you really want to change the 'publish' flag on the node to 'false' as removing it might mess up your order tracking, accounting etc. You could:

1. try extending this modules code directly
2. write your own module that extends this module
3. write your own inventory manager that plugs into the API that does this.

I think 3 is the best bet as the pluggable nature of the API was designed to handle people with particular tracking requests.

Uberdevelopment www.tsd.net.au/blog

flaminhoon@yahoo.co.uk's picture
Offline
Joined: 09/19/2007
Juice: 21
Re: Re: Sold out items

Thanks, unfortunately this is beyond my ability

bmagistro's picture
Offline
Getting busy with the Ubercode.
Joined: 09/24/2007
Juice: 200
Re: Inventory API & Simple Stock Levels

does this work with the latest svn of ubercart?

Guest (not verified)
Guest's picture
Cancelling orders and adjusting inventory

I've noticed that when I cancel or remove products from an order, the inventory count does not increase. Also, when I edit an order and add or remove products, the inventory count does not fluctuate correctly. Does that mean anytime I make a change to an order I have to manually adjust the inventory so that it is accurate?

Thanks

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: Cancelling orders and adjusting inventory

Yep. There is a problem with the UC hooks so update events are not notifying the inventory API. I remember noting this but its up to Ryan or Lyle to do something bout that (or they might have and I'm not aware of it)

Uberdevelopment www.tsd.net.au/blog

avolve's picture
Offline
Joined: 09/14/2007
Juice: 47
spelling error

Just starting to have a play with this and found a typo in the simple stock module.

On the edit page for a product, in bold:


Tracking options:
Track stock levels for this product?
Simpel Stock Levels track the stock for this item. If not checked then customers will always be able to add this item to their shopping cart.

also wanted to test the water to see if there was any movement on other modules in devel using this API?

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: spelling error

Thanks for the spell check Smiling

Haven't heard of any. I have made some updates improving the Ajax reliability and allowing i to work in conjunction with another module I have made which replaces the select list of attributes with a radio button list of images. Other than that nobody has contributed any Inventory Managers. I guess these would nearly always be specific to the job/site. I'm always open to include any contributions.

Uberdevelopment www.tsd.net.au/blog

bmagistro's picture
Offline
Getting busy with the Ubercode.
Joined: 09/24/2007
Juice: 200
Re: Re: spelling error

im using the latest stable version of the ubercart, and when adding or modifying products it sets the track inventory even if i do not have it checked. I do not recall seeing any js errors. any thoughts?

thanks

c0psrul3's picture
Offline
Joined: 10/07/2007
Juice: 95
$is_tracked

change in uc_stocklevels.module

~ line 139

$form['table']['body'][$key]['is_tracked'] = array(
'#type' => 'checkbox',
'#default_value' => $stock_level->is_tracked, <=== THIS ONE!
'#prefix' => '<td>',
'#suffix' => '</td>'
);

and

~ line 180

function uc_stocklevels_product_node_form_submit($form_id, $values)
{
if(isset($values['quantity'])) // If there at attributes then this will not be set
{
// Convert the 'is_tracking' option to a boolean (1 or 0)
$is_tracked = ($values['tracking_options']['is_tracked']) 1: 0;  <== THIS ONE TOO!

$detail = _uc_stocklevels_get_details($values['model']);

should fix the default "1" value for column "is_tracked" in table "uc_stocklevels"

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: $is_tracked

thanks mate, have updated and will release a new version with your changes.

Uberdevelopment www.tsd.net.au/blog

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Inventroy MySQL Error

Gave "uc_inventory_api_v1.4.zip" a try. End up with the following error on each of my 3 sample products.

"user warning: Table 'jewelrycart.uc_product_adjustments' doesn't exist query: SELECT * FROM uc_product_adjustments WHERE nid = 3 in C:\apache2triad\htdocs\drupal_5.2\includes\database.mysql.inc on line 172."

Any suggestions...

Thanks.

Jim

dimon_td's picture
Offline
Joined: 10/16/2007
Juice: 52
Re: Inventroy MySQL Error

I have this problem too! =(

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: Inventroy MySQL Error

I thought I'd fixed this already. The attachment here should fix it. Let me know and I'll post it above as the next version.

AttachmentSize
uc_inventory_api_v1.5.zip 39.51 KB

Uberdevelopment www.tsd.net.au/blog

dimon_td's picture
Offline
Joined: 10/16/2007
Juice: 52
Re: Re: Inventroy MySQL Error

Oh, thank you, CpILL, you realy help me! This version is working! =)

But I've saw another problem.
I have in my warehouse 10 disks (for example), and I've ordered 1 disk, and in my warehouse remains 9 disks, but I've canceled my order, and also in my warehouse remains 9 disks, but should be 10 disks! Can you edit your code in this module??
Thank you! =)

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Inventory Install Instructions

Have downloaded version 1.5 and un zipped. Normally place this in the Drupal > modules folder with the other Ubercart modules. However, noticed that I have two files that are unzipped.

One is "uc_inventory_api" at 84.2 K and the other is "__MACOSX" at 246 bytes. I assume that these both get placed in the modules folder. Do I have to also run "mysite/update.php"? I would assume not, but just want to make sure that the inventory module is installed correctly and the the DB table is created and updated as needed.

PS Looked for an install text file in the download but could not locate one that would address the how to install correctly question.

Thanks,

Jim

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Inventory

Installed version 1.5 and all is working.

Thanks for the updated version.

Jim

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
@Alaska Thanks for the

@Alaska
Thanks for the feedback Jim, I'll post up the v1.5 file as the main one now.

@dimon_td
ya, this is an issue. I'm not sure if there is a hook to handle order changes thought the Admin. There is a new event system that the UC boys have just recently integrated, I'll check it out... at some point.

Uberdevelopment www.tsd.net.au/blog

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Inventory/Simple Stock Block Movement

Using localhost and Apache 2 Triad to test both Drupal and Ubercart. Using a 3 column theme and tested both Aurora and Garland with the same results.

When Simple Stock Levels 1.3 and Inventory 1.5 are enabled the left and right columns are both moved to the center. In the admin node it looks fine, but when logged out the site user will see one column with no side columns. (i.e. both left/right are correctly setup in blocks)

When Simple Stock is removed from Store Config and then Simple Stock and Inventory from enabled modules, then all return to normal. Maybe I missed a check box someplace. Always a possibility with Drupal and add ons.

Odd behavior - Any fixes, as it would be nice to use these two modules as the site has one of each item to sell with no backup inventory.

Thanks,

Jim

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Update on Blocks Added Images of Site

Have attached two images. One of the site working properly called full width. The other is narrow width when both Inventory and Simple Stock Levels are activated in admin > modules. Note: site returns to normal when both modules are deselected.

Did notice that all of the left column blocks are missing. Only the center and right are displayed. Both now in the center column with missing left and right columns.

Jim

AttachmentSize
narrow_width.gif 17.57 KB
full_width.gif 26.9 KB
CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: Update on Blocks Added Images of Site

curious, I'm guessing that there is a tag thats not being closed. i fixed the only instance of this I could see in 1.5. Can you see any HTML errors? If your using FireFox perhaps try the HTML Validator Add-on.

Uberdevelopment www.tsd.net.au/blog

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Strange Results with Inventory

Thanks for the look at the interesting display with the Inventory/SSL modals activated. Have looked at the page in both IE 6 and FF and both display the same. May take your suggestion as looking at the code side by side with working vs non working page and see what can be seen.

Perhaps when Inventory is activated it causes an error that has always been present in Drupal. Or Inventory places its own error into the code and breaks the Drupal page. It is tough to see what the action is at this juncture.

Others seem to have this working so not sure what the issue is. Using Drupal 5.3 and Uber E. So far the cart works well but only when Inventory and SSL are not used. What is interesting is that this is the 2nd install that has had the same issues. Used Drupal 5.2 and Uber E on the computer as localhost with the same exact results. Then upload an entirely new site to the server. Same results. At least it is consistent!

Please keep me posted on possible solutions.

Jim

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
CpILL: Here are two text

CpILL:

Here are two text files containing all of the code from the home page. The broken is when SSL and Inventory are enabled.

Looked for an extra or missing "div" tag but both scripts look the same. Noticed some additional JS at the top of the page in lines 29 - 36 as follows that only appears in the broken site.

var base_path = "/";

var lang_add_to_cart = "Add to cart";
var lang_not_available = "Not available";
var lang_checking = "Checking availability...";

var node_id_list = new Array();
var attrs_list = new Array();"

Did notice that Oslinux will trade a solution for a neckless.

Jim

AttachmentSize
broken.txt 16.29 KB
working.txt 14.67 KB
Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
CpILL: Did a comparison of

CpILL:

Did a comparison of the code from the working and non working home page. Here is the result in a Word document. The yellow highlights indicate the code in the non working page that is different from the working page. The same code repeats for the other product form pages.

Take a look and let me know if you see anything that would break the page or cause Drupal to hiccup when SSL and Inventory are in use.

Thanks,

Jim

AttachmentSize
differences.doc 21 KB
CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: CpILL: Did a comparison of

ya, seems the v1.5 download wasn't the latest file so the HTML fix I did wasn't active. should be OK now. Give it a go.

Uberdevelopment www.tsd.net.au/blog

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Fixed

CpILL:

Thanks so much for version 1.6. That worked well on the desktop PC under Localhost. However when I just overwrote the files on the live server it would not work. Had to first totally delete version 1.5 and then FTP 1.6 to the server.

In any event, it looks like it is a go at this point.

Thanks again.

Jim

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Inventory Refresh

When an order is canceled by the store administrator in the Inventory module,the "Stock levels Number in stock: 0 The number of items Ãœbercart is allowed to sell." is not updated. Is that what others are seeing in product settings?

i.e. there is one item to sell. The number in stock is set to 1. When the order is completed by the customer, Inventory sets this to 0 indicating no stock available. And Uber will display the message "Sorry, there is not enought in stock to add this to you cart.".

Should inventory be reset from 0 back to 1 when the store admin cancels an order?

Looks like two spelling issues - enought should be enough and you should be your. Found the text in uc_inventory_api.module and uc_inventory_api.module.svn-base .

Is this the correct location for making changes in this text??

Jim

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Hi Jim, ignore

Hi Jim,

ignore "uc_inventory_api.module.svn-base" or anything with ".svn" in the name. This is my version trackers (Subversions) junk. "uc_inventory_api.module" is the place to make the change. Thanks for the corrections. The old dislexica is acting up again Smiling

There is an issue with changes to orders in the admin not reflexed in the stock levels. At the time of writing this there was no way for me to hook into the admin to know when an order had been canceled or updated. The UC team have changed the event system since and now it should be possible... when i find the time. I need this myself so should be soonish.

Uberdevelopment www.tsd.net.au/blog

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
File Change

CpILL:

Changing one file sure does make it easier. Thanks for the suggestion.

That will be a nice update to allow the admin to cancel an order and update the inventory. So far no issue, but it will be a great enhancement once it is implemented.

Not sure if I saw this happen or just imagined it.... When stock inventories are at zero the "add to cart" button should say "sold out" and be non clickable. The way it works now is that the button has to be clicked in order to see the sold out message on the next page. That might make a customer unhappy especially if they really wanted that one item. In many cases with a lot of inventory, it will make no difference. But with sites that only have one of each item, it does become important.

Or the site admin could have a check box that would provide a selection when sold out. That would be either have the sold out button displayed or have the entire listing removed including text and picture. However, if that were to happen then there should be a way to recover the text and image if that order were to be canceled and the inventory once again brought back to one, etc. The best approach would to use just the sold out text. Seems simpler and one less thing to worry about.

Jim

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Alaska (aka Jim): It should

Alaska (aka Jim):

It should do an Ajax call when the page loads and disable the button and change the text to "Checking..." then ether say "Sold Out" if the items isn't available. Are you getting Javascript errors on any page with an "Add to cart" form on it?

Uberdevelopment www.tsd.net.au/blog

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Sold Out

CpILL:

Guess that I was correct in that I did see that button change at one point in the life of the site.

Just now checked both my localhost site and the live site. Both do the same when inventory is at zero. The message is at the top of the home page as shown in the attachment. When looking at the item which is down the page; no sold out is listed and the button is still active. And if clicked, once again it will display the same top of page message.

There are no warnings on the page or in the Drupal log.

There are a number of Drupal modules that are either non selected or removed from the server. Let me know if a specific module has to be in use for Ajax to make the specific call.

Having another issue with a call back for In Store Pickup but that should not be related to this issue. http://ubercart.org/forum/support/1556/store_picklup_valid_callback_erro...

It would be interesting to see why the sold out button once worked but not is not functional. Interesting!!!

Jim

AttachmentSize
message_homepage.gif 24.69 KB
Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Page Code

CpILL:

Not sure if this is the issue or not. Did not locate this CSS class as there is no CSS style sheet in inventory. Perhaps it is being accessed in some other way.

<div class="uc_inventory_ajax_form">

Here is the code for the item that has zero inventory. It looks the same as the code from an item that has a lot of remaining inventory.

<div class="content">
    <div class="product_image"><a href="http://localhost/drupal_5.2/files/4993.jpg" title="4993.jpg" class="thickbox" rel="field_image_cache_1"><img src="http://localhost/drupal_5.2/files/imagecache/product/files/4993.jpg" alt="4993.jpg" title="4993.jpg"  /></a><br /></div><p>The accent area of this necklace contains five Sun Stones set off on both sides by a daisy spacer, Rhodonite, Unakite, and a Quartz Faceted Rectangle bead. The non-accent portion of the necklace is a pattern of Czech glass, frosted bead, and a rose bead. (Click on image for larger view)</p>
<div class="display_price">$24.95</div><div class="add_to_cart"><div class="uc_inventory_ajax_form"><form action="/drupal_5.2/node"  method="post" id="uc-product-add-to-cart-form-4">
<div><input type="hidden" name="qty" id="edit-qty" value="1"  />
<input type="submit" name="op" id="edit-submit" value="Add to cart"  class="form-submit" />
<input type="hidden" name="form_id" id="edit-uc-product-add-to-cart-form-4" value="uc_product_add_to_cart_form_4"  />
<input type="hidden" name="uc_inventory_nid" id="edit-uc-inventory-nid" value="4"  />
<input type="hidden" name="uc_inventory_aids" id="edit-uc-inventory-aids" value=""  />

Looks like this maybe the code that causes the action to change the button from "add to cart" to sold or the call made by div class when inventory is zero.

<div class="display_price">$24.95</div><div class="add_to_cart"><div class="uc_inventory_ajax_form"><form action="/drupal_5.2/node"  method="post" id="uc-product-add-to-cart-form-4">

Also using version 1.6 of Inventory and Uber 7E.

Let me know about any fix.

Thanks

Jim

dimon_td's picture
Offline
Joined: 10/16/2007
Juice: 52
Hi all, I just wondered

Hi all,

I just wondered about this question:
"I have in my warehouse 10 disks (for example), and I've ordered 1 disk, and in my warehouse remains 9 disks, but I've canceled my order, and also in my warehouse remains 9 disks, but should be 10 disks! Can you edit your code in this module??"
Thank you! =)

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Inventory Now Working

CpILL:

Now have the module working 100% on localhost. Still no go on the live sites.

Had to start over with the localhost setup and remove all of the files and the DB. Now Inventory, Simple Stock Levels and In Store Pickup all work including the nice sold out box.

Any idea of why it took a new install to make it work? Perhaps something in the DB was not updating correctly.

Will have to most likely do the same to get the live sites to work. But first will add some of the additional modules to make sure that none were missing causing the issue.

Thanks for the assistance.

Jim

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Order Cancled

I think that CpILL indicated that when an order is canceled by the admin the stock levels do not reset. This is an option that he would like to add to the code as you have suggested as others have the same need.

Jim

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Comment by CpILL

Here is the comment made on Oct 26th...

"There is an issue with changes to orders in the admin not reflexed in the stock levels. At the time of writing this there was no way for me to hook into the admin to know when an order had been canceled or updated. The UC team have changed the event system since and now it should be possible... when i find the time. I need this myself so should be soonish."

Jim

CpILL's picture
Offline
Early adopter... addicted to alphas.Getting busy with the Ubercode.
Joined: 08/08/2007
Juice: 550
Re: Comment by CpILL

Thanks Jim, I also added to the above description, in bold:

* * * NOTE: Changes to an order from the admin do not affect the stock levels at this time! You will have to manually do this for now. This will eventually be changed. * * *

but sadly there is no web development trick that will get people to read what is under their nose.

Uberdevelopment www.tsd.net.au/blog

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
Is Inventory MACOSX File Needed?

CpILL

Notice that I end up with two files when unzipping.

uc_inventory.api

and

__MACOSX

Are these both required? If not which one can be removed from the Drupal modules?

Jim

Alaska's picture
Offline
Joined: 10/16/2007
Juice: 1434
MACOSX

Deleted __MACOSX from the server. Looks like that file was some material left over from code development. Not sure how it ended up in the zip file.

Jim

dimon_td's picture
Offline
Joined: 10/16/2007
Juice: 52
Re: Re: Comment by CpILL

CpILL, oh, thank, I shall wait..

jorditr's picture
Offline
Getting busy with the Ubercode.
Joined: 10/31/2007
Juice: 256
uc_stocklevels.module with inventory lists

Hi you all, I´ve upgraded uc_stocklevels.module to be usable on one site I'm developing. The main problem is that there was no place to see how your stock is evolving. I've added:

  • a new page which list the products which are tracked with inventory control
  • a link under products to access that page on the shop management
  • a css class on that list to build a css style on red light to highlight on that list which products are out of stock
  • not only displays model but also product name
  • another page to list all not tracked products on your shop
  • on both pages every line on the table allows to open the product edit page to instant changes
  • the edit page opens on a new window
  • both tables paginate every 20 products
  • both pages are tabs on the same store link
  • all the added strings allow for internationalization

Some ideas I want to add soon:

  • a threshold range to display more or less products per page
  • display new columns of information, as, units sold
  • a threshold range to decide how many units will show the red line, maybe you prefer to be aware of it not at 0 units, but when only 3 are remaining
  • sending an email when a product reaches the threshold limit

I've attached only the uc_stocklevels.module to replace the old one, only that is needed, rebuild your menu cache in order to have the new menus and links available. It's working for me and I would love to see others comments and suggestions. The more people using it the more things we'll be able to improve Smiling

AttachmentSize
uc_stocklevels.zip 3.84 KB