Skip to content

Commit

Permalink
Merge pull request #130 from sameday-courier/SIP-648
Browse files Browse the repository at this point in the history
SIP-648
  • Loading branch information
Soptareanu authored Sep 20, 2024
2 parents 7cc3857 + 7c49afd commit af29ba1
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 10 deletions.
18 changes: 15 additions & 3 deletions samedaycourier.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function __construct()
$this->name = 'samedaycourier';
$this->tab = 'shipping_logistics';

$this->version = '1.7.1';
$this->version = '1.7.2';
$this->author = 'Sameday Courier';
$this->need_instance = 0;
$this->bootstrap = true;
Expand Down Expand Up @@ -2002,13 +2002,25 @@ private function addAwb($order)
);
}

if ('' === $phone = !empty($address->phone_mobile) ? $address->phone_mobile : $address->phone) {
$this->addMessage('danger', [$this->l('Must complete phone number!')]);
}

if ('' === $email = $customer->email ?? '') {
$this->addMessage('danger', [$this->l('Must complete email!')]);
}

if (!empty($this->messages)) {
return null;
}

$recipient = new \Sameday\Objects\PostAwb\Request\AwbRecipientEntityObject(
$address->city,
$stateName,
trim($address->address1 . ' ' . $address->address2),
$address->firstname . ' ' . $address->lastname,
!empty($address->phone_mobile) ? $address->phone_mobile : $address->phone,
$customer->email,
$phone,
$email,
$company,
(!empty($address->postcode)) ? $address->postcode : null
);
Expand Down
2 changes: 1 addition & 1 deletion views/templates/front/checkout_lockers.v16.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<table class="resume table table-bordered">
<tbody>
<tr>
<td>{l s='Select locker' mod='samedaycourier'}</td>
<td>{l s='Select location' mod='samedaycourier'}</td>
<td>
<button type="button"
name="samedaycourier_locker_id"
Expand Down
2 changes: 1 addition & 1 deletion views/templates/front/checkout_lockers.v17.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

{include file='./_partials/checkout_lockers.tpl'}
<div class="col-sm-2">
{l s='Select locker' mod='samedaycourier'}
{l s='Select location' mod='samedaycourier'}
</div>
<div class="col-sm-8">
<button type="button" style="display:inline-block"
Expand Down
4 changes: 2 additions & 2 deletions views/templates/front/checkout_lockers_selector.v16.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
<table class="resume table table-bordered">
<tbody>
<tr>
<td>{l s='Select locker' mod='samedaycourier'}</td>
<td>{l s='Select location' mod='samedaycourier'}</td>
<td>
<select name="samedaycourier_locker_id" id="lockerIdSelector">
<option value=""> {l s='Select locker' mod='samedaycourier'} </option>
<option value=""> {l s='Select location' mod='samedaycourier'} </option>
{foreach from=$lockers key=city item = cityLockers}
<optgroup label="{$city|escape:'htmlall':'UTF-8'}">
{foreach from=$cityLockers item=locker}
Expand Down
4 changes: 2 additions & 2 deletions views/templates/front/checkout_lockers_selector.v17.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
{include file='./_partials/checkout_lockers.tpl'}
{if isset($lockers) }
<div class="col-sm-2">
{l s='Select locker' mod='samedaycourier'}
{l s='Select location' mod='samedaycourier'}
</div>
<div class="col-sm-10">
<select name="samedaycourier_locker_id" class="form-control" id="lockerIdSelector">
<option value=""> {l s='Select locker' mod='samedaycourier'} </option>
<option value=""> {l s='Select location' mod='samedaycourier'} </option>
{foreach from=$lockers key=city item = cityLockers}
<optgroup label="{$city|escape:'htmlall':'UTF-8'}">
{foreach from=$cityLockers item=locker}
Expand Down
2 changes: 1 addition & 1 deletion views/templates/hook/displayAdminOrder.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@
id="select_locker"
style="margin-left: 0px !important; margin-top: 10px;"
>
{l s='Change locker' mod='samedaycourier'}
{l s='Change location' mod='samedaycourier'}
</button>
</div>
</div>
Expand Down

0 comments on commit af29ba1

Please sign in to comment.