Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Posts
    3
    Plugin Contributions
    0

    Default 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...e&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?Am...rom=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...e&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?Am...rom=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...e&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?Am...rom=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?

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

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

  3. #3
    Join Date
    Jul 2005
    Posts
    3
    Plugin Contributions
    0

    Default 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 ^_^

  4. #4
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default 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

  5. #5
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default 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:
    Code:
    <?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

 

 

Similar Threads

  1. New Type of Currency?
    By Lailokken in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 6
    Last Post: 19 Sep 2010, 03:45 PM
  2. Swiss post payment module: Yellowpay
    By moktar in forum Addon Payment Modules
    Replies: 28
    Last Post: 23 May 2010, 05:13 PM
  3. How do I add a new currency?
    By conglm in forum Addon Payment Modules
    Replies: 2
    Last Post: 14 Jan 2009, 06:36 AM
  4. New Currency Help
    By tony_sar in forum Customization from the Admin
    Replies: 1
    Last Post: 6 Aug 2006, 06:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg