Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How do I keep an item in the catalog with a negative stock?


Guest

Recommended Posts

I need to leave items in the catalog even if they have a negative stock associated with them. As long as the stock is 0, everything is fine, but when it drops below 0 the item drops off the page. I need it to stay on there and I need to track stock in OSC, the negative allows for backorders. Any help would be great!

Link to comment
Share on other sites

Hi,

 

Do you have it set in the Admin Tools Under "Configuration >> Stock"?

it has to be set to:

 

"Check stock level" Has to be "True"

"Subtract Stock" Has to be "True"

"Allow Checkout" Has to be "True"

 

I would set the "Mark Product Out Of Stock" To: "Back Order" or "Out Of Stock" or something that tells the user that it is out of stock and needs to be back ordered.

 

Set the "Stock Reorder Level" To Anything you want.

 

 

Let me know if this helps.

 

Good Luck

Sean Cherven :wink:

Link to comment
Share on other sites

This is exactly what I have, but when someone places an order and the item goes into the negative quantity, the item is turned off and does not show in the catalog anymore.

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

I've got the same problem...I am running the loaded MS1...

 

I would like my customers to be able to view the products, and check them out, even if stock quantity is below "0" as I don't keep much stock but can have the items within 2 business days ready for shipment from my supplier. I still want to be able to maintain stock counts on my products, and I've already changed the out of stock message to read that the product is being ordered and will be delivered in two business days.

 

Anyone else have any ideas for keeping products in the catalog that you CAN still checkout and purchase??

Link to comment
Share on other sites

in 2.2 this is fixed (with the version I have any way...)

 

but you might look at includes/functions/general.php and look at the tep_check_stock($products_id, $products_quantity)

function...

 

see if there is something that's like

 

if quantity == 0 then

display out of stock message

 

elseif quantity < 0 then

don't display or result false or something along those lines...

 

 

if there is... change the if quantity == 0 to if quantity <= 0 and then take out the quantity < 0 statement....

 

I dunno how helpful this is, because I don't know what the function you have looks like...

Link to comment
Share on other sites

When I look in the general.php file for MS1, these seem to be the only two areas of code dealing with stock (the whole file is too long to post):

 

////

// Return a product's stock

// TABLES: products

function tep_get_products_stock($products_id) {

$products_id = tep_get_prid($products_id);

$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . $products_id . "'");

$stock_values = tep_db_fetch_array($stock_query);

return $stock_values['products_quantity'];

}

 

////

// Check if the required stock is available

// If insufficent stock is available return an out of stock message

function tep_check_stock($products_id, $products_quantity) {

$stock_left = tep_get_products_stock($products_id) - $products_quantity;

$out_of_stock = '';

if ($stock_left < 0) {

$out_of_stock = '<span class="markProductOutOfStock">' . STOCK_MARK_PRODUCT_OUT_OF_STOCK . '</span>';

}

return $out_of_stock;

}

 

 

Anyone have any ideas what or where else to edit - I had an earlier 2.2 version working too where I could still see and sell stock that had a negative inventory, and I'd love to be able to do it with this MS1 store too!!

 

Thanks for any assistance anyone can provide.

Link to comment
Share on other sites

hmm.. maybe look in the file that displays the products... maybe there's an if statement there that's something like

 

if tep_check_stock($products_id, $products_quantity) > 0

display product

elseif tep_check_stock($products_id, $products_quantity) == 0

display out of stock

 

 

is it that it isn't showing up in the catalog at all when it's less than 0 or when it's in the cart?

Link to comment
Share on other sites

Thanks for help with this one Paddylong,

 

When a product has negative inventory, it won't show in the catalog and thus will not go to checkout.

 

I've looked for the statement you posted, and can't find anything in .php file at all similar to it, is there a certain file to check, or could I email you a file to look at??

 

Anyone else with any suggestions please feel free to post, or you can email me at [email protected]

Link to comment
Share on other sites

hmm, very odd indeed.

 

I tried to recreate the problem with our store, but couldn't seem to. I tried manually entering -1 for the quantity in the catalog manager.

 

sorry that I couldn't figure out what was wrong.

Link to comment
Share on other sites

Not a problem, thanks for all your trying and help on the other issue as well - its greatly appreciated :D

 

Anyone else running MS1 loaded with a similar problem???

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...