• kero83

    (@kero83)


    Hi Marcin,

    We have been using your Omnibus plugin with our Finnish website. It has worked normally.

    Now we are opening sell to EU countries. I noticed that your plugin does not convert/show latest 30 days price correctly in DKK, SEK etc. It takes latest EURO price and shows it not in currency it should.

    I contacted Aelia developer team. This was their response:

    Thanks for reaching out. The Currency Switcher, by itself, doesn’t interact with omnibus plugins (or other plugins). It doesn’t know what amounts they handle, as that depends on the plugins’ internal logic, therefore it cannot convert them automatically. This is by design: the Currency Switcher won’t try to “intercept” the logic from plugins to inject multi-currency capabilities in them.

    How to show the correct prices from the omnibus plugin

    If an omnibus plugin keeps track of historical prices to show them on the product page, to have these prices converted the omnibus plugin will have to pass them to the conversion function. This requires one line of code:

    // Convert an amount from the shop’s base currency to the active currency$converted_amount = apply_filters(‘wc_aelia_cs_convert’, $amount, $from_currency, $to_currency);

    The omnibus plugin would simply have to pass the historical prices to the conversion function before displaying them, and they should appear correctly on the frontend.How to implement the conversion of the pricesThe best way to add multi-currency support to any plugin is to modify the original code and add the calls to the conversion logic where needed. That’s something that the plugin’s authors would have to do, as they know which prices are displayed on the frontend and when. Our recommendation is always to contact the plugin’s authors and ask them if they would be interested in adding multi-currency support to it. They can use the filter I sent you, and reach out to us if they have any questions.

    If the authors of the plugin take too long to update it, a potential workaround is to write an external filter to intercept the amount to be converted. For this to be possible, the omnibus plugin must provide a hook that you can use to alter the amount before it’s displayed. The plugin’s authors can tell you if that’s the case. Once you have the hook, you can write a filter like the following:

    add_filter(‘<SOME FILTER FROM THE OMNIBUS PLUGIN>’, function($omnibus_plugin_amount) { // Conver the amount from the shop’s base currency to the active currency return apply_filters(‘wc_aelia_cs_convert’, $omnibus_plugin_amount, get_option(‘woocommerce_currency’), get_woocommerce_currency());}, 10, 1);

    You will have to replace <SOME FILTER FROM THE OMNIBUS PLUGIN> with the filter provided by the omnibus plugin’s developers, and that should be sufficient to convert the values.

    Can you to get your awesome plugin working with Aelua multicurrency ??

    Best regards

    joni

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Marcin Pietrzak

    (@iworks)

    Hi @kero83

    I’m sorry, but my plugin is not handling multicurrences. 

    I had a plan to create a pro version, but currently I’m involved in other projects.

    Marcin

    Thread Starter kero83

    (@kero83)

    Hi,

    Can i add that hook to plugin that Aelia support suggested?

    If the authors of the plugin take too long to update it, a potential workaround is to write an external filter to intercept the amount to be converted. For this to be possible, the omnibus plugin must provide a hook that you can use to alter the amount before it’s displayed. The plugin’s authors can tell you if that’s the case.

    Once you have the hook, you can write a filter like the following:

    add_filter(‘<SOME FILTER FROM THE OMNIBUS PLUGIN>’, function($omnibus_plugin_amount) { // Conver the amount from the shop’s base currency to the active currency return apply_filters(‘wc_aelia_cs_convert’, $omnibus_plugin_amount, get_option(‘woocommerce_currency’), get_woocommerce_currency());}, 10, 1);

    You will have to replace <SOME FILTER FROM THE OMNIBUS PLUGIN> with the filter provided by the omnibus plugin’s developers, and that should be sufficient to convert the values.

    Joni

    Plugin Author Marcin Pietrzak

    (@iworks)

    I’m a big fan of filters, and there are plenty of them.

    But I think this is not as simple as they show it.

    Why?

    The exchange rate is not flat, and it changes every day.

    We have to write, store, and remember prices in all currencies, not just “now”.

    M

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.