VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: Adwans on March 04, 2021, 12:21:48 PM

Title: Currency converting on any different-than-daily basis? convertECB.php
Post by: Adwans on March 04, 2021, 12:21:48 PM
Hello VM fans  :)
Is it possible to change currency synchronisation interval, from "daily" to let say "weekly", without any hacking?
F.e: It could be confusing for customers to see different prices everyday - so I would like to change prices, according to convertECB, 2 times or once a week.
Regards
A.
Title: Re: Currency converting on any different-than-daily basis? convertECB.php
Post by: Jörgen on March 04, 2021, 13:14:11 PM
You can put in Your own conversion settings, in VM back end, that overrides the convertECB rules. Updating may be an issue, but if You have only a few currencies this might be doable.

Jörgen @ Kreativ Fotografi
Title: Re: Currency converting on any different-than-daily basis? convertECB.php
Post by: Adwans on March 04, 2021, 18:33:10 PM
Hi, Jörgen, thanks.
I m afraid it's not the point. Doesn't want to abandon automatic conversion ;)
So, tell me please, if it is correct approach.
I cloned convertECB and renamed the clone to sth else. Inside of .php file I changed class name accordingly and set new time interval in this line:
$cache->setLifeTime(360); // check 4 time per day
to sth like this:
$cache->setLifeTime(24*60*7); // so i have a week!
and that line too:
$globalCurrencyConverter = $cache->call( array( 'NEWCONVERTERSNAME', 'getSetExchangeRates' ),$this->document_address );
So far so good, supposed to work. Is it ok?