Fixed::When guest enters invalid order refund reason in order detail page, after clicking the submit button it become disabled and guest can not submit the reason again

This commit is contained in:
sumit panwar
2021-01-28 09:26:59 +05:30
parent 6b7ef21e3a
commit 4980eba2d9
2 changed files with 5 additions and 1 deletions

View File

@@ -204,6 +204,8 @@ class OrderDetailControllerCore extends FrontController
$hasError = 0;
if (!$refundReason = Tools::getValue('cancellation_reason')) {
$hasError = 1;
} elseif (!Validate::isCleanHtml($refundReason)) {
$hasError = 1;
}
if ($bookingRefunds = Tools::getValue('bookings_to_refund')) {
if (!count($bookingRefunds = Tools::jsonDecode($bookingRefunds, true))) {

View File

@@ -236,12 +236,14 @@ $(document).ready(function(){
showOrder(1, $("input[name=id_order]").val(), historyUrl)
} else {
showErrorMessage(refund_request_sending_error);
showErrorMessage(refund_request_sending_error);
$('#submit_refund_reason').attr('disabled', false);
}
$(".loading_overlay").hide();
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
showErrorMessage(textStatus);
$('#submit_refund_reason').attr('disabled', false);
$(".loading_overlay").hide();
}
});