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

chapabu’s picture

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!

L-four’s picture

Status: Fixed » Needs work

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

L-four’s picture

Category: support » feature
stewart.adam’s picture

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.

stewart.adam’s picture

Status: Active » Fixed

This 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!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.