Page 21 of 30 FirstFirst ... 111920212223 ... LastLast
Results 201 to 210 of 298
  1. #201
    Join Date
    Nov 2009
    Posts
    56
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    I've dumped the file up on my server, altered the root path and it works!

    However, if I don't set up the cron job at all, I wont be able to get automatic updates will I?

    In which case, I can just run it say once a day myself by typing in the URL?

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

    Default Re: Currency Update (Automatic)

    Well yes, you could do that. But you could also just click the update button on the currencies page in the Admin.
    Kuroi Web Design and Development | Twitter

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

  3. #203
    Join Date
    Dec 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    I have currency update script working ok.

    But on my zen cart site I want Euros as the default currency rather than customers having to select euros, so I have euros set as the default currency.

    But with us purchasing in US dollars I want to update the other currencies based on the US dollar and the script uses the default currency to update the others.

    Any ideas if there is a way I can achieve this please?

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

    Default Re: Currency Update (Automatic)

    @jezspain

    You're probably attacking this from the wrong end.

    Basically of your goods are priced in dollars then your currency conversions need to default to the same currency.

    If you want to present a different currency as the default for customers, you need to go to the place that this default is set. This is in the includes/init_includes/init_currencies.php which you can copy to the overrides folder and then replace the reference to DEFAULT_CURRENCY with that which you would like to present first to customers.

    Give it a good test though, as I haven't actually tried this in practise.
    Kuroi Web Design and Development | Twitter

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

  5. #205
    Join Date
    Dec 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Thanks for the reply Kurio, I think you are right.

    I will give it a try from that angle. I have a test site I will try it on first.

  6. #206
    Join Date
    Dec 2008
    Posts
    8
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    @ Kurio,

    Not sure if you can help further.

    I understood the principle of what you said in your post but I am not sure how to implement it. I copied init_currencies.php into the overides folder, but I don't know enough to know what/where to change the code to get the customer to always see the price in euros first while the default currency is set to US dollars.

    I am not sure how hard or easy it is to achieve this but it would be much appreciated if you/someone could help me..

    Posting the code below: -

    [SCR]

    <?php
    /**
    * initialise currencies
    * see {@link http://www.zen-cart.com/wiki/index.p...als#InitSystem wikitutorials} for more details.
    *
    * @package initSystem
    * @copyright Copyright 2003-2007 Zen Cart Development Team
    * @copyright Portions Copyright 2003 osCommerce
    * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
    * @version $Id: init_currencies.php 6300 2007-05-11 15:49:41Z drbyte $
    */
    if (!defined('IS_ADMIN_FLAG')) {
    die('Illegal Access');
    }

    // If no currency is set, use appropriate default
    if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = DEFAULT_CURRENCY;

    // Validate selected new currency, if any. Is false if valid not found.
    $new_currency = (isset($_GET['currency'])) ? zen_currency_exists($_GET['currency']) : zen_currency_exists($_SESSION['currency']);

    // Validate language-currency and default-currency if relevant. Is false if valid not found.
    if ($new_currency == false || isset($_GET['language'])) $new_currency = (USE_DEFAULT_LANGUAGE_CURRENCY == 'true') ? zen_currency_exists(LANGUAGE_CURRENCY) : $new_currency;

    // Final check -- if selected currency is bad and the "default" is bad, default to the first-found currency in order of exch rate.
    if ($new_currency == false) $new_currency = zen_currency_exists(DEFAULT_CURRENCY, true);
    //echo '<br />NEW = ' . $new_currency . '<br />';

    // Now apply currency update
    if (
    // Has new currency been selected?
    (isset($_GET['currency'])) ||

    // Does language change require currency update?
    (isset($_GET['language']) && USE_DEFAULT_LANGUAGE_CURRENCY == 'true' && LANGUAGE_CURRENCY != $_SESSION['currency'] )

    ) {
    $_SESSION['currency'] = $new_currency;
    // redraw the page without the currency/language info in the URL
    if (isset($_GET['currency']) || isset($_GET['language'])) zen_redirect(zen_href_link($current_page_base, zen_get_all_get_params(array('currency','language'))));
    }
    ?>[/SCR]

  7. #207
    Join Date
    Apr 2010
    Location
    UK
    Posts
    150
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Hello, could anyone help with this?
    I uploaded the script to /public_html/my shopname.com. I got the right command from my hosting company. They say it should be:
    /usr/bin/php -q /home/my username/public_html/myshopname.com/currency_update.php and I have used wrong path. Yes, I used just '/', so I corrected it to: /public_html/my shopname.com/currency_update.php.

    And now I get messages:
    PHP Warning:
    require_once(/public_html/myshopname.com/currency_update.phpincludes/configure.php)
    [<a href='function.require-once'>function.require-once</a>]: failed to open stream:
    No such file or directory in
    /home/myusername/public_html/myshopname.com/currency_update.php on line 20
    <br />
    <b>Warning</b>:
    require_once(/public_html/myshopname.com/currency_update.phpincludes/configure.php)
    [<a href='function.require-once'>function.require-once</a>]: failed to open stream:
    No such file or directory in
    <b>/home/myusername/public_html/myshopname.com/currency_update.php</b> on line
    <b>20</b><br />
    PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]:
    Failed opening required
    '/public_html/myshopname.com/currency_update.phpincludes/configure.php'
    (include_path='.:/usr/lib/php:/usr/local/lib/php') in
    /home/myusername/public_html/myshopname.com/currency_update.php on line 20
    <br />
    <b>Fatal error</b>: require_once() [<a
    href='function.require'>function.require</a>]: Failed opening required
    '/public_html/myshopname.com/currency_update.phpincludes/configure.php'
    (include_path='.:/usr/lib/php:/usr/local/lib/php') in
    <b>/home/myusername/public_html/myshopname.com/currency_update.php</b> on line
    <b>20</b><br />

    What does it mean? What should I change?
    Any help, please

  8. #208
    Join Date
    Apr 2010
    Location
    UK
    Posts
    150
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    OK, it seems to work now. My path is /home/myusername/public_html/myshopname.com/ without "currency_update.php"

  9. #209
    Join Date
    Feb 2009
    Posts
    40
    Plugin Contributions
    0

    Default Re: Currency Update (Automatic)

    Quote Originally Posted by kuroi View Post
    Well yes, you could do that. But you could also just click the update button on the currencies page in the Admin.
    should i press 'update' button every day?

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

    Default Re: Currency Update (Automatic)

    @jezspain

    Simply change
    if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = DEFAULT_CURRENCY;
    to
    if (!isset($_SESSION['currency']) && !isset($_GET['currency']) ) $_SESSION['currency'] = 'EUR';
    Then open up a new browser window as the change will work only when there's not an old php session lurking, and you'll see it as you customers will.

    This assumes, of course, that you have dollars and euros enabled as currencies, though there is protection in that file for if you don't.
    Kuroi Web Design and Development | Twitter

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

 

 
Page 21 of 30 FirstFirst ... 111920212223 ... LastLast

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

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR