We launched and our store is doing GREAT! http://www.musicforamerica.org/unstore

Bad news is that the inventory module does not work.
It does not work once people have placed the order.
And it does not work once you say that the order has been shipped.

I tried changing the inventory to say “0” so that the “sold out” button would appear but it didn’t. I don’t know how to stop people from buying these items short of deleting the sub-products. I don’t want to do this because I’m afraid it will mess stuff up.

HELP.

Comments

rjung’s picture

Are you using Gordon's patch for subproducts/variations (as documented here)? Because as far as I can see, that patch doesn't do any sort of inventory control as-is; you can add a subproduct to your cart even if it's sold out.

There also seems to be a bug with the latest version of the ecommerce module for Drupal 4.6 -- specifically, in store.module version 1.44.2.11, the function store_transaction_save() calls store_payment_status_complete_callback(), but the $edit parameter doesn't have an $edit['items'] array entry. As a result, the callback does not properly decrement the inventory for purchased items. I think this will fix the bug, though I admit I'm just lifting code from store.module 1.44 and haven't tested it yet:

store_transaction_save() {
    :
 /* Update inventory for transactions that just gained a payment status of 'completed' */
if ($paid) {
  if (!$edit['item']) { 	 
    $t = store_transaction_load($edit['txnid']); 	 
    store_payment_status_complete_callback($t); 	 
  } 	 
  else { 	 
    store_payment_status_complete_callback($edit); 	         store_payment_status_complete_callback($edit);
  }
}

(I tried to submit a quick fix for this the other night, but Drupal rejected my follow-up message for "suspicious content")

--R.J.

gordon’s picture

the subproduct patch does not stop the checking for product availablity. The apparel module itself does need to do checking of stock availability, it this stage it doesn't but I am going to add this soon.

sime’s picture

Component: store.module » product
Status: Active » Closed (won't fix)

We are not supporting 4.6 now. Please re-open if any problems.