updated booking form loader

This commit is contained in:
Shreesh Arora
2022-12-19 18:15:08 +05:30
parent 366950d2d7
commit 8519f8ae0b
9 changed files with 31 additions and 26 deletions

View File

@@ -85,7 +85,7 @@
</td>
<td style="display:none;" class="productQuantity text-center" colspan="2">
{if $order->is_occupnacy_provided}
{if $order->occupnacy_wise_booking}
<div class="booking_occupancy">
<div class="dropdown">
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy disabled" type="button">

View File

@@ -79,7 +79,7 @@
{/if}
</td>
<td class="text-center">
{if $order->is_occupnacy_provided && $data['children']}
{if $order->occupnacy_wise_booking && $data['children']}
<div class="dropdown booking_occupancy_show">
<button class="btn btn-default btn-left btn-block" data-toggle="dropdown" type="button">
<span>{if $data['adult']}{$data['adult']}{/if} {if $data['adult'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
@@ -98,7 +98,7 @@
{else}
<span class="booking_occupancy_show">{if $data['adult']}{$data['adult']}{/if} {if $data['adult'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}</span>
{/if}
{if $order->is_occupnacy_provided}
{if $order->occupnacy_wise_booking}
<div class="booking_occupancy_edit" style="display:none;">
<div class="dropdown">
<button class="booking_guest_occupancy btn btn-default btn-left btn-block input-occupancy" type="button">

View File

@@ -355,7 +355,7 @@ abstract class PaymentModuleCore extends Module
}
// if (Configuration::get('PS_FRONT_SEARCH_TYPE') == HotelBookingDetail::SEARCH_TYPE_OWS) {
// $order->is_occupnacy_provided = 1;
// $order->occupnacy_wise_booking = 1;
// }
// advance payment information

View File

@@ -193,7 +193,7 @@ class OrderCore extends ObjectModel
/**
* @var int is occupancy provided in this order
*/
public $is_occupnacy_provided;
public $occupnacy_wise_booking;
/**
* @see ObjectModel::$definition
@@ -249,7 +249,7 @@ class OrderCore extends ObjectModel
'reference' => array('type' => self::TYPE_STRING),
'is_advance_payment' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
'advance_paid_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice'),
'is_occupnacy_provided' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
'occupnacy_wise_booking' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId', 'default' => 0),
'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'),
),

View File

@@ -1792,7 +1792,7 @@ class AdminOrdersControllerCore extends AdminController
'error' => Tools::displayError('Check out Date Should be after Check In date.'),
)));
}
if ($order->is_occupnacy_provided) {
if ($order->occupnacy_wise_booking) {
if ($occupancy) {
foreach($occupancy as $key =>$roomOccupancy) {
if (!Validate::isUnsignedInt($roomOccupancy['adult'])) {
@@ -1952,7 +1952,7 @@ class AdminOrdersControllerCore extends AdminController
$objCartBookingData->date_from = $date_from;
$objCartBookingData->date_to = $date_to;
if ($order->is_occupnacy_provided) {
if ($order->occupnacy_wise_booking) {
$room_occupancy = array_shift($occupancy);
$objCartBookingData->adult = $room_occupancy['adult'];
$objCartBookingData->children = $room_occupancy['children'];

View File

@@ -1138,7 +1138,7 @@ CREATE TABLE `PREFIX_orders` (
`valid` int(1) unsigned NOT NULL DEFAULT '0',
`is_advance_payment` tinyint(1) NOT NULL DEFAULT '0',
`advance_paid_amount` decimal(20,6) NOT NULL DEFAULT '0.00',
`is_occupnacy_provided` tinyint(1) NOT NULL DEFAULT '0',
`occupnacy_wise_booking` tinyint(1) NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_order`),

View File

@@ -86,11 +86,11 @@
<span>
{if isset($content_only) && $content_only && (isset($product->customization_required) && $product->customization_required)}{l s='Customize'}{else}{l s='Book Now'}{/if}
</span>
<span id="booking_action_loader"></span>
</button>
</p>
{/if}
</div>
<div id="booking_action_loader"><i class="icon-refresh icon-spin"></i></div>
</div>
{else}
<div class="sold_out_alert">

View File

@@ -1358,22 +1358,27 @@ Quick View Styles
#booking_action_block {
position: relative;
}
#booking_action_loader {
display: none;
position: absolute;
top: -15px;
left: -15px;
right: -15px;
bottom: -15px;
border-radius: 0px 0px 4px 4px;
z-index: 1000;
background-color: rgba(0, 0, 0, 0.1);
@keyframes blink {
33%{background-size:calc(100%/3) 0% ,calc(100%/3) 100%,calc(100%/3) 100%}
50%{background-size:calc(100%/3) 100%,calc(100%/3) 0% ,calc(100%/3) 100%}
66%{background-size:calc(100%/3) 100%,calc(100%/3) 100%,calc(100%/3) 0% }
}
#booking_action_loader {
margin: auto;
height: 16px;
width: 50px;
--_circle: no-repeat radial-gradient(circle closest-side,rgb(255, 255, 255) 80%,#0000);
background:
var(--_circle) 0% 50%,
var(--_circle) 50% 50%,
var(--_circle) 100% 50%;
background-size: calc(100%/3) 100%;
animation: blink 1.5s infinite linear;
display: none;
}
#booking_action_loader.active {
font-size: 40px;
display: flex;
justify-content: center;
align-items: center;
display: block;
}
/* room type extra demands container */
.room_demands_container_overlay {

View File

@@ -1230,7 +1230,7 @@ var BookingForm = {
if(BookingForm.currentRequest != null) {
BookingForm.currentRequest.abort();
}
$('.book_now_submit').prop('disabled', true);
$('.book_now_submit').prop('disabled', true).find('span:not(#booking_action_loader)').hide();
$('#booking_action_block').find('#booking_action_loader').addClass('active');
},
success: function(response) {
@@ -1240,7 +1240,7 @@ var BookingForm = {
}
},
complete: function() {
$('.book_now_submit').prop('disabled', false);
$('.book_now_submit').prop('disabled', false).find('span:not(#booking_action_loader)').show();
$('#booking_action_block').find('#booking_action_loader').removeClass('active');
}
});