Jump to content

currencies conversion


Recommended Posts

Hey,

Since a couple of days i have a problem with the currencies conversion, infact there is no convertion all €64 = 64$

yes i update all the currencies in my BO so euro=1, dollar, 1.23 and pound, 0.82 so that's fine.

i have two shops the same theme, so i tought i replace the files, blockcurrencies

and the files tools.php in classes and the file tools.js in my theme folder.

still not working.

is there an other file i should replace or look at?

please help, i already looking for hours and nothing helps.

thanks in advance


B

Link to comment
Share on other sites

hey,

yes they are on the same host, i worked before, so it should work again i suppose.

i can copy files from the working shop into the not working, but witch are related to the currency conversion?

Thx,

B

Link to comment
Share on other sites

yes,

i deleted the blockcurrencies and placed it again and reinstelled it.

i guess it must be around the files tools.hp in classes and tools.js in my theme.

like i puted like prestashop asked:

File: /classes/Tools.php
Where: Line 17
After "class Tools
{"
Add these two functions:

/**
* Get the server variable SERVER_NAME
*
* @param string $referrer URL referrer
*/
static function getServerName()
{
if (isset($_SERVER['HTTP_X_FORWARDED_SERVER']) AND $_SERVER['HTTP_X_FORWARDED_SERVER'])
return $_SERVER['HTTP_X_FORWARDED_SERVER'];
return $_SERVER['SERVER_NAME'];
}

/**
* Secure an URL referrer
*
* @param string $referrer URL referrer
*/
static public function secureReferrer($referrer)
{
if (preg_match('/^http?:\/\/'.self::getServerName().'\/.*$/Ui', $referrer))
return $referrer;
return __PS_BASE_URI__;
}


altough i replaced the old files (tools.php) back, but then i get a white screen on my shop, so that's even worse.

i will try to replace and reinstall the blockcurrencies again, but ...

thx,


B

Link to comment
Share on other sites

I am helping Billy27 on this project.

As far as I can see is it only the price display that is incorrect, and not the price itself. When finishing the order, the prices are correct in the backoffice in the correct currency.

So I thought I need to change the function displayPrice in tools.php. However when I added the following line:

$price = self::convertPrice($price, $currency);



... the prices are shown correctly all over the site, but they are "double" converted when they arrive in the order stage.


So I concluded that it might be one of the two following situations:

- this line is indeed needed in Tools.php, and I need to adapt the conversion between cart and order

- it is only the display that is incorrect, and I need to adapt a function, but apparently not displayPrice().

I hope someone can give us a clue...

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...