Guest Posted October 15, 2006 Posted October 15, 2006 Hi all, I have this coding in product info: if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<span class="product_info_price">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = '<span class="product_info_price">' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } I want to add a new string $month_price, where it is the $products_price / 12 and only show 2 decimal places, I have tried the coding below, but it only returns a Zero, and unsure if it will if working only show 2 decimal places, can anyone help? if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<span class="product_info_price">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; $month_price = ($currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) / 12); } else { $products_price = '<span class="product_info_price">' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; $month_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) / 12; }
Guest Posted October 15, 2006 Posted October 15, 2006 also tried $month_price = $products_price/12; but returns a zero. :(
Guest Posted October 15, 2006 Posted October 15, 2006 Where am I going wrong if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])); } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } $month_price = ($products_price / 12);
Guest Posted October 16, 2006 Posted October 16, 2006 BUMP, anyone, I just need to show a products_price divided by 12 or x 0.0833
Recommended Posts
Archived
This topic is now archived and is closed to further replies.