Commerce add to cart form combined products: how to change default product How can I set for example the mp3 as first item?
Now it takes the products (product reference) from a product display node and display it in order of product creation.

In this example the "CD" was created before "MP3", but I want to be able to always display MP3 before CD.

I use a view with an add to cart field and the option "Attempt to combine like products on the same line item in the cart." checked. 



Solution in my case (thanks Ryan Szrama!):

function mymodule_commerce_product_reference_default_delta_alter(&amp;$delta, $products) {
foreach ($products as $key =&gt; $product) {
    if ($product-&gt;type == 'audio' &amp;&amp; $product-&gt;field_audio_medium[LANGUAGE_NONE][0]['value'] == 'mp3') {
        $delta = $key;
    } elseif ($product-&gt;type == 'video' &amp;&amp; $product-&gt;field_video_medium[LANGUAGE_NONE][0]['value'] == 'mp4') {
        $delta = $key;
    }
}


}
That checkbox you've mentioned is irrelevant, if I understand your request properly. The Add to Cart form assumes whichever product you reference first is the default product when it first builds the form (i.e. it has a product reference field value delta of 0).