Phuah Posted October 25, 2010 Share Posted October 25, 2010 I'm using V1.3.2, can we make our currencies auto update without manually click on "update currencies" daily.Thanks. Link to comment Share on other sites More sharing options...
rocky Posted October 26, 2010 Share Posted October 26, 2010 No, PrestaShop doesn't have the option to automatically update currencies. You'd have to create a crob job that calls the update function. Create a file similiar to modules/followup/cron.php, but call Currency::refreshCurrencies() instead of the followup module. Link to comment Share on other sites More sharing options...
Phuah Posted October 28, 2010 Author Share Posted October 28, 2010 So sorry Rocky, I can't get clearly what you mean? Did you mean we need to create a new module call update function? Or we need to create a cron job at our cpanel? Or we need to create one file similar to Create a file similiar to modules/followup/cron.php but the cron.php file we need to modify the :$secureKey = Configuration::get into $secureKey = Currency::refreshCurrencies() and name this new file as update function?So sorry Rocky, I'm blind in programming. I just try my best to did it. Can you guide me the way how to do it?Thanks for your warm helpful. Link to comment Share on other sites More sharing options...
rocky Posted October 29, 2010 Share Posted October 29, 2010 I'll try to make it easier. Create a file called cron.php in the root directory of PrestaShop with the following code: <?php include(dirname(__FILE__).'/config/config.inc.php'); include(dirname(__FILE__).'/classes/Currency.php'); if (isset($_GET['secure_key']) AND $_GET['secure_key'] === 'password') Currency::refreshCurrencies(); ?> Change 'password' to a password only you know that that only you can update your currency rates. Then create a cron job in your cPanel with the URL http://www.yoursite.com/cron.php?secure_key=password where password is the password you entered in cron.php. 1 Link to comment Share on other sites More sharing options...
Phuah Posted October 31, 2010 Author Share Posted October 31, 2010 Hi Rocky, thanks for your good information. But after I create a cron.php and cron job at my Cpanel, it seem nothing for currencies update and we still need to manually login our admin to update a currency for a latest rate. Is it we need to change a Currency::refreshCurrencies(); to Currency::updateCurrencies(); ?? Or we need to modify admincurrencies.php at our admin folder? Link to comment Share on other sites More sharing options...
rocky Posted October 31, 2010 Share Posted October 31, 2010 No, refreshCurrencies() is the right function. Modifying AdminCurrencies.php won't make a difference. If clicking on the "Update currencies" button on the Payment > Currencies tab works, then the cron job should also work. Make sure that the cron job is actually executing.Here's what happens when the "Update currencies" button is clicked: elseif (Tools::isSubmit('submitExchangesRates')) { if (!$this->_errors[] = Currency::refreshCurrencies()) Tools::redirectAdmin($currentIndex.'&conf=6'.'&token;='.$this->token); } It is just a simple function call. Link to comment Share on other sites More sharing options...
Phuah Posted October 31, 2010 Author Share Posted October 31, 2010 I had try it again with notification mail when a cron job is done but the notification I receive is /bin/sh: http://www.mydomain.com/cron.php?secure_key=update: No such file or directory. The password "update" is the same with the password I create in cron.php. But I try to visit my back office, the currencies seem still remain the same rate as yesterday. I suspect is it related with the password I create in "cron.php" file at root directory because I seen the sign in "cron.php" password is woth this "==='update' " but the cron job at cpanel I put is "=update". Is it a cause ?Thanks. Link to comment Share on other sites More sharing options...
rocky Posted November 1, 2010 Share Posted November 1, 2010 No, that won't make a difference. You should have one = in the query string and three = in the cron.php (or maybe two = would work). Try temporarily taking out the if statement. That should let you use it without a password. If that works, then you know the password is causing the problem. Link to comment Share on other sites More sharing options...
RuletZ Posted November 1, 2010 Share Posted November 1, 2010 Hi Rocky, thanks from Italy!!!!! Link to comment Share on other sites More sharing options...
Phuah Posted November 6, 2010 Author Share Posted November 6, 2010 PianetaModellismo, your currencies can automatically update by using a cron job? How you make it because I had try a several days but it see nothing to my currencies update and I need to login back office manually update. Can share your result? Thanks. Link to comment Share on other sites More sharing options...
Yann - Prestaplugins Posted November 6, 2010 Share Posted November 6, 2010 Just try to call your cron.php url (http://www.mydomain.com/cron.php?secure_key=update) in your browser.If you can't, then you didn't put it in the right place.If it works, in your cron job, try this :curl http://www.mydomain.com/cron.php?secure_key=updatenot just : http://www.mydomain.com/cron.php?secure_key=update: Link to comment Share on other sites More sharing options...
Phuah Posted November 9, 2010 Author Share Posted November 9, 2010 I had set my cron job for every 12hour with this "curl http://www.mydomain.com/cron.php?secure_key=update" currencies still can't auto update but when I try to put a url "http://www.mydomain.com/cron.php?secure_key=update" then browse it, it work updating the currencies. Is it my cron job got any wrong setting? Link to comment Share on other sites More sharing options...
Yann - Prestaplugins Posted November 9, 2010 Share Posted November 9, 2010 Do you have a ssh access on your server ?Maybe curl is not installed, and you could try a wget http://...... Link to comment Share on other sites More sharing options...
Phuah Posted November 15, 2010 Author Share Posted November 15, 2010 Thanks Patanock. I had try it in few days and I saw the result. I try with "wget", it work for me.Rocky, thanks for your warm helpful too.Thanks you for your all. Link to comment Share on other sites More sharing options...
salesfromisrael Posted November 17, 2010 Share Posted November 17, 2010 never mind found my answer Link to comment Share on other sites More sharing options...
salesfromisrael Posted November 18, 2010 Share Posted November 18, 2010 I set up the Cron job and I get the following error in email:/bin/sh: http://www.jerusalemspicespace.com/cron.php?secure_key=?: No such file or directoryI tried both addresses www.jerusalemspicespace.com/shop/cron.php and the address above and I get the same answer for both!Nofia Link to comment Share on other sites More sharing options...
salesfromisrael Posted November 18, 2010 Share Posted November 18, 2010 I have another issue also that the currency exchange file for Europe excludes the shekel. I really would prefer an update from a bank that has shekel rates also. Link to comment Share on other sites More sharing options...
frosticek Posted December 2, 2010 Share Posted December 2, 2010 I'll try to make it easier. Create a file called cron.php in the root directory of PrestaShop with the following code: <?php include(dirname(__FILE__).'/config/config.inc.php'); include(dirname(__FILE__).'/classes/Currency.php'); if (isset($_GET['secure_key']) AND $_GET['secure_key'] === 'password') Currency::refreshCurrencies(); ?> Change 'password' to a password only you know that that only you can update your currency rates. Then create a cron job in your cPanel with the URL http://www.yoursite.com/cron.php?secure_key=password where password is the password you entered in cron.php. Working GREAT ! Link to comment Share on other sites More sharing options...
salesfromisrael Posted December 26, 2010 Share Posted December 26, 2010 How would I get the update from the Bank of Israel instead of Europe?XML link:http://www.bankisrael.gov.il/currency.xmlThank you,Nofia Link to comment Share on other sites More sharing options...
fjanos Posted March 31, 2011 Share Posted March 31, 2011 Thanks Patanock. I had try it in few days and I saw the result. I try with "wget", it work for me.Rocky, thanks for your warm helpful too.Thanks you for your all. OK it doesn!t work for me but I have the same problem as Phuah. I added cronjob in my Cpanel- On the e-mail I get this error:/bin/sh: http://www.mysite.net/cron.php?secure_key=password: No such file or directory I read that Phuah has the solution but I can't see how you solved it. What is the "wget"????What do I have to do exactly?. thanks in advance Link to comment Share on other sites More sharing options...
ezakimak Posted March 31, 2011 Share Posted March 31, 2011 I've seen people having this same problem, I have come up with a kind of solution, if you'd want to give it a try just drop a line regardsHughp.s. it works for cpanel cron jobs Link to comment Share on other sites More sharing options...
fjanos Posted March 31, 2011 Share Posted March 31, 2011 I've seen people having this same problem, I have come up with a kind of solution, if you'd want to give it a try just drop a line regardsHughp.s. it works for cpanel cron jobs Hi ezakimak!I consulted with my webhosting support. They always say the same solution and I tried everything. It just doesn't work.I tried this:php -q /home/usern5/public_html/scripts/testrun.phpthis:lynx -dump http://domain.com/folder/script.php?dl=fileand this:curl http://domain.com/folder/script.php?dl=fileI gave 755 permission to the file on my server but no success. Link to comment Share on other sites More sharing options...
fjanos Posted March 31, 2011 Share Posted March 31, 2011 This is what I got from the hosting support lately:From review of the cron logs, your script looks to be running without issue. Server side, everything is fine. You will need to check your script to find out why it is emailing blank content.Also, PHP is located at /usr/local/bin/php Link to comment Share on other sites More sharing options...
ezakimak Posted March 31, 2011 Share Posted March 31, 2011 Hi Now i am not at my office so i cannot post my php file i'll post it when i get there this afternoon,In my case is wirking i had to make some twist to my Php file but it finaly worked Link to comment Share on other sites More sharing options...
ezakimak Posted April 1, 2011 Share Posted April 1, 2011 First of all create a directory in your shops root directory and call it cronjobs, then upload the file attached in this email to that directory and in your cpanel create a cron job with this command:/usr/bin/php -q /home/youruser/public_html/yourshoprootdir/cronjobs/cronjobs.php --secure_key=123 --type=currency replace 123 with your password just make sure to change the program to check against that passwordhope this help Hughps. in my isntallation php is located in /usr/bin/ so make sure whre your php is installed in your server cronjobs.php 1 Link to comment Share on other sites More sharing options...
fjanos Posted April 2, 2011 Share Posted April 2, 2011 First of all create a directory in your shops root directory and call it cronjobs, then upload the file attached in this email to that directory and in your cpanel create a cron job with this command:/usr/bin/php -q /home/youruser/public_html/yourshoprootdir/cronjobs/cronjobs.php --secure_key=123 --type=currency replace 123 with your password just make sure to change the program to check against that passwordhope this help Hughps. in my isntallation php is located in /usr/bin/ so make sure whre your php is installed in your server First of all thank you Ezakimak. It just gives me this error in the mail: ..sorry you provided bad arguments..Than what can be the problem? Link to comment Share on other sites More sharing options...
ezakimak Posted April 2, 2011 Share Posted April 2, 2011 did you change the secure_key value ? if so , did you also changed the program to check for that value ?regardsHugh Link to comment Share on other sites More sharing options...
fjanos Posted April 2, 2011 Share Posted April 2, 2011 did you change the secure_key value ? if so , did you also changed the program to check for that value ?regardsHugh HiThis is what I didI changed cronjobs.php what you uploaded within line 7 if (isset($result['secure_key']) AND $result['secure_key'] === 'mypassword') I also attached an image how I added the cronjob in my webhosting cPanel. Link to comment Share on other sites More sharing options...
ezakimak Posted April 3, 2011 Share Posted April 3, 2011 in your cpanel you wrote -secure_key=xxxx -type=yyy and it must be --secure_key=xxxx --type=yyy Link to comment Share on other sites More sharing options...
fjanos Posted April 3, 2011 Share Posted April 3, 2011 in your cpanel you wote -secure_key=xxxx -type=yyy and it must be --secure_key=xxxx --type=yyy Hi I tried six different '–' none of them is working. Maybe give me the ALT code of this '-' to try. I don't know it's just so upsetting. Link to comment Share on other sites More sharing options...
ezakimak Posted April 3, 2011 Share Posted April 3, 2011 Hi , there is nothing special with those --, they are just two consecutive minus signs. Link to comment Share on other sites More sharing options...
fjanos Posted April 3, 2011 Share Posted April 3, 2011 Hi , there is nothing special with those --, they are just two consecutive minus signs. Yessss! Success. Thank you very much EZAKIMAK. I hate this tiny characters that's what causing me hard time in programming too. by the way you did this cronjob.php function? Link to comment Share on other sites More sharing options...
ezakimak Posted April 3, 2011 Share Posted April 3, 2011 I am glad that you solved it and I am glad that I could help youRegardsHughps. and yes I did it with the help of the php manuals Link to comment Share on other sites More sharing options...
Housy Posted May 16, 2011 Share Posted May 16, 2011 Are the currencies automatically updated in the newest PS version (1.4.1)?Housy Link to comment Share on other sites More sharing options...
Housy Posted May 16, 2011 Share Posted May 16, 2011 Are the currencies automatically updated in the newest PS version (1.4.1)?Housy I guess they aren't, because you have to update them manually with the update currency rate function within admin area. Link to comment Share on other sites More sharing options...
Housy Posted May 16, 2011 Share Posted May 16, 2011 First of all create a directory in your shops root directory and call it cronjobs, then upload the file attached in this email to that directory and in your cpanel create a cron job with this command:/usr/bin/php -q /home/youruser/public_html/yourshoprootdir/cronjobs/cronjobs.php --secure_key=123 --type=currency replace 123 with your password just make sure to change the program to check against that passwordhope this help Hughps. in my isntallation php is located in /usr/bin/ so make sure whre your php is installed in your server Your method is way way too complicated. Just use file, that was recommended by Rocky and the command below:wget -q http://www.your-site.com/cron.php?secure_key=your-password Thats it, very simple and it works like a charm =)Cheers, Housy Link to comment Share on other sites More sharing options...
Rixou Posted June 6, 2011 Share Posted June 6, 2011 I have copy the code above how I know that the following code working.I have prestashop 1.4.1 and my cron is there http://www.jolie-et-julian.com/cronjobs/cron.php?secure_key=123 <?php include(dirname(__FILE__).'/../config/config.inc.php'); include(dirname(__FILE__).'/../classes/Currency.php'); if (isset($_GET['secure_key']) AND $_GET['secure_key'] === '123') Currency::refreshCurrencies(); ?> Thank you so much Link to comment Share on other sites More sharing options...
Housy Posted June 6, 2011 Share Posted June 6, 2011 To prevent creating files each time the cron is executed, rather use the following command: wget -O /dev/null http://www.your-domain.com/cron.php?secure_key=x2r8tnt > /dev/null 2>&1; If you use the upper code, you won't have problems, that can be seen on the attached image.Cheers First of all create a directory in your shops root directory and call it cronjobs, then upload the file attached in this email to that directory and in your cpanel create a cron job with this command:/usr/bin/php -q /home/youruser/public_html/yourshoprootdir/cronjobs/cronjobs.php --secure_key=123 --type=currency replace 123 with your password just make sure to change the program to check against that passwordhope this help Hughps. in my isntallation php is located in /usr/bin/ so make sure whre your php is installed in your server Your method is way way too complicated. Just use file, that was recommended by Rocky and the command below:wget -q http://www.your-site.com/cron.php?secure_key=your-password Thats it, very simple and it works like a charm =)Cheers, Housy Link to comment Share on other sites More sharing options...
Rixou Posted June 6, 2011 Share Posted June 6, 2011 Thanks a lot Housy Link to comment Share on other sites More sharing options...
Housy Posted June 6, 2011 Share Posted June 6, 2011 Just simply visit this URL -> Currencies, then open up your Back Office (log in as admin), go to payment tab and then click currencies. If the currencies from the Back Office match the currencies from the link, then it works how I know that the following code working Link to comment Share on other sites More sharing options...
oondudutz Posted June 7, 2012 Share Posted June 7, 2012 (edited) Hi there. Currently I'm running prestashop 1.4.3 I just tried what Rocky asked to do and successfully check the link ....secure_key=password result returned. I go back to BO and check the currencies has not been updated. Any idea? Does this method compatible with 1.4x version? Thanks Mate Edited June 7, 2012 by oondudutz (see edit history) Link to comment Share on other sites More sharing options...
virgawhiskeygravity Posted December 3, 2012 Share Posted December 3, 2012 Hi there. Currently I'm running prestashop 1.4.3 I just tried what Rocky asked to do and successfully check the link ....secure_key=password result returned. I go back to BO and check the currencies has not been updated. Any idea? Does this method compatible with 1.4x version? Thanks Mate Check paths of including files... Worked for me... <?php include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/../../classes/Currency.php'); if (isset($_GET['secure_key']) AND $_GET['secure_key'] === '987654321') Currency::refreshCurrencies(); ?> Link to comment Share on other sites More sharing options...
Rukshar Khan Posted August 29, 2013 Share Posted August 29, 2013 Does this cron job apply to version 1.5x? Link to comment Share on other sites More sharing options...
ringued Posted December 9, 2013 Share Posted December 9, 2013 Does this cron job apply to version 1.5x? Hi, I have this version of prestashop and I tried everything, until try to check my files permissions wich was 755. None of the files on admin folder should have a permission bigger then 644. After changing that I put the comand wget http://www.yourdomain....(as shown on currency page of presta) and it worked out! I hope it helps Link to comment Share on other sites More sharing options...
nikketrikke Posted March 23, 2014 Share Posted March 23, 2014 Hi, I have this version of prestashop and I tried everything, until try to check my files permissions wich was 755. None of the files on admin folder should have a permission bigger then 644. After changing that I put the comand wget http://www.yourdomain....(as shown on currency page of presta) and it worked out! I hope it helps Hello excuse me how do you do this ? i try to xhange permission to fil cron_.... but nothing what permission do you give to file ? and to what files ? thanks for help Link to comment Share on other sites More sharing options...
outlet.ee Posted March 30, 2014 Share Posted March 30, 2014 (edited) Hello, where does the PS BO (http://www.myshop.com/admin/index.php?controller=admincurrencies) takes the currency rates from? They seem to be a bit different than http://www.ecb.europa.eu/stats/exchange/eurofxref/html/index.en.html. I was trying to look all the files related to currency but couldn't locate the source of therates. Edited March 30, 2014 by outlet.ee (see edit history) Link to comment Share on other sites More sharing options...
mecollectibles Posted October 13, 2015 Share Posted October 13, 2015 I use the following free plan: https://www.easycron.com/ I suggest you also do. It has also the paid plans if you want to spend some money for peace of mind of renewing. Link to comment Share on other sites More sharing options...
slaymesh Posted August 28, 2020 Share Posted August 28, 2020 Hi, I am using prestashop version 1.7.6.7 and i would like to update my currencies , i am on plesk panel , please whats the best way to start any guidance will be appreciated ? Thank you so much. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now