Update design of customer order detail page

This commit is contained in:
Abhishek Kumar
2024-02-26 20:01:39 +05:30
parent 9af78bcf14
commit 154e74fd5d
21 changed files with 3083 additions and 2027 deletions

View File

@@ -105,6 +105,58 @@ class GuestTrackingControllerCore extends FrontController
}
}
public function displayAjaxGetRoomTypeBookingDemands()
{
$response = array('extra_demands' => false);
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objHotelBookingDemands = new HotelBookingDemands();
$useTax = 0;
if (Group::getPriceDisplayMethod($this->context->customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
}
if ($extraDemands = $objHotelBookingDemands->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
0,
$dateFrom,
$dateTo,
1,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'extraDemands' => $extraDemands,
));
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
}
$this->ajaxDie(json_encode($response));
}
/**
* Assign template vars related to page content
* @see FrontController::initContent()
@@ -113,60 +165,6 @@ class GuestTrackingControllerCore extends FrontController
{
parent::initContent();
$method = Tools::getValue('method');
if ($method == 'getRoomTypeBookingDemands') {
$response = array('reload' => false);
$extraDemandsTpl = '';
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objBookingDemand = new HotelBookingDemands();
$customer = new Customer((int)$order->id_customer);
$useTax = 0;
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
}
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
0,
$dateFrom,
$dateTo,
1,
0,
$useTax
)) {
$this->context->smarty->assign(
array(
'useTax' => $useTax,
'extraDemands' => $extraDemands,
)
);
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
}
$this->ajaxDie(json_encode($response));
}
/* Handle brute force attacks */
if (count($this->errors)) {
sleep(1);
@@ -207,224 +205,258 @@ class GuestTrackingControllerCore extends FrontController
$nonRequestedRooms = 0;
$anyBackOrder = 0;
$processedProducts = array();
$cartHotelData = array();
}
foreach ($order_list as &$order) {
$idOrder = $order->id;
/** @var Order $order */
$order->id_order_state = (int)$order->getCurrentState();
$order->invoice = (OrderState::invoiceAvailable((int)$order->id_order_state) && $order->invoice_number);
$order->order_history = $order->getHistory((int)$this->context->language->id, false, true);
$order->carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
$order->address_invoice = new Address((int)$order->id_address_invoice);
$order->address_delivery = new Address((int)$order->id_address_delivery);
$order->inv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_invoice->id_country);
$order->dlv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_delivery->id_country);
$order->invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_invoice, $order->inv_adr_fields);
$order->deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_delivery, $order->dlv_adr_fields);
$order->currency = new Currency($order->id_currency);
$order->discounts = $order->getCartRules();
$order->invoiceState = (Validate::isLoadedObject($order->address_invoice) && $order->address_invoice->id_state) ? new State((int)$order->address_invoice->id_state) : false;
$order->deliveryState = (Validate::isLoadedObject($order->address_delivery) && $order->address_delivery->id_state) ? new State((int)$order->address_delivery->id_state) : false;
$order->products = $order->getProducts();
$order->customizedDatas = Product::getAllCustomizedDatas((int)$order->id_cart);
Product::addCustomizationPrice($order->products, $order->customizedDatas);
$order->total_old = $order->total_discounts > 0 ? (float)$order->total_paid - (float)$order->total_discounts : false;
foreach ($order_list as &$order) {
$idOrder = $order->id;
if ($order->carrier->url && $order->shipping_number) {
$order->followup = str_replace('@', $order->shipping_number, $order->carrier->url);
}
$order->hook_orderdetaildisplayed = Hook::exec('displayOrderDetail', array('order' => $order));
$processedProducts = array();
$cartHotelData = array();
// enter the details of the booking the order
if ($hotelresInstalled) {
if ($orderProducts = $order->getProducts()) {
$total_demands_price_te = 0;
$total_demands_price_ti = 0;
$total_convenience_fee_te = 0;
$total_convenience_fee_ti = 0;
foreach ($orderProducts as $type_key => $type_value) {
if (in_array($type_value['product_id'], $processedProducts)) {
continue;
}
if ($type_value['is_booking_product']) {
$processedProducts[] = $type_value['product_id'];
$order->id_order_state = (int)$order->getCurrentState();
$order->invoice = (OrderState::invoiceAvailable((int)$order->id_order_state) && $order->invoice_number);
$order->order_history = $order->getHistory((int)$this->context->language->id, false, true);
$order->carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
$order->address_invoice = new Address((int)$order->id_address_invoice);
$order->address_delivery = new Address((int)$order->id_address_delivery);
$order->inv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_invoice->id_country);
$order->dlv_adr_fields = AddressFormat::getOrderedAddressFields($order->address_delivery->id_country);
$order->invoiceAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_invoice, $order->inv_adr_fields);
$order->deliveryAddressFormatedValues = AddressFormat::getFormattedAddressFieldsValues($order->address_delivery, $order->dlv_adr_fields);
$order->currency = new Currency($order->id_currency);
$order->discounts = $order->getCartRules();
$order->invoiceState = (Validate::isLoadedObject($order->address_invoice) && $order->address_invoice->id_state) ? new State((int)$order->address_invoice->id_state) : false;
$order->deliveryState = (Validate::isLoadedObject($order->address_delivery) && $order->address_delivery->id_state) ? new State((int)$order->address_delivery->id_state) : false;
$order->products = $order->getProducts();
$order->customizedDatas = Product::getAllCustomizedDatas((int)$order->id_cart);
Product::addCustomizationPrice($order->products, $order->customizedDatas);
$order->total_old = $order->total_discounts > 0 ? (float)$order->total_paid - (float)$order->total_discounts : false;
$product = new Product($type_value['product_id'], false, $this->context->language->id);
$cover_image_arr = $product->getCover($type_value['product_id']);
if ($order->carrier->url && $order->shipping_number) {
$order->followup = str_replace('@', $order->shipping_number, $order->carrier->url);
}
$order->hook_orderdetaildisplayed = Hook::exec('displayOrderDetail', array('order' => $order));
if (!empty($cover_image_arr)) {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
} else {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
// enter the details of the booking the order
if ($hotelresInstalled) {
if ($orderProducts = $order->getProducts()) {
$total_demands_price_te = 0;
$total_demands_price_ti = 0;
$total_convenience_fee_te = 0;
$total_convenience_fee_ti = 0;
foreach ($orderProducts as $type_key => $type_value) {
if (in_array($type_value['product_id'], $processedProducts)) {
continue;
}
if ($type_value['is_booking_product']) {
$processedProducts[] = $type_value['product_id'];
if (isset($customer->id)) {
$obj_cart = new Cart($order->id_cart);
$order_bk_data = $objBookingDetail->getOnlyOrderBookingData($order->id, $obj_cart->id_guest, $type_value['product_id'], $customer->id);
} else {
$order_bk_data = $objBookingDetail->getOnlyOrderBookingData($order->id, $customer->id_guest, $type_value['product_id']);
}
$cartHotelData[$type_key]['id_product'] = $type_value['product_id'];
$cartHotelData[$type_key]['cover_img'] = $cover_img;
$product = new Product($type_value['product_id'], false, $this->context->language->id);
$cover_image_arr = $product->getCover($type_value['product_id']);
$objBookingDemand = new HotelBookingDemands();
foreach ($order_bk_data as $data_k => $data_v) {
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
$cartHotelData[$type_key]['adults'] = $data_v['adults'];
$cartHotelData[$type_key]['children'] = $data_v['children'];
/*Product price when order was created*/
$order_details_obj = new OrderDetail($data_v['id_order_detail']);
$cartHotelData[$type_key]['name'] = $order_details_obj->product_name;
$cartHotelData[$type_key]['paid_unit_price_tax_excl'] = ($order_details_obj->total_price_tax_excl)/$order_details_obj->product_quantity;
$cartHotelData[$type_key]['paid_unit_price_tax_incl'] = ($order_details_obj->total_price_tax_incl)/$order_details_obj->product_quantity;
if (isset($cartHotelData[$type_key]['date_diff'][$date_join])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
$num_days = $cartHotelData[$type_key]['date_diff'][$date_join]['num_days'];
$var_quant = (int) $cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'];
$cartHotelData[$type_key]['date_diff'][$date_join]['adults'] += $data_v['adults'];
$cartHotelData[$type_key]['date_diff'][$date_join]['children'] += $data_v['children'];
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += $data_v['total_price_tax_excl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['is_backorder'] = $data_v['is_back_order'];
if ($data_v['is_back_order']) {
$anyBackOrder = 1;
}
if ($data_v['is_refunded']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1;
}
if ($data_v['is_cancelled']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1;
}
if (!empty($cover_image_arr)) {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
} else {
$num_days = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['data_form'] = $data_v['date_from'];
$cartHotelData[$type_key]['date_diff'][$date_join]['data_to'] = $data_v['date_to'];
$cartHotelData[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['adults'] = $data_v['adults'];
$cartHotelData[$type_key]['date_diff'][$date_join]['children'] = $data_v['children'];
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
}
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] = $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = $data_v['total_price_tax_incl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_excl'] = $data_v['total_price_tax_excl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['is_backorder'] = $data_v['is_back_order'];
if ($data_v['is_back_order']) {
$anyBackOrder = 1;
if (isset($customer->id)) {
$obj_cart = new Cart($order->id_cart);
$order_bk_data = $objBookingDetail->getOnlyOrderBookingData($order->id, $obj_cart->id_guest, $type_value['product_id'], $customer->id);
} else {
$order_bk_data = $objBookingDetail->getOnlyOrderBookingData($order->id, $customer->id_guest, $type_value['product_id']);
}
$cartHotelData[$type_key]['id_product'] = $type_value['product_id'];
$cartHotelData[$type_key]['cover_img'] = $cover_img;
$objBookingDemand = new HotelBookingDemands();
foreach ($order_bk_data as $data_k => $data_v) {
$date_join = strtotime($data_v['date_from']).strtotime($data_v['date_to']);
$cartHotelData[$type_key]['adults'] = $data_v['adults'];
$cartHotelData[$type_key]['children'] = $data_v['children'];
/*Product price when order was created*/
$order_details_obj = new OrderDetail($data_v['id_order_detail']);
$cartHotelData[$type_key]['name'] = $order_details_obj->product_name;
$cartHotelData[$type_key]['paid_unit_price_tax_excl'] = ($order_details_obj->total_price_tax_excl)/$order_details_obj->product_quantity;
$cartHotelData[$type_key]['paid_unit_price_tax_incl'] = ($order_details_obj->total_price_tax_incl)/$order_details_obj->product_quantity;
if (isset($cartHotelData[$type_key]['date_diff'][$date_join])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] += 1;
$num_days = $cartHotelData[$type_key]['date_diff'][$date_join]['num_days'];
$var_quant = (int) $cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'];
$cartHotelData[$type_key]['date_diff'][$date_join]['adults'] += $data_v['adults'];
$cartHotelData[$type_key]['date_diff'][$date_join]['children'] += $data_v['children'];
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] += $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] += $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_incl'] += $data_v['total_price_tax_incl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_excl'] += $data_v['total_price_tax_excl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['is_backorder'] = $data_v['is_back_order'];
if ($data_v['is_back_order']) {
$anyBackOrder = 1;
}
if ($data_v['is_refunded']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1;
}
if ($data_v['is_cancelled']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1;
}
} else {
$num_days = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']);
$cartHotelData[$type_key]['date_diff'][$date_join]['num_rm'] = 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['data_form'] = $data_v['date_from'];
$cartHotelData[$type_key]['date_diff'][$date_join]['data_to'] = $data_v['date_to'];
$cartHotelData[$type_key]['date_diff'][$date_join]['num_days'] = $num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['adults'] = $data_v['adults'];
$cartHotelData[$type_key]['date_diff'][$date_join]['children'] = $data_v['children'];
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'] = $data_v['total_price_tax_excl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'] = $data_v['total_price_tax_incl']/$num_days;
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_excl'] = $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_excl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['avg_paid_unit_price_tax_incl'] = $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_incl'] = $data_v['total_price_tax_incl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['amount_tax_excl'] = $data_v['total_price_tax_excl'];
$cartHotelData[$type_key]['date_diff'][$date_join]['is_backorder'] = $data_v['is_back_order'];
if ($data_v['is_back_order']) {
$anyBackOrder = 1;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] = 0;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] = 0;
if ($data_v['is_refunded']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1;
}
if ($data_v['is_cancelled']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1;
}
}
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] = 0;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] = 0;
if ($data_v['is_refunded']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['is_refunded'] = $data_v['is_refunded'];
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id'];
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to']
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = 0;
}
if ($data_v['is_cancelled']) {
$cartHotelData[$type_key]['date_diff'][$date_join]['count_cancelled'] += 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['count_refunded'] -= 1;
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] += $extraDemandPriceTI = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$type_value['product_id'],
$data_v['id_room'],
$data_v['date_from'],
$data_v['date_to'],
0,
1,
1
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_te'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] += $extraDemandPriceTE = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$type_value['product_id'],
$data_v['id_room'],
$data_v['date_from'],
$data_v['date_to'],
0,
1,
0
);
$total_demands_price_ti += $extraDemandPriceTI;
$total_demands_price_te += $extraDemandPriceTE;
$cartHotelData[$type_key]['date_diff'][$date_join]['product_price_tax_excl'] = $order_details_obj->unit_price_tax_excl;
$cartHotelData[$type_key]['date_diff'][$date_join]['product_price_tax_incl'] = $order_details_obj->unit_price_tax_incl;
$cartHotelData[$type_key]['date_diff'][$date_join]['product_price_without_reduction_tax_excl'] = $order_details_obj->unit_price_tax_excl + $order_details_obj->reduction_amount_tax_excl;
$cartHotelData[$type_key]['date_diff'][$date_join]['product_price_without_reduction_tax_incl'] = $order_details_obj->unit_price_tax_incl + $order_details_obj->reduction_amount_tax_incl;
$feature_price_diff = (float)($cartHotelData[$type_key]['date_diff'][$date_join]['product_price_without_reduction_tax_incl'] - $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl']);
$cartHotelData[$type_key]['date_diff'][$date_join]['feature_price_diff'] = $feature_price_diff;
$cartHotelData[$type_key]['hotel_name'] = $data_v['hotel_name'];
// add additional services products in hotel detail.
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to']
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_ti'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_ti'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_ti'] += $additionalServicesPriceTI = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_te'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_te'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_te'] += $additionalServicesPriceTE = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0
);
// get auto added price to be displayed with room price
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
}
$cartHotelData[$type_key]['date_diff'][$date_join]['is_refunded'] = $data_v['is_refunded'];
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id'];
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$type_value['product_id'],
0,
$data_v['date_from'],
$data_v['date_to']
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_ti'] += $extraDemandPriceTI = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$type_value['product_id'],
$data_v['id_room'],
$data_v['date_from'],
$data_v['date_to'],
0,
1,
1
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_te'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands_price_te'] += $extraDemandPriceTE = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$type_value['product_id'],
$data_v['id_room'],
$data_v['date_from'],
$data_v['date_to'],
0,
1,
0
);
$total_demands_price_ti += $extraDemandPriceTI;
$total_demands_price_te += $extraDemandPriceTE;
$cartHotelData[$type_key]['date_diff'][$date_join]['product_price_tax_excl'] = $order_details_obj->unit_price_tax_excl;
$cartHotelData[$type_key]['date_diff'][$date_join]['product_price_tax_incl'] = $order_details_obj->unit_price_tax_incl;
$cartHotelData[$type_key]['date_diff'][$date_join]['product_price_without_reduction_tax_excl'] = $order_details_obj->unit_price_tax_excl + $order_details_obj->reduction_amount_tax_excl;
$cartHotelData[$type_key]['date_diff'][$date_join]['product_price_without_reduction_tax_incl'] = $order_details_obj->unit_price_tax_incl + $order_details_obj->reduction_amount_tax_incl;
$feature_price_diff = (float)($cartHotelData[$type_key]['date_diff'][$date_join]['product_price_without_reduction_tax_incl'] - $cartHotelData[$type_key]['date_diff'][$date_join]['paid_unit_price_tax_incl']);
$cartHotelData[$type_key]['date_diff'][$date_join]['feature_price_diff'] = $feature_price_diff;
$cartHotelData[$type_key]['hotel_name'] = $data_v['hotel_name'];
// add additional services products in hotel detail.
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services'] = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to']
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_ti'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_ti'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_ti'] += $additionalServicesPriceTI = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_te'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_te'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_te'] += $additionalServicesPriceTE = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0
);
// get auto added price to be displayed with room price
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = 0;
@@ -458,121 +490,92 @@ class GuestTrackingControllerCore extends FrontController
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
}
// get auto added price to be displayed with room price
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_ti'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
1,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
if (empty($cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'])) {
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] = 0;
}
$cartHotelData[$type_key]['date_diff'][$date_join]['additional_services_price_auto_add_te'] += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$type_value['product_id'],
$data_v['date_from'],
$data_v['date_to'],
$data_v['id_room'],
1,
0,
1,
Product::PRICE_ADDITION_TYPE_WITH_ROOM
);
// calculate averages now
foreach ($cartHotelData[$type_key]['date_diff'] as $key => &$value) {
$value['avg_paid_unit_price_tax_excl'] = Tools::ps_round($value['avg_paid_unit_price_tax_excl'] / $value['num_rm'], 6);
$value['avg_paid_unit_price_tax_incl'] = Tools::ps_round($value['avg_paid_unit_price_tax_incl'] / $value['num_rm'], 6);
// calculate averages now
foreach ($cartHotelData[$type_key]['date_diff'] as $key => &$value) {
$value['avg_paid_unit_price_tax_excl'] = Tools::ps_round($value['avg_paid_unit_price_tax_excl'] / $value['num_rm'], 6);
$value['avg_paid_unit_price_tax_incl'] = Tools::ps_round($value['avg_paid_unit_price_tax_incl'] / $value['num_rm'], 6);
$value['avg_price_diff_tax_excl'] = abs(Tools::ps_round($value['avg_paid_unit_price_tax_excl'] - $value['product_price_tax_excl'], 6));
$value['avg_price_diff_tax_incl'] = abs(Tools::ps_round($value['avg_paid_unit_price_tax_incl'] - $value['product_price_tax_incl'], 6));
}
} else if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_WITH_ROOMTYPE) {
if ($type_value['product_auto_add'] && $type_value['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT) {
$total_convenience_fee_ti += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
$type_value['product_id'],
0,
0,
0,
0,
0,
1,
1,
1
);
$total_convenience_fee_te += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
$type_value['product_id'],
0,
0,
0,
0,
0,
1,
0,
1
);
}
} else {
// get all products that are independent.
if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
$product = new Product($type_value['product_id'], false, $this->context->language->id);
$cover_image_arr = $product->getCover($type_value['product_id']);
if (!empty($cover_image_arr)) {
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
} else {
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
$value['avg_price_diff_tax_excl'] = abs(Tools::ps_round($value['avg_paid_unit_price_tax_excl'] - $value['product_price_tax_excl'], 6));
$value['avg_price_diff_tax_incl'] = abs(Tools::ps_round($value['avg_paid_unit_price_tax_incl'] - $value['product_price_tax_incl'], 6));
}
} else if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_WITH_ROOMTYPE) {
if ($type_value['product_auto_add'] && $type_value['product_price_addition_type'] == Product::PRICE_ADDITION_TYPE_INDEPENDENT) {
$total_convenience_fee_ti += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
$type_value['product_id'],
0,
0,
0,
0,
0,
1,
1,
1
);
$total_convenience_fee_te += $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
$type_value['product_id'],
0,
0,
0,
0,
0,
1,
0,
1
);
}
} else {
// get all products that are independent.
if ($type_value['product_service_type'] == Product::SERVICE_PRODUCT_WITHOUT_ROOMTYPE) {
$product = new Product($type_value['product_id'], false, $this->context->language->id);
$cover_image_arr = $product->getCover($type_value['product_id']);
if (!empty($cover_image_arr)) {
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
} else {
$type_value['cover_img'] = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
}
$cartServiceProducts[] = $type_value;
}
$cartServiceProducts[] = $type_value;
}
}
}
}
// end booking details entries
$redirectTermsLink = $this->context->link->getCMSLink(
new CMS(3, $this->context->language->id),
null, $this->context->language->id
);
$customerGuestDetail = false;
if ($id_customer_guest_detail = OrderCustomerGuestDetail::isCustomerGuestBooking($order->id)) {
$customerGuestDetail = new OrderCustomerGuestDetail($id_customer_guest_detail);
}
$idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
// set order specific values
$order->total_convenience_fee_ti = $total_convenience_fee_ti;
$order->total_convenience_fee_te = $total_convenience_fee_te;
$order->total_demands_price_ti = $total_demands_price_ti;
$order->total_demands_price_te = $total_demands_price_te;
$order->any_back_order = $anyBackOrder;
$order->shw_bo_msg = Configuration::get('WK_SHOW_MSG_ON_BO');
$order->back_ord_msg = Configuration::get('WK_BO_MESSAGE');
$order->order_has_invoice = $order->hasInvoice();
$order->cart_htl_data = $cartHotelData;
$order->non_requested_rooms = $nonRequestedRooms;
$order->customerGuestDetail = $customerGuestDetail;
$order->obj_hotel_branch_information = $objHotelBranchInformation;
$order->hotel_address_info = $hotelAddressInfo;
//end
Hook::exec('actionOrderDetail', array('carrier' => $order->carrier, 'order' => $order));
}
// end booking details entries
$redirectTermsLink = $this->context->link->getCMSLink(
new CMS(3, $this->context->language->id),
null, $this->context->language->id
);
$customerGuestDetail = false;
if ($id_customer_guest_detail = OrderCustomerGuestDetail::isCustomerGuestBooking($order->id)) {
$customerGuestDetail = new OrderCustomerGuestDetail($id_customer_guest_detail);
}
$this->context->smarty->assign(
array(
'total_convenience_fee_ti' => $total_convenience_fee_ti,
'total_convenience_fee_te' => $total_convenience_fee_te,
'total_demands_price_ti' => $total_demands_price_ti,
'total_demands_price_te' => $total_demands_price_te,
'any_back_order' => $anyBackOrder,
'shw_bo_msg' => Configuration::get('WK_SHOW_MSG_ON_BO'),
'back_ord_msg' => Configuration::get('WK_BO_MESSAGE'),
'order_has_invoice' => $order->hasInvoice(),
'cart_htl_data' => $cartHotelData,
'non_requested_rooms' => $nonRequestedRooms,
'customerGuestDetail' => $customerGuestDetail,
)
);
//end
Hook::exec('actionOrderDetail', array('carrier' => $order->carrier, 'order' => $order));
}
$this->context->smarty->assign(array(
@@ -599,9 +602,48 @@ class GuestTrackingControllerCore extends FrontController
)
);
$this->addJS(_THEME_JS_DIR_.'history.js');
$this->addCSS(_THEME_CSS_DIR_.'history.css');
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
if (Tools::getValue('ajax') != 'true') {
$this->addCSS(_THEME_CSS_DIR_.'order-detail.css');
$this->addJS(array(
_THEME_JS_DIR_.'order-detail.js',
_THEME_JS_DIR_.'tools.js',
));
$this->addJqueryPlugin(array('fancybox', 'scrollTo', 'footable', 'footable-sort'));
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
// load Google Maps library if configured
if (!count($this->errors)) {
$ordersCollection = Order::getByReference(Tools::getValue('order_reference'));
if ($objOrder = $ordersCollection->getFirst()) {
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder($objOrder->id)) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
if (Validate::isLoadedObject($objHotelBranchInformation)) {
if ($apiKey = Configuration::get('PS_API_KEY')) {
if (floatval($objHotelBranchInformation->latitude) != 0
&& floatval($objHotelBranchInformation->longitude) != 0
) {
Media::addJsDef(array(
'hotel_location' => array(
'latitude' => $objHotelBranchInformation->latitude,
'longitude' => $objHotelBranchInformation->longitude,
'map_input_text' => $objHotelBranchInformation->map_input_text,
),
'hotel_name' => $objHotelBranchInformation->hotel_name,
));
$this->addJS(
'https://maps.googleapis.com/maps/api/js?key='.$apiKey.'&libraries=places&language='.
$this->context->language->iso_code.'&region='.$this->context->country->iso_code
);
}
}
}
}
}
}
}
}
protected function processAddressFormat(Address $delivery, Address $invoice)

