This is a discussion on Removing .00 in price? within the osCMax v2 Features Discussion forums, part of the osCMax v2.0 Forums category; Is there an easy way to do this? All of my prices are in complete dollars, so I'd like ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
|
#1
| |||
| |||
| Is there an easy way to do this? All of my prices are in complete dollars, so I'd like to display $700 instead of $700.00 Thanks, Nick |
|
#2
| |||
| |||
| $price = substr($price,0,strpos($price,'.')-1); I haven't tested that out, but that should work. It takes the price and eliminates the .00 from the string. you might also try using the round() function. You may also have to make a few mods on the currencies class as there are functions you may want to look at: Code: function get_decimal_places($code) {
return $this->currencies[$code]['decimal_places'];
}
function display_price($products_price, $products_tax, $quantity = 1) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
}
__________________ so endith the lesson<think>sometimes I just sit's and thinks</think> "Here you are with a hand full of holes, a thumb up your ass, and a big grin to pass the time of day with." - TWB |
|
#3
| ||||
| ||||
| You might also want to take a look at /includes/classes/PriceFormatter.php You might be able to change it somewhere in there, and have it changed everywhere. Note, I am just guessing, I have not checked. |
|
#4
| |||
| |||
| Will this retain the two digits after the decimal place when in the shopping cart (for post tax prices)? |
| Thread Tools | |
| |
| ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Quantity Price Breaks Per Product Price Table Formatter | michael_s | New osCommerce Contributions | 0 | 03-22-2007 12:00 PM |
| Quantity Price Breaks Per Product Price Table Formatter | michael_s | New osCommerce Contributions | 0 | 03-20-2007 10:02 PM |
| Price Break 1.11.3 -- inconsistent display of price breaks across different pages | argentbeads | osCMax v2 Installation issues | 1 | 02-19-2007 08:44 PM |
| removing price on new product | creativeone | osCommerce 2.2 Modification Help | 7 | 05-20-2005 02:35 PM |
| Removing price listing from "New Products For ..." | JGofGFS | osCommerce 2.2 Modification Help | 1 | 03-31-2004 11:34 AM |