You are here

function commerce_product_post_update_7 in Commerce Core 8.2

Move the variations form to its own tab.

File

modules/product/commerce_product.post_update.php, line 123
Post update functions for Product.

Code

function commerce_product_post_update_7() {
  $entity_type_manager = \Drupal::entityTypeManager();

  /** @var \Drupal\commerce_product\Entity\ProductTypeInterface[] $product_types */
  $product_types = $entity_type_manager
    ->getStorage('commerce_product_type')
    ->loadMultiple();
  foreach ($product_types as $product_type) {
    $form_display = commerce_get_entity_display('commerce_product', $product_type
      ->id(), 'form');
    $form_display
      ->removeComponent('variations');
    $form_display
      ->save();
  }
}