boyler1 Posted September 8, 2010 Posted September 8, 2010 Hi I have certain products that have no price so i wish not to display them.. I have created an if statment which hides the price if the product = £0.00.. I am looking to hide the actual label "price" from the users aswell.. I think i have to incoperate the code for writing the text to the screen into the if statement but im not to sure how to do this. if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'] , tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { $products_name = (($products_new['products_rrp'] > 0) ? . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; } else { $products_name = $product_info['products_name']; } ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?></td> </tr> <tr> <td class="Price" align="right" valign="top"> <?php echo 'Our Price: ' . $products_price; ?> </td> </tr> <tr> </tr> </tr> </table></td> Has anyone any ideas. Thanks Donal
web-project Posted September 8, 2010 Posted September 8, 2010 very easy: find: <tr> <td class="Price" align="right" valign="top"> <?php echo 'Our Price: ' . $products_price; ?> </td> </tr> change to: <?php if ($product_info['products_price']!="0"){ ?> <tr> <td class="Price" align="right" valign="top"> <?php echo 'Our Price: ' . $products_price; ?> </td> </tr> <?php } ?> 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.
boyler1 Posted September 9, 2010 Author Posted September 9, 2010 very easy: find: <tr> <td class="Price" align="right" valign="top"> <?php echo 'Our Price: ' . $products_price; ?> </td> </tr> change to: <?php if ($product_info['products_price']!="0"){ ?> <tr> <td class="Price" align="right" valign="top"> <?php echo 'Our Price: ' . $products_price; ?> </td> </tr> <?php } ?> Thanks a million Alex it worked a charm
boyler1 Posted September 9, 2010 Author Posted September 9, 2010 Thanks a million Alex it worked a charm Hi I am having the same problem in the new products module tryin to hide the price label </tr> <td height="20" valign="bottom" align="center"style="padding-bottom:5px;" > <span style="color:#FF0000; font-size:16px; font-weight:bold; ">' . "Our Price:". ' ' . $currencies->display_price($new_products['products_price'] , tep_get_tax_rate($new_products['products_tax_class_id'])).' ' . $products_price . ' </span></td> </tr> cheers Donal
Recommended Posts
Archived
This topic is now archived and is closed to further replies.