View File

@@ -36,15 +36,9 @@ class HistoryControllerCore extends FrontController
parent::setMedia();
$this->addCSS(array(
_THEME_CSS_DIR_.'history.css',
_THEME_CSS_DIR_.'addresses.css'
));
$this->addJS(array(
_THEME_JS_DIR_.'history.js',
_THEME_JS_DIR_.'tools.js' // retro compat themes 1.5
));
$this->addJqueryPlugin(array('fancybox')); //fancybox not found for some client theme
$this->addJqueryPlugin(array('scrollTo', 'footable', 'footable-sort'));
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->addJqueryPlugin(array('footable', 'footable-sort'));
}
/**

View File

@@ -43,249 +43,19 @@ class OrderDetailControllerCore extends FrontController
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
}
/**
* Start forms process
* @see FrontController::postProcess()
*/
public function postProcess()
{
if (Tools::isSubmit('submitMessage')) {
$idOrder = (int)Tools::getValue('id_order');
$msgText = Tools::getValue('msgText');
if (!$idOrder || !Validate::isUnsignedId($idOrder)) {
$this->errors[] = Tools::displayError('The order is no longer valid.');
} elseif (empty($msgText)) {
$this->errors[] = Tools::displayError('The message cannot be blank.');
} elseif (!Validate::isMessage($msgText)) {
$this->errors[] = Tools::displayError('This message is invalid (HTML is not allowed).');
}
if (!count($this->errors)) {
$order = new Order($idOrder);
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
//check if a thread already exist
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($this->context->customer->email, $order->id);
$id_product = (int)Tools::getValue('id_product');
$cm = new CustomerMessage();
if (!$id_customer_thread) {
$ct = new CustomerThread();
$ct->id_contact = 0;
$ct->id_customer = (int)$order->id_customer;
$ct->id_shop = (int)$this->context->shop->id;
if ($id_product && $order->orderContainProduct($id_product)) {
$ct->id_product = $id_product;
}
$ct->id_order = (int)$order->id;
$ct->id_lang = (int)$this->context->language->id;
$ct->email = $this->context->customer->email;
$ct->status = 'open';
$ct->token = Tools::passwdGen(12);
$ct->add();
} else {
$ct = new CustomerThread((int)$id_customer_thread);
$ct->status = 'open';
$ct->update();
}
$cm->id_customer_thread = $ct->id;
$cm->message = $msgText;
$cm->ip_address = (int)ip2long($_SERVER['REMOTE_ADDR']);
$cm->add();
if (!Configuration::get('PS_MAIL_EMAIL_MESSAGE')) {
$to = strval(Configuration::get('PS_SHOP_EMAIL'));
} else {
$to = new Contact((int)Configuration::get('PS_MAIL_EMAIL_MESSAGE'));
$to = strval($to->email);
}
$toName = strval(Configuration::get('PS_SHOP_NAME'));
$customer = $this->context->customer;
$product = new Product($id_product);
$product_name = '';
if (Validate::isLoadedObject($product) && isset($product->name[(int)$this->context->language->id])) {
$product_name = $product->name[(int)$this->context->language->id];
}
if (Validate::isLoadedObject($customer)) {
Mail::Send(
$this->context->language->id,
'order_customer_comment',
Mail::l('Message from a customer'),
array(
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{email}' => $customer->email,
'{id_order}' => (int)$order->id,
'{order_name}' => $order->getUniqReference(),
'{message}' => Tools::nl2br($msgText),
'{product_name}' => $product_name
),
$to,
$toName,
strval(Configuration::get('PS_SHOP_EMAIL')),
$customer->firstname.' '.$customer->lastname,
null,
null,
_PS_MAIL_DIR_,
false,
null,
null,
$customer->email
);
}
if (Tools::getValue('ajax') != 'true') {
Tools::redirect('index.php?controller=order-detail&id_order='.(int)$idOrder);
}
$this->context->smarty->assign('message_confirmation', true);
} else {
$this->errors[] = Tools::displayError('Order not found');
}
}
}
}
public function displayAjax()
{
$this->display();
}
/**
* Assign template vars related to page content
* @see FrontController::initContent()
*/
public function initContent()
{
$this->show_breadcrump = true;
parent::initContent();
if (!($id_order = (int) Tools::getValue('id_order')) || !Validate::isUnsignedId($id_order)) {
$this->errors[] = Tools::displayError('Order ID required');
Tools::redirect($this->context->link->getPageLink('history'));
} else {
$order = new Order($id_order);
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
// Here handle request from the ajax on order details page i.e refund, additional qty etc
$method = Tools::getValue('method');
// extra demands popup ajax
if ($method == 'getRoomTypeBookingDemands') {
$response = array('reload' => false);
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objBookingDemand = new HotelBookingDemands();
$useTax = 0;
$customer = Context::getContext()->customer;
if (Group::getPriceDisplayMethod($customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
}
if ($extraDemands = $objBookingDemand->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
0,
$dateFrom,
$dateTo,
1,
0,
$useTax
)) {
$this->context->smarty->assign(
array(
'useTax' => $useTax,
'extraDemands' => $extraDemands,
)
);
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
}
die(json_encode($response));
} elseif ($method == 'submitRefundRequest') { // room cancellation ajax
$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 = json_decode($bookingRefunds, true))) {
$hasError = 1;
} else {
foreach ($bookingRefunds as $idHtlBooking) {
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
if ($objHotelBookingDetail->id_customer != $order->id_customer
|| OrderReturn::getOrdersReturnDetail($order->id, 0, $idHtlBooking)
) {
$hasError = 1;
break;
}
}
}
} else {
$hasError = 1;
}
$res = true;
if (!$hasError) {
if ((int)$order->total_paid_real == 0){
foreach ($bookingRefunds as $idHtlBooking) {
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
$objHtlBooking->save();
}
}
$objOrderReturn = new OrderReturn();
$objOrderReturn->id_customer = $order->id_customer;
$objOrderReturn->id_order = $order->id;
$objOrderReturn->state = 0;
$objOrderReturn->by_admin = 0;
$objOrderReturn->question = $refundReason;
$objOrderReturn->save();
if ($objOrderReturn->id) {
foreach ($bookingRefunds as $idHtlBooking) {
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
$numDays = $objHtlBooking->getNumberOfDays(
$objHtlBooking->date_from,
$objHtlBooking->date_to
);
$objOrderReturnDetail = new OrderReturnDetail();
$objOrderReturnDetail->id_order_return = $objOrderReturn->id;
$objOrderReturnDetail->id_order_detail = $objHtlBooking->id_order_detail;
$objOrderReturnDetail->product_quantity = $numDays;
$objOrderReturnDetail->id_htl_booking = $idHtlBooking;
$objOrderReturnDetail->save();
}
}
// Emails to customer, admin on refund request state change
$objOrderReturn->changeIdOrderReturnState(Configuration::get('PS_ORS_PENDING'));
die(json_encode(array('status' => 1)));
}
die(json_encode(array('status' => 0)));
}
} else {
die(json_encode(array('status' => 0)));
}
// END ajax request handle
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
$id_order_state = (int)$order->getCurrentState();
$carrier = new Carrier((int)$order->id_carrier, (int)$order->id_lang);
@@ -343,9 +113,9 @@ class OrderDetailControllerCore extends FrontController
$cover_image_arr = $product->getCover($type_value['product_id']);
if (!empty($cover_image_arr)) {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'small_default');
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $product->id.'-'.$cover_image_arr['id_image'], 'home_default');
} else {
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'small_default');
$cover_img = $this->context->link->getImageLink($product->link_rewrite, $this->context->language->iso_code.'-default', 'home_default');
}
if (isset($customer->id)) {
@@ -426,9 +196,18 @@ class OrderDetailControllerCore extends FrontController
}
}
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['id_htl_booking'] = $data_v['id'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['id_room'] = $data_v['id_room'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['adults'] = $data_v['adults'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['children'] = $data_v['children'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['child_ages'] = $data_v['child_ages'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['is_refunded'] = $data_v['is_refunded'];
$cartHotelData[$type_key]['date_diff'][$date_join]['hotel_booking_details'][$data_v['id']]['is_cancelled'] = $data_v['is_cancelled'];
$cartHotelData[$type_key]['date_diff'][$date_join]['is_refunded'] = $data_v['is_refunded'];
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_htl_booking_detail'][] = $data_v['id'];
$cartHotelData[$type_key]['date_diff'][$date_join]['ids_rooms'][] = $data_v['id_room'];
$cartHotelData[$type_key]['date_diff'][$date_join]['extra_demands'] = $objBookingDemand->getRoomTypeBookingExtraDemands(
$id_order,
@@ -604,6 +383,9 @@ class OrderDetailControllerCore extends FrontController
$objHotelBookingDetail = new HotelBookingDetail();
$htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id);
$idHotel = HotelBookingDetail::getIdHotelByIdOrder($order->id);
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
$hotelAddressInfo = HotelBranchInformation::getAddress($idHotel);
$this->context->smarty->assign(
array(
'id_cms_refund_policy' => Configuration::get('WK_GLOBAL_REFUND_POLICY_CMS'),
@@ -619,6 +401,8 @@ class OrderDetailControllerCore extends FrontController
'cart_htl_data' => $cartHotelData,
'cart_service_products' => $cartServiceProducts,
'non_requested_rooms' => $nonRequestedRooms,
'obj_hotel_branch_information' => $objHotelBranchInformation,
'hotel_address_info' => $hotelAddressInfo,
)
);
// }
@@ -628,6 +412,7 @@ class OrderDetailControllerCore extends FrontController
if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1)) {
$refundedAmount = $objOrderReturn->getRefundedAmount($order->id);
}
$this->context->smarty->assign(
array(
'hasOrderPaid' => $order->hasBeenPaid(),
@@ -685,12 +470,292 @@ class OrderDetailControllerCore extends FrontController
$this->setTemplate(_PS_THEME_DIR_.'order-detail.tpl');
}
public function displayAjaxGetRoomTypeBookingDemands()
{
$response = array('extra_demands' => false);
if (($idProduct = Tools::getValue('id_product'))
&& ($idOrder = Tools::getValue('id_order'))
&& ($dateFrom = Tools::getValue('date_from'))
&& ($dateTo = Tools::getValue('date_to'))
) {
$objHotelBookingDemands = new HotelBookingDemands();
$useTax = 0;
if (Group::getPriceDisplayMethod($this->context->customer->id_default_group) == PS_TAX_INC) {
$useTax = 1;
}
if ($extraDemands = $objHotelBookingDemands->getRoomTypeBookingExtraDemands(
$idOrder,
$idProduct,
0,
$dateFrom,
$dateTo,
1,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'extraDemands' => $extraDemands,
));
}
$objRoomTypeServiceProductOrderDetail = new RoomTypeServiceProductOrderDetail();
if ($additionalServices = $objRoomTypeServiceProductOrderDetail->getroomTypeServiceProducts(
$idOrder,
0,
0,
$idProduct,
$dateFrom,
$dateTo,
0,
0,
$useTax
)) {
$this->context->smarty->assign(array(
'useTax' => $useTax,
'additionalServices' => $additionalServices,
));
}
$response['extra_demands'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/order_booking_demands.tpl');
}
$this->ajaxDie(json_encode($response));
}
public function displayAjaxSubmitRefundRequest()
{
$response = array('has_errors' => false);
$idOrder = Tools::getValue('id_order');
$idsHtlBooking = Tools::getValue('bookings_to_refund');
$cancellationReason = trim(Tools::getValue('cancellation_reason'));
if (!$idsHtlBooking) {
$this->errors[] = Tools::displayError('Please select at least on room for cancellation.');
}
if (!$cancellationReason) {
$this->errors[] = Tools::displayError('Please mention a reason for cancellation.');
} elseif ($cancellationReason && !Validate::isCleanHtml($cancellationReason)) {
$this->errors[] = Tools::displayError('Reason of cancellation is invalid. Please enter valid data.');
}
if (!count($this->errors)) {
$objOrder = new Order($idOrder);
if (!(Validate::isLoadedObject($objOrder) && $objOrder->id_customer == $this->context->customer->id)) {
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
} elseif ($idsHtlBooking) {
foreach ($idsHtlBooking as $idHtlBooking) {
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
if ($objHotelBookingDetail->id_customer != $objOrder->id_customer) {
$this->errors[] = Tools::displayError('Something went wrong. Please try later.');
break;
}
if (OrderReturn::getOrdersReturnDetail($objOrder->id, 0, $idHtlBooking)) {
$this->errors[] = Tools::displayError('Some selected rooms have already been requested for cancellation.');
break;
}
}
}
if (!count($this->errors)) {
if ((int) $objOrder->total_paid_real == 0) {
foreach ($idsHtlBooking as $idHtlBooking) {
$objHtlBooking = new HotelBookingDetail($idHtlBooking);
$objHtlBooking->save();
}
}
$objOrderReturn = new OrderReturn();
$objOrderReturn->id_customer = $objOrder->id_customer;
$objOrderReturn->id_order = $objOrder->id;
$objOrderReturn->state = 0;
$objOrderReturn->by_admin = 0;
$objOrderReturn->question = $cancellationReason;
$objOrderReturn->save();
if ($objOrderReturn->id) {
foreach ($idsHtlBooking as $idHtlBooking) {
$objHotelBookingDetail = new HotelBookingDetail($idHtlBooking);
$numDays = $objHotelBookingDetail->getNumberOfDays(
$objHotelBookingDetail->date_from,
$objHotelBookingDetail->date_to
);
$objOrderReturnDetail = new OrderReturnDetail();
$objOrderReturnDetail->id_order_return = $objOrderReturn->id;
$objOrderReturnDetail->id_order_detail = $objHotelBookingDetail->id_order_detail;
$objOrderReturnDetail->product_quantity = $numDays;
$objOrderReturnDetail->id_htl_booking = $idHtlBooking;
$objOrderReturnDetail->save();
}
}
// Emails to customer, superadmin and employees on refund request state change
$objOrderReturn->changeIdOrderReturnState(Configuration::get('PS_ORS_PENDING'));
}
}
if (count($this->errors)) {
$this->context->smarty->assign(array('errors' => $this->errors));
$response['errors_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'errors.tpl');
}
$response['has_errors'] = (bool) count($this->errors);
$this->ajaxDie(json_encode($response));
}
public function displayAjaxSubmitMessage()
{
$response = array('status' => false);
$idOrder = (int) Tools::getValue('id_order');
$msgText = Tools::getValue('msgText');
if (!$idOrder || !Validate::isUnsignedId($idOrder)) {
$this->errors[] = Tools::displayError('The order is no longer valid.');
} elseif (empty($msgText)) {
$this->errors[] = Tools::displayError('The message cannot be blank.');
} elseif (!Validate::isMessage($msgText)) {
$this->errors[] = Tools::displayError('This message is invalid (HTML is not allowed).');
}
if (!count($this->errors)) {
$order = new Order($idOrder);
if (Validate::isLoadedObject($order) && $order->id_customer == $this->context->customer->id) {
//check if a thread already exist
$id_customer_thread = CustomerThread::getIdCustomerThreadByEmailAndIdOrder($this->context->customer->email, $order->id);
$id_product = (int)Tools::getValue('id_product');
$cm = new CustomerMessage();
if (!$id_customer_thread) {
$ct = new CustomerThread();
$ct->id_contact = 0;
$ct->id_customer = (int)$order->id_customer;
$ct->id_shop = (int)$this->context->shop->id;
if ($id_product && $order->orderContainProduct($id_product)) {
$ct->id_product = $id_product;
}
$ct->id_order = (int)$order->id;
$ct->id_lang = (int)$this->context->language->id;
$ct->email = $this->context->customer->email;
$ct->status = 'open';
$ct->token = Tools::passwdGen(12);
$ct->add();
} else {
$ct = new CustomerThread((int)$id_customer_thread);
$ct->status = 'open';
$ct->update();
}
$cm->id_customer_thread = $ct->id;
$cm->message = $msgText;
$cm->ip_address = (int)ip2long($_SERVER['REMOTE_ADDR']);
$cm->add();
if (!Configuration::get('PS_MAIL_EMAIL_MESSAGE')) {
$to = strval(Configuration::get('PS_SHOP_EMAIL'));
} else {
$to = new Contact((int)Configuration::get('PS_MAIL_EMAIL_MESSAGE'));
$to = strval($to->email);
}
$toName = strval(Configuration::get('PS_SHOP_NAME'));
$customer = $this->context->customer;
$product = new Product($id_product);
$product_name = '';
if (Validate::isLoadedObject($product) && isset($product->name[(int)$this->context->language->id])) {
$product_name = $product->name[(int)$this->context->language->id];
}
if (Validate::isLoadedObject($customer)) {
Mail::Send(
$this->context->language->id,
'order_customer_comment',
Mail::l('Message from a customer'),
array(
'{lastname}' => $customer->lastname,
'{firstname}' => $customer->firstname,
'{email}' => $customer->email,
'{id_order}' => (int)$order->id,
'{order_name}' => $order->getUniqReference(),
'{message}' => Tools::nl2br($msgText),
'{product_name}' => $product_name
),
$to,
$toName,
strval(Configuration::get('PS_SHOP_EMAIL')),
$customer->firstname.' '.$customer->lastname,
null,
null,
_PS_MAIL_DIR_,
false,
null,
null,
$customer->email
);
}
// send message html in json
$response['status'] = true;
$message = CustomerMessage::getMessagesByOrderId($order->id, false)[0];
$this->context->smarty->assign(array('message' => $message));
$response['message_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'_partials/booking-message.tpl');
} else {
$this->errors[] = Tools::displayError('Order not found');
}
}
if (count($this->errors)) {
$this->context->smarty->assign(array('errors' => $this->errors));
$response['errors_html'] = $this->context->smarty->fetch(_PS_THEME_DIR_.'errors.tpl');
}
$response['has_errors'] = (bool) count($this->errors);
$this->ajaxDie(json_encode($response));
}
public function setMedia()
{
if (Tools::getValue('ajax') != 'true') {
parent::setMedia();
$this->addCSS(_THEME_CSS_DIR_.'history.css');
$this->addCSS(_THEME_CSS_DIR_.'addresses.css');
$this->addCSS(_THEME_CSS_DIR_.'order-detail.css');
$this->addJS(array(
_THEME_JS_DIR_.'order-detail.js',
_THEME_JS_DIR_.'tools.js',
));
$this->addJqueryPlugin(array('fancybox', 'scrollTo', 'footable', 'footable-sort'));
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
// load Google Maps library if configured
if ($idHotel = HotelBookingDetail::getIdHotelByIdOrder(Tools::getValue('id_order'))) {
$objHotelBranchInformation = new HotelBranchInformation($idHotel, $this->context->language->id);
if (Validate::isLoadedObject($objHotelBranchInformation)) {
if ($apiKey = Configuration::get('PS_API_KEY')) {
if (floatval($objHotelBranchInformation->latitude) != 0
&& floatval($objHotelBranchInformation->longitude) != 0
) {
Media::addJsDef(array(
'hotel_location' => array(
'latitude' => $objHotelBranchInformation->latitude,
'longitude' => $objHotelBranchInformation->longitude,
'map_input_text' => $objHotelBranchInformation->map_input_text,
),
'hotel_name' => $objHotelBranchInformation->hotel_name,
));
$this->addJS(
'https://maps.googleapis.com/maps/api/js?key='.$apiKey.'&libraries=places&language='.
$this->context->language->iso_code.'&region='.$this->context->country->iso_code
);
}
}
}
}
}
}
}
}

View File

@@ -68,6 +68,10 @@
<page>history</page>
<configurable>1</configurable>
</meta>
<meta id="order-detail">
<page>order-detail</page>
<configurable>1</configurable>
</meta>
<meta id="identity">
<page>identity</page>
<configurable>1</configurable>

View File

@@ -107,14 +107,14 @@ class QloHotelReview extends Module
public function reviewPopupResources()
{
$controllers = array('history', 'guesttracking');
$controllers = array('orderdetail', 'guesttracking');
$controller = Tools::getValue('controller');
if (!in_array($controller, $controllers)) {
return;
}
$idOrder = 0;
if ($controller == 'history') {
if ($controller == 'orderdetail') {
$idOrder = (int) Tools::getValue('id_order');
}
@@ -162,8 +162,6 @@ class QloHotelReview extends Module
public function loadMedia($idOrder)
{
Media::addJsDef(array('qlo_hotel_review_js_vars' => array(
'id_order' => (int) $idOrder, // 0 for guesttracking
'link' => $this->context->link->getPageLink('order-detail', true),
'review_ajax_link' => $this->context->link->getModuleLink($this->name),
'review_ajax_token' => $this->secure_key,
'raty_img_path' => $this->getPathUri().'views/img/raty',
@@ -201,7 +199,7 @@ class QloHotelReview extends Module
public function hookDisplayFooterBefore()
{
$controllers = array('history', 'guesttracking');
$controllers = array('orderdetail', 'guesttracking');
$controller = Tools::getValue('controller');
if (in_array($controller, $controllers)) {
$categories = QhrCategory::getAll();

View File

@@ -31,10 +31,12 @@
}
#add-review-popup {
width: 650px;
width: 600px;
margin: 0 auto;
padding-right: 20px;
padding-bottom: 20px;
}
#add-review-popup .card-body {
padding: 15px;
}
#add-review-popup .form-group {
@@ -43,7 +45,8 @@
#add-review-popup label {
font-size: 14px;
text-transform: uppercase;
font-weight: normal;
margin-bottom: 6px;
}
#add-review-popup .form-control {
@@ -53,10 +56,6 @@
border-radius: 4px;
}
#add-review-popup .hotel-name {
font-size: 18px;
}
#add-review-popup .form-control.description {
padding: 10px 10px;
}
@@ -74,28 +73,18 @@
font-size: 12px;
}
#add-review-popup .review-actions-wrap .btn-review {
font-size: 14px;
padding: 12px 30px;
font-weight: 600;
text-transform: uppercase;
text-align: center;
margin-left: 10px;
}
#add-review-popup .review-actions-wrap .btn-review.disabled {
#add-review-popup .review-actions-wrap .btn.disabled {
background-color: #1292FF;
border: 1px solid #1292FF;
}
#add-review-popup .image-input-btn {
width: 100px;
height: 100px;
border-radius: 4px;
border: 1px dashed #999;
display: table-cell;
vertical-align: middle;
cursor: pointer;
display: flex;
align-items: center;
}
#add-review-popup .image-input-btn .img-camera-plus {
@@ -109,7 +98,8 @@
}
#add-review-popup .previews-wrap {
margin-bottom: 15px;
margin-top: 10px;
margin-bottom: 20px;
}
#add-review-popup .previews-wrap span {
@@ -120,9 +110,10 @@
#add-review-popup .previews-wrap span i {
position: absolute;
top: 3px;
right: 14px;
font-size: 21px;
color: #7f7f7f;
right: 16px;
font-size: 30px;
font-weight: 100;
color: #fff;
cursor: pointer;
}
@@ -135,14 +126,6 @@
}
/* success popup */
.fancybox-add-review-success {
top: 80px !important;
.fancybox-order-detail.feedback .add-review-success-popup i.text-info {
color: #1292FF;
}
.add-review-success-popup {
width: 650px;
}
.add-review-success-popup i {
font-size: 40px;
}

View File

@@ -205,10 +205,6 @@ $(document).on('shown.bs.tab', 'a[href="#hotel-reviews"]', function(e) {
});
$(document).ready(function () {
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.id_order) {
showOrder(1, qlo_hotel_review_js_vars.id_order, qlo_hotel_review_js_vars.link);
}
// init raty
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.raty_img_path) {
initRaty(qlo_hotel_review_js_vars.raty_img_path);

View File

@@ -21,14 +21,14 @@ var QhrReviewForm = {
init: function(idOrder, idHotel, hotelName) {
$('#add-review-form').find('[name="id_order"]').val(idOrder);
$('#add-review-form').find('[name="id_hotel"]').val(idHotel);
$('#add-review-form').find('.hotel-name').html(hotelName);
$('#add-review-popup').find('.hotel-name').html(hotelName);
QhrReviewImages.init();
},
show: function() {
$.fancybox.open({
href: '#add-review-popup',
wrapCSS: 'fancybox-add-review',
padding: 20,
wrapCSS: 'fancybox-add-review fancybox-order-detail',
padding: 0,
});
},
close: function() {
@@ -95,8 +95,8 @@ var QhrReviewForm = {
$.fancybox.open({
href: href,
wrapCSS: 'fancybox-add-review-success',
padding: 20,
wrapCSS: 'fancybox-order-detail feedback',
padding: 0,
});
},
reset: function() {
@@ -139,7 +139,7 @@ var QhrReviewImages = {
addFileToPreview: function(file, iInput, iFile) {
var reader = new FileReader();
reader.onload = function (e) {
$('.previews-wrap').append('<span><img data-i-input="'+iInput+'" data-i-file="'+iFile+'" src="'+e.target.result+'" class="img-preview"><i class="icon icon-times-circle-o"></i></span>');
$('.previews-wrap').append('<span><img data-i-input="'+iInput+'" data-i-file="'+iFile+'" src="'+e.target.result+'" class="img-preview"><i>×</i></span>');
};
reader.readAsDataURL(file);
},
@@ -249,10 +249,6 @@ $(document).on('change', 'input.input-images', function(e) {
});
$(document).ready(function () {
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.id_order) {
showOrder(1, qlo_hotel_review_js_vars.id_order, qlo_hotel_review_js_vars.link);
}
// init raty
if (typeof qlo_hotel_review_js_vars === 'object' && qlo_hotel_review_js_vars.raty_img_path) {
initRaty(qlo_hotel_review_js_vars.raty_img_path);

View File

@@ -18,98 +18,103 @@
*}
<div id="qlohotelreview" style="display: none;">
<div id="add-review-popup">
<div id="add-review-popup" class="card">
<div class="card-header">
<span class="hotel-name"></span>
</div>
<form action="{$action}" id="add-review-form" method="post" enctype="multipart/form-data">
<input type="hidden" name="id_order" value="0"/>
<input type="hidden" name="id_hotel" value="0"/>
<div class="card-body">
<input type="hidden" name="id_order" value="0"/>
<input type="hidden" name="id_hotel" value="0"/>
<div class="alert alert-danger" id="review-general-errors" style="display:none;"></div>
<div class="form-group">
<label>{l s='Hotel Name' mod='qlohotelreview'}</label>
<p class="hotel-name" type="text" name=""></p>
</div>
<div class="alert alert-danger" id="review-general-errors" style="display:none;"></div>
<div class="form-group images-field">
<label>{l s='Images' mod='qlohotelreview'}</label>
<div class="inputs-wrap"></div>
<div class="form-group images-field">
<label>{l s='Images' mod='qlohotelreview'}</label>
<div class="previews-wrap"></div>
<div class="inputs-wrap"></div>
<div class="image-input-btn">
<img class="img-camera-plus">
</div>
</div>
<div class="form-group">
<label>
{l s='Tell us about your Overall experience' mod='qlohotelreview'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_overall" data-score="0"></div>
</div>
</div>
{if isset($categories) && count($categories)}
<div class="categories-wrap">
<div class="form-group">
<label>
{l s='Tell us more what went well?' mod='qlohotelreview'}
</label>
<div class="image-input-btn">
<img class="img-camera-plus">
</div>
{foreach $categories as $category}
<div class="form-group">
<label class="label-category">
{$category.name|escape:'html':'UTF-8'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_categories[{$category.id_category}]" data-score="0"></div>
</div>
</div>
{/foreach}
<div class="previews-wrap"></div>
</div>
{/if}
<div class="form-group">
<label>
{l s='Sumup your review' mod='qlohotelreview'}
</label>
<input class="form-control" type="text" name="subject" />
<p class="review-error subject"></p>
<div class="form-group">
<label>
{l s='Tell us about your Overall experience' mod='qlohotelreview'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_overall" data-score="0"></div>
</div>
</div>
{if isset($categories) && count($categories)}
<div class="categories-wrap">
<div class="form-group">
<label>
{l s='Tell us more what went well?' mod='qlohotelreview'}
</label>
</div>
{foreach $categories as $category}
<div class="form-group">
<label class="label-category">
{$category.name|escape:'html':'UTF-8'}
</label>
<div class="stars-wrap">
<div class="raty" data-score-name="rating_categories[{$category.id_category}]" data-score="0"></div>
</div>
</div>
{/foreach}
</div>
{/if}
<div class="form-group">
<label>
{l s='Sumup your review' mod='qlohotelreview'}
</label>
<input class="form-control" type="text" name="subject" />
<p class="review-error subject"></p>
</div>
<div class="form-group">
<label>
{l s='Write in detail' mod='qlohotelreview'}
</label>
<textarea class="form-control description" type="text" rows="5" name="description"></textarea>
<p class="review-error description"></p>
</div>
</div>
<div class="form-group">
<label>
{l s='Write in detail' mod='qlohotelreview'}
</label>
<textarea class="form-control description" type="text" rows="5" name="description"></textarea>
<p class="review-error description"></p>
</div>
<div class="review-actions-wrap text-right">
<a class="btn btn-default btn-review" id="btn-submit-review">
{l s='Make Review' mod='qlohotelreview'}
</a>
<a class="btn btn-default btn-review" id="btn-cancel-review">
{l s='Cancel' mod='qlohotelreview'}
</a>
<div class="card-footer clearfix review-actions-wrap">
<div class="pull-right">
<button class="btn btn-secondary" id="btn-cancel-review">
{l s='Cancel' mod='qlohotelreview'}
</button>
<button class="btn btn-primary" id="btn-submit-review">
{l s='Make Review' mod='qlohotelreview'}
</button>
</div>
</div>
</form>
</div>
<div id="popup-review-submit-success-no-approval"
class="add-review-success-popup">
<div class="text-center">
<div><i class="icon icon-check-circle text-success"></i></div>
<h3>{l s='Review added successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been added successfully.' mod='qlohotelreview'}</p>
<div id="popup-review-submit-success-no-approval" class="add-review-success-popup">
<div class="card">
<div class="text-center">
<div><i class="icon icon-check-circle text-info"></i></div>
<h3>{l s='Review added successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been added successfully.' mod='qlohotelreview'}</p>
</div>
</div>
</div>
<div id="popup-review-submit-success-with-approval"
class="add-review-success-popup">
<div class="text-center">
<div><i class="icon icon-check-circle text-success"></i></div>
<h3>{l s='Review submitted successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been submitted for approval.' mod='qlohotelreview'}</p>
<div id="popup-review-submit-success-with-approval" class="add-review-success-popup">
<div class="card">
<div class="text-center">
<div><i class="icon icon-check-circle text-info"></i></div>
<h3>{l s='Review submitted successfully.' mod='qlohotelreview'}</h3>
<p>{l s='Your review has been submitted for approval.' mod='qlohotelreview'}</p>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,42 @@
{*
* 2010-2024 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2024 Webkul IN
* @license LICENSE.txt
*}
<div class="message {if isset($message.id_employee) && $message.id_employee}management{else}customer{/if}">
<div class="profile">
<div class="row">
<div class="col-sm-6">
<strong>
{if isset($message.elastname) && $message.elastname}
{$message.efirstname|escape:'html':'UTF-8'} {$message.elastname|escape:'html':'UTF-8'}
{elseif $message.clastname}
{$message.cfirstname|escape:'html':'UTF-8'} {$message.clastname|escape:'html':'UTF-8'}
{else}
{$shop_name|escape:'html':'UTF-8'}
{/if}
</strong>
</div>
<div class="col-sm-6 text-right">
{dateFormat date=$message.date_add full=1}
</div>
</div>
</div>
<div class="message-content">
{$message.message|escape:'html':'UTF-8'|nl2br}
</div>
</div>

View File

@@ -0,0 +1,130 @@
{*
* 2010-2024 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2024 Webkul IN
* @license LICENSE.txt
*}
<div class="booking-room-detail" data-id-product="{$data_v.id_product}" data-date-diff="{$rm_k}">
<div class="row">
<div class="col-xs-3 col-sm-2">
<a href="{$link->getProductLink($data_v.id_product)|escape:'html':'UTF-8'}" title="{$data_v.name|escape:'html':'UTF-8'}" target="_blank">
<img class="img img-responsive img-room-type" src="{$data_v.cover_img|escape:'html':'UTF-8'}" />
</a>
</div>
<div class="col-xs-9 col-sm-10 col-md-12 col-lg-10 info-wrap">
<div class="row">
<div class="col-xs-12">
<a href="{$link->getProductLink($data_v.id_product)|escape:'html':'UTF-8'}" title="{$data_v.name|escape:'html':'UTF-8'}" target="_blank" class="room-type-name">
<h3>{$data_v.name|escape:'html':'UTF-8'}</h3>
</a>
</div>
<div class="col-xs-12">
<div class="description-list">
<dl class="row">
<dt class="col-xs-6 col-sm-3">{l s='Check-in'}</dt>
<dd class="col-xs-6 col-sm-3">{$rm_v.data_form|date_format:'D'}, {dateFormat date=$rm_v.data_form}</dd>
<dt class="col-xs-6 col-sm-3">{l s='Check-out'}</dt>
<dd class="col-xs-6 col-sm-3">{$rm_v.data_to|date_format:'D'}, {dateFormat date=$rm_v.data_form}</dd>
<dt class="col-xs-6 col-sm-3">{l s='Room Capacity'}</dt>
<dd class="col-xs-6 col-sm-3">
{$rm_v.adults|string_format:'%02d'} {if $rm_v.adults > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if $rm_v.children}, {$rm_v.children|string_format:'%02d'} {if $rm_v.children > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
</dd>
<dt class="col-xs-6 col-sm-3">{l s='Room(s)'}</dt>
<dd class="col-xs-6 col-sm-3">{$rm_v.num_rm|string_format:'%02d'}</dd>
<dt class="col-xs-6 col-sm-3">{l s='Extra Services'}</dt>
<dd class="col-xs-6 col-sm-3">
{if (isset($rm_v.extra_demands) && $rm_v.extra_demands) || isset($rm_v.additional_services) && $rm_v.additional_services}
<a data-date_from="{$rm_v.data_form}" data-date_to="{$rm_v.data_to}" data-id_product="{$data_v.id_product}" data-id_order="{$order->id}" data-action="{$link->getPageLink({$page_name})}" class="btn-view-extra-services" href="#rooms_type_extra_services_form">
{/if}
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_ti + $rm_v.additional_services_price_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_te + $rm_v.additional_services_price_te) currency=$currency}
{/if}
{if (isset($rm_v.extra_demands) && $rm_v.extra_demands) || isset($rm_v.additional_services) && $rm_v.additional_services}
</a>
{/if}
</dd>
<dt class="col-xs-6 col-sm-3">{l s='Total'}</dt>
<dd class="col-xs-6 col-sm-3">
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_incl + $rm_v.extra_demands_price_ti + $rm_v.additional_services_price_ti + $rm_v.additional_services_price_auto_add_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.extra_demands_price_te + $rm_v.additional_services_price_te + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
{if (isset($rm_v.extra_demands) && $rm_v.extra_demands) || isset($rm_v.additional_services) && $rm_v.additional_services}
<span class="order-price-info">
<img src="{$img_dir}icon/icon-info.svg" />
</span>
<div class="price-info-container" style="display: none;">
<div class="price-info-tooltip-cont">
<div class="list-row">
<div>
<p>{l s='Room(s) cost:'}</p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_incl + $rm_v.additional_services_price_auto_add_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.amount_tax_excl + $rm_v.additional_services_price_auto_add_te) currency=$currency}
{/if}
</p>
</div>
</div>
<div class="list-row">
<div>
<p>{l s='Service(s) cost:'}</p>
</div>
<div class="text-right">
<p>
{if $group_use_tax}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_ti + $rm_v.additional_services_price_ti) currency=$currency}
{else}
{displayWtPriceWithCurrency price=($rm_v.extra_demands_price_te + $rm_v.additional_services_price_te) currency=$currency}
{/if}
</p>
</div>
</div>
</div>
</div>
{/if}
</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
{if $rm_v['count_refunded'] > 0}
<div class="num-refunded-rooms">
<span class="badge badge-danger">
{if $rm_v['count_refunded'] > 1}
{$rm_v['count_refunded']} {l s='Rooms Refunded'}
{else}
{$rm_v['count_refunded']} {l s='Room Refunded'}
{/if}
</span>
</div>
{/if}
</div>

View File

@@ -17,93 +17,96 @@
* @license LICENSE.txt
*}
<section>
{if (isset($extraDemands) && $extraDemands) || (isset($additionalServices) && $additionalServices)}
<ul class="nav nav-tabs">
{if isset($extraDemands) && $extraDemands}
<li class="active"><a href="#room_type_demands_desc" data-toggle="tab">{l s='Facilities'}</a></li>
{/if}
{if isset($additionalServices) && $additionalServices}
<li{if !isset($extraDemands) || !$extraDemands} class="active"{/if}><a href="#room_type_service_product_desc" data-toggle="tab">{l s='Services'}</a></li>
{/if}
</ul>
<div class="tab-content">
{if isset($extraDemands) && $extraDemands}
<div id="room_type_demands_desc" class="tab-pane active">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Below are the facilities chosen by you in this booking'}</p>
</div>
{assign var=roomCount value=1}
{foreach $extraDemands as $roomDemand}
<div class="card">
<div class="row">
<div class="col-sm-12 demand_header">
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}&nbsp;
<span>({if {$roomDemand['adults']} <= 9}0{$roomDemand['adults']}{else}{$roomDemand['adults']}{/if} {if $roomDemand['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if {$roomDemand['children']} <= 9}0{$roomDemand['children']}{else}{$roomDemand['children']}{/if} {if $roomDemand['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if})</span>
</div>
<div class="col-sm-12 room_demand_detail">
{foreach $roomDemand['extra_demands'] as $demand}
<div class="row room_demand_block">
<div class="col-xs-6">{$demand['name']|escape:'html':'UTF-8'}</div>
<div class="col-xs-6">
<span class="pull-right">
{if $useTax}
{displayPrice price="{$demand['total_price_tax_incl']|escape:'html':'UTF-8'}"}
{else}
{displayPrice price="{$demand['total_price_tax_excl']|escape:'html':'UTF-8'}"}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
<div class="card">
<div class="card-header">
{l s='Extra Services'}
</div>
<div class="card-body">
{if (isset($extraDemands) && $extraDemands) || (isset($additionalServices) && $additionalServices)}
<div class="">
<ul class="nav nav-tabs">
{if isset($extraDemands) && $extraDemands}
<li class="active"><a href="#room_type_demands_desc" data-toggle="tab">{l s='Facilities'}</a></li>
{/if}
{if isset($additionalServices) && $additionalServices}
<li{if !isset($extraDemands) || !$extraDemands} class="active"{/if}><a href="#room_type_service_product_desc" data-toggle="tab">{l s='Services'}</a></li>
{/if}
</ul>
<div class="tab-content">
{if isset($extraDemands) && $extraDemands}
<div id="room_type_demands_desc" class="tab-pane active">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Facilities chosen for this booking.'}</p>
</div>
{assign var=roomCount value=1}
{foreach $extraDemands as $roomDemand}
<div class="room_demands">
<div class="demand_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
<span>({if {$roomDemand['adults']} <= 9}0{$roomDemand['adults']}{else}{$roomDemand['adults']}{/if} {if $roomDemand['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if {$roomDemand['children']} <= 9}0{$roomDemand['children']}{else}{$roomDemand['children']}{/if} {if $roomDemand['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if})</span>
</div>
<div class="room_demand_detail">
{foreach $roomDemand['extra_demands'] as $demand}
<div class="room_demand_block">
<div class="">{$demand['name']|escape:'html':'UTF-8'}</div>
<div class="">
<span>
{if $useTax}
{displayPrice price="{$demand['total_price_tax_incl']|escape:'html':'UTF-8'}"}
{else}
{displayPrice price="{$demand['total_price_tax_excl']|escape:'html':'UTF-8'}"}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
{if isset($additionalServices) && $additionalServices}
<div id="room_type_service_product_desc" class="tab-pane{if !isset($extraDemands) || !$extraDemands} active{/if}">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Below are the services chosen by you in this booking'}</p>
</div>
{assign var=roomCount value=1}
{foreach $additionalServices as $key => $roomAdditionalService}
<div class="card">
<div class="row">
<div class="col-sm-12 demand_header">
{l s='Room'} {$roomCount|escape:'html':'UTF-8'}&nbsp;
<span>({if {$roomAdditionalService['adults']} <= 9}0{$roomAdditionalService['adults']}{else}{$roomAdditionalService['adults']}{/if} {if $roomAdditionalService['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if {$roomAdditionalService['children']} <= 9}0{$roomAdditionalService['children']}{else}{$roomAdditionalService['children']}{/if} {if $roomAdditionalService['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if})</span>
</div>
<div class="col-sm-12 room_demand_detail">
{foreach $roomAdditionalService['additional_services'] as $additionalService}
<div class="row room_demand_block">
<div class="col-xs-6">
<div>{$additionalService['name']|escape:'html':'UTF-8'}</div>
{if $additionalService['allow_multiple_quantity']}
<div class="quantity">{l s='Qty:'}&nbsp;{$additionalService['quantity']|escape:'html':'UTF-8'}</div>
{/if}
</div>
<div class="col-xs-6">
<span class="pull-right">
{if $useTax}
{displayPrice price=$additionalService['total_price_tax_incl']|escape:'html':'UTF-8'}
{else}
{displayPrice price=$additionalService['total_price_tax_excl']|escape:'html':'UTF-8'}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
</div>
{/foreach}
</div>
{/if}
</div>
{/if}
</section>
{if isset($additionalServices) && $additionalServices}
<div id="room_type_service_product_desc" class="tab-pane{if !isset($extraDemands) || !$extraDemands} active{/if}">
<div class="rooms_extra_demands_head">
<p class="rooms_extra_demands_text">{l s='Services chosen for this booking.'}</p>
</div>
{assign var=roomCount value=1}
{foreach $additionalServices as $key => $roomAdditionalService}
<div class="room_demands">
<div class="demand_header">
{l s='Room'} {$roomCount|string_format:'%02d'}&nbsp;
<span>({if {$roomAdditionalService['adults']} <= 9}0{$roomAdditionalService['adults']}{else}{$roomAdditionalService['adults']}{/if} {if $roomAdditionalService['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}, {if {$roomAdditionalService['children']} <= 9}0{$roomAdditionalService['children']}{else}{$roomAdditionalService['children']}{/if} {if $roomAdditionalService['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if})</span>
</div>
<div class="room_demand_detail">
{foreach $roomAdditionalService['additional_services'] as $additionalService}
<div class="room_demand_block">
<div class="">
<div>{$additionalService['name']|escape:'html':'UTF-8'}</div>
{if $additionalService['allow_multiple_quantity']}
<div class="quantity">{l s='Qty:'}&nbsp;{$additionalService['quantity']|escape:'html':'UTF-8'}</div>
{/if}
</div>
<div class="">
<span>
{if $useTax}
{displayPrice price=$additionalService['total_price_tax_incl']|escape:'html':'UTF-8'}
{else}
{displayPrice price=$additionalService['total_price_tax_excl']|escape:'html':'UTF-8'}
{/if}
</span>
</div>
</div>
{/foreach}
</div>
</div>
{assign var=roomCount value=$roomCount+1}
{/foreach}
</div>
{/if}
</div>
</div>
{/if}
</div>
</div>

View File

@@ -1,188 +0,0 @@
/************************************************************
History Page Styles
************************************************************/
#order-detail-content table .return_quantity_buttons {
margin-top: 3px; }
#order-detail-content table .return_quantity_buttons a {
display: none;
float: left; }
#order-detail-content table .return_quantity_buttons a + a {
margin-left: 3px; }
#order-detail-content table .order_qte_input {
display: none;
width: 57px;
height: 27px;
line-height: 27px;
padding: 0;
text-align: center; }
#order-detail-content table label {
font-weight: 400; }
.wk_booking_details_wrapper table {
margin-bottom: 10px!important;}
.table td.history_detail a + a {
margin-left: 14px; }
.table td.step-by-step-date {
width: 105px; }
.table tfoot strong {
color: #333; }
.info-order i {
font-size: 20px; }
.info-order i.icon-gift {
color: #f13340; }
.info-order i.icon-repeat {
color: #55c65e; }
#sendOrderMessage {
margin-bottom: 30px; }
#sendOrderMessage select.form-control {
width: 263px; }
/*# sourceMappingURL=history.css.map */
/* ----- Order cancellation in order detail page ---- */
.standard_refund_fields {
display: none;}
.loading_overlay {
display: none;
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 100000;}
.loading-img {
position: absolute;
left: 50%;
top: 50%;}
.refund_reason_head {
margin-bottom: 15px;
font-size: 22px;
color: #414141;}
#reasonForRefund {
font-size: 14px;
color: #777777;}
.booking-actions-wrap {
margin-bottom: 10px;}
.booking-actions-wrap .btn {
font-size: 14px;
padding: 12px 30px;
font-weight: 600;
text-transform: uppercase;
text-align: center;
margin-left: 10px;}
.terms_btn {
background-color: #404040;
color: #ffffff;
font-size: 13px;
font-weight: 700;}
.totalOrdercancellation_btn {
background-color: #379bf0;
color: #ffffff;
font-size: 13px;
font-weight: 700;
margin-right: 10px;}
.reason_submit_wrapper {
text-align: center;}
/* ----- Order cancellation in order detail page ---- */
.back_o_msg {
color: red;
font-size: 14px;}
.cust_serv_lnk {
text-decoration: underline;}
.room_type_old_price {
text-decoration: line-through;
color:#979797;
font-size:12px;}
/* Fancy-box for extra demands Css */
/* #rooms_extra_demands {
font-size: 16px;}
.room_extra_demands .open_rooms_extra_demands {
font-size:12px;
font-weight: 600;
color: #0000FF;}
#rooms_extra_demands .demand_header {
padding-bottom: 15px;
border-bottom: 1px solid rgb(0, 0, 0, 0.1);
margin-bottom: 15px;}
#rooms_extra_demands .demand_detail .demand_detail_price_block {
font-size: 14px;
margin-bottom: 15px;}
#rooms_extra_demands .rooms_extra_demands_head {
margin-bottom: 18px;}
#rooms_extra_demands .card {
padding-bottom: 0px;} */
.cancel_requests_link_wrapper a {
font-weight: bold;
font-style: italic;
text-decoration: underline;
color: #000;}
/* refund buttons */
#history .checkbox {
margin-bottom: 15px;
line-height: 12px;}
#history .booking_refund_fields label {
font-size: 14px;
color: #333;
font-weight: bold;
padding-left: 6px;}
#history .refund_policy_link {
background-color: #D9D9D9;
border: 1px solid #D9D9D9;}
#history #order_refund_request {
background-color: #1292FF;
border: 1px solid #1292FF;
color: #FFF;}
@media screen and (max-width: 405px) {
#history #order_refund_request {
margin-bottom: 5px;}}
#history .cancel_request_btn {
background-color: #FF4B4B!important;
border: 1px solid #FF4B4B!important;}
#history #order_refund_request_submit {
background-color: #36BA46;
border: 1px solid #36BA46;
color: #fff;
font-weight: bold;
text-transform: uppercase;
font-size: 14px;
padding: 12px 30px;}
#history #submit_refund_reason {
background-color: #1292FF;
border: 1px solid #1292FF;
color: #fff;
font-weight: bold;
text-transform: uppercase;
font-size: 14px;
padding: 12px 30px;}
.refund_request_fields {
display: none;}
.ui-tooltip.price-tootip {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
color: #333;
padding: 9px 15px;
max-height: 310px;
overflow-y: auto;
}
.price-info-tooltip-cont {
min-width: 180px;
}
.price-info-tooltip-cont .list-row {
display: flex;
justify-content: space-between;
}

