Product Attributes Commerce I am moving my site from Ubercart to Commerce. I currently have some products set up with attributes that can be selected by a customer, please see this URL for an example http://www.wild-sage.co.uk/products/soap-box 

How would I go about setting this up using Commerce?
Instead of dropdowns, you could use checkboxes and line item fields using Commerce custom products module.

All fields are supported as customer-facing line item fields, except some entity reference fields that use views to display their options. Note, the only limitation here would be that your fields would need to be able to react to the specific product. 

Customizable products are like content types and define fields per bundle. So you would need a bundle per unique set of requirements. There is no limit, but it would probably be easier to model the "selection criteria" using fields on the products and then create a hook_form_alter() that would change the options available to select.



UPDATE: Code Example

Assumption 1: You've created a custom line item bundle

Assumption 2: You've created two fields. The first for the line item options (this would include all possibilities) and the second would be for the product (this would include any possibilities that match what that kind of product should have, doesn't need to be a complete list, but it would need to be the same ids/values of the first field).

Assumption 3: The workflow would look like this:




  select the soaps you would want to show PER product


Now, on the product display you would see this:



&lt;?php
function MODULE_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if (strpos($form_id, 'commerce_cart_add_to_cart_form_') === 0) {
    $product = $form_state['default_product'];
    $show_these = $product-&gt;field_include_these_soaps['und'];
    $all_soap_options = $form['line_item_fields']['field_soaps']['und']['#options'];
    $only_show = array();
    foreach ($show_these as $key =&gt; $value) {
      $real_key = $value['value'];
      $only_show[$real_key] = $all_soap_options[$real_key];
    }
    $form['line_item_fields']['field_soaps']['und']['#options'] = $only_show;
  }
}
?&gt;