Hi,
I've been looking at the api and testing things out but can't seem to be able to remove a line item from an order after it is added but before the order is saved. For example, I'd like to be able to create sub products such that, you can only purchase product B if you have purchased product A. These items would be linked via an entity reference field or something.

The closest hook I found was hook_commerce_order_presave, and I can remove the line item so it is not stored in the field_data table but the other commerce field data tables (total, price, product, etc) still get populated with data.

Thanks.