Hi,
Well, you can but that's not a long term solution as you would need to do the change after each update.
It would be better for us to properly understand the situation, in order to add an appropriate patch so that no modification is necessary on your end.
How is the rounding to 1 decimal done on your frontend ?
Is this something you configured in your currency settings ?
Could you provide a screenshot of that ?
What is the status of the setting "round prices during calculations" ?
What is the price of each product and its quantity in the order ?
I've looked into this recalculateFullPrice function's code and I think such code should do the job:
public function recalculateFullPrice(&$order, $products = null) {
//load all the prices and recalculate total
if(empty($products)) {
$query = 'SELECT * FROM '.hikashop_table('order_product').' WHERE order_id = ' . (int)$order->order_id;
$this->database->setQuery($query);
$products = $this->database->loadObjectList();
}
$total = 0.0;
$taxes = array();
$bases = array();
JPluginHelper::importPlugin('hikashop');
$app = JFactory::getApplication();
if(empty($order->old) && !empty($order->order_id)) {
$order->old = $this->get($order->order_id);
}
$old = @$order->old;
$rounding = 2;
$currencyClass = hikashop_get('class.currency');
if(!empty($old->order_currency_id)) {
$rounding = $currencyClass->getRounding($old->order_currency_id, true);
}
foreach($products as $i => $product) {
if($product->order_product_code != 'order additional') {
$app->triggerEvent( 'onBeforeCalculateProductPriceForQuantityInOrder', array( &$products[$i]) );
if(function_exists('hikashop_product_price_for_quantity_in_order')) {
hikashop_product_price_for_quantity_in_order($product);
} else {
$product->order_product_total_price = ((float)$product->order_product_price + (float)$product->order_product_tax) * (int)$product->order_product_quantity;
}
$app->triggerEvent('onAfterCalculateProductPriceForQuantityInOrder', array( &$products[$i]) );
} else {
$product->order_product_total_price = ((float)$product->order_product_price + (float)$product->order_product_tax);
}
$total += $currencyClass->round($product->order_product_total_price, $rounding);
// Recalculate taxes for that product line
if(!empty($product->order_product_tax_info)) {
if(is_string($product->order_product_tax_info))
$product_taxes = hikashop_unserialize($product->order_product_tax_info);
else
$product_taxes = $product->order_product_tax_info;
foreach($product_taxes as $tax) {
if(!isset($taxes[$tax->tax_namekey])) {
$taxes[$tax->tax_namekey] = 0;
$bases[$tax->tax_namekey] = 0;
}
if($product->order_product_code == 'order additional') {
$taxes[$tax->tax_namekey] += (float)@$tax->tax_amount;
$bases[$tax->tax_namekey] += (float)@$tax->amount;
} else {
$taxes[$tax->tax_namekey] += (float)@$tax->tax_amount * $product->order_product_quantity;
$bases[$tax->tax_namekey] += (float)@$tax->amount * $product->order_product_quantity;
}
}
}
}
if(!isset($order->order_discount_price))
$order->order_discount_price = @$old->order_discount_price;
if(!isset($order->order_shipping_price))
$order->order_shipping_price = @$old->order_shipping_price;
if(!isset($order->order_payment_price))
$order->order_payment_price = @$old->order_payment_price;
$additionals = 0 - $currencyClass->round((float)$order->order_discount_price, $round) + $currencyClass->round((float)$order->order_shipping_price, $round) + $currencyClass->round((float)$order->order_payment_price, $round);
$order->order_full_price = $total + $additionals;
if($order->order_full_price < 0 && $total > 0)
$order->order_full_price = 0;
//recalculate total taxes
$config =& hikashop_config();
if(!isset($order->order_tax_info) || empty($order->order_tax_info)) {
if(!empty($old->order_tax_info)) {
$order->order_tax_info = $old->order_tax_info;
} elseif($config->get('detailed_tax_display', 1)) {
$order->order_tax_info = array();
}
}
if(!empty($order->order_tax_info) || $config->get('detailed_tax_display', 1)) {
if(is_string($order->order_tax_info))
$order->order_tax_info = hikashop_unserialize($order->order_tax_info);
if(count($order->order_tax_info)){
foreach($order->order_tax_info as $k => $tax) {
$order->order_tax_info[$k]->todo = true;
}
}
if(!empty($taxes)) {
foreach($taxes as $namekey => $amount) {
$found = false;
foreach($order->order_tax_info as $k => $tax) {
if($tax->tax_namekey == $namekey) {
$tax_additionals = @$tax->tax_amount_for_shipping + @$tax->tax_amount_for_payment - @$tax->tax_amount_for_coupon;
$gross_additionals = $tax_additionals - $order->order_discount_price + $order->order_shipping_price + $order->order_payment_price;
$order->order_tax_info[$k]->tax_amount = $amount + $tax_additionals;
$order->order_tax_info[$k]->amount = $bases[$namekey] + $gross_additionals;
if($order->order_full_price == 0) {
$order->order_tax_info[$k]->tax_amount = 0;
$order->order_tax_info[$k]->amount = 0;
}
unset($order->order_tax_info[$k]->todo);
$found = true;
break;
}
}
if(!$found) {
$obj = new stdClass();
$obj->tax_namekey = $namekey;
$obj->tax_amount = $amount;
$obj->amount = $bases[$namekey];
if($order->order_full_price == 0) {
$obj->tax_amount = 0;
$obj->amount = 0;
}
$order->order_tax_info[$namekey] = $obj;
}
}
}
$unset = array();
foreach($order->order_tax_info as $k => $tax) {
if(isset($tax->todo)) {
$tax_additionals = @$tax->tax_amount_for_shipping + @$tax->tax_amount_for_payment - @$tax->tax_amount_for_coupon;
$gross_additionals = $tax_additionals - $order->order_discount_price + $order->order_shipping_price + $order->order_payment_price;
$order->order_tax_info[$k]->tax_amount = $tax_additionals;
$order->order_tax_info[$k]->amount = $gross_additionals;
if($order->order_full_price == 0) {
$order->order_tax_info[$k]->tax_amount = 0;
$order->order_tax_info[$k]->amount = 0;
}
if(!bccomp(sprintf('%F',$order->order_tax_info[$k]->tax_amount),0,5)) {
$unset[]=$k;
} else {
unset($order->order_tax_info[$k]->todo);
}
}
}
if(!empty($unset)) {
foreach($unset as $u) {
unset($order->order_tax_info[$u]);
}
}
}
}
So you could copy/paste it instead of the current code and see if that helps. But I can't say it will work for sure as I'm not able to reproduce the problem on my end as I don't have yet the necessary information for that.