Acheron Posted June 30, 2004 Posted June 30, 2004 Just a little mod to add a stock label to product_info.php which can be turned on/off via Admin CP. Run the SQL: INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('216', 'Show stock', 'SHOW_PRODSTOCK', 'True', 'Show stock status on product info page', 9, 6, '2004-06-30 07:10:52', '2004-06-30 07:10:52', NULL, 'tep_cfg_select_option(array(\'True\', \'False\'),'); Modify product_info.php FIND: if (tep_not_null($product_info['products_model'])) { $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ADD BELOW: if ($product_info['products_quantity'] > 0) { $showstock = "In Stock: Yes"; } else { $showstock = "In Stock: No"; } Then place the code below wherever you want it displayed: <?php if (SHOW_PRODSTOCK=='True') {echo $showstock;} ?> I can't really offer any suggestions on where you should put it since my product_info.php has been completely rewritten and reorganized. ;)
masterblaster Posted July 5, 2004 Posted July 5, 2004 Just a little mod to add a stock label to product_info.php which can be turned on/off via Admin CP. Run the SQL: INSERT INTO configuration (configuration_id, configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, last_modified, date_added, use_function, set_function) VALUES ('216', 'Show stock', 'SHOW_PRODSTOCK', 'True', 'Show stock status on product info page', 9, 6, '2004-06-30 07:10:52', '2004-06-30 07:10:52', NULL, 'tep_cfg_select_option(array(\'True\', \'False\'),'); Modify product_info.php FIND: ? ?if (tep_not_null($product_info['products_model'])) { ? ? ?$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; ? ?} else { ? ? ?$products_name = $product_info['products_name']; ? ?} ADD BELOW: ? ?if ($product_info['products_quantity'] > 0) { ? ? ?$showstock = "In Stock: Yes"; ? ?} else { ? ? ?$showstock = "In Stock: No"; ? ?} Then place the code below wherever you want it displayed: <?php if (SHOW_PRODSTOCK=='True') {echo $showstock;} ?> I can't really offer any suggestions on where you should put it since my product_info.php has been completely rewritten and reorganized. ;) And if you want to let the user see this message in a language specified in your shop, then put in the following code, instead of the one above. if ($product_info['products_quantity'] > 0) { $showstock = "<?php echo INSTOCK_YES; ?>"; } else { $showstock = "<?php echo INSTOCK_NO; ?>"; } And then define INSTOCK_YES and INSTOCK_NO in your desired language file. Masterblaster B)
mark27uk3 Posted May 6, 2005 Posted May 6, 2005 Will someone who has done this mod post their url I can see what it looks like. Thanks Mark Lifes a bitch, then you marry one, then you die!
virose_pt Posted May 6, 2005 Posted May 6, 2005 there is a great contrib to do that. It puts a sold_out image instead of buy_now image, and it is very simple to install, just a few lines: http://www.oscommerce.com/community/contri...search,sold+out
Zyrul Posted May 13, 2005 Posted May 13, 2005 there is a great contrib to do that. It puts a sold_out image instead of buy_now image, and it is very simple to install, just a few lines: http://www.oscommerce.com/community/contri...search,sold+out <{POST_SNAPBACK}> Cool!
Zyrul Posted May 17, 2005 Posted May 17, 2005 http://www.oscommerce.com/community/contri...search,sold+out <{POST_SNAPBACK}> What if I want to do the exact same thing to the catalog/products_new.php ? Anybody know?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.