You are here

function commerce_option_set_reference_field_formatter_view in Commerce Product Option 7

File

option_set_reference/commerce_option_set_reference.module, line 71

Code

function commerce_option_set_reference_field_formatter_view($entity_type, $object, $field, $instance, $langcode, $items, $display) {
  $result = array();

  // Collect the list of product IDs.
  $product_ids = array();
  if ($display['type'] == 'commerce_option_set_reference_form') {

    /*foreach ($items as $delta => $item) {

          $option_set = commerce_option_set_load($item['set_id']);

          if(is_array($option_set)) {
            // Create new option:
            $option = entity_create('commerce_option', array('set_id' => $option_set['set_id']));
          }
        }*/
  }
  if ($display['type'] == 'commerce_option_set_reference_attribute_view') {
    foreach ($items as $delta => $item) {
      $option_set = commerce_option_set_load($item['set_id']);
      if (is_array($option_set)) {
      }
    }
  }
  return $result;
}