Welcome Guest, Not a member yet? Register   Sign In
flexi cart - A comprehensive shopping cart library for CodeIgniter
#97

[eluser]koichirose[/eluser]
Hi haseydesign,

I'm still trying to fix the rounding problem when adding tax data to a cart item.

I set this in the config:
Code:
$config['defaults']['configuration']['price_inc_tax'] = false;

And here's the array I'm passing to your insert_items() function:
Code:
$updated_item_data = array(
  'id' => $product->product_version_option_id,
  'name' => $product->model,
  'price' => $product->rrp_eur_ex_tax,
}

'price' there is 24.785 (I'm trying to save three decimals to see if I can fix it).
Tax rate is 21%, so the price including tax should be 29.98985 => 29.99

This is what I'd like.
For some reason, flexi_cart saves 30.00 internally.

I could change the config and do the calculations myself, but I'd like to understand where this is coming from.

Could you point me to the line where the calculation is made?

I guess it's in flexi_cart_lite_model:545, but I see that there (and in calculate_tax(), above) $value is already 24.79, with just two decimals, so I'm kind of lost and can't find where this rounding is done.

Thank you again!


Messages In This Thread
flexi cart - A comprehensive shopping cart library for CodeIgniter - by El Forum - 02-04-2013, 06:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB