Ambassador Posted September 24, 2002 Posted September 24, 2002 I want to display a product as "out of stock", at the moment the sock level is depleting as people oder, with no problems and customers cannot 'checkout' stock we do not have. However when the product level reaches "0" the product is removed from the site (it is still visable in the admin section, set to red) I don't want to display the stock levels of "in stock" items, just those "out of stock" Can someone please help ?
Floob Posted September 28, 2002 Posted September 28, 2002 Yeah - I am looking to do the same thing. Anyone have any ideas?
Mark Evans Posted September 28, 2002 Posted September 28, 2002 Can someone please help ? If you change if ($stock_left < 1) { tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); } To // if ($stock_left < 1) { // tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'"); // } Then the stock will keep decrementing but the product will stay availale :) Mark Evans osCommerce Monkey & Lead Guitarist for "Sparky + the Monkeys" (Album on sale in all good record shops) --------------------------------------- Software is like sex: It's better when it's free. (Linus Torvalds)
Floob Posted September 28, 2002 Posted September 28, 2002 Thanks - looks like that will do it - but how can I mark the product as "out fof stock" - or will they just see that if they try to checkout? Thanks
webdesignpro Posted October 4, 2002 Posted October 4, 2002 The code above worked, but there was an error on the confirmation page until I removed the last few characters. Here is the corrected code: // if ($stock_left < 1) { // tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']); // } -- Harold Corbin
jon_l Posted October 4, 2002 Posted October 4, 2002 There was a thread discussing something very similar on the old forums - I think it was actually about having definable shipping times for products, but the results would be the same. I think it got forgotten about when the new forums were put up. We could do with getting this discussion going again. Unless it has been started again elsewhere. Problem is that I think there are a number of different ways of doing it. I handle it by building the product description offline. If the product is in stock it says so and that it will ship within 1-2 days, if it is out of stock it says so and that it will ship in 7 days. All products that are either in stock, or still available are marked as active in the database. To resolve this fully within OSC would require quite a few changes. I guess ideally someone would need to start with writing a mod, which could then be improved upon, prior to be moved in to the cvs. Its on my to do list, but it not very high. Jon.
Arien Posted January 3, 2004 Posted January 3, 2004 Thread revival i know but i can't work out what file the information to edit is in? Could someone tell me please?
defender39 Posted January 7, 2004 Posted January 7, 2004 I am wondering the same thing...which file is this in?
danix Posted April 11, 2005 Posted April 11, 2005 I am also wondering which file this is.... <{POST_SNAPBACK}> It's in checkout_process.php.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.