Results 1 to 10 of 298

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Can anyone point me towards an example of this module actually working on a live Zen Cart site? I went through 5 pages of this long thread but didn't see a real example.

    Thanks :)

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Currency Update (Automatic)

    I run it on any site operating with more than one currency, but there's nothing to see. It's all hidden away behind the scenes.

    If your point is that the thread contains posts primarily with people having problems, well that's the nature of a support thread. People who install and run it without problem don't really have any reason to post here.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Jan 2009
    Posts
    16
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Thanks kuroi

    Is there an option to change currency? e.g. if price is displayed by default in £, can the user change it to $?

  4. #4
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: Currency Update (Automatic)

    This mod only updates currencies, it doesn't touch prices which are converted to the appropriate currency by Zen Cart core code.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  5. #5
    Join Date
    Apr 2009
    Location
    Japan.
    Posts
    21
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Hi,

    Got a question for those folks who might understand what's going on with the currency update addon I have that just stopped working...

    The cronjob I had running the update automatically today returned a timeout error, and doing the same thing manually gets the same time out. I am using the EU site for updates.

    The error I get is this...

    Warning: file(http://www. e c b.europa.eu/stats/eurofxref/eurofxref-daily.xml) [function.file]: failed to open stream: Connection timed out in /home/mysite/public_html/currency_update.php on line 37

    Warning: Invalid argument supplied for foreach() in /home/mysite/public_html/currency_update.php on line 40


    The .php file on the site has not changed (when compared to a known good file) , and it looks like the EU site is there and working and the mod has been working just fine for the past few months.

    Any ideas why it's stopped working just now?


    (And I just ran it again now, it's working again! I guess this means it's something that generally isn't noticed? Something not to worry about?)

    Thanks, and I hope some good comes of this, even if what I had happening was nothing...

  6. #6
    Join Date
    Oct 2009
    Posts
    28
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    to anyone having problems with the root directory install I had problems with this until I removed the . at the start of the directory address.


    $location = '/home/[username]/public_html/'; // location of zen-cart intall


    seemed to work fine after that.

  7. #7
    Join Date
    Oct 2009
    Posts
    28
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Ok I'll post my setup to help people having problems. (Using justhost.com)


    using standard cron through cpanel:

    php -q /home/[username]/public_html/catalog/currency_update.php


    php -q tells the cron to use the php intrepter or the cron will just try to run each line in the php file itself.


    the php file has:

    $location = '/home/[username]/public_html/catalog/'; // location of zen-cart intall


    Although yours may not have the catalog folder. Make sure you include the '/' at the end and in this case I had to delete the '.' at the start.

    The file persmission needs to be 644 although some cron jobs need 755? i think.

    With this currency_update.php script I added an email function that tells you when the script has been run. I had concerns that a user can run the script to update currencies when rates suddenly drop in a certain currency and therefore purchasing the product for cheaper than you intended. Ok it's unlikely but never say never.
    Anyway this addition emails you when its run and also the new rates. This also provides you with a backup of currency rates if you need to change them back.



    add this:


    Code:
     require_once($location.'includes/configure.php');
     require_once($location.'includes/database_tables.php');
     // no need to edit below this line
     // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    
    
    $newrates=''; // add this here
    now add the $newrates code to the orignal and also the email function so it looks like:



    Code:
        $newrates = $newrates."\n".$currency['code']." ".$rate;
    	
        if ($rate) {mysql_db_query(DB_DATABASE, "update " . TABLE_CURRENCIES . " set value = '" . $rate . "', last_updated = now() where currencies_id = '" . $currency['currencies_id']. "'", $link);}
       }
     }
    
     mysql_close($link);
     //end lookup
    
    $to = "[email protected]";
    $subject = "Currency Update";
    $thedate = getdate();
    $thedate = $thedate['hours'].":".$thedate['minutes'].".".$thedate['seconds']." ".$thedate['mday']."/".$thedate['mon']."/".$thedate['year'];
    $body = "mywebsite.com\n\ncurrency_update.php script has been run on ".$thedate."\nRate: ".$newrates;
    if (mail($to, $subject, $body)) {
      echo("<p>Message successfully sent!</p>");
     } else {
      echo("<p>Message delivery failed...</p>");
    }
    dont forget to change the email address.


    Not sure if that will help you or not but it's helped me.
    Last edited by wurdup; 25 Oct 2009 at 12:02 AM.

 

 

Similar Threads

  1. Automatic Currency Updates - curl version problem
    By mtimber in forum All Other Contributions/Addons
    Replies: 0
    Last Post: 10 Dec 2008, 07:53 PM
  2. Automatic Currency Selection for a domain
    By [email protected] in forum Currencies & Sales Taxes, VAT, GST, etc.
    Replies: 3
    Last Post: 5 Jun 2007, 09:38 AM
  3. Automatic Currency Updates
    By dustyservers in forum Customization from the Admin
    Replies: 6
    Last Post: 28 Jun 2006, 12:38 AM

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