You are here

function commerce_product_bundle_form_alter in Commerce Product Bundle 8

Same name and namespace in other branches
  1. 7.2 commerce_product_bundle.module \commerce_product_bundle_form_alter()
  2. 7 commerce_product_bundle.module \commerce_product_bundle_form_alter()

Implements hook_form_alter().

File

./commerce_product_bundle.module, line 109
Contains commerce_product_bundle.module.

Code

function commerce_product_bundle_form_alter(&$form, FormStateInterface $form_state, $form_id) {

  // Add theme wrapper for the product bundle items add to cart field widget.
  if (strpos($form_id, 'add_to_cart') !== FALSE && substr($form_id, 0, 43) == 'commerce_order_item_commerce_product_bundle') {
    $form['purchased_entity']['#theme_wrappers'] = [
      'container__field__widget_commerce_product_bundle_items',
    ];
  }
}