You are here

function _commerce_webform_conditional_operator_info in Commerce Webform 8

Same name and namespace in other branches
  1. 7.2 productfield.inc \_commerce_webform_conditional_operator_info()

Define conditional operators for productfields.

1 call to _commerce_webform_conditional_operator_info()
commerce_webform_webform_conditional_operator_info in ./commerce_webform.module
Implements hook_webform_conditional_operator_info().

File

./productfield.inc, line 756

Code

function _commerce_webform_conditional_operator_info() {
  $operators = array();
  $operators['productfield']['product_is'] = array(
    'label' => t('is a product'),
    'comparison callback' => 'webform_conditional_operator_product_is',
    'js comparison callback' => 'conditionalOperatorProductEqual',
    'form callback' => 'commerce_webform_conditional_product_select',
  );
  $operators['productfield']['product_is_not'] = array(
    'label' => t('is not a product'),
    'comparison callback' => 'webform_conditional_operator_product_is_not',
    'js comparison callback' => 'conditionalOperatorProductNotEqual',
    'form callback' => 'commerce_webform_conditional_product_select',
  );
  $operators['productfield']['product_is_of_type'] = array(
    'label' => t('is a product of type'),
    'comparison callback' => 'webform_conditional_operator_product_is_of_type',
    'js comparison callback' => 'conditionalOperatorProductOfType',
    'form callback' => 'commerce_webform_conditional_product_type_select',
    'comparison prepare js' => 'webform_conditional_prepare_productfield_type_js',
  );
  $operators['productfield']['product_is_not_of_type'] = array(
    'label' => t('is not a product of type'),
    'comparison callback' => 'webform_conditional_operator_product_is_not_of_type',
    'js comparison callback' => 'conditionalOperatorProductNotOfType',
    'form callback' => 'commerce_webform_conditional_product_type_select',
    'comparison prepare js' => 'webform_conditional_prepare_productfield_type_js',
  );
  $operators['productfield']['quantity_equals'] = array(
    'label' => t('total quantity is equal to'),
    'comparison callback' => 'webform_conditional_operator_product_quantity_equals',
    'js comparison callback' => 'conditionalOperatorProductQuantityEquals',
  );
  $operators['productfield']['quantity_less_than'] = array(
    'label' => t('total quantity is less than'),
    'comparison callback' => 'webform_conditional_operator_product_quantity_less_than',
    'js comparison callback' => 'conditionalOperatorProductQuantityLessThan',
  );
  $operators['productfield']['quantity_greater_than'] = array(
    'label' => t('total quantity is greater than'),
    'comparison callback' => 'webform_conditional_operator_product_quantity_greater_than',
    'js comparison callback' => 'conditionalOperatorProductQuantityGreaterThan',
  );
  return $operators;
}