Download & Extend

Cannot add out of stock items to cart

Project:Ubercart AJAX Cart
Version:6.x-2.x-dev
Component:Code
Category:feature request
Priority:major
Assigned:Unassigned
Status:active

Issue Summary

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

#1

Status:active» fixed

I'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!

#2

Status:fixed» needs work

This will work,
but we really needs an admin setting to disable the out of stock message.

#3

Category:support request» feature request

#4

Version:» 6.x-2.x-dev
Status:needs work» active

The 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.

nobody click here