Jump to content

Update Currencies Automatically With Cron Job In Multistore


rizwang

Recommended Posts

Hello Everyone,

 

We enable multi-store and created 5 different stores for 5 different countries. Now we want to update the currency of each store with the help of cron job and in the currencies section we have a link that is http://domain.com/admin/cron_currency_rates.php?secure_key=my_key now the problem is that this cron job only works for one store. I checked the refreshCurrencies() function that is in Currency class which update the currency prices. 

 

Here is the same question that is asked but this is only for one store and its working for me https://www.prestashop.com/forums/topic/75337-solved-can-currency-auto-update-without-manually-click-on-update-currencies-daily/

 

Kindly let me know about this or any helpful link. I didn't get anything in the documentation for update currencies for multi-store.

 

Thanks,

Rizwan

Link to comment
Share on other sites

  • 2 months later...

I have the same issue and it would be great if Prestashop could fix this issue.

I think the problem is there in cron_currency_rates.php in this loop :

 

        foreach ($shop_ids as $shop_id) {
            Shop::setContext(Shop::CONTEXT_SHOP, (int)$shop_id);
            Currency::refreshCurrencies();
        }
 

$id_shop is well parsed but after it doesn't works !!

 

Prestashop team fix this please !!

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 2 weeks later...
  • 3 weeks later...

Aloha,

 

I have one suggestion, perhaps it will help. If you set the selector at the top to "all shops" or to your default group and then run the cron job, does this change the behavior? I have been updating my site manually, daily, and have discovered that this change updates my two stores at the same time (per currency).

 

hth, Tim

Link to comment
Share on other sites

  • 8 months later...

Hello,

 

Same problem for me, it is a very big problem because I need to update manualy the currencies and sometimes I forgot, and as you know they can change a lot in a few days...

Does anyone found a solution?

 

Thank you in advance.

Link to comment
Share on other sites

Hello,

 

Same problem for me, it is a very big problem because I need to update manualy the currencies and sometimes I forgot, and as you know they can change a lot in a few days...

Does anyone found a solution?

 

Thank you in advance.

 

What ps version do you have? This functionality works just fine on my 1.6.1.7 and 1.7.1.0

 

It's possible you just don't have set up your cron correctly. You could check by opening the cron url manually.

 

Also, my free datakick module has build-in support for refreshing currencies (also for other tasks, like updating search index, creating db backup or updating cache for layered navigational block), so you could try that one. 

Link to comment
Share on other sites

  • 7 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...