Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Currency symbol wrong on bottom of checkout details


Go to End


2 Posts   2876 Views

Avatar
Aaron Brockhurst

Community Member, 30 Posts

30 May 2009 at 11:45am

Hi

I've set the ecommerce configurations to use GBP and to have a £ currency symbol. However when you enter your checkout details it displays a £ under the paypal logo.

All other currency symbols display as £

Does anyone know where this rogue $ is generated?

I'm currently running SS 2.3.1 and ecommerce from trunk

Thanks

Aaron

Avatar
Aaron Brockhurst

Community Member, 30 Posts

4 June 2009 at 11:37am

Found the problem

In OrderForm.php the $ currency symbol is hard coded on line 71:

$total = '$' . number_format($currentOrder->Total(), 2);

I found this post in the forum

http://www.silverstripe.org/e-commerce-module-forum/show/252874#post252874

Although a simpler fix is to add the following to /sapphire/core/model/fieldtypes/Currency.php

public static function currencySymbol() {
return self::$currencySymbol;
}

and then change the line in OrderForm.php to:

$total = Currency::currencySymbol() . number_format($currentOrder->Total(), 2);

NOTE - any upgrade with break to Sapphire will need the change in the Currency.php