Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Ecommerce Problems - remove the leading $

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

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

Page: 1
Go to End
Author Topic: 1918 Views
  • OCO Pure
    Avatar
    Community Member
    14 Posts

    Ecommerce Problems - remove the leading $ Link to this post

    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

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Ecommerce Problems - remove the leading $ Link to this post

    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
    Avatar
    Community Member
    14 Posts

    Re: Ecommerce Problems - remove the leading $ Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Ecommerce Problems - remove the leading $ Link to this post

    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
    Avatar
    Community Member
    14 Posts

    Re: Ecommerce Problems - remove the leading $ Link to this post

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

  • OCO Pure
    Avatar
    Community Member
    14 Posts

    Re: Ecommerce Problems - remove the leading $ Link to this post

    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?

  • Sam
    Avatar
    Administrator
    679 Posts

    Re: Ecommerce Problems - remove the leading $ Link to this post

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

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