YITH WooCommerce Product Add-Ons
Plugin URL: https://wordpress.org/plugins/yith-woocommerce-product-add-ons/
In file functions.php of the current WordPress theme add next code:
add_filter('yith_wapo_get_addon_price', function ($price, $do, $price_method, $price_type, $index) {
if (class_exists('WOOCS') AND $price > 0 AND 'percentage' !== $price_type AND 'multiplied' !== $price_type) {
global $WOOCS;
$price = $WOOCS->woocs_exchange_value(floatval($price));
}
return $price;
}, 99, 5);
add_filter('yith_wapo_get_addon_sale_price', function ($price, $do, $price_method, $price_type, $index) {
if (class_exists('WOOCS') AND $price > 0 AND 'percentage' !== $price_type AND 'multiplied' !== $price_type) {
global $WOOCS;
$price = $WOOCS->woocs_exchange_value(floatval($price));
}
return $price;
}, 99, 5);
add_filter('yith_wapo_total_item_price', function ($total_options_price) {
if (class_exists('WOOCS') AND $total_options_price) {
global $WOOCS;
if ($WOOCS->is_multiple_allowed) {
$currrent = $WOOCS->current_currency;
if ($currrent != $WOOCS->default_currency) {
$currencies = $WOOCS->get_currencies();
$rate = $currencies[$currrent]['rate'];
$total_options_price = $total_options_price / $rate;
}
}
}
return $total_options_price;
});
