commerce_product_bundles-8.x-1.0/commerce_product_bundles.post_update.php

commerce_product_bundles.post_update.php
<?php

/**
 * Revert Cart views to include product bundle item.
 */
function commerce_product_bundles_post_update_1() {
  /** @var \Drupal\commerce\Config\ConfigUpdaterInterface $config_updater */
  $config_updater = \Drupal::service('commerce.config_updater');

  $views = [
    'views.view.commerce_cart_block',
    'views.view.commerce_cart_form',
    'views.view.commerce_carts',
  ];
  $result = $config_updater->revert($views, FALSE);

  $success_results = $result->getSucceeded();
  $failure_results = $result->getFailed();
  if ($success_results) {
    $message = t('Succeeded:') . '<br>';
    foreach ($success_results as $success_message) {
      $message .= $success_message . '<br>';
    }
    $message .= '<br>';
  }
  if ($failure_results) {
    $message .= t('Failed:') . '<br>';
    foreach ($failure_results as $failure_message) {
      $message .= $failure_message . '<br>';
    }
  }

  return $message;
}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc