woocommerce product addon with fox currency
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 skysolution on May 24, 2024, 13:24Hi support
On this site staging.tibladin.dk we also use woocommerce product addon, and we have tried adding your spcial code to the php, but the site fail. I think it's a wrong place we place your code, but couldn't find your suggest for code placement (we use newest woocommerce product addon version). Can you help where to place your code in the php
regards
Ole
Hi support
On this site staging.tibladin.dk we also use woocommerce product addon, and we have tried adding your spcial code to the php, but the site fail. I think it's a wrong place we place your code, but couldn't find your suggest for code placement (we use newest woocommerce product addon version). Can you help where to place your code in the php
regards
Ole
Quote from Pablo Borysenco on May 27, 2024, 10:41Hello Ole
Ok! I added this to the adaptation queue
Hello Ole
Ok! I added this to the adaptation queue
Quote from Pablo Borysenco on May 31, 2024, 17:43Hello Ole
Please do a test
Hello Ole
Please do a test
Quote from skysolution on June 3, 2024, 08:58Hi Pablo
I have tested but would it be possible to always round up ex 10 dkk should be 2 euro and not only 1 euro
where can i find the code for woocommerce product addon, so I can add it to live site
regards
Ole
Hi Pablo
I have tested but would it be possible to always round up ex 10 dkk should be 2 euro and not only 1 euro
where can i find the code for woocommerce product addon, so I can add it to live site
regards
Ole
Quote from Pablo Borysenco on June 3, 2024, 10:44Hello
Please try this - https://currency-switcher.com/hook/woocs_raw_woocommerce_price/
New code:
In file wp-content\plugins\woocommerce-product-addons\includes\class-wc-product-addons-cart.php add next code: https://share.pluginus.net/image/i20240531181742.png
if ($addon['price'] AND class_exists('WOOCS')) {
global $WOOCS;
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$addon['price'] = $addon['price'] * $rate;
}
}Also in the same file add code: https://share.pluginus.net/image/i20240531182106.png
if (class_exists('WOOCS')) {
global $WOOCS;
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$addon_price = $addon_price * $rate;
}
}In file wp-content\plugins\woocommerce-product-addons\includes\class-wc-product-addons-display.php add next code: - https://share.pluginus.net/image/i20240603113834.png
$suffix = ''; //woocs fix
$woocs_is_multiple = 0;
if (class_exists('WOOCS')) {
global $WOOCS;
$woocs_is_multiple = $WOOCS->is_multiple_allowed;
}And on the same file add code: - https://share.pluginus.net/image/i20240603113927.png
'woocs_is_multiple' => $woocs_is_multiple
In file wp-content\plugins\woocommerce-product-addons\assets\js\addons.js add next code: - https://share.pluginus.net/image/i20240531183303.png
var woocs_exists = true;try {if (woocs_current_currency)woocs_exists = true;} catch (e) {woocs_exists = false;}if (woocs_exists) {if (woocs_current_currency != undefined AND woocs_current_currency['rate'] != undefined AND woocommerce_addons_params.woocs_is_multiple == 0) {self.base_price = self.base_price * woocs_current_currency['rate'];}}And on the same file: - https://share.pluginus.net/image/i20240531183404.pngvar woocs_exists = true;try {if (woocs_current_currency)woocs_exists = true;} catch (e) {woocs_exists = false;}if (woocs_exists) {if (woocs_current_currency != undefined AND woocs_current_currency['rate'] != undefined AND addon_cost != undefined) {addon_data.cost = addon_data.cost * woocs_current_currency['rate'];addon_data.cost_raw = addon_data.cost_raw * woocs_current_currency['rate'];}}
Hello
Please try this - https://currency-switcher.com/hook/woocs_raw_woocommerce_price/
New code:
In file wp-content\plugins\woocommerce-product-addons\includes\class-wc-product-addons-cart.php add next code: https://share.pluginus.net/image/i20240531181742.png
if ($addon['price'] AND class_exists('WOOCS')) {
global $WOOCS;
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$addon['price'] = $addon['price'] * $rate;
}
}
Also in the same file add code: https://share.pluginus.net/image/i20240531182106.png
if (class_exists('WOOCS')) {
global $WOOCS;
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency AND $WOOCS->is_multiple_allowed) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$addon_price = $addon_price * $rate;
}
}
In file wp-content\plugins\woocommerce-product-addons\includes\class-wc-product-addons-display.php add next code: - https://share.pluginus.net/image/i20240603113834.png
$suffix = ''; //woocs fix
$woocs_is_multiple = 0;
if (class_exists('WOOCS')) {
global $WOOCS;
$woocs_is_multiple = $WOOCS->is_multiple_allowed;
}
And on the same file add code: - https://share.pluginus.net/image/i20240603113927.png
'woocs_is_multiple' => $woocs_is_multiple
In file wp-content\plugins\woocommerce-product-addons\assets\js\addons.js add next code: - https://share.pluginus.net/image/i20240531183303.png
Quote from Pablo Borysenco on June 3, 2024, 10:45and into file functions.php of the current WordPress theme add next code:
add_filter('woocommerce_product_addons_option_price', function ($price_html, $option, $i, $type) {
if ($price_html AND class_exists('WOOCS')) {
global $WOOCS;$option_price = !empty($option['price']) ? $option['price'] : '';
$option_price_type = !empty($option['price_type']) ? $option['price_type'] : '';
$price_prefix = 0 < $option_price ? '+' : '';
$price_type = $option_price_type;
$price_raw = apply_filters('woocommerce_product_addons_option_price_raw', $option_price, $option);
$price_raw = $WOOCS->woocs_exchange_value($price_raw);
$price_html = '(' . $price_prefix . wc_price(WC_Product_Addons_Helper::get_product_addon_price_for_display($price_raw)) . ')';
}return $price_html;
}, 20, 4);
and into file functions.php of the current WordPress theme add next code:
add_filter('woocommerce_product_addons_option_price', function ($price_html, $option, $i, $type) {
if ($price_html AND class_exists('WOOCS')) {
global $WOOCS;
$option_price = !empty($option['price']) ? $option['price'] : '';
$option_price_type = !empty($option['price_type']) ? $option['price_type'] : '';
$price_prefix = 0 < $option_price ? '+' : '';
$price_type = $option_price_type;
$price_raw = apply_filters('woocommerce_product_addons_option_price_raw', $option_price, $option);
$price_raw = $WOOCS->woocs_exchange_value($price_raw);
$price_html = '(' . $price_prefix . wc_price(WC_Product_Addons_Helper::get_product_addon_price_for_display($price_raw)) . ')';
}
return $price_html;
}, 20, 4);
Quote from skysolution on June 3, 2024, 11:32Hi Pablo
I have tried add this code to function.php, should it be the code for always round up? if so see this product https://staging.tibladin.dk/en/product/dish-in-green-30-cm-tamegroute-ceramic/ 10 dkk is still 1 euro (and not 2)
regards
Ole
Hi Pablo
I have tried add this code to function.php, should it be the code for always round up? if so see this product https://staging.tibladin.dk/en/product/dish-in-green-30-cm-tamegroute-ceramic/ 10 dkk is still 1 euro (and not 2)
regards
Ole
Quote from skysolution on June 3, 2024, 11:37Hi again Pablo
Can see you have added the code other thing that round up, I will try your links
regrads
Ole
Hi again Pablo
Can see you have added the code other thing that round up, I will try your links
regrads
Ole
Quote from Pablo Borysenco on June 3, 2024, 12:40Hello
10 dkk is still 1 euro (and not 2) - Try to enable decimal 2 for EUR - https://share.pluginus.net/image/i20240603133958.png
Hello
10 dkk is still 1 euro (and not 2) - Try to enable decimal 2 for EUR - https://share.pluginus.net/image/i20240603133958.png
Quote from skysolution on June 3, 2024, 14:36Hi Pablo
I found two issue more in the product addons. the price is calculated correct now. but in the product text in SEK it say Ønsker du gaveindpakning?:
Ja tack (+ 23 SEK) (and calculated price is 15 SEK) and in euro it say (+ 0 euro) and calculated to 1
and in this link wp-content\plugins\woocommerce-product-addons\assets\js\addons.js add next code: it should be wp-content\plugins\woocommerce-product-addons\assets\js\frontend/addons.js add next code:
regards
Ole
Hi Pablo
I found two issue more in the product addons. the price is calculated correct now. but in the product text in SEK it say Ønsker du gaveindpakning?:
Ja tack (+ 23 SEK) (and calculated price is 15 SEK) and in euro it say (+ 0 euro) and calculated to 1
and in this link wp-content\plugins\woocommerce-product-addons\assets\js\addons.js add next code: it should be wp-content\plugins\woocommerce-product-addons\assets\js\frontend/addons.js add next code:
regards
Ole
Quote from Pablo Borysenco on June 4, 2024, 09:41Hello Ole
Ok! I will check it
Hello Ole
Ok! I will check it
Quote from Pablo Borysenco on June 7, 2024, 12:36Hello Ole
Ja tack (+ 23 SEK) (and calculated price is 15 SEK) and in euro it say (+ 0 euro) and calculated to 1 - Please drop me exact link to the issue(exact product)
Hello Ole
Ja tack (+ 23 SEK) (and calculated price is 15 SEK) and in euro it say (+ 0 euro) and calculated to 1 - Please drop me exact link to the issue(exact product)
Quote from skysolution on June 7, 2024, 13:03https://tibladin.dk/sv/produkt/strandvaska-shopper-i-flatat-%C2%B7-vanilj/
regards
Ole
https://tibladin.dk/sv/produkt/strandvaska-shopper-i-flatat-%C2%B7-vanilj/
regards
Ole
Quote from Pablo Borysenco on June 7, 2024, 17:06ok! please drop me a link to the issue on test site
ok! please drop me a link to the issue on test site
Quote from Pablo Borysenco on June 7, 2024, 17:54https://staging.tibladin.dk/fr/produit/filet-au-crochet/ - I have tested this product and it seems to work correctly.
https://staging.tibladin.dk/fr/produit/filet-au-crochet/ - I have tested this product and it seems to work correctly.
Quote from skysolution on June 10, 2024, 08:47Hi Pablo
Can see the issue is solved now ??, I have tested 4 products and all is funtioning
thanks
Ole
Hi Pablo
Can see the issue is solved now ??, I have tested 4 products and all is funtioning
thanks
Ole
Quote from Pablo Borysenco on June 10, 2024, 11:23Hello Ole
Great! Welcome;)
Hello Ole
Great! Welcome;)
Quote from skysolution on June 12, 2024, 08:32Hi pablo
My customer have found one more small issue in product addon (minibasket/basket/checkuot is ok)
but in the product page there is a little issue, see
this (you can still use staging, but please tell me what to do on live site)
Hi pablo
My customer have found one more small issue in product addon (minibasket/basket/checkuot is ok)
but in the product page there is a little issue, see
this (you can still use staging, but please tell me what to do on live site) 
Quote from Pablo Borysenco on June 12, 2024, 11:58Hello Ole
Ok! I will check it
Hello Ole
Ok! I will check it
Quote from skysolution on June 20, 2024, 12:20Hi Pablo
I think you have forget this small issue
regards
Ole
Hi Pablo
I think you have forget this small issue
regards
Ole