Inventory Stock Level "Checking Availability" Disabled

Posts: 48
Joined: 01/31/2008

I'm not sure if I'm setting this up correctly. In Stock tab - I have stock set as 3 threshold set as 1. In the product tab, I have Stock Level "Number in Stock" set as 3 and Tracking Options checked. The frontend now has "Checking Availability..." instead of "Add to Cart" and it's disabled - can't click on it...

Can someone also explain to what the difference is in the Stock tab and Product tab "stock" (should they just be the same number and do I need to enter it in both places) and what threshold is and how that's used?

Thanks!!

inventory 1.11
simple stock levels 1.5
ubercart 5.x-1.0-beta4
drupal 5.7

Posts: 891
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

It looks like you also have the core "Stock" module enabled - that's an independent stock tracking module. You have to use the Inventory/Simple Stock Levels or Stock, but not both.

--

<tr>.

Posts: 48
Joined: 01/31/2008

Thanks, so it's either or...

I also think it's because I had some attribute that had text fields, so there's no way of really checking for stock (since I suppose that would be custom product and will not work in this instance). I tried it with drop down selection of attributes and that worked fine.

Thanks TR! I've read from another post you were updating Inventory/Simple Stock Levels module from now on - what kind of feature are you working on and how is it going?

Posts: 891
Joined: 11/05/2007
Bug FinderFAQ ModeratorGetting busy with the Ubercode.

I'm going to start a new thread "soon" discussing my changes. But they will be backwards compatible, so if you are using Inventory/Simple Stock Levels, OR if you are using uc_stock, you will be able to move to the new version without having to re-enter all your stock data. Underneath the hood there will be a lot of changes, but I want to make the upgrade as painless as possible.

--

<tr>.

Posts: 48
Joined: 01/31/2008

That's great - really appreciate your contribution!

Which one do you recommend using though, the Inventory/Simple Stock Level or the uc_stock. I've disabled the stock that came with ubercart (uc_stock?) and it doesn't have the threshold feature. Any other big difference between the two?

I can't get rid of the "checking availability" now even if I put stock level as 100, how can I change that to say "add to cart"? This is the one with the different text area attribute...

Posts: 48
Joined: 01/31/2008

I guess the code in availability_check.v2.js does the check, but because I'm using multiple text fields (to customize a product with user submitted dimensions), it probably can't do the check really. Is there a way to by pass this if I use text field and only execute this if it's with option dropdown or no attribute:

// Ask Drupal if current selection is availible with AJAX post...

var submit_id = "#" + form.id + " .form-submit";

$(submit_id).val(lang_checking).attr({disabled: "disabled"});
$.post(
base_path + '?q=uc_inventory_api/ajax/can_add',
eval("({"+params.join(",")+"})"),
function(data){ toggle_submit(data, submit_id); }
);

Posts: 15
Joined: 11/20/2007

Hi Giggler,

I have the same problem -- the stock level module 'hangs' on "checking availability" with no checkout button. It happens for products that have text boxes, defined as product attributes. In my case this is for gift certificates which use text boxes to send a message to the recipient of the gift certificate (thus rendering the gift certificate module incompatible with the stock levels module).

Did you figure out a solution to the problem?

Thanks,

Shiraz

Posts: 48
Joined: 01/31/2008

Unfortunately no. The only way to Add to Cart button is to disable the inventory/simple stock and use the default stock option which basically just notifies shop own that stock is going low, but doesn't stop people from purchasing more than available. The inventory/simple stock also has another issue when I tried it which is when you go to view by cart and you add more item than there is in stock, it still goes through from this page.

Posts: 15
Joined: 11/20/2007

I hacked the uc_inventory_api.module to be compatible with Gift Certificates by adding the final 'and' condition on line 187:

if(isset($form['attributes']) and count(element_children($form['attributes'])) and !array_search("Recipient's Email Address", $form['attributes']) ) // do we have attributes on this product?

Replace "recipient's email address" with the name of your attribute to use the module again.

Also, confirmed that inventory/simple stock module does not prevent users from adding more items than is in stock via the quantity field in the shopping cart.

Cheers,

Shiraz

Posts: 48
Joined: 01/31/2008

Quote:
Replace "recipient's email address" with the name of your attribute to use the module again.

What does this mean?

As for the cart quantity field problem, is there a way to make a check for the limit on view cart page? I guess the problem would be that it would require messing with the core?

Posts: 15
Joined: 11/20/2007

I'm referring to the text in the code that I pasted just before that.

Replace that text with the name of your product attribute -- ie. the one that is the cause of the conflict.