You are here

function commerce_price_table_form_commerce_product_ui_product_form_alter in Commerce Price Table 7

Implements hook_form_FORM_ID_alter().

1 call to commerce_price_table_form_commerce_product_ui_product_form_alter()
commerce_price_table_ief_inline_entity_form_entity_form_alter in commerce_price_table_ief/commerce_price_table_ief.module
Implements hook_inline_entity_form_entity_form_alter().

File

./commerce_price_table.module, line 545

Code

function commerce_price_table_form_commerce_product_ui_product_form_alter(&$form, &$form_state, $form_id) {
  foreach (commerce_price_table_get_field_instance_settings($form['#entity_type'], $form['#bundle']) as $setting) {
    if (isset($setting['settings']['commerce_price_table']['hide_default_price']) && $setting['settings']['commerce_price_table']['hide_default_price'] == TRUE) {
      $form['commerce_price']['#access'] = FALSE;
      break;
    }
  }
}