if(!isset($rate->shipping_params->shipping_virtual_included) || $rate->shipping_params->shipping_virtual_included) {
if($rate->shipping_params->shipping_price_use_tax)
$price = $shipping_prices->all_with_tax;
else
$price = $shipping_prices->all_without_tax;
} else {
if($rate->shipping_params->shipping_price_use_tax)
$price = $shipping_prices->real_with_tax;
else
$price = $shipping_prices->real_without_tax;
}
if($rate->shipping_currency_id != hikashop_getCurrency()){
$rate->shipping_price = $currencyClass->convertUniquePrice($rate->shipping_price, $rate->shipping_currency_id, $rate->shipping_currency_id);
$rate->shipping_currency_id_orig = $rate->shipping_currency_id;
$rate->shipping_currency_id = hikashop_getCurrency();
}
if(bccomp($price, 0, 5) && isset($rate->shipping_params->shipping_percentage) && bccomp($rate->shipping_params->shipping_percentage, 0, 3)){
$rate->shipping_price = $rate->shipping_price + $price * $rate->shipping_params->shipping_percentage / 100;
}
$rate->shipping_price = $currencyClass->round($rate->shipping_price, $currencyClass->getRounding($rate->shipping_currency_id, true));