Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Inventory not updated / subtracted when items ordered Please Help


oscommerceking

Recommended Posts

Here is my checkout_process.php code, why arent the orders being subtracted from my inventory?

 

// do not decrement quantities if products_attributes_filename exists
	if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
	  $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
	} else {
	  $stock_left = $stock_values['products_quantity'];
	}
	tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
	if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
	  tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
	}
  }
}

 

 

Thanks so much

 

Jon

Link to comment
Share on other sites

In your admin section Configuration > Stock, do you have Subtract Stock set to true?

 

Hi! This is happening in my store also and I have always had the configuration set as above. It seems like the 'clock' just suddenly stopped because it was working before.

 

weeeeeiiiirrrrrddddd...

 

Any other ideas?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...