PluginUs.Net - Business Tools for WooCommerce and WordPress

[realize your idea - make your dreams come true]

Support Forum

You need to log-in to create request (topic) to the support

Currency switcher changing values on cart again.

The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday. If you have problems with registration ask help on contact us page please
If you not got email within 24~36 business hours, firstly check your spam box, and if no any email from the support there - back to the forum and read answer here. DO NOT ANSWER ON EMAILS [noreply@pluginus.net] FROM THE FORUM!! Emails are just for your info, all answers should be published only here.
The support doesn work on Saturdays and Sundays, so some Friday requests can be answered on Monday.

Hi, so i have the pro version of currency switcher, i have custom add-on on my products and set a custom price on the cart by the custom add-ons, currency switcher change the product price correctly but on cart totals it change the price inccorrectly. I see when i add product to the cart, the products are added on the selected currency, can you tell me where is the function changing the cart totals on the plugin, that's what i need because the product is added correctly in selected currency but the plugin is converting the currency on cart totals again. Here is my page https://goshopping.cl

 

Thanks.

 

Smahuzier.

Hello

Paste your license key here - https://c2n.me/43SC6rb.png -> https://c2n.me/42HBIt7.png

To  get  license - https://codecanyon.net/downloads -> https://c2n.me/45ZXF4E.jpg

Ok, i have post it. Sorry for the delay, i have custom add-ons on my products so i have a function to multiply this add-ons and add to the cart total price.

The plugin change the currency in the products individual price and when i sum the converted currency it is ok, but when in cart review, the plugin multiply it again and that its wrong.

Hello

Please  read  this - https://currency-switcher.com/woocs-labs/

Hello, i have read it, no solution for me. I am changing the cart totals with custom product add-ons(not the plugin, just my code). The multi currency plugin is not working in cart totals.

This is my code to change the cart totals.

function add_custom_price( $cart_object ) {
    if ( is_admin() && ! defined( 'DOING_AJAX' ) )
        return;
    if ( did_action( 'woocommerce_before_calculate_totals' ) >= 2 )
        return;
    foreach ( $cart_object->get_cart() as $cart_item ) {
        if ( !empty($cart_item['adult_add_on']) && !empty($cart_item['child_add_on'])  && !empty($cart_item['infant_add_on']) ) {
            $price = $cart_item['data']->price*$cart_item['adult_add_on'] + $cart_item['data']->price*$cart_item['child_add_on'] + $cart_item['data']->price*0.75*$cart_item['infant_add_on'];
            if ( version_compare( WC_VERSION, '3.0', '<' ) ) {
                $cart_item['data']->price = $price; // Before WC 3.0
            } else {
                $cart_item['data']->set_price($price); // WC 3.0+
            }
            }
}
}

Hello

In  this  case  please  read   - https://currency-switcher.com/codex/#functions

To  convert price  - https://currency-switcher.com/function/woocs-woocs_exchange_value/

if the cart has double conversion:

        if (class_exists('WOOCS')) {
            global $WOOCS;
            if ($WOOCS->is_multiple_allowed) {
                $currrent = $WOOCS->current_currency;
                if ($currrent != $WOOCS->default_currency) {
                    $currencies = $WOOCS->get_currencies();
                    $rate = $currencies[$currrent]['rate'];
                    $price = $price/ $rate;
                }
            }

Ok, this works but why the function

WOOCS->woocs_exchange_value()
Returns price like this"(50,00)" or"(33,45)" it should return an integer or a double.

Actually it doesn't work, when i print the function like this

echo"$WOOCS->woocs_exchange_value($price)";

it returns correct price like this"(price)" but if, i declare the function like this

$exchangedPrice = $WOOCS->woocs_exchange_value($price);

echo"$exchangePrice";

It returns price wrong... i dont know what is the problem.

Hello

it should return an integer or a double. - float
https://c2n.me/46LZoUg.png - In fact, you show two identical codes. No magic happens here. Unfortunately, by this piece of code I can’t determine the problem in your code, you should debug.