Help For Tracking Code

works, finally! Thank you so much!!!

You are welcome :)

{$_taxes = 0}
{foreach from=$order_info.taxes item=tax}
{$_taxes = $_taxes + $tax.tax_subtotal}
{/foreach}
{$my_total = $order_info.total - $order_info.shipping_cost - $_taxes}

I am also trying to setup tracking code and used this code above. It did work, however the calculation is wrong because $order_info.shipping_cost already includes tax, so tax for shipping is deducted twice.

Any suggestion how to fix this?

Print our the $order_info array to see if it contains shipping cost without tax or shipping tax in separate element

{$order_info|fn_print_r}
I can confirm that [shipping_cost] => includes tax.

How can I get the shipping cost without tax?

I've marked in bold the information I need to add back into the calculation. Any idea the right code to do this? Thanks.

[taxes] => Array
(
[6] => Array
(
[rate_type] => P
[rate_value] => 20.000
[price_includes_tax] => N
[regnumber] => GB -------------
[priority] => 0
[tax_subtotal] => 8.8
[description] => VAT
[applies] => Array
(
[P_1233026983] => 7.2
[S_0_7] => 1.6
)

)

)

[tax_subtotal] => 8.8
[display_shipping_cost] => 9.6
[profile_update_timestamp] =>
[is_root] =>
[birthday] =>
[purchase_timestamp_from] =>
[purchase_timestamp_to] =>
[responsible_email] =>
[last_passwords] =>
[password_change_timestamp] =>
[api_key] =>
[janrain_identifier] =>
[eu_tax_exempt] =>
[vies_valid] =>
[partner_id] =>
[b_country_descr] => ----------
[s_country_descr] => ----------
[b_state_descr] => ----------
[s_state_descr] => ----------
[need_shipping] => 1
[shipping] => Array
(
[0] => Array
(
[shipping_id] => 7
[shipping] => -------
[delivery_time] =>
[description] =>
[rate_calculation] => M
[service_params] => Array
(
)

[destination] => I
[min_weight] => 0.000
[max_weight] => 0.000
[service_id] => 0
[free_shipping] =>
[module] =>
[service_code] =>
[is_address_required] => Y
[rate_info] => Array
(
[rate_id] => 1170
[shipping_id] => 7
[rate_value] => Array
(
[C] => Array
(
[0] => Array
(
[amount] => 0
[value] => 0
[type] => F
[per_unit] => N
)

[400] => Array
(
[amount] => 400
[value] => 0
[type] => F
[per_unit] => N
)

)

[W] => Array
(
[0] => Array
(
[amount] => 0
[value] => 2.5
[type] => F
[per_unit] => N
)

[0.2] => Array
(
[amount] => 0.2
[value] => 3
[type] => F
[per_unit] => N
)

[0.3] => Array
(
[amount] => 0.3
[value] => 4
[type] => F
[per_unit] => N
)

[1] => Array
(
[amount] => 1
[value] => 8
[type] => F
[per_unit] => N
)

[10] => Array
(
[amount] => 10
[value] => 10
[type] => F
[per_unit] => N
)

[15] => Array
(
[amount] => 15
[value] => 12.5
[type] => F
[per_unit] => N
)

[20] => Array
(
[amount] => 20
[value] => 15
[type] => F
[per_unit] => N
)

[40] => Array
(
[amount] => 40
[value] => 20
[type] => F
[per_unit] => N
)

[60] => Array
(
[amount] => 60
[value] => 30
[type] => F
[per_unit] => N
)

)

)

[destination_id] => 9
)

[image] => Array
(
)

[group_key] => 0
[rate] => 8
[taxes] => Array
(
[6] => Array
(
[rate_type] => P
[rate_value] => 20.000
[price_includes_tax] => N
[regnumber] => GB ---------
[priority] => 0
[tax_subtotal] => 1.6
[description] => VAT
)

)

[taxed_price] => 9.6
[inc_tax] => 1
[group_name] =>--------------
[need_shipment] => 1
)

)