sackling Posted May 6, 2009 Share Posted May 6, 2009 Hello, I am using a mootools script called tips. I have it set to popup the product discription and price on rollover as demonstrated here: http://www.anzie.com/test5.php For some reason I am getting 4 decimal places in the title though? is there extra code I need to include to get rid of them? here is the code I am using for the link: <?php echo '<table border="0" bordercolor="#E8E8E8" cellspacing="0" cellpadding="0" ><tr><td style="float:left;" height="200" align="center" width="150" class="productGrid"><a class="productImg" title="Product Info ::'.$products_new['products_name'].' <br /><br /> $'.$products_new['products_price'].'" href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $products_new['products_id']) . ' " >' . tep_image(DIR_WS_IMAGES . $products_new['products_image'], $products_new['products_name'], 159, 210 ) . ' </a></td></tr></table>'; ?> I appreciate any help. Thanks, Rob Link to comment Share on other sites More sharing options...
masat Posted May 6, 2009 Share Posted May 6, 2009 First there are java errors on the page as per IE8. If you are speaking of the currency i.e. $750.0000 The currency is not being formatted properly. The default table cell in products is set to four decimal places but the class currencies is responsible for formatting the values written to screen. The price variable should be set as follows: $currencies->display_price($products_new['products_price']... The class is called in includes/application_top.php. How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
sackling Posted May 6, 2009 Author Share Posted May 6, 2009 First there are java errors on the page as per IE8. If you are speaking of the currency i.e. $750.0000 The currency is not being formatted properly. The default table cell in products is set to four decimal places but the class currencies is responsible for formatting the values written to screen. The price variable should be set as follows: $currencies->display_price($products_new['products_price']... The class is called in includes/application_top.php. Sorry I should have warned you about the IE bugs. I'm working on them now as well. Im not sure I understand what you are saying to change however. i tried changing the $currencies value in application_top to display_price($products_new['products_price'] = new currencies(); Not sure what you are saying to change. sorry can you further elaborate? Link to comment Share on other sites More sharing options...
MrPhil Posted May 6, 2009 Share Posted May 6, 2009 I think the intent was to change .$products_new['products_price']. to .$currencies->display_price($products_new['products_price'], tax rate, quantity). display_price() is a method in the currencies class. Just outputting $products_new['products_price'] all by itself should use a default numeric formatting. Link to comment Share on other sites More sharing options...
masat Posted May 6, 2009 Share Posted May 6, 2009 I think the intent was to change .$products_new['products_price']. to .$currencies->display_price($products_new['products_price'], tax rate, quantity). display_price() is a method in the currencies class. Just outputting $products_new['products_price'] all by itself should use a default numeric formatting. Thanks for the clarification Phil. You are correct in the intent. How do you know when you know what you want to do for the rest of your life? Link to comment Share on other sites More sharing options...
sackling Posted May 7, 2009 Author Share Posted May 7, 2009 Thanks for the clarification Phil. You are correct in the intent. Thank you both for the solution and the clarification. Its working now. I had to change tax rate to 1 and quantity to 1. it seems to be working correctly so hopefully it won't mess up somewhere I'm not looking. Thanks again, Rob Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.