A
A
argenit2015-01-03 11:52:34
Electronic commerce
argenit, 2015-01-03 11:52:34

How to set up plugin for Woocommerce on Wordpress?

There is such a problem with setting up a plugin for Woocommerce that displays different currencies. Installed WooCommerce Currency Switcher, turned it on and got a couple of problems.
So. It turns out that the main currency there is the US dollar.
This is how the basket for the dollar looks like
9d4936ac89a24a528ba33b7e812755f5.png
. And in the end, everything is correctly calculated, the delivery is also 1.5 bucks
f4333687dc404fc9be79ab0fdb8d2639.png
. And now we just switch to EURO. The page has been updated and now the cart is correct.
fd33055541ce44508c1fe5154cebca33.png
But now the delivery has suddenly grown many times, although it costs $ 1.5
d1defaafc4744c06a162b498843b4801.png37b0bc6354d14bf29a1e13339ee0ce5f.png
The same thing, if, for example, we switch to Ukr. hryvnia or ruble
d06008cc03ce468b86d8c1316b01027a.pngAND delivery
44f2fab3bb7a41be829fa3307899c11d.png
I understand that this is a plugin bug. Here I found a crutch, which should help with something, but it did not help anything.

add_action('woocommerce_before_calculate_totals', 'fix_currency_conversion');
function fix_currency_conversion($cart_object){
            global $WOOCS;
            $cur_currency = $WOOCS->current_currency;
            $currencies = $WOOCS->get_currencies();
            $conversion_rate = $currencies[$WOOCS->current_currency]['rate'];
            if($cur_currency == 'USD'){
                foreach ( $cart_object->cart_contents as $cart_item_key => $cart_item ) {
                    $cart_item['data']->price = $cart_item['data']->price / $conversion_rate;
                }
            }
}

Can you tell me other adequate plugins or how to insert crutches here at least.
In short, who can

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Develm, 2015-01-03
@Develm

Uninstall wordpress, set normal Cms

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question