Contribution Date
Technology
Contribution Project
Contribution Details
-
+++ 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...
-
+++ b/modules/receipt/src/Controller/PrintController.php @@ -94,19 +101,25 @@ class PrintController extends ControllerBase { + $gift_order = '<strong>GIFT ORDER</strong>';
String translation missing.
-
+++ 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. -
+++ 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 Issue Link
Files count
0
Patches count
0