Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Stock < 0 Sets product inactive


enragedcow

Recommended Posts

Posted

Our old store never had this problem. This is driving me crazy, as we have some items that are *extremely* popular and are constantly going on backorder. However, as soon as someone orders it again, it resets to being inactive. Is there a way to stop the site from setting things inactive? I tried turning off "check stock levels" and all that good jazz. Anyone have any ideas?

"People tell me I have an inferiority complex. They must be right; after all, they are all smarter than me."

Posted

OK, the basics which it sounds like you already have covered, but just in case (and for reference when people find this on a search later)

 

In admin->Configuration->Stock, your settings should be:

Check stock level false

Subtract stock true - (u could try changing this to false to stop your stock levels decreasing...?)

Allow Checkout true

Mark product out of stock *** - irrelevant

Stock Re-order level 5 - irrelevant

 

If that doesnt work, or you have already done all that (which it sounds like you have, I'm just trying to get off lightly!!), yell back and I'll talk you through some code.

Posted
OK, the basics which it sounds like you already have covered, but just in case (and for reference when people find this on a search later)

 

In admin->Configuration->Stock, your settings should be:

Check stock level false

Subtract stock true - (u could try changing this to false to stop your stock levels decreasing...?)

Allow Checkout true

Mark product out of stock *** - irrelevant

Stock Re-order level 5 - irrelevant

 

If that doesnt work, or you have already done all that (which it sounds like you have, I'm just trying to get off lightly!!), yell back and I'll talk you through some code.

 

Yep, all that is done. Those were the settings I had used before, with no issue. SO I'm confused :)

 

Any other thoughts?

"People tell me I have an inferiority complex. They must be right; after all, they are all smarter than me."

Posted

OK, just stumbled on this one. In product_info.php, very close to the top of the file, you will see these two lines:

 

$product_check_query = tep_db_query("select count(*) as total from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$product_check = tep_db_fetch_array($product_check_query);

 

 

comment them out (insert \\ at the start of each line) and your products should come back again!

 

Hope that helps.

Posted

The best method I found to keep products visible when they are sold out is by changing your checkout_process.php

Search for

		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']) . "'");
	}

and change to

		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']) . "'");
	}

Archived

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

×
×
  • Create New...