Skip to content

Commit 85c99dc

Browse files
authored
Generalized currency formatting method formatPriceTxt() for use in order email templates. (#2924)
1 parent 263df62 commit 85c99dc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

app/code/core/Mage/Sales/Model/Order.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,13 +2012,14 @@ public function formatPricePrecision($price, $precision, $addBrackets = false)
20122012
}
20132013

20142014
/**
2015-
* Retrieve text formatted price value including order rate
2015+
* Retrieve currency formatted string.
20162016
*
2017-
* @param float $price
2018-
* @return string
2017+
* @param float|string $price Numeric value or field name, e.g. "grand_total".
2018+
* @return string
20192019
*/
20202020
public function formatPriceTxt($price)
20212021
{
2022+
$price = (float) (is_numeric($price) ? $price : $this->_getData($price));
20222023
return $this->getOrderCurrency()->formatTxt($price);
20232024
}
20242025

0 commit comments

Comments
 (0)