Support » Plugin: Facebook for WooCommerce » Multi currency WC, set to EUR, but changes to USD in FB shop after some time

  • Resolved Mindas22

    (@mindas22)


    Hi, we have shop with multi currency EUR, USD and GBP.

    Set to EUR in: Currency options /wp-admin/admin.php?page=wc-settings

    We use https://aelia.co/shop/currency-switcher-woocommerce/ plugin for multicurrency.

    If we manually click /wp-admin/admin.php?page=wc-facebook&tab=product_sync product sync FB shop shows prices in EUR.

    In Facebook Catalog Manager, Catalogue, Data Sources Default currency is set to
    EUR

    The problem is somehow FB shop prices changes to USD after some time(same day).

    THen again if we manually click /wp-admin/admin.php?page=wc-facebook&tab=product_sync product sync FB shop shows prices in EUR.

    Also same effect if we click Replace schedule request update now in Facebook Catalogue Manager data sources.

    We need to show EUR prices in Facebook. Can You help us with that?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Mindas22

    (@mindas22)

    From the aelia support:

    you can set the active currency on the fly, with a filter

    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.

    What <SOME ARGUMENT> and <SOME VALUE> should be if feed url: ?wc-api=wc_facebook_get_feed_data&secret=xxx

    I have the same issue using Aelia + Facebook for Woocommerce with the Geolocation activated.
    Please let me know if you solved.

    thanks!

    Oscar.

    oscarlarajara

    (@oscarlarajara)

    Hi @mindas22 ,
    You were able to fix this problem with your facebook catalog?
    I am having the same issue and it will be very helpful if you share your solution.

    Thanks in advance.

    Oscar.

    Thread Starter Mindas22

    (@mindas22)

    @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.

    Plugin Support Mike Straw

    (@mikestraw)

    Hi @mindas22 ,

    Thanks for passing on that fix!

    I’ll mark this thread as resolved now. If you have any further questions, I recommend creating a new thread.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Multi currency WC, set to EUR, but changes to USD in FB shop after some time’ is closed to new replies.