From 10fbf4d8ca9fa9e674377dfb79e837c9e5301e52 Mon Sep 17 00:00:00 2001 From: Aparup Banerjee Date: Mon, 25 Jul 2011 12:59:49 +0800 Subject: [PATCH] MDL-27717 Enrolments - separated display of localized cost being displayed from cost being charged at authorize.net --- enrol/authorize/enrol.php | 4 ++-- enrol/authorize/localfuncs.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php index 5931a8bb823..14263744006 100755 --- a/enrol/authorize/enrol.php +++ b/enrol/authorize/enrol.php @@ -71,7 +71,7 @@ class enrolment_plugin_authorize $curcost = get_course_cost($course); echo '
'; echo '

'.get_string('paymentrequired').'

'; - echo '

'.get_string('cost').": $curcost[currency] $curcost[cost]".'

'; + echo '

'.get_string('cost').': '. $curcost['currency'] . $curcost['localizedcost'] .'

'; echo '

'.get_string('loginsite').'

'; echo '
'; } @@ -387,7 +387,7 @@ class enrolment_plugin_authorize } $str .= '
'.$strcost.': '; - $str .= $currency . ' ' . $curcost['cost'].'
'; + $str .= $currency . ' ' . $curcost['localizedcost'].''; } return $str; diff --git a/enrol/authorize/localfuncs.php b/enrol/authorize/localfuncs.php index 2ba4a3973d5..3e9dbb4e3d5 100644 --- a/enrol/authorize/localfuncs.php +++ b/enrol/authorize/localfuncs.php @@ -12,10 +12,11 @@ function get_course_cost($course) if (!empty($course->cost)) { $cost = (float)(((float)$course->cost) < 0) ? $CFG->enrol_cost : $course->cost; } - - $cost = format_float($cost, 2); + $costlocalizeddisplay = format_float($cost, 2); + $cost = format_float($cost, 2, false); $ret = array( 'cost' => $cost, + 'localizedcost' => $costlocalizeddisplay, 'currency' => $currency );