Author Topic: Currency converting on any different-than-daily basis? convertECB.php  (Read 1036 times)

Adwans

  • Jr. Member
  • **
  • Posts: 53
  • Beginner+
  • VirtueMart Version: J! 3.9.25 VM 3.8.8
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

  • Global Moderator
  • Sr. Member
  • *
  • Posts: 3881
    • Kreativ Fotografi
  • VirtueMart Version: 3.4.x
Re: Currency converting on any different-than-daily basis? convertECB.php
« Reply #1 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
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

Adwans

  • Jr. Member
  • **
  • Posts: 53
  • Beginner+
  • VirtueMart Version: J! 3.9.25 VM 3.8.8
Re: Currency converting on any different-than-daily basis? convertECB.php
« Reply #2 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?