View File

@@ -0,0 +1,927 @@
/**
* 2010-2023 Webkul.
*
* NOTICE OF LICENSE
*
* All right is reserved,
* Please go through LICENSE.txt file inside our module
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize this module for your
* needs please refer to CustomizationPolicy.txt file inside our module for more information.
*
* @author Webkul IN
* @copyright 2010-2023 Webkul IN
* @license LICENSE.txt
*/
/* elements - start */
.well.well-order-date {
background: #2FA368;
padding: 16px 15px;
border-radius: 4px;
color: #FFF;
font-size: 16px;
}
.card {
padding: 0;
border-radius: 4px;
border: 1px solid #E5E5E5;
background: #FFF;
box-shadow: 0px 1px 6px 0px rgba(0, 0, 0, 0.10);
color: #333;
}
.card .card-header {
padding: 10px 15px;
margin-bottom: 0;
border-bottom: 1px solid #E5E5E5;
font-size: 20px;
font-weight: bold;
line-height: 27px;
}
.card .card-subheader {
margin-bottom: 0;
font-size: 14px;
font-weight: normal;
}
.card .card-body {
padding: 15px;
}
.card .card-body .card-title {
margin: 0;
font-size: 18px;
font-weight: bold;
}
.card .card-body .card-subtitle {
margin: 0;
margin-bottom: 8px;
font-size: 16px;
font-weight: bold;
}
.card .card-body .card-text {
font-size: 14px;
line-height: 26px;
}
.description-list {
margin-top: 12px;
}
.description-list dl {
font-size: 16px;
margin-bottom: 0;
}
.description-list dt,
.description-list dd {
margin: 5px 0;
}
.description-list dd .hotel-email {
word-wrap: break-word;
}
.description-list .label {
font-size: 12px;
}
.hotel-location p.hotel-address {
font-size: 16px;
line-height: 24px;
}
.booking-hotel-map-container {
height: 200px;
}
.table.table-summary {
margin-bottom: 0;
border: none;
}
.table.table-summary td {
border-top: none;
font-size: 14px;
}
.table.table-summary.table-sm td {
padding: 6px 0;
}
.table.table-summary .price {
font-size: 14px;
color: #333;
}
.room-details .card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
.room-details .card-body {
padding: 0;
}
.room-details .booking-room-detail {
padding: 20px;
position: relative;
}
.room-details .booking-room-detail:not(:last-of-type) {
border-bottom: 1px solid #E5E5E5;
}
.booking-room-detail .description-list dt {
font-weight: 400;
}
.booking-room-detail .description-list dd {
font-weight: 600;
}
.booking-room-detail .img-room-type {
width: 100%;
border-radius: 2px;
}
.booking-room-detail .room-type-name h3 {
display: inline-block;
margin: 0;
font-size: 20px;
font-weight: bold;
color: #333;
}
.booking-room-detail .order-price-info {
position: relative;
top: -1px;
}
.booking-room-detail .num-refunded-rooms {
position: absolute;
top: 20px;
right: 20px;
}
.booking-room-detail .num-refunded-rooms .badge {
padding: 8px;
font-size: 12px;
border-radius: 2px;
}
.booking-room-detail .btn-view-extra-services {
color: #167BFF;
}
@media (min-width: 992px) and (max-width: 1199px) {
.booking-room-detail .info-wrap {
margin-top: 10px;
}
.booking-room-detail .info-wrap .description-list {
margin-top: 10px;
}
}
.order-messages .card-body {
padding: 0;
}
.order-messages .message {
padding: 20px;
}
.order-messages .message.management {
margin: 0 20px;
border-left: 1px solid #333;
background-color: rgba(229, 229, 229, 0.30);
}
.order-messages .message-content {
margin-top: 10px;
}
.order-messages .message-content br {
display: block;
content: '';
height: 8px;
}
.add-order-message .dropdown {
width: 300px;
}
.add-order-message .dropdown button {
min-width: 300px;
text-align: left;
font-size: 16px;
color: #0006;
border: 1px solid #E5E5E5;
border-radius: 4px;
}
.add-order-message .dropdown button::after {
content: '\2304';
position: absolute;
top: -7px;
right: 10px;
font-size: 28px;
font-weight: 100;
color: #333;
}
.add-order-message .dropdown .dropdown-menu {
width: 100%;
left: 0;
right: unset;
border-radius: 4px;
}
.add-order-message .dropdown .dropdown-menu > li > a {
padding-top: 4px;
padding-bottom: 4px;
font-size: 16px;
}
.add-order-message form textarea {
border-radius: 4px;
border: 1px solid #E5E5E5;
background: #FFF;
}
.fancybox-wrap.fancybox-order-detail {
top: 72px !important;
}
.fancybox-wrap.fancybox-order-detail .card {
width: 650px;
}
.fancybox-wrap.fancybox-order-detail .fancybox-close {
background: none;
top: 8px;
right: 10px;
font-size: 32px;
}
.fancybox-wrap.fancybox-order-detail .fancybox-close:after {
content: '\00D7';
color: #333;
}
.fancybox-wrap.fancybox-order-detail .card-body {
padding: 0;
max-height: 70vh;
overflow: auto;
}
.fancybox-wrap.fancybox-order-detail .card-body::-webkit-scrollbar {
width: 14px;
}
.fancybox-wrap.fancybox-order-detail .card-body::-webkit-scrollbar-track {
background-color: #F1F1F1;
}
.fancybox-wrap.fancybox-order-detail .card-body::-webkit-scrollbar-thumb {
border-radius: 9px;
background-color: #C1C1C1;
border: 4px solid #F1F1F1;
}
.fancybox-wrap.fancybox-order-detail .card-body .room-type-wrap {
padding: 15px;
}
.fancybox-wrap.fancybox-order-detail .card-body .room-type-wrap:not(:last-of-type) {
border-bottom: 1px solid #E5E5E5;
}
.fancybox-wrap.fancybox-order-detail .room-type-wrap p a {
font-size: 18px;
color: #333;
font-weight: bold;
}
.fancybox-wrap.fancybox-order-detail .room-type-wrap .row {
margin-left: -5px;
margin-right: -5px;
}
.fancybox-wrap.fancybox-order-detail .room-type-wrap [class*=col] {
padding-left: 5px;
padding-right: 5px;
}
.fancybox-wrap.fancybox-order-detail .room-type-wrap .labels {
color: #5B5B5B;
font-size: 14px;
margin-bottom: 10px;
}
.fancybox-wrap.fancybox-order-detail .room-type-wrap .date-diff {
color: #333;
font-size: 16px;
margin-bottom: 6px;
}
.fancybox-wrap.fancybox-order-detail .room-type-wrap .date-diff select.form-control {
max-width: 150px;
}
.fancybox-wrap.fancybox-order-detail .card-footer {
padding: 10px 15px;
border-top: 1px solid #E5E5E5;
}
.fancybox-wrap.fancybox-order-detail .card-footer .btn {
padding: 10px 30px;
border-radius: 2px;
font-size: 14px;
line-height: 22px;
font-weight: bold;
}
.fancybox-wrap.fancybox-order-detail .card-footer .btn:not(:last-of-type) {
margin-right: 10px;
}
.fancybox-wrap.fancybox-order-detail .card-footer .btn:hover {
opacity: 0.8;
}
.fancybox-wrap.fancybox-order-detail .card-footer .btn.btn-primary {
border: 1px solid #1292FF;
background: #1292FF;
color: #FFF;
}
.fancybox-wrap.fancybox-order-detail .card-footer .btn.btn-secondary {
border: 1px solid #E5E5E5;
background: #fff;
color: #2E2E2E;
}
.label {
color: #333;
font-weight: normal;
border-radius: 2px;
}
.alert {
border-radius: 4px;
}
.button.button-medium {
padding: 8px 15px;
background-color: #379bf0;
background-image: none;
border-radius: 2px;
}
.button.button-medium span {
padding: 0;
}
.button.button-medium:hover,
.button.button-medium:focus,
.button.button-medium:active {
opacity: 0.8;
}
/* elements - end */
.page-heading.bottom-indent {
margin-bottom: 32px;
}
#order-detail-content table .return_quantity_buttons {
margin-top: 3px;
}
#order-detail-content table .return_quantity_buttons a {
display: none;
float: left;
}
#order-detail-content table .return_quantity_buttons a+a {
margin-left: 3px;
}
#order-detail-content table .order_qte_input {
display: none;
width: 57px;
height: 27px;
line-height: 27px;
padding: 0;
text-align: center;
}
#order-detail-content table label {
font-weight: 400;
}
.wk_booking_details_wrapper table {
margin-bottom: 10px !important;
}
.wk_booking_details_wrapper table .table_body .cart_product img {
border-radius: 2px;
}
.table td.step-by-step-date {
width: 105px;
}
.table tfoot strong {
color: #333;
}
.info-order i {
font-size: 20px;
}
.info-order i.icon-gift {
color: #f13340;
}
.info-order i.icon-repeat {
color: #55c65e;
}
#sendOrderMessage {
margin-bottom: 30px;
}
#sendOrderMessage select.form-control {
width: 263px;
}
/* ----- Order cancellation in order detail page ---- */
.standard_refund_fields {
display: none;
}
.loading_overlay {
display: none;
position: fixed;
left: 0;
top: 0;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.5);
z-index: 100000;
}
.loading-img {
position: absolute;
left: 50%;
top: 50%;
}
.refund_reason_head {
margin-bottom: 15px;
font-size: 22px;
color: #414141;
}
#reasonForRefund {
font-size: 14px;
color: #777777;
}
.booking-actions-wrap .btn {
font-size: 14px;
padding: 8px 20px;
font-weight: bold;
text-align: center;
margin-left: 10px;
margin-top: 1px;
margin-bottom: 1px;
border-radius: 2px;
}
.reason_submit_wrapper {
text-align: center;
}
/* ----- Order cancellation in order detail page ---- */
.back_o_msg {
color: red;
font-size: 14px;
}
.cust_serv_lnk {
text-decoration: underline;
}
.room_type_old_price {
text-decoration: line-through;
color: #979797;
font-size: 12px;
}
.cancel_requests_link_wrapper {
color: #000;
line-height: 18px;
font-size: 13px;
padding-top: 12px;
padding-bottom: 12px;
}
.cancel_requests_link_wrapper i {
font-size: 20px;
color: #1292FF;
background-color: #E0EEFF;
margin-right: 4px;
position: relative;
top: 2px
}
.cancel_requests_link_wrapper a {
font-weight: bold;
font-style: italic;
text-decoration: underline;
color: #000;
}
/* refund buttons */
#order-detail .checkbox {
margin-bottom: 15px;
line-height: 12px;
}
#order-detail .booking_refund_fields label {
font-size: 14px;
color: #333;
font-weight: bold;
padding-left: 6px;
}
#order-detail #order_refund_request {
background-color: #ff4b4b;
border: 1px solid #ff4b4b;
color: #FFF;
}
#order-detail #order_refund_request:focus,
#order-detail #order_refund_request:hover {
opacity: 0.8;
}
#order-detail #order_refund_request_submit {
background-color: #36BA46;
border: 1px solid #36BA46;
color: #fff;
font-weight: bold;
text-transform: uppercase;
font-size: 14px;
padding: 12px 30px;
}
#order-detail #submit_refund_reason {
background-color: #1292FF;
border: 1px solid #1292FF;
color: #fff;
font-weight: bold;
text-transform: uppercase;
font-size: 14px;
padding: 12px 30px;
}
.refund_request_fields {
display: none;
}
.ui-tooltip.price-tootip {
box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%);
background: #FFFFFF;
border: unset;
color: #333;
padding: 2px 10px;
max-height: 310px;
overflow-y: auto;
}
.price-info-tooltip-cont {
min-width: 180px;
}
.price-info-tooltip-cont .list-row {
display: flex;
justify-content: space-between;
margin: 5px 0;
}
.price-info-tooltip-cont .list-row p {
margin: 0;
}
.hotel-details .form-group,
.guest-details .form-group {
margin-bottom: 10px;
}
.hotel-details .form-group p,
.guest-details .form-group p {
margin: 0;
display: inline-block;
font-size: 16px;
color: #333;
}
.hotel-details .form-group p:first-child,
.guest-details .form-group p:first-child {
font-weight: bold;
}
.hotel-details .form-group p:nth-child(2),
.guest-details .form-group p:nth-child(2) {
float: right;
max-width: 50%;
text-align: right;
word-break: break-all;
}
#create-new-refund-popup .card.cancel-booking .card-footer {
display: flex;
justify-content: space-between;
align-items: center;
}
#create-new-refund-popup .row.no-gutters [class*="col-"] {
padding-right: 0;
padding-left: 0;
}
#create-new-refund-popup .tab-content {
margin-top: 0;
}
/* nav-tabs resets - start */
#create-new-refund-popup .nav-tabs,
#create-new-refund-popup .nav-tabs > li,
#create-new-refund-popup .nav-tabs > li > a {
border: none;
}
#create-new-refund-popup .nav-tabs > li {
margin: 0;
}
/* nav-tabs resets - end */
/* nav-tabs custom - start */
#create-new-refund-popup .nav-tabs > li > a {
border-right: 1px solid #E5E5E5;
color: #333;
}
#create-new-refund-popup .nav-tabs > li:not(:last-of-type) > a {
border-bottom: 1px solid #E5E5E5;
}
#create-new-refund-popup .nav-tabs > li:last-of-type:first-of-type > a {
border-bottom: 1px solid #E5E5E5;
}
#create-new-refund-popup .nav-tabs li.active a {
border-right: none;
}
/* nav-tabs custom - end */
#create-new-refund-popup .nav-tabs li.active a::after {
content: '';
position: absolute;
top: 0;
left: 0;
width: 2px;
height: 100%;
background-color: #1292FF;
}
#create-new-refund-popup .nav-tabs li a .room-type-name {
font-size: 14px;
font-weight: 600;
margin-bottom: 2px;
}
#create-new-refund-popup .tab-content .room-type-summary {
padding: 10px 15px;
border-bottom: 1px solid #E5E5E5;
}
#create-new-refund-popup .tab-content .room-type-summary .room-type-name {
font-size: 16px;
font-weight: bold;
}
#create-new-refund-popup .tab-content .room-type-summary > [class*=col-xs-] > p {
font-size: 10px;
margin-bottom: 0px;
}
#create-new-refund-popup .tab-content .room-details {
padding: 10px 15px;
}
#create-new-refund-popup .tab-content .room-details.cancelled {
background-color: #F5F5F5;
}
#create-new-refund-popup .tab-content .room-details.cancelled .badge-cancelled {
position: absolute;
top: -4px;
margin-left: 6px;
padding: 5px 10px;
border-radius: 31px;
font-size: 12px;
background-color: #FF4B4B;
}
#create-new-refund-popup .room-details .occupancy-wrap {
position: relative;
}
#create-new-refund-popup .room-details .occupancy-wrap .checkbox {
margin: 0;
}
#create-new-refund-popup .room-details .occupancy-wrap .checker {
margin-right: 8px;
}
#create-new-refund-popup .room-details .checkbox label {
font-size: 14px;
font-weight: 600;
color: #333;
}
#create-new-refund-popup .room-details .checkbox label + span {
font-size: 12px;
}
#create-new-refund-popup .room-details .extra-services-wrap {
margin-top: 4px;
padding-left: 23px;
}
#create-new-refund-popup .room-details .extra-services-wrap > div:not(:first-of-type) {
margin-top: 4px;
}
#create-new-refund-popup .services-wrap .service:not(:last-of-type)::after,
#create-new-refund-popup .facilities-wrap .facility:not(:last-of-type)::after {
content: ' | ';
}
#create-new-refund-popup .card.cancel-booking-preview .card-body {
padding: 15px;
}
#create-new-refund-popup .card.cancel-booking-preview .well {
box-shadow: none;
background-color: #EEF4FF;
border: 1px solid #1292FF;
border-radius: 4px;
padding: 10px 15px;
}
#create-new-refund-popup .card.cancel-booking-preview .well p {
margin: 0;
font-size: 12px;
color: #333333
}
#create-new-refund-popup .card.cancel-booking-preview .form-group .label {
padding: 0;
margin-bottom: 8px;
font-size: 14px;
}
#create-new-refund-popup .card.cancel-booking-preview .form-group .label sup {
color: #FF4B4B;
}
#create-new-refund-popup .card.cancel-booking-preview .form-group textarea {
border: 1px solid #E5E5E5;
border-radius: 4px;
color: #333;
}
#create-new-refund-popup .card.cancel-booking-preview .form-group textarea:focus {
box-shadow: none;
}
#create-new-refund-popup .card.cancel-booking-preview .errors .alert-danger {
padding: 8px 15px;
background-color: #FF4B4B1A;
border: 1px solid #FF4B4B;
border-radius: 4px;
font-size: 12px;
font-weight: normal;
color: #FF4B4B;
text-shadow: none;
}
#create-new-refund-popup .card.cancel-booking-preview .errors .alert-danger::before {
content: none;
}
#create-new-refund-popup .card.cancel-booking-preview .errors .alert-danger p {
margin: 0;
margin-bottom: 2px;
}
.fancybox-order-detail.feedback {
width: 480px !important;
}
.fancybox-order-detail.feedback .card {
width: 480px !important;
padding: 25px 25px;
}
.fancybox-order-detail.feedback i {
font-size: 120px;
}
.fancybox-order-detail.feedback h3 {
font-size: 22px;
}
.fancybox-order-detail.feedback h4 {
margin-top: 16px;
font-size: 16px;
line-height: 24px;
}
#popup-view-extra-services .nav-tabs {
border-bottom: none;
}
#popup-view-extra-services .nav-tabs > li {
width: 50%;
text-align: center;
margin: 0;
}
#popup-view-extra-services .nav-tabs > li > a {
border: none;
margin: 0;
font-size: 14px;
font-weight: bold;
color: #333;
}
#popup-view-extra-services .nav-tabs > li.active {
border-bottom: 1px solid #1292FF;
}
#popup-view-extra-services .nav-tabs > li.active > a {
color: #1292FF;
}
#popup-view-extra-services .nav-tabs > li:not(.active) {
border-bottom: 1px solid #F0F0F0;
}
#popup-view-extra-services .tab-content {
margin-top: 0;
padding: 0 15px 15px;
}
#popup-view-extra-services .tab-content .rooms_extra_demands_text {
padding: 10px 0px;
border-bottom: 1px solid #F0F0F0;
font-size: 12px;
}
#popup-view-extra-services .tab-content .room_demands:not(:last-of-type) {
margin-bottom: 20px;
}
#popup-view-extra-services .tab-content .demand_header {
font-size: 16px;
font-weight: bold;
line-height: 24px;
margin-bottom: 10px;
}
#popup-view-extra-services .tab-content .room_demand_detail {
font-size: 14px;
font-weight: 500;
}
#popup-view-extra-services .tab-content .room_demand_block {
display: flex;
justify-content: space-between;
}

