Skip to content

Commit

Permalink
Display customer email on order edit page
Browse files Browse the repository at this point in the history
  • Loading branch information
sampoyigi committed Apr 24, 2020
1 parent c349128 commit 3b3caab
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/admin/models/config/orders_model.php
Expand Up @@ -219,7 +219,7 @@
],
'location[location_name]' => [
'label' => 'lang:admin::lang.orders.text_restaurant',
'type' => 'text',
'type' => 'location',
'disabled' => TRUE,
'span' => 'right',
'placeholder' => 'lang:admin::lang.text_please_select',
Expand All @@ -240,9 +240,9 @@
'span' => 'left',
'cssClass' => 'flex-width',
],
'customer_name' => [
'label' => 'lang:admin::lang.orders.label_customer_name',
'type' => 'text',
'customer[full_name]' => [
'label' => 'lang:admin::lang.orders.text_customer',
'type' => 'customer',
'disabled' => TRUE,
'span' => 'right',
],
Expand Down
16 changes: 16 additions & 0 deletions app/admin/views/orders/form/field_customer.php
@@ -0,0 +1,16 @@
<?php $fieldValue = sprintf('%s (%s)', $formModel->customer_name, $formModel->email); ?>
<?php if ($this->previewMode) { ?>
<p class="form-control-static"><?= $fieldValue ? e($fieldValue) : '&nbsp;' ?></p>
<?php } else { ?>
<input
type="text"
name="<?= $field->getName() ?>"
id="<?= $field->getId() ?>"
value="<?= e($fieldValue) ?>"
placeholder="<?= e($field->placeholder) ?>"
class="form-control"
autocomplete="off"
<?= $field->hasAttribute('maxlength') ? '' : 'maxlength="255"' ?>
<?= $field->getAttributes() ?>
/>
<?php } ?>
19 changes: 19 additions & 0 deletions app/admin/views/orders/form/field_location.php
@@ -0,0 +1,19 @@
<?php
$location = $formModel->location;
$fieldValue = sprintf('%s (%s)', $location->location_name, format_address($location->getAddress(), false));
?>
<?php if ($this->previewMode) { ?>
<p class="form-control-static"><?= $fieldValue ? e($fieldValue) : '&nbsp;' ?></p>
<?php } else { ?>
<input
type="text"
name="<?= $field->getName() ?>"
id="<?= $field->getId() ?>"
value="<?= e($fieldValue) ?>"
placeholder="<?= e($field->placeholder) ?>"
class="form-control"
autocomplete="off"
<?= $field->hasAttribute('maxlength') ? '' : 'maxlength="255"' ?>
<?= $field->getAttributes() ?>
/>
<?php } ?>

0 comments on commit 3b3caab

Please sign in to comment.