Closed (fixed)
Project:
Ubercart AJAX Cart
Version:
6.x-2.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
12 Mar 2010 at 12:29 UTC
Updated:
13 Jun 2012 at 23:41 UTC
Hello,
The "product out of stock" is shown when product stock is under "stock threshold limit" but stock is not 0 (and, them, it can not be possible to add this product to the shopping cart).
Tell me if you need futher information
Regards
Comments
Comment #1
manos_ws commentedI have notice the same effect with the 6.x-1.0 release, That's why I reverted to rc9.
I have Ubercart Stock Manager With Attributes installed, I don't think its relevant thou.
regards,
ManosK
http://websynergy.gr/
Comment #2
manos_ws commentedI tracked down the problem to the uc_modules_add_to_cart.php
on line 51
I replaced it with
and it worked.
1. Could the developer tell why it has " threshold > stock " in his sql statement
2. I did allot of sql in uni some years back and from the top of my head I should put " stock > 0" and not " stock < 0" as I have written. But "stock > 0 " doesn't work.
ManosK
http://websynergy.gr/
Comment #3
henrijs.seso commentedsame here
Comment #4
henrijs.seso commented#2 works. must be fixed asap. threshold > stock does not make any sense at all. threshold is used to warn store owner of stocks getting low, nothing to do with ajax cart.
Comment #5
henrijs.seso commentedactually stock < 0 should be stock <= 0 since you are out of stock as soon as you hit 0
Comment #6
erik seifert commentedThx. Will be in next release
Comment #8
carlitus commentedThe query
doesn't look if the stock is active. I've add a active = 1;
Comment #9
petergus commented<= 0 wasnt working on mine (actually it was but it just stopped suddenly after using bulk stock updates if that had something to do with weirdly)
changed it to < 0 and its working. however, that doesnt detect if it is actually out of stock anymore.
any ideas?
Comment #10
petergus commentedi am reopening this issue with the above comments.
however, i notice the original poster said the error mentioned threshold level.
all of my stock items have threshold of 0 and out of stock message does not mention threshold, just stock level, even though i have tried on both 0 stock and filled stock items.
when using < 0 then it doesn't recognize stock level, adds everything.
Comment #11
VanessaM commentedI am experiencing the same problem.
I checked uc_modules_add_to_cart.php and the sql is as follows:
$sql = "SELECT nid FROM {uc_product_stock} WHERE sku = '%s' AND nid = '%s' AND active = 1 AND stock <= 0";
the threshold is 5 for the product, I have 11 in stock and when I try to add 7 items I get an error message saying that there are only 6 items left in the cart
I have the latest version of Ubercart ajax cart installed: 6.x-2.0-rc3
please help.
Comment #12
tunicI need more info on this issue. I've enabled Ubercart stock module, set up some stock for some productos (with and without attributes) and I coudn't reproduce the bug.
Are you using any other modules than standard stock module for Ubercart?
Comment #13
VanessaM commentedI am using the following modules to handle stock:
Bulk stock updater 6.x-1.2
stock manager with attributes 6.x-1.x-dev
Product Power Tools 6.x-1.12
Comment #14
tunicComment #15
tunicComment #16
stewart.adam commentedThe stock checking which uc_ajax_cart did was out of place; uc_ajax_cart fails gracefully when there is an error and informs the user via the popup-message.
I have removed the stock checking hook from the latest dev release and this should be implemented instead in a module dedicated to stock management, for example uc_out_of_stock. When it flags that a product cannot be added to the cart, uc_ajax_cart should pick it up and relay the error to the user.