Order Total not updating after I change the line item price I have a custom form which on submit creates a new order, loads a product and a custom line item type. I then save the information from the form in the line item. The line item price is updated via a rule which calls a custom PHP function. The problem is when I redirect to checkout/order_id the Order Total is not updated.

I've tried altering the order directly using my order_wrapper and i've also tried using commerce_price_component_add. I tried a rule which called "Save entity" again but nothing seems to be working.

Can somebody give me a point in the right direction on how to get the order total to re-calculate.

Also if anyone has any good examples of creating orders using custom line item types from a custom form that may be helpful
The solution was to use commerce_price_add_component()

    $line_item_wrapper = entity_metadata_wrapper("commerce_line_item", $commerce_line_item);
    $line_item_wrapper-&gt;commerce_unit_price-&gt;data = commerce_price_component_add(
        $line_item_wrapper-&gt;commerce_unit_price-&gt;value(),
        'base_price',
        array(
                'amount' =&gt; $booking_price,
                'currency_code' =&gt; 'AUD',
                'data' =&gt; array(),
        ),
        TRUE
);
}