tome Posted February 18, 2009 Share Posted February 18, 2009 What I'm looking for is, on my "products_new.php", I've got some products on the list with their price being 0,00 (Yes, I've put them to 0) and what I need is to hide the price of those products to show "" instead of "0,00". I've been looking through "products_new" to see if I could find any way to manage that but couldn't. Anyone got suggestions? Thanks in advance. Link to comment Share on other sites More sharing options...
web-project Posted February 18, 2009 Share Posted February 18, 2009 very easy to do, simply create the check function to replace the 0.00 to nothing. Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here! 8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself. Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues. Any issues with oscommerce, I am here to help you. Link to comment Share on other sites More sharing options...
tome Posted February 18, 2009 Author Share Posted February 18, 2009 I'm a little newbie at coding, can you give some help or link me to a tutorial or so? I can't find anything useful. Link to comment Share on other sites More sharing options...
burt Posted February 18, 2009 Share Posted February 18, 2009 Do something with (tep_not_null($products_new['products_price'])) Link to comment Share on other sites More sharing options...
tome Posted February 18, 2009 Author Share Posted February 18, 2009 Do something with (tep_not_null($products_new['products_price'])) in what file do I find that? Link to comment Share on other sites More sharing options...
kelowna25 Posted February 18, 2009 Share Posted February 18, 2009 very easy to do, simply create the check function to replace the 0.00 to nothing. How exactly do I do this. I would like to do the same thing as well. Thanks. Link to comment Share on other sites More sharing options...
burt Posted February 18, 2009 Share Posted February 18, 2009 Sorry I was in a rush earlier, and I was not thinking. If you open up products_new.php it's easy to see where the price string is made; if ($new_price = tep_get_products_special_price($products_new['products_id'])) { $products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])); } So all you need do is change that to: if ($new_price = tep_get_products_special_price($products_new['products_id'])) { if ($products_new['products_price'] > 0) $products_price = '<s>' . $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($products_new['products_tax_class_id'])) . '</span>'; } else { if ($products_new['products_price'] > 0) $products_price = $currencies->display_price($products_new['products_price'], tep_get_tax_rate($products_new['products_tax_class_id'])); } then find the output; <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br />' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br />' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br /><br />' . TEXT_PRICE . ' ' . $products_price; ?></td> and change it to <td valign="top" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . '"><b><u>' . $products_new['products_name'] . '</u></b></a><br />' . TEXT_DATE_ADDED . ' ' . tep_date_long($products_new['products_date_added']) . '<br />' . TEXT_MANUFACTURER . ' ' . $products_new['manufacturers_name'] . '<br /><br />'; if ($products_new['products_price'] > 0) echo TEXT_PRICE . ' ' . $products_price; ?></td> Link to comment Share on other sites More sharing options...
tome Posted February 19, 2009 Author Share Posted February 19, 2009 It worked, thank you so much. I owe you my life :lol: Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.