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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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

E-Commerce 0.6 beta 1 released


Go to End


108 Posts   25481 Views

Avatar
Digital Punk

Community Member, 51 Posts

11 March 2010 at 3:09am

Hi,

add this in your mysite/_config.php file:

// Set the currency of the site to be in NZD (New Zealand Dollars).
Payment::set_site_currency('GBP');
Currency::setCurrencySymbol('£ ');

best regards
digital punk

Avatar
eskimo

Community Member, 30 Posts

11 March 2010 at 5:45am

That is there, but I'm still getting the error message:

"Fatal error: Call to undefined method Currency::getcurrencysymbol() in /home/wwdncouk/public_html/ecommerce/code/forms/OrderForm.php on line 70"

Avatar
eskimo

Community Member, 30 Posts

11 March 2010 at 6:19am

Also how do you set up the page PayPal redirects to? It is currently going to "Paypal/complete/" Which doesn't exist. Any ideas ?

Avatar
TotalNet

Community Member, 181 Posts

11 March 2010 at 9:11am

Edited: 11/03/2010 9:15am

my bad.

I assumed there would be a get method as well as the set method, I discovered this yesterday.

change the code in orderform.php to:

$total = new Currency('Amount');
$total->setValue($currentOrder->Total());
$paymentFields = Payment::combined_form_fields($total->Nice()." ".$currentOrder->Currency(), $currentOrder->Total());

watch out for the line wrap on that last line

If you don't want GBP showing try removing:
." ".$currentOrder->Currency()

Avatar
eskimo

Community Member, 30 Posts

11 March 2010 at 12:43pm

I've done that and now it displays as:" £ " Which I think is nearly there.

Also - I've added a Shipping Modifier and it works completely up to the point of going to PayPal - anyone know what that is?

Cheers for all the help

Avatar
TotalNet

Community Member, 181 Posts

11 March 2010 at 12:57pm

yep, it tries to encode the ampersand!
try this in your config instead:
Currency::setCurrencySymbol("£");

works when I tested it, perhaps not ideal but it works.

Don't use PayPal so can't help there sorry.

Cheers,

Rich

Avatar
eskimo

Community Member, 30 Posts

11 March 2010 at 1:06pm

Nope that didn't work - just get a lot of ? in diamonds.

Which payment provider do you use? PayPal is driving me nuts.

Avatar
TotalNet

Community Member, 181 Posts

11 March 2010 at 1:17pm

I use Paymate, not sure it'll do UK banks though.

Are your templates and other pages all saved as UTF-8? when the encoding is off that's when you get the diamonds etc.

Rich