Results 1 to 10 of 298

Hybrid View

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

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by mtimber View Post
    I also wanted to ask, as the currency exchange sites are now charging for connection, is Zen Cart now accessing them illegally?
    Glad to hear that Zen Cart is going well for you. It is a steep learning curve but well worth the effort.

    In response to you question. No Zen Cart isn't accessing these rates illegally, but it is now unwittingly (since the ground rules were changed after Zen Cart's code was written) encouraging you to access them in contravention of the site owners' terms of use. Vger is absolutely correct on this.

    Accordingly, I've updated the mod to use the European Central Bank's daily reference rates instead. It's actually easier, quicker, less likely to fail and unlikely to fall foul of a change in screen layout (as it no longer uses screen scrapping), as well as being completely above board and legal.

    Look out for version 3.0 being enabled here.
    Kuroi Web Design and Development | Twitter

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

  2. #2
    Join Date
    May 2008
    Posts
    57
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by kuroi View Post
    Glad to hear that Zen Cart is going well for you. It is a steep learning curve but well worth the effort.

    In response to you question. No Zen Cart isn't accessing these rates illegally, but it is now unwittingly (since the ground rules were changed after Zen Cart's code was written) encouraging you to access them in contravention of the site owners' terms of use. Vger is absolutely correct on this.

    Accordingly, I've updated the mod to use the European Central Bank's daily reference rates instead. It's actually easier, quicker, less likely to fail and unlikely to fall foul of a change in screen layout (as it no longer uses screen scrapping), as well as being completely above board and legal.

    Look out for version 3.0 being enabled here.
    When do you think this will be ready?

    :-)

    I do not like the idea of breaking someones terms of use :-(

  3. #3
    Join Date
    May 2005
    Location
    England
    Posts
    740
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Hello Kuroi,

    This is an excellent update. For one site on a PHP 4.0 system, it works whereas previous versions didn't. I just had one thing. I have pounds (GBP) set as default currency. I have it set as 1.000000 . Today it was set at 1.04. So the prices on the website changed. I wondered if I can exclude the Default currency from increasing with the cron updates of the update page?

    Heathenmagic

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

    Default Re: Currency Update (Automatic)

    @HeathenMagic

    Eeek. That's a bug. Can't believe I missed it Guess I was too busy checking very precisely the other currencies in my test dB that I forgot the default!!

    I'll submit a corrected version immediately, and until it's approved, here's the correction.

    Change lines 58-61 from:
    PHP Code:
          $rate $currencyArray[$currency['code']] / $currencyArray[DEFAULT_CURRENCY];
        }
        
    $updateSql "UPDATE " TABLE_CURRENCIES "
                      SET value = '" 
    $rate CURRENCY_UPLIFT_RATIO "', 
    to:
    PHP Code:
          $rate = ($currencyArray[$currency['code']] / $currencyArray[DEFAULT_CURRENCY]) * CURRENCY_UPLIFT_RATIO;
        }
        
    $updateSql "UPDATE " TABLE_CURRENCIES "
                      SET value = '" 
    $rate "', 
    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
    Nov 2008
    Posts
    4
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Any chance someone will come up with an updated version using CURL to access European Central Bank? My server has allow_url_fopen disabled for security purposes. Thank you all.

  6. #6
    Join Date
    May 2005
    Location
    England
    Posts
    740
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Hello Kuroi,

    Thats okay. Thanks for the correction by the way. I imagine its difficult to check so much code.

    Regards,

    Heathenmagic

  7. #7
    Join Date
    Jan 2009
    Posts
    71
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Where can I adjust the spread?

    (The difference between the actual rate and the one that is posted on the website?)

    Thanks!

  8. #8
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by naturesartandgifts View Post
    Any chance someone will come up with an updated version using CURL to access European Central Bank? My server has allow_url_fopen disabled for security purposes. Thank you all.
    The built-in currency update button works with CURL, and the ECB option is now part of the v1.4.0 core with CURL support. Just one more good thing about the next version, due out soon :)
    .

    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.

  9. #9
    Join Date
    Dec 2006
    Posts
    163
    Plugin Contributions
    1

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by DrByte View Post
    The built-in currency update button works with CURL, and the ECB option is now part of the v1.4.0 core with CURL support. Just one more good thing about the next version, due out soon :)
    It is worth noting that unlike the Oanda and XE, the ECB based only publishes reference rates for a select set of currencies. If a user has a currency outside that set, the code sets the rate to 0 which can cause users some grief.

    It is necessary to escape updating any currency that returns a null value and perhaps sending the site admin an email to inform of this issue.

 

 

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