Jump to:

2084 Posts in 1005 Topics by 453 members

E-Commerce Modules

SilverStripe Forums » E-Commerce Modules » Currency symbol wrong on bottom of checkout details

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, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1903 Views
  • Aaron Brockhurst
    Avatar
    Community Member
    30 Posts

    Currency symbol wrong on bottom of checkout details Link to this post

    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

  • Aaron Brockhurst
    Avatar
    Community Member
    30 Posts

    Re: Currency symbol wrong on bottom of checkout details Link to this post

    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

    1903 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.