Loading modules/checkout/tests/src/Functional/CheckoutOrderTest.php +14 −11 Changes for modules/checkout/tests/src/Functional/CheckoutOrderTest.php: 14 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\Tests\commerce_checkout\Functional; use Drupal\commerce_price\Price; use Drupal\commerce_store\StoreCreationTrait; use Drupal\Tests\commerce\Functional\CommerceBrowserTestBase; use Drupal\profile\Entity\Profile; Loading Loading @@ -46,6 +47,16 @@ class CheckoutOrderTest extends CommerceBrowserTestBase { 'editor', ]; /** * {@inheritdoc} */ protected function getAdministratorPermissions() { return array_merge([ 'administer commerce_checkout_flow', 'administer views', ], parent::getAdministratorPermissions()); } /** * {@inheritdoc} */ Loading Loading @@ -99,7 +110,9 @@ class CheckoutOrderTest extends CommerceBrowserTestBase { ]); $profile->save(); $order_item = OrderItem::create([ 'type' => 'test', 'type' => 'default', 'quantity' => 2, 'unit_price' => new Price('12.00', 'USD'), ]); $order_item->save(); $order = Order::create([ Loading Loading @@ -142,16 +155,6 @@ class CheckoutOrderTest extends CommerceBrowserTestBase { $this->assertSession()->statusCodeEquals(403); } /** * {@inheritdoc} */ protected function getAdministratorPermissions() { return array_merge([ 'administer commerce_checkout_flow', 'administer views', ], parent::getAdministratorPermissions()); } /** * Tests than an order can go through checkout steps. */ Loading modules/order/commerce_order.libraries.yml +6 −0 Changes for modules/order/commerce_order.libraries.yml: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -3,3 +3,9 @@ form: css: layout: css/commerce_order.module.css: {} total_summary: version: VERSION css: layout: css/commerce_order.total_summary.css: {} modules/order/commerce_order.module +6 −0 Changes for modules/order/commerce_order.module: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -34,6 +34,12 @@ function commerce_order_theme($existing, $type, $theme, $path) { 'billing_information' => NULL, 'shipping_information' => NULL, 'payment_method' => NULL, 'totals' => NULL, ], ], 'commerce_order_total_summary' => [ 'variables' => [ 'totals' => NULL, ], ], ]; Loading modules/order/commerce_order.post_update.php +32 −0 Changes for modules/order/commerce_order.post_update.php: 32 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -86,3 +86,35 @@ function commerce_order_post_update_3() { return $message; } /** * Revert the Order entity view displays. */ function commerce_order_post_update_4() { /** @var \Drupal\commerce\Config\ConfigUpdaterInterface $config_updater */ $config_updater = \Drupal::service('commerce.config_updater'); $views = [ 'core.entity_view_display.commerce_order.default.default', 'core.entity_view_display.commerce_order.default.user', ]; $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; } modules/order/commerce_order.services.yml +5 −1 Changes for modules/order/commerce_order.services.yml: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -34,10 +34,14 @@ services: commerce_order.order_receipt_subscriber: class: Drupal\commerce_order\EventSubscriber\OrderReceiptSubscriber arguments: ['@entity_type.manager', '@language_manager', '@plugin.manager.mail', '@renderer'] arguments: ['@entity_type.manager', '@language_manager', '@plugin.manager.mail', '@commerce_order.order_total_summary', '@renderer'] tags: - { name: 'event_subscriber' } plugin.manager.commerce_adjustment_type: class: Drupal\commerce_order\AdjustmentTypeManager arguments: ['@module_handler', '@cache.discovery'] commerce_order.order_total_summary: class: Drupal\commerce_order\OrderTotalSummary arguments: ['@plugin.manager.commerce_adjustment_type'] Loading
modules/checkout/tests/src/Functional/CheckoutOrderTest.php +14 −11 Changes for modules/checkout/tests/src/Functional/CheckoutOrderTest.php: 14 added lines, 11 removed lines. Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\Tests\commerce_checkout\Functional; use Drupal\commerce_price\Price; use Drupal\commerce_store\StoreCreationTrait; use Drupal\Tests\commerce\Functional\CommerceBrowserTestBase; use Drupal\profile\Entity\Profile; Loading Loading @@ -46,6 +47,16 @@ class CheckoutOrderTest extends CommerceBrowserTestBase { 'editor', ]; /** * {@inheritdoc} */ protected function getAdministratorPermissions() { return array_merge([ 'administer commerce_checkout_flow', 'administer views', ], parent::getAdministratorPermissions()); } /** * {@inheritdoc} */ Loading Loading @@ -99,7 +110,9 @@ class CheckoutOrderTest extends CommerceBrowserTestBase { ]); $profile->save(); $order_item = OrderItem::create([ 'type' => 'test', 'type' => 'default', 'quantity' => 2, 'unit_price' => new Price('12.00', 'USD'), ]); $order_item->save(); $order = Order::create([ Loading Loading @@ -142,16 +155,6 @@ class CheckoutOrderTest extends CommerceBrowserTestBase { $this->assertSession()->statusCodeEquals(403); } /** * {@inheritdoc} */ protected function getAdministratorPermissions() { return array_merge([ 'administer commerce_checkout_flow', 'administer views', ], parent::getAdministratorPermissions()); } /** * Tests than an order can go through checkout steps. */ Loading
modules/order/commerce_order.libraries.yml +6 −0 Changes for modules/order/commerce_order.libraries.yml: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -3,3 +3,9 @@ form: css: layout: css/commerce_order.module.css: {} total_summary: version: VERSION css: layout: css/commerce_order.total_summary.css: {}
modules/order/commerce_order.module +6 −0 Changes for modules/order/commerce_order.module: 6 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -34,6 +34,12 @@ function commerce_order_theme($existing, $type, $theme, $path) { 'billing_information' => NULL, 'shipping_information' => NULL, 'payment_method' => NULL, 'totals' => NULL, ], ], 'commerce_order_total_summary' => [ 'variables' => [ 'totals' => NULL, ], ], ]; Loading
modules/order/commerce_order.post_update.php +32 −0 Changes for modules/order/commerce_order.post_update.php: 32 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -86,3 +86,35 @@ function commerce_order_post_update_3() { return $message; } /** * Revert the Order entity view displays. */ function commerce_order_post_update_4() { /** @var \Drupal\commerce\Config\ConfigUpdaterInterface $config_updater */ $config_updater = \Drupal::service('commerce.config_updater'); $views = [ 'core.entity_view_display.commerce_order.default.default', 'core.entity_view_display.commerce_order.default.user', ]; $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; }
modules/order/commerce_order.services.yml +5 −1 Changes for modules/order/commerce_order.services.yml: 5 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -34,10 +34,14 @@ services: commerce_order.order_receipt_subscriber: class: Drupal\commerce_order\EventSubscriber\OrderReceiptSubscriber arguments: ['@entity_type.manager', '@language_manager', '@plugin.manager.mail', '@renderer'] arguments: ['@entity_type.manager', '@language_manager', '@plugin.manager.mail', '@commerce_order.order_total_summary', '@renderer'] tags: - { name: 'event_subscriber' } plugin.manager.commerce_adjustment_type: class: Drupal\commerce_order\AdjustmentTypeManager arguments: ['@module_handler', '@cache.discovery'] commerce_order.order_total_summary: class: Drupal\commerce_order\OrderTotalSummary arguments: ['@plugin.manager.commerce_adjustment_type']