Fix display on amount error

This commit is contained in:
Abhishek Kumar
2023-12-06 14:52:10 +05:30
parent bd34cd9e38
commit 5b77e36408
3 changed files with 7 additions and 3 deletions

View File

@@ -2100,7 +2100,7 @@
<div class="col-lg-9">
<div class="input-group fixed-width-xl">
<span class="input-group-addon">{$currency->sign}</span>
<input type="text" class="fixed-width-xl" name="payment_amount" id="payment_amount" value="{0|string_format:"%.`$smarty.const._PS_PRICE_DISPLAY_PRECISION_`f"}" />
<input type="text" class="fixed-width-xl" name="payment_amount" id="payment_amount" value="{if isset($smarty.post.payment_amount)}{$smarty.post.payment_amount}{else}{0|string_format:"%.`$smarty.const._PS_PRICE_DISPLAY_PRECISION_`f"}{/if}" />
</div>
</span>
</div>

View File

@@ -275,7 +275,7 @@ class AdminOrdersControllerCore extends AdminController
if ($id_cart && Validate::isLoadedObject($cart) && !$cart->id_customer) {
$this->errors[] = $this->l('The cart must have a customer');
}
if (count($this->errors)) {
if (count($this->errors) && !Tools::getValue('submitAddorder')) {
return false;
}
@@ -1010,6 +1010,10 @@ class AdminOrdersControllerCore extends AdminController
Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token.'&conf=3');
}
}
} else {
// if errors render add order form
$_GET['addorder'] = '1';
$_GET['cart_id'] = $id_cart;
}
} else {
$this->errors[] = Tools::displayError('You do not have permission to add this.');

View File

@@ -80,7 +80,7 @@
</div>
</div>
<div class="modal-footer">
<a href="{$link->getAdminLink('AdminOrders')}&amp;addorder&amp;cart_id={$id_cart|escape:'htmlall':'UTF-8'|intval}&amp;guest_id={$id_guest|escape:'htmlall':'UTF-8'|intval}" class="btn btn-primary cart_booking_btn" {if !$total_products_in_cart}disabled="disabled"{/if}>
<a href="{$link->getAdminLink('AdminOrders')}&amp;addorder&amp;cart_id={$id_cart|escape:'htmlall':'UTF-8'|intval}" class="btn btn-primary cart_booking_btn" {if !$total_products_in_cart}disabled="disabled"{/if}>
{l s='Book Now' mod='hotelreservationsystem'}
</a>
<button type="button" class="btn btn-default" data-dismiss="modal">{l s='Close' mod='hotelreservationsystem'}</button>