VirtueMart Forum

VirtueMart 2 + 3 => 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:
Code: [Select]
$cache->setLifeTime(360); // check 4 time per dayto sth like this:
Code: [Select]
$cache->setLifeTime(24*60*7); // so i have a week!and that line too:
Code: [Select]
$globalCurrencyConverter = $cache->call( array( 'NEWCONVERTERSNAME', 'getSetExchangeRates' ),$this->document_address );So far so good, supposed to work. Is it ok?