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.


Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Ecommerce Problems - remove the leading $


7 Posts   1927 Views

OCO Pure

14 July 2008 at 7:00am Community Member, 14 Posts

I have come to a problem after I have installed the ecommerce feature on my website. On the items page the prices show a $ in front of the price, that is meant to be in EUR - which is behind the numbers.
Any idea how to change that?

You can see the problem here:

Thank you for your help.


14 July 2008 at 1:14pm Forum Moderator, 5511 Posts

I think Ecommerce using a CurrencyField() for storing the values and in the CurrencyField.php file the method prepends the $ to the value -

   function setValue($val) {
      $this->value = '$' . number_format(ereg_replace('[^0-9.]',"",$val), 2);

This could be where you need to change it

OCO Pure

14 July 2008 at 5:58pm Community Member, 14 Posts

Tell me a noob, but I can`t find what you mentioned ... using the 2.2.2 with the 0.5.2 ecommerce.


14 July 2008 at 6:03pm Forum Moderator, 5511 Posts

Thats part of the core fieldtypes - located in sapphire/forms/CurrencyField.php . Easiest thing to do when working with a silverstripe project is to use a editor with a global file search so you just enter the file name, rather then dig through folders

OCO Pure

15 July 2008 at 5:03am Community Member, 14 Posts

Well, I found it - but the changes did not seem to affect the showing of the $ on the website. Pretty little problems ...

OCO Pure

15 July 2008 at 8:23am Community Member, 14 Posts

Got 90% of the problem solved as I removed the hard coded $ in the sapphire/core/model/fieldtypes/Currency.php - now it`s only the problem on the checkout page, when the order is been prepared for the payment. Total is still been shown as $ xx.xx EUR

Any idea where I find this?


18 July 2008 at 3:22pm Administrator, 685 Posts

It's possible that it's also hard-coded in Checkout.php or