jclngvl Posted April 4, 2011 Share Posted April 4, 2011 The site owner likes to use specials to promote products, some of which aren't reduced in price. Can someone show me how (provide specific code changes) to change specials.php (OSC 2.3) so that the specials page does not echo the product price and the special price if they are the same. There should be an if statement added around line 77 of specials.php. e.g. something like if ($specials['specials_new_products_price'] < $products['products_price']{ then echo as currently coded OTHERWISE leave out $specials['products_price'] in the code from above. I'm not a php programmer, but can easily replace or add specific lines in the php code. I've tried a half dozen ways and apparently haven't hit the right syntax. One of you guys should be able to do this in 5 minutes Thanks, John Quote Link to comment Share on other sites More sharing options...
web-project Posted April 5, 2011 Share Posted April 5, 2011 try: if ($specials['specials_new_products_price'] < $products['products_price']){ Quote 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...
jclngvl Posted April 11, 2011 Author Share Posted April 11, 2011 Web-Project suggests that I try a conditional statement that I indicated I was not able to get to work. I know we're close but still no luck. Can someone please be more specific about the syntax of how this statement will be incorporated into specials.php. I've provided the section of the code that displays the image & pricing (product price and specials price), but would appreciate it if someone could show me where the conditional statement starts and how it ends. I can re-write the echo statement to leave out the original price, but each time I have tried to put in some sort of condition, the website only returns a blank page. Thanks, John =========== lines 76 - 94 ============================== <?php $row = 0; $specials_query = tep_db_query($specials_split->sql_query); while ($specials = tep_db_fetch_array($specials_query)) { $row++; echo ' <td align="center" width="33%" class="smallText"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $specials['products_image'], $specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $specials['products_id']) . '">' . $specials['products_name'] . '</a><br><s>' . $currencies->display_price($specials['products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($specials['specials_new_products_price'], tep_get_tax_rate($specials['products_tax_class_id'])) . '</span></td>' . "\n"; if ((($row / 3) == floor($row / 3))) { ?> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> </tr> <tr> <?php } } ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.