News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Currency converting on any different-than-daily basis? convertECB.php

Started by Adwans, March 04, 2021, 12:21:48 PM

Previous topic - Next topic

Adwans

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.

Jörgen

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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Adwans

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?