Commerce add to cart while checkout I would like to add some products to my cart while I am on checkout process. The cart appears to be empty at the time. I want to make a selection of some add-on products on the checkout process.

I created my own custom checkout pane(it's a form). Also a submit function.

There are "commerce_line_items" in the order object, but then I get an error that says my entity is missing bundle. There is also 'commerce_order_total' that includes the totals? so I can't just edit the object/array?

This is how I create my line item:

$line_item = commerce_product_line_item_new($product, 1, $order-&gt;order_id);


This is how I am trying to add it to my order:

$order-&gt;commerce_line_items['und'][] = array('line_item_id' =&gt; $line_item-&gt;line_item_id);
You likely need to save the line item before adding it to the order. The order total should be recomputed for you automatically on save.