Forums / Templates, Stylesheets, Page Layout / New currency: Swiss Franc

New currency: Swiss Franc

Locked

Views: 2,855

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
22 Aug 2006, 11:57 AM
#1
lifesayko avatar

lifesayko

New Zenner

Join Date:
Jul 2005
Posts:
3
Plugin Contributions:
0

New currency: Swiss Franc

Hi,
I just installed Zen Cart, and I wanted to make the Swiss Franc the default currency.
I entered the names and the correct code, CHF, and it said I'd have to hit "update currencies"
But when I do this is gives me the following error:

Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 25

Warning: file(http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=USD&format=CSV&dest=Get+Table&sel_list=CHF) [function.file]: failed to open stream: no suitable wrapper could be found in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 25

Warning: implode() [function.implode]: Bad arguments. in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 29

Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 39

Warning: file(http://www.xe.net/ucc/convert.cgi?Amount=1&From=CHF&To=USD) [function.file]: failed to open stream: no suitable wrapper could be found in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 39

Warning: implode() [function.implode]: Bad arguments. in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 43

Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 25

Warning: file(http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=EUR&format=CSV&dest=Get+Table&sel_list=CHF) [function.file]: failed to open stream: no suitable wrapper could be found in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 25

Warning: implode() [function.implode]: Bad arguments. in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 29

Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 39

Warning: file(http://www.xe.net/ucc/convert.cgi?Amount=1&From=CHF&To=EUR) [function.file]: failed to open stream: no suitable wrapper could be found in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 39

Warning: implode() [function.implode]: Bad arguments. in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 43

Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 25

Warning: file(http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=CHF&format=CSV&dest=Get+Table&sel_list=CHF) [function.file]: failed to open stream: no suitable wrapper could be found in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 25

Warning: implode() [function.implode]: Bad arguments. in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 29

Warning: file() [function.file]: URL file-access is disabled in the server configuration in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 39

Warning: file(http://www.xe.net/ucc/convert.cgi?Amount=1&From=CHF&To=CHF) [function.file]: failed to open stream: no suitable wrapper could be found in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 39

Warning: implode() [function.implode]: Bad arguments. in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php on line 43

Warning: Cannot modify header information - headers already sent by (output started at /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/localization.php:29) in /home/.cela/lifesayko/cross.jesterscircle.com/store/admin/includes/functions/general.php on line 34

Can anyone help me please?

22 Aug 2006, 12:04 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: New currency: Swiss Franc

Due to your server's configuration of PHP settings for the file() function wrapper, you cannot use the "update currency" button.
Instead, you'll need to set your currency exchange rates manually.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

24 Aug 2006, 12:47 PM
#3
lifesayko avatar

lifesayko

New Zenner

Join Date:
Jul 2005
Posts:
3
Plugin Contributions:
0

Re: New currency: Swiss Franc

Hmmm, ok. No way to fix this? does it have anything to do with the PHP version?
Otherwise, is there a module or extension or something to have a real-time converter in the site, say in a sidebar or something? Sort of like a little calculator on the side so a customer doesn't have to open a new window to do it?

Thanks in advance and thanks already for the reply ^_^

25 Sep 2006, 3:30 PM
#4
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: New currency: Swiss Franc

Did you ever get this solved?

I never had a problem, now the last two days it started doing this. I've contacted my web host to see if they will reverse or relax whatever they just did, but I'm doubtful... is there no other way around this problem?

  • Steven
25 Sep 2006, 4:20 PM
#5
s_mack avatar

s_mack

Totally Zenned

Join Date:
Jun 2005
Location:
Kelowna, BC Canada
Posts:
1,033
Plugin Contributions:
4

Re: New currency: Swiss Franc

Well, that wasn't too hard to fix. After a small amount of Googling and reading I've discovered an alternative way of doing this. It works on my host... yours may or may not allow it, I don't know. It is dependent on the curl library being installed on your server.

Open /admin/includes/functions/localization.php and change it to this instead:```

<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2003 The zen-cart developers | // | | // | http://www.zen-cart.com/index.php | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | http://www.zen-cart.com/license/2_0.txt. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: localization.php 290 2004-09-15 19:48:26Z wilt $ // function quote_oanda_currency($code, $base = DEFAULT_CURRENCY) { // $page = file('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $code . '&format=CSV&dest=Get+Table&sel_list=' . $base); $curl_handle = curl_init('http://www.oanda.com/convert/fxdaily?value=1&redirected=1&exch=' . $code . '&format=CSV&dest=Get+Table&sel_list=' . $base); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT,1); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); $page = ""; $page = curl_exec($curl_handle); curl_close($curl_handle); $match = array(); // preg_match('/(.+),(\w{3}),([0-9.]+),([0-9.]+)/i', implode('', $page), $match); preg_match('/(.+),(\w{3}),([0-9.]+),([0-9.]+)/i', $page, $match) if (sizeof($match) > 0) { return $match[3]; } else { return false; } } function quote_xe_currency($to, $from = DEFAULT_CURRENCY) { // $page = file('http://www.xe.net/ucc/convert.cgi?Amount=1&From=' . $from . '&To=' . $to); $curl_handle = curl_init('http://www.xe.net/ucc/convert.cgi?Amount=1&From=' . $from . '&To=' . $to); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT,1); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); $page = ""; $page = curl_exec($curl_handle); curl_close($curl_handle); $match = array(); // preg_match('/[0-9.]+\s*' . $from . '\s*=\s*([0-9.]+)\s*' . $to . '/', implode('', $page), $match); preg_match('/[0-9.]+\s*' . $from . '\s*=\s*([0-9.]+)\s*' . $to . '/', $page, $match); if (sizeof($match) > 0) { return $match[1]; } else { return false; } } ?>

PLEASE NOTE!!  This is for ZenCart 1.27d.  I looked at the updated code for 1.3.5 and they already addressed this.

 - Steven