@oscarlarajara:
Solution for me was to
1. enable currency by URL in aelia settings and
2. edit Facebook feed in FACEBOOK Catalogue manager > Catalogue > Data sources > pick your data-feed > Settings > then at Replace schedule click on … edit and modify URL by adding &aelia_cs_currency=EUR
like:
example.com/?wc-api=wc_facebook_get_feed_data&aelia_cs_currency=EUR&secret=xxx
(You can check and download and open the feed and check what You are getting.
Maybe it is relevant if You use cloudflare make sure this feed is not cached by creating rules for this url.
That was enough to solve.
Make sure Default currency EUR or what You need is set in Facebook and woocommerce.
Part of the message from aelia support.
Thanks for getting in touch. The issue you describe could be due to the fact that the Facebook servers connect from a US IP address. Since all visits are handled the same way, and they are subject to geolocation, any call made from the US will receive prices in USD. That includes calls made to special URLs, used to generate a feed.
?
How to fix the issue
We haven’t used a Facebook feed plugin ourselves, but, based on past experience with feed generators, there should be two ways to generate a feed in a specific currency.
1. Feed generated by calling a special URL
If the Facebook feed plugin generates the feed “on the fly” by calling a special URL (e.g. https://example.org?generate_feed=1), you could try enabling the “currency by URL” feature in Currency Switcher > Currency Selection (see https://prnt.sc/gpd3vj), then pass the currency via the URL, as https://example.org?generate_feed=1&aelia_cs_currency=USD. That would change the active currency on the fly. If it’s not possible to use a special URL with the currency being part of it, then you can set the active currency on the fly, with a filter (see Aelia Currency Switcher – How to change the selected currency via code, example #3), after checking if the URL is the feed one. Here’s an example of this logic:
add_filter('wc_aelia_cs_selected_currency', function($selected_currency) {
// If current page URL contains a specific "generate feed" argument,
// force the currency to EUR
if(isset($_GET['<SOME ARGUMENT>']) && ($_GET['<SOME ARGUMENT>'] === '<SOME VALUE>')) {
// Force selected currency to Euro
$selected_currency = 'EUR';
}
return $selected_currency;
}
You will have to replace <SOME ARGUMENT> and <SOME VALUE> with the actual values used by the Facebook feed plugin, and that should be sufficient to return a feed always in EUR.