• Resolved Shrik

    (@saowp)


    I am currently using the plugin “WooCommerce Currency Converter”, but would like to move to this Switcher plugin since it has the ability to set payment currency, which the Converter does not.

    I have a configurator with which I preview the price of a product (which is not yet created) based on dynamic user inputs. With the Converter plugin enabled, I change, using JavaScript, the value of the price data attribute, which is always in the payment currency (which is fixed). After that, if I trigger ‘wc_fragments_refreshed’ then the displayed price in the chosen currency is refreshed.

    With the Converter plugin disabled (since it would conflict with Switcher) can I achieve a similar effect with Switcher? Since Switcher does not set a price data attribute, and neither is the payment currency fixed)

    • This topic was modified 6 years, 1 month ago by Shrik.
    • This topic was modified 6 years, 1 month ago by Shrik.
Viewing 3 replies - 1 through 3 (of 3 total)
  • pavloborysenko

    (@pavloborysenko)

    Hello

    Not sure I understood you correctly.

    Please drop me exact link to the product with this function.

    Thread Starter Shrik

    (@saowp)

    Thanks for the reply. I think I found the answer myself – it is not possible with this plugin. That is because “WooCommerce Currency Converter” changes the currency through JavaScript without requiring a reload of the page, whereas “WOOCS – Currency Switcher for WooCommerce” always causes a reload when the currency is changed.

    I did a workaround by placing an existing product on the same page, and back-calculating the exchange rate through JavaScript. However, my code is far from perfect. It would be nice if this plugin evolves into doing the conversion in JavaScript without requiring page reloads. That would also give a smoother and better experience for the user.

    pavloborysenko

    (@pavloborysenko)

    Hello

    Ok! I will pass it to developers

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Preview price using JavaScript?’ is closed to new replies.