View File

@@ -46,6 +46,20 @@
{assign var=products value=$order->products}
{assign var=customizedDatas value=$order->customizedDatas}
{assign var=HOOK_ORDERDETAILDISPLAYED value=$order->hook_orderdetaildisplayed}
{assign var=total_convenience_fee_ti value=$order->total_convenience_fee_ti}
{assign var=total_convenience_fee_te value=$order->total_convenience_fee_te}
{assign var=total_demands_price_ti value=$order->total_demands_price_ti}
{assign var=total_demands_price_te value=$order->total_demands_price_te}
{assign var=any_back_order value=$order->any_back_order}
{assign var=shw_bo_msg value=$order->shw_bo_msg}
{assign var=back_ord_msg value=$order->back_ord_msg}
{assign var=order_has_invoice value=$order->order_has_invoice}
{assign var=cart_htl_data value=$order->cart_htl_data}
{assign var=non_requested_rooms value=$order->non_requested_rooms}
{assign var=customerGuestDetail value=$order->customerGuestDetail}
{assign var=obj_hotel_branch_information value=$order->obj_hotel_branch_information}
{assign var=hotel_address_info value=$order->hotel_address_info}
{if isset($order->total_old)}
{assign var=total_old value=$order->total_old}
{/if}

View File

@@ -61,7 +61,7 @@
{* {if isset($order.invoice) && $order.invoice && isset($order.virtual) && $order.virtual}
<img class="icon" src="{$img_dir}icon/download_product.gif" alt="{l s='Products to download'}" title="{l s='Products to download'}" />
{/if} *}
<a class="color-myaccount" href="javascript:showOrder(1, {$order.id_order|intval}, '{$link->getPageLink('order-detail', true)|escape:'html':'UTF-8'}');">
<a class="color-myaccount" href="{$link->getPageLink('order-detail', true, NULL, "id_order={$order.id_order|intval}")|escape:'html':'UTF-8'}">
{Order::getUniqReferenceOf($order.id_order)}
</a>
</td>
@@ -99,7 +99,7 @@
{/if}
</td>
<td class="history_detail">
<a class="btn btn-default button button-small" href="javascript:showOrder(1, {$order.id_order|intval}, '{$link->getPageLink('order-detail', true)|escape:'html':'UTF-8'}');">
<a class="btn btn-default button button-small" href="{$link->getPageLink('order-detail', true, NULL, "id_order={$order.id_order|intval}")|escape:'html':'UTF-8'}">
<span>
{l s='Details'}<i class="icon-chevron-right right"></i>
</span>
@@ -137,16 +137,3 @@
</a>
</li>
</ul>
<!-- By webkul added for history controller url on history.js -->
{strip}
{addJsDef historyUrl=$link->getPageLink("orderdetail", true)|escape:'quotes':'UTF-8'}
{addJsDefL name=req_sent_msg}{l s='Request Sent..' js=1}{/addJsDefL}
{addJsDefL name=wait_stage_msg}{l s='Waiting' js=1}{/addJsDefL}
{addJsDefL name=pending_state_msg}{l s='Pending...' js=1}{/addJsDefL}
{addJsDefL name=mail_sending_err}{l s='Some error occurred while sending mail to the customer' js=1}{/addJsDefL}
{addJsDefL name=refund_request_sending_error}{l s='Some error occurred while processing request for booking cancelation.' js=1}{/addJsDefL}
{addJsDefL name=no_bookings_selected}{l s='No rooms selected. Please select at least one room.' js=1}{/addJsDefL}
{addJsDefL name=refund_request_success_txt}{l s='Request for booking cancelation is successffully created.' js=1}{/addJsDefL}
{addJsDefL name=cancel_req_txt}{l s='Cancel Request' js=1}{/addJsDefL}
{addJsDefL name=cancel_booking_txt}{l s='Cancel Bookings' js=1}{/addJsDefL}
{/strip}

View File

@@ -115,7 +115,6 @@ $(document).ready(function(){
});
$(document).on('click', '.open_rooms_extra_services_panel', function() {
console.log('dasdasd');
var idProduct = $(this).data('id_product');
var idOrder = $(this).data('id_order');
var dateFrom = $(this).data('date_from');

View File

@@ -1,306 +0,0 @@
/*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2017 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
//show the order-details with ajax
function showOrder(mode, var_content, file)
{
$.get(
file,
((mode === 1) ? {'id_order': var_content, 'ajax': true} : {'id_order_return': var_content, 'ajax': true}),
function(data)
{
$('#block-order-detail').fadeOut('slow', function()
{
$(this).html(data);
$('.footab').footable();
/* if return is allowed*/
if ($('#order-detail-content .order_cb').length > 0)
{
//return slip : check or uncheck every checkboxes
$('#order-detail-content th input[type=checkbox]').click(function()
{
$('#order-detail-content td input[type=checkbox]').each(function()
{
this.checked = $('#order-detail-content th input[type=checkbox]').is(':checked');
updateOrderLineDisplay(this);
});
});
//return slip : enable or disable 'global' quantity editing
$('#order-detail-content td input[type=checkbox]').click(function()
{
updateOrderLineDisplay(this);
});
//return slip : limit quantities
$('#order-detail-content td .order_qte_input').keyup(function()
{
var maxQuantity = parseInt($(this).parent().find('.order_qte_span').text());
var quantity = parseInt($(this).val());
if (isNaN($(this).val()) && $(this).val() !== '')
{
$(this).val(maxQuantity);
}
else
{
if (quantity > maxQuantity)
$(this).val(maxQuantity);
else if (quantity < 1)
$(this).val(1);
}
});
// The button to increment the product return value
$(document).on('click', '.return_quantity_down', function(e){
e.preventDefault();
var $input = $(this).parent().parent().find('input');
var count = parseInt($input.val()) - 1;
count = count < 1 ? 1 : count;
$input.val(count);
$input.change();
});
// The button to decrement the product return value
$(document).on('click', '.return_quantity_up', function(e){
e.preventDefault();
var maxQuantity = parseInt($(this).parent().parent().find('.order_qte_span').text());
var $input = $(this).parent().parent().find('input');
var count = parseInt($input.val()) + 1;
count = count > maxQuantity ? maxQuantity : count;
$input.val(count);
$input.change();
});
}
//catch the submit event of sendOrderMessage form
$('form#sendOrderMessage').submit(function(){
return sendOrderMessage();
});
$(this).fadeIn('slow', function() {
$('html, body').animate({
scrollTop: $('#block-order-detail').offset().top
}, 1200);
initPriceTooltip();
});
});
});
}
function updateOrderLineDisplay(domCheckbox)
{
var lineQuantitySpan = $(domCheckbox).parent().parent().find('.order_qte_span');
var lineQuantityInput = $(domCheckbox).parent().parent().find('.order_qte_input');
var lineQuantityButtons = $(domCheckbox).parent().parent().find('.return_quantity_up, .return_quantity_down');
if($(domCheckbox).is(':checked'))
{
lineQuantitySpan.hide();
lineQuantityInput.show();
lineQuantityButtons.show();
}
else
{
lineQuantityInput.hide();
lineQuantityButtons.hide();
lineQuantityInput.val(lineQuantitySpan.text());
lineQuantitySpan.show();
}
}
//send a message in relation to the order with ajax
function sendOrderMessage()
{
paramString = "ajax=true";
$('#sendOrderMessage').find('input, textarea, select').each(function(){
paramString += '&' + $(this).attr('name') + '=' + encodeURIComponent($(this).val());
});
$.ajax({
type: "POST",
headers: { "cache-control": "no-cache" },
url: $('#sendOrderMessage').attr("action") + '?rand=' + new Date().getTime(),
data: paramString,
beforeSend: function(){
$(".button[name=submitMessage]").prop("disabled", "disabled");
},
success: function(msg){
$('#block-order-detail').fadeOut('slow', function() {
$(this).html(msg);
//catch the submit event of sendOrderMessage form
$('#sendOrderMessage').submit(function(){
return sendOrderMessage();
});
$(this).fadeIn('slow');
$(".button[name=submitMessage]").prop("disabled", false);
});
},
error: function(){
$(".button[name=submitMessage]").prop("disabled", false);
}
});
return false;
}
function initPriceTooltip()
{
if ($('.order-price-info').length) {
$('.order-price-info').each(function() {
$(this).tooltip({
content: $(this).closest('td').find('.price-info-container').html(),
items: "span",
trigger : 'hover',
tooltipClass: "price-tootip",
open: function(event, ui) {
if (typeof(event.originalEvent) === 'undefined')
{
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
// ajax function to pull in data and add it to the tooltip goes here
},
close: function(event, ui) {
ui.tooltip.hover(function()
{
$(this).stop(true).fadeTo(400, 1);
},
function()
{
$(this).fadeOut('400', function()
{
$(this).remove();
});
});
}
});
});
}
}
$(document).ready(function(){
var page = $('html, body');
page.on('mousewheel', function () {
page.stop();
});
// If customer clicks for refund request then toggle refund request fields
$('body').on('click', '#order_refund_request', function(e) {
e.preventDefault();
if ($(this).attr('refund_fields_on') == 0) {
$('.standard_refund_fields').show();
$(this).attr('refund_fields_on', 1);
$(this).addClass('cancel_request_btn');
$(this).html('<i class="icon-close"></i> ' + cancel_req_txt);
} else {
$('.standard_refund_fields').hide();
$(this).attr('refund_fields_on', 0);
$(this).removeClass('cancel_request_btn');
$(this).text(cancel_booking_txt);
}
});
$('body').on('click', '#order_refund_request_submit', function(e) {
e.preventDefault();
// get the checked bookings to refund
var bookings_to_refund = $("input[name='bookings_to_refund[]']:checked").map(function(){return $(this).val();}).get();
// check if at least one room is selected for refund request
if (bookings_to_refund.length) {
bookings_to_refund = JSON.stringify(bookings_to_refund);
$.fancybox({
href: "#reason_fancybox_content",
minWidth : 500,
autoScale : true,
autoSize : true,
'hideOnContentClick': false,
beforeLoad: function () {
$('#htlRefundReasonForm #bookings_to_refund').val(bookings_to_refund);
},
beforeClose: function () {
$('#bookings_to_refund').val('');
$('.cancel_req_amount').hide();
$('.reasonForRefund').css('border','1px solid #d6d4d4');
$('.required_err').hide();
}
});
} else {
showErrorMessage(no_bookings_selected);
}
});
$('body').on('click', '#submit_refund_reason', function() {
var bookings_to_refund = $('#htlRefundReasonForm #bookings_to_refund').val();
if (bookings_to_refund) {
var cancellation_reason = $('.reasonForRefund').val();
var id_order = $(this).data('id_order');
if (cancellation_reason == '') {
$('.required_err').show();
$('.reasonForRefund').css('border','1px solid #AA1F00');
} else {
$(".loading_overlay").show();
$('#submit_refund_reason').attr('disabled', 'disabled');
$.ajax({
data:{
contentType: "application/json; charset=UTF-8",
id_order: id_order,
bookings_to_refund: bookings_to_refund,
cancellation_reason : cancellation_reason,
ajax : true,
method: 'submitRefundRequest',
},
method:'POST',
dataType:'JSON',
url:historyUrl,
success:function(data) {
if (data.status == '1') {
$(".roomRequestForRefund").parent().html('<p>'+req_sent_msg+'</p>');
showSuccessMessage(refund_request_success_txt);
$('.bookings_to_refund:checked').prop('disabled', true);
$.fancybox.close();
showOrder(1, $("input[name=id_order]").val(), historyUrl)
} else {
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();
}
});
}
} else {
showErrorMessage(no_bookings_selected);
}
});
initPriceTooltip();
});

View File

@@ -0,0 +1,323 @@
/*
* 2007-2017 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2017 PrestaShop SA
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*/
// send a message in relation to the order with ajax
function sendOrderMessage() {
let paramString = 'ajax=true&action=submitMessage';
$('#sendOrderMessage').find('input, textarea, select').each(function () {
paramString += '&' + $(this).attr('name') + '=' + encodeURIComponent($(this).val());
});
$.ajax({
type: 'POST',
headers: { 'cache-control': 'no-cache' },
url: $('#sendOrderMessage').attr('action') + '?rand=' + new Date().getTime(),
data: paramString,
dataType: 'JSON',
beforeSend: function () {
$('.add-order-message .errors-block').hide(200).html('');
$('.button[name=submitMessage]').prop('disabled', 'disabled');
},
success: function (response) {
if (response.has_errors) {
$('.add-order-message .errors-block').html(response.errors_html).show(200);
} else if (response.status) {
if (!$('.order-messages .messages-list .message').length) {
$('.order-messages').removeClass('hide');
}
$('.order-messages .messages-list').prepend(response.message_html);
$('.add-order-message .select-room-type button span').html(order_message_choose_txt);
$('.add-order-message .select-room-type .id_product').val(0);
$('.add-order-message form textarea').val('');
showSuccessMessage(order_message_success_txt);
}
},
complete: function () {
$('.button[name=submitMessage]').prop('disabled', false);
}
});
}
function initPriceTooltip() {
if ($('.order-price-info').length) {
$('.order-price-info').each(function () {
$(this).tooltip({
content: $(this).closest('dd').find('.price-info-container').html(),
items: 'span',
trigger: 'hover',
tooltipClass: 'price-tootip',
open: function (event, ui) {
if (typeof (event.originalEvent) === 'undefined') {
return false;
}
var $id = $(ui.tooltip).attr('id');
// close any lingering tooltips
if ($('div.ui-tooltip').not('#' + $id).length) {
return false;
}
},
close: function (event, ui) {
ui.tooltip.hover(function () {
$(this).stop(true).fadeTo(400, 1);
},
function () {
$(this).fadeOut('400', function () {
$(this).remove();
});
});
}
});
});
}
}
function initMap() {
const hotelLocation = {
lat: Number(hotel_location.latitude),
lng: Number(hotel_location.longitude),
};
$('.booking-hotel-map-container').each(function (i, element) {
const map = new google.maps.Map(element, {
zoom: 10,
center: hotelLocation,
disableDefaultUI: true,
fullscreenControl: true,
});
const marker = new google.maps.Marker({
position: hotelLocation,
map: map,
title: hotel_name,
});
marker.addListener('click', function() {
let query = '';
if (hotel_location.map_input_text != '') {
query = hotel_location.map_input_text;
} else {
query = hotel_location.latitude + ',' + hotel_location.longitude;
}
window.open('https://www.google.com/maps/search/?api=1&query='+encodeURIComponent(query), '_blank');
});
});
}
/* Refund management - start */
const BookingRefundManager = {
show: function() {
$.fancybox.open({
href: '#create-new-refund-popup',
wrapCSS: 'fancybox-order-detail',
padding: 0,
});
},
close: function() {
$.fancybox.close();
},
beforeSubmit: function() {
BookingRefundManager.hideGeneralErrors();
BookingRefundManager.disableSubmitButton();
},
validate: function() {
if (!$('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').length) {
showErrorMessage(no_bookings_selected);
return false;
}
return true;
},
submit: function() {
BookingRefundManager.beforeSubmit();
const formData = new FormData($('#form-cancel-booking').get(0));
formData.append('ajax', true);
formData.append('token', token);
formData.append('action', 'SubmitRefundRequest');
$.ajax({
url: location.href,
data: formData,
processData: false,
contentType: false,
type: 'POST',
dataType: 'JSON',
success: function(response) {
if (response.has_errors) {
BookingRefundManager.showGeneralErrors(response.errors_html);
} else {
BookingRefundManager.close();
BookingRefundManager.showSuccessMessage();
BookingRefundManager.reset();
}
},
complete: function() {
BookingRefundManager.enableSubmitButton();
},
});
},
reset: function () {
$('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').closest('.room-details').addClass('cancelled');
$('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').closest('span').removeClass('checked');
$('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').attr('disabled', true);
$('#form-cancel-booking .num-selected-rooms').html('00');
$('#form-cancel-booking .count-total-rooms').html('00');
$('#form-cancel-booking .cancellation_reason').val('');
$('#form-cancel-booking .cancel-booking').show();
$('#form-cancel-booking .cancel-booking-preview').hide();
},
updateSelectedRooms: function() {
let countSelected = $('#form-cancel-booking input.bookings_to_refund:not(:disabled):checked').length;
countSelected = (countSelected <= 9) ? ('0' + countSelected) : countSelected;
$('#form-cancel-booking .num-selected-rooms').html(countSelected);
$('#form-cancel-booking .count-total-rooms').html(countSelected);
},
showGeneralErrors: function(errors) {
$('.fancybox-wrap.fancybox-order-detail .cancel-booking-preview .errors').stop().html(errors);
$('.fancybox-wrap.fancybox-order-detail .cancel-booking-preview .errors').show(200);
},
hideGeneralErrors: function() {
$('.fancybox-wrap.fancybox-order-detail .cancel-booking-preview .errors').hide(200, function() {
$('.fancybox-wrap.fancybox-order-detail .cancel-booking-preview .errors').html('');
});
},
enableSubmitButton: function() {
$('#form-cancel-booking .btn-submit').removeClass('disabled');
},
disableSubmitButton: function() {
$('#form-cancel-booking .btn-submit').addClass('disabled');
},
showSuccessMessage: function() {
$.fancybox.open({
href: '#popup-cancellation-submit-success',
wrapCSS: 'fancybox-order-detail feedback',
padding: 0,
});
},
}
$(document).on('click', '#order_refund_request', function(e) {
e.preventDefault();
BookingRefundManager.show();
});
$(document).on('click', '.fancybox-order-detail .cancel-booking .btn-cancel', function(e) {
e.preventDefault();
BookingRefundManager.close();
});
$(document).on('click', '.fancybox-order-detail .cancel-booking .btn-next', function(e) {
e.preventDefault();
if (BookingRefundManager.validate()) {
$('.fancybox-order-detail .cancel-booking').hide();
$('.fancybox-order-detail .cancel-booking-preview').show();
}
});
$(document).on('click', '.fancybox-order-detail .cancel-booking-preview .btn-back', function(e) {
e.preventDefault();
$('.fancybox-order-detail .cancel-booking-preview').hide();
$('.fancybox-order-detail .cancel-booking').show();
});
$(document).on('click', '.fancybox-order-detail .cancel-booking-preview .btn-submit', function(e) {
e.preventDefault();
BookingRefundManager.submit();
});
$(document).on('click', '.fancybox-order-detail input.bookings_to_refund', function() {
BookingRefundManager.updateSelectedRooms();
});
/* Refund management - end */
$(document).on('click', '.btn-view-extra-services', function(e) {
e.preventDefault();
let idProduct = $(this).data('id_product');
let idOrder = $(this).data('id_order');
let dateFrom = $(this).data('date_from');
let dateTo = $(this).data('date_to');
$.ajax({
type: 'POST',
headers: {
'cache-control': 'no-cache',
},
url: window.location,
dataType: 'json',
cache: false,
data: {
date_from: dateFrom,
date_to: dateTo,
id_product: idProduct,
id_order: idOrder,
action: 'getRoomTypeBookingDemands',
ajax: true,
token: static_token,
},
success: function(result) {
if (result.extra_demands) {
$('#popup-view-extra-services').html('');
$('#popup-view-extra-services').append(result.extra_demands);
$.fancybox.open({
href: '#popup-view-extra-services',
wrapCSS: 'fancybox-order-detail',
padding: 0,
});
}
},
});
});
$(document).ready(function () {
$(document).on('click', '.add-order-message .dropdown-menu li a', function (e) {
e.preventDefault();
$('.add-order-message .select-room-type button span').html($(this).html());
$('.add-order-message .select-room-type .id_product').val($(this).attr('value'));
});
$(document).on('click', '#submitMessage', function (e) {
e.preventDefault();
sendOrderMessage();
});
initPriceTooltip();
if (typeof google === 'object'
&& typeof google.maps === 'object'
&& typeof hotel_location === 'object'
) {
initMap();
}
});

File diff suppressed because it is too large Load Diff

View File

@@ -62,7 +62,7 @@
</span>
</td>
<td class="history_method">
<a class="color-myaccount" href="javascript:showOrder(1, {$slip.id_order|intval}, '{$link->getPageLink('order-detail')|escape:'html':'UTF-8'}');">
<a class="color-myaccount" href="{$link->getPageLink('order-detail', true, NULL, "id_order={$slip.id_order|intval}")|escape:'html':'UTF-8'}" target="_blank">
#{$slip.id_order|string_format:"%06d"}
</a>
</td>