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.

Archive

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

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

Ecommerce Problems - remove the leading $


Reply

7 Posts   1927 Views

Avatar
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:
http://www.oco-pure.net/oco-pure-webshop/

Thank you for your help.
Andreas

Avatar
Willr

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

Avatar
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.

Avatar
Willr

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

Avatar
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 ...

Avatar
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?

Avatar
Sam

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

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