Support » Plugin: Booster for WooCommerce » Any custom php script to convert an amount to another currency?

  • Resolved menathor

    (@menathor)


    Hello,

    I use another multi currency plugin and I am considering trying booster! However one of the things I need is to be able to convert an amount from the shop base currency to whatever the current currency is, in custom locations. Is there an example of some kind of php filter or code (or shortcodes) I could use to do this? For example, at the moment I use something like this with my current plugin:

    $base_currency = get_option('woocommerce_currency');
    $current_currency = get_woocommerce_currency();
    $totalsales = $order_totals->total_sales;
    $totalsales_converted = apply_filters('plugin_currency_convert', $totalsales, $base_currency, $current_currency);

    Could I do something similar with booster?

    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi,

    No, unfortunately there is no easy way to achieve this yet but we have added it to our todo list.

    Thread Starter menathor

    (@menathor)

    Hi again. Many thanks for adding this to your todo list- it will be a great feature for developers to be able to access the currency conversion hooks directly.

    I also just noticed these shortcodes in your stand-along currency switcher (https://wordpress.org/plugins/currency-switcher-woocommerce/)

    [woocommerce_currency_switcher_product_price_table] – product prices preview in all currencies.
    [woocommerce_currency_switcher_convert_price] – convert any price to another currency.
    [woocommerce_currency_switcher_current_currency_symbol] – show current currency symbol.
    [woocommerce_currency_switcher_current_currency_code] – show current currency code.

    Are these same shortcodes available in booster? Could what I was asking about be done with a combination of these shortcodes?

    Hi,

    No, unfortunately these shortcodes are not yet available in Booster. Booster and this plugin are fundamentally different in their functionality, and there are more multi currency modules available in Booster hence this is not working yet.

    Is there still no way of using PHP to convert a front end price manually?

    Or even perhaps getting the conversion rates from the plugin in PHP / Localized JS var?

    @rokasjan Can you come back to me about this at all to let me know if there is any way to do a currency conversion from the plugin direct in PHP or shortcode.

    @rokasjan any movement on this in terms of it being on your todo list?

    Hi,

    Your suggestion is definitely in our todo list however these tasks are handled by another team so I am unable to answer what the status of it currently is.

    @rokasjan is this still on the TODO list?

    Not so much chasing just looking to know if I missed it in the last 2 months.

    Any movement on this?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Any custom php script to convert an amount to another currency?’ is closed to new replies.