S
S
Sergey Burduzha2019-11-14 11:37:43
WooCommerce
Sergey Burduzha, 2019-11-14 11:37:43

How to withdraw the amount from the basket, taking into account the currency?

Good afternoon.
I am using the currency switcher plugin. 2 currencies: $ and euro.
I withdraw the amount from the basket in the header in this way.

<div class="restrain small-cart-content">
                            <p class="total"> <?php echo carbon_get_theme_option('crb_summ'.get_lang()); ?>:
                                <span class="amount">
                                    <?php
                                    global $woocommerce;
                                    $total = $woocommerce->cart->total;
                                    echo $total .' '. get_woocommerce_currency_symbol();
                                    ?>
                                </span>
                            </p>
                            <p class="buttons">
                                <a href="<?php echo $cart_url; ?>" class="button"><?php echo carbon_get_theme_option('crb_to_cart'.get_lang()); ?></a>
                            </p>
                        </div>

When I select a dollar in the select, only the currency symbol changes in the header. But, if I change the currency again, then the value also changes, only it turns out late.
For example, a product costs 30 dollars or 40 euros.
The currency is the euro, the basket costs 40 euros.
I change the currency switcher, there are 40 dollars in the basket.
I change it again, there are 30 euros in the basket.
Do you understand what the problem is?
Thanks in advance for your help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ilham Karimov, 2019-11-14
@Ilham

Can I see an example? poke?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question