+++ b/modules/receipt/src/Controller/PrintController.php
@@ -94,19 +101,25 @...

Contribution Date
Technology
Contribution Project
Contribution Details
  1. +++ b/modules/receipt/src/Controller/PrintController.php @@ -94,19 +101,25 @@ class PrintController extends ControllerBase { + $order_date = \Drupal::service('date.formatter')->format($commerce_order->getCompletedTime());

    As best practice, services should be loaded via dependency injection. Sources: https://docs.acquia.com/articles/drupal-8-dependency-injection, https://www.drupal.org/docs/8/api/services-and-dependency-injection/serv...

  2. +++ b/modules/receipt/src/Controller/PrintController.php @@ -94,19 +101,25 @@ class PrintController extends ControllerBase { + $gift_order = '<strong>GIFT ORDER</strong>';

    String translation missing.

  3. +++ b/modules/receipt/src/Controller/PrintController.php @@ -94,19 +101,25 @@ class PrintController extends ControllerBase { + else { + $gift_order = ''; + }

    $gift_order can be defaulted above. Then we won't need this `else` statement.

  4. +++ b/src/Form/POSForm.php @@ -285,6 +292,12 @@ class POSForm extends ContentEntityForm { + if ($form_state->getValue('gift_order')) { + $this->entity->setData('gift_order', TRUE); + } + else { + $this->entity->setData('gift_order', FALSE); + }

    $this->entity->setData('gift_order', $form_state->getValue('gift_order')) maybe?

I will work on them.

Contribution Author
Files count
0
Patches count
0