Hi,
I think I found the problem.
The issue is that the detailed tax info for each product is not present in the orders. This is not a problem for the normal display once an order is created. However, when an order is modified, the taxes are recalculated based on several things including that detailed tax product information. And that's why the taxes from the products disappear when you set the shipping fee.
This is because the TaxCloud plugin actually provides the taxes to HikaShop when the cart is loaded, but not the detailed tax information for the unit price.
Change the code:
if(!empty($product->prices[0]->unit_price))
$product->prices[0]->unit_price->price_value_with_tax = $product->prices[0]->unit_price->price_value + $item->TaxAmount/$product->cart_product_quantity;
}
to:
if(!empty($product->prices[0]->unit_price)) {
$tu = hikashop_copy($t);
$tu->tax_amount = $tu->tax_amount/$product->cart_product_quantity;
$product->prices[0]->unit_price->taxes[$tu->tax_namekey] = $tu;
$product->prices[0]->unit_price->price_value_with_tax = $product->prices[0]->unit_price->price_value + $tu->tax_amount;
}
in the file plugins/hikashop/taxcloud/taxcloud.php
That way it should properly set the detailed tax information for each product in the new orders that will be created and it should then not be a problem when you modify the order.
Please do the modification and confirm that new orders work properly on your website so that we can include the patch on our end for the next version of HikaShop.