Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
My client orders some stock in when it is needed, rather than keep it in house. With Ajax Cart 1.0 I was able to add out of stock items to my shopping cart, but now I cannot. I get the jQuery message stating that the product is out of stock!
Is there a fix for this, or am I being a COMPLETE noob and missing a simple option somewhere in Ubercart or Ajax Cart?
Should also be said, I cnnot revert back to Ajax Cart 1 as I had issues with anonymous users that do not occur in the UCAC Beta release!
Thanks in advance!
Comments
Comment #1
chapabu CreditAttribution: chapabu commentedI've fixed my issue by changing the SQL query from
$sql = "SELECT nid FROM {uc_product_stock} WHERE sku = '%s' AND nid = '%s' AND stock <= 0";
to
$sql = "SELECT nid FROM {uc_product_stock} WHERE sku = '%s' AND nid = '%s' AND stock < 0";
It's a bit hacky, but it works for me now!
Comment #2
L-four CreditAttribution: L-four commentedThis will work,
but we really needs an admin setting to disable the out of stock message.
Comment #3
L-four CreditAttribution: L-four commentedComment #4
stewart.adam CreditAttribution: stewart.adam commentedThe stock hook will be removed from uc_ajax_cart in the next release. Users who want this functionality should install a dedicated stock module that has proper support for attributes and alternate SKUs.
Comment #5
stewart.adam CreditAttribution: stewart.adam commentedThis fix has been committed, and the stock check will be removed in the next stable release. For the ambitious ones who want it now, check out the latest dev!