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 pleaseIf 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.
Quote from Sebastian on February 13, 2020, 19:13Hi, 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.
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.
Quote from Pablo Borysenco on February 14, 2020, 11:43Hello
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
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
Quote from Sebastian on February 26, 2020, 18:28Ok, 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.
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.
Quote from Pablo Borysenco on February 27, 2020, 13:10Hello
Please read this - https://currency-switcher.com/woocs-labs/
Hello
Please read this - https://currency-switcher.com/woocs-labs/
Quote from Sebastian on March 30, 2020, 20:11Hello, 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, 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+}}}}
Quote from Pablo Borysenco on March 31, 2020, 11:51Hello
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;}}
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:
Quote from Sebastian on March 31, 2020, 20:30Ok, 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.
Ok, this works but why the function
WOOCS->woocs_exchange_value()
Quote from Sebastian on March 31, 2020, 21:02Actually 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.
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.
Quote from Pablo Borysenco on April 1, 2020, 11:07Hello
it should return an integer or a double. - floathttps://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.
Hello