khoking Posted April 7, 2011 Share Posted April 7, 2011 Hi, I tried to use the following double IF command, but it doesn't seems to be working. <?php if ($product_info['products_hideprice'] == '0'){ ?> <?php if ($product_info['products_price']> 0 and $product_info['products_price']<999998){ ?> <td class="pageHeadingPrice"><?php echo $products_price; ?></td> </tr> <?php } else { ?> <td class="pageHeadingPrice">To be Announced</td> </tr> <?php } ?> <?php } else { ?> <td class="main">Too Low to Show (Add to Cart to See Price)</td> </tr> <?php } ?> The codes above is ignoring this command: <?php } else { ?> <td class="pageHeadingPrice">To be Announced</td> </tr> <?php } ?> Can someone help me? Quote Best regards, Koh Kho King Link to comment Share on other sites More sharing options...
djp-at Posted April 13, 2011 Share Posted April 13, 2011 that is some miserable code you have there, im not gonna redo the whole thing the way it's supposed to be, but this should work, or give you an idea of how its supposed to work... <?php if ($product_info['products_hideprice'] == '0'){ if (($product_info['products_price'] > 0) && ($product_info['products_price'] < 999998)){ ?> <td class="pageHeadingPrice"><?php echo $products_price; ?></td> </tr> <?php } else { ?> <td class="pageHeadingPrice">To be Announced</td> </tr> <?php } } else { ?> <td class="main">Too Low to Show (Add to Cart to See Price)</td> </tr> <?php } ?> Quote Professionally Done Module Install's Custom Modules Support USA Coder's. And Get The Job Done Right! Link to comment Share on other sites More sharing options...
khoking Posted April 13, 2011 Author Share Posted April 13, 2011 Hi djp-at, Thank you very much! Quote Best regards, Koh Kho King Link to comment Share on other sites More sharing options...
khoking Posted April 16, 2011 Author Share Posted April 16, 2011 I have another PHP code cleaning problem below...it works but I find the codes to be duplicating and messy. Can someone guides me on how to clean it up? Many thanks. <?php if ($products_new['products_price'] > 999998) { ?> <b><font color="#FF0000" size="5">Coming Soon!</font></b> <?php } else { ?> <?php echo (($products_new['products_price'] > 0 and $products_new['products_price'] < 999998 && $products_new['products_quantity'] > -5001) ? '<a href="' . tep_href_link(FILENAME_PRODUCTS_NEW, tep_get_all_get_params(array('action')) . 'action=buy_now&products_id=' . $products_new['products_id']) . '">' . tep_image_button('button_in_cart.gif', IMAGE_BUTTON_IN_CART) . '</a>': '<b><font color="#FF0000" size="5">SOLD</font></b>'); ?></td> <?php } ?> Quote Best regards, Koh Kho King 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.