Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Set out of stock level


chowpay

Recommended Posts

Hi all,

 

Where and how do I go to change the code so it says out of stock when the actual quantity is 20 instead of waiting for it to be zero. We want to have enough stock in our system to make sure we can fulfill in store orders since they are both pulling on the same data base.

 

Any help would be greatly appreciated.

 

Thanks.

Link to comment
Share on other sites

You could try the Low Stock Report Beta contribution

 

Link:

http://www.oscommerce.com/community/contri...earch,Low+Stock

 

 

I did this a while back and its not the nicest looking layout ... but it works. You can set each product's stock warning level.

 

The instructions need updating but you should be able to figiure it out.

 

Hope that helps.

 

 

Hi all,

 

Where and how do I go to change the code so it says out of stock when the actual quantity is 20 instead of waiting for it to be zero. We want to have enough stock in our system to make sure we can fulfill in store orders since they are both pulling on the same data base.

 

Any help would be greatly appreciated.

 

Thanks.

Link to comment
Share on other sites

I would just change the check function ... see if this works for you. You could even define a key so that value can be changed comfortably from your admin panel when you decide you want to set it to 40 instead of 20

 

includes/functions/general.php

////

// 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;

}

 

 

change to:

////

// 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) {

$shop_min_stock = '20';

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

$out_of_stock = '';

 

if ($stock_left < 0) {

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

}

 

return $out_of_stock;

}

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

come to think of it, the STOCK_REORDER_LEVEL (last parameter in stock in admin) is probably not used in your store for anything, so you could pop that in here:

 

$shop_min_stock = STOCK_REORDER_LEVEL;

 

then just set the value in admin to 20

:-)

Monika

 

addicted to writing code ... can't get enough of databases either, LOL!

 

my toolbox: Textpad - Compare and Merge - phpMyAdmin - WS_FTP - Photoshop - How to search the forum

 

Interactive Media Award July 2007 ~ category E-Commerce

my advice on the forum is for free, PMs where you send me work are considered consultation which I charge for ...

Link to comment
Share on other sites

Why thanks I will def give this a try and report back if it works or has issues. thanks!

 

 

come to think of it, the STOCK_REORDER_LEVEL (last parameter in stock in admin) is probably not used in your store for anything, so you could pop that in here:

 

$shop_min_stock = STOCK_REORDER_LEVEL;

 

then just set the value in admin to 20

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...