You are here

function commerce_webform_conditional_product_type_select in Commerce Webform 7.2

Same name and namespace in other branches
  1. 8 productfield.inc \commerce_webform_conditional_product_type_select()

Webform conditional form callback.

1 string reference to 'commerce_webform_conditional_product_type_select'
_commerce_webform_conditional_operator_info in ./productfield.inc
Define conditional operators for productfields.

File

./productfield.inc, line 987

Code

function commerce_webform_conditional_product_type_select($node) {
  $forms = array();
  webform_component_include('productfield');
  foreach ($node->webform['components'] as $cid => $component) {
    if (webform_component_property($component['type'], 'conditional_type') == 'productfield') {
      $options = commerce_product_type_options_list();
      $element = array(
        '#type' => 'select',
        '#multiple' => FALSE,
        '#size' => NULL,
        '#attributes' => array(),
        '#id' => NULL,
        '#name' => NULL,
        '#options' => $options,
        '#parents' => array(),
      );
      $forms[$cid] = drupal_render($element);
    }
  }
  return $forms;
}