From 125948ad015ca771e6e2c653151647746d9bf31f Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Sat, 28 Jan 2023 18:09:33 +0530 Subject: [PATCH 01/18] Resolved: incorrect id_guest in cookie after login --- classes/Context.php | 81 ++++++++++++++++++++++++ classes/Guest.php | 41 ++++++------ classes/controller/FrontController.php | 1 + controllers/front/AuthController.php | 64 ++----------------- controllers/front/OrderOpcController.php | 18 +----- controllers/front/PasswordController.php | 3 + modules/statsdata/statsdata.php | 30 +-------- 7 files changed, 114 insertions(+), 124 deletions(-) diff --git a/classes/Context.php b/classes/Context.php index c6d21c4de..fa672b884 100644 --- a/classes/Context.php +++ b/classes/Context.php @@ -288,4 +288,85 @@ class ContextCore { return clone($this); } + + public function updateCustomer(Customer $customer, $loginCustomer = 0) + { + $this->customer = $customer; + $this->cookie->id_customer = (int) $customer->id; + $this->cookie->customer_lastname = $customer->lastname; + $this->cookie->customer_firstname = $customer->firstname; + $this->cookie->passwd = $customer->passwd; + $this->cookie->logged = true; + $customer->logged = true; + $this->cookie->email = $customer->email; + $this->cookie->is_guest = $customer->isGuest(); + + $currentCookieGuest = $this->cookie->id_guest; + + if (Configuration::get('PS_CART_FOLLOWING') && (empty($this->cookie->id_cart) || Cart::getNbProducts((int) $this->cookie->id_cart) == 0) && $idCart = (int) Cart::lastNoneOrderedCart($this->customer->id)) { + $this->cart = new Cart($idCart); + $this->cart->secure_key = $customer->secure_key; + if (!$loginCustomer) { + $this->cookie->id_guest = (int) $this->cart->id_guest; + } + } else { + if (!isset($this->cookie->id_guest)) { + Guest::setNewGuest($this->cookie); + } + + if (Validate::isLoadedObject($this->cart)) { + $idCarrier = (int) $this->cart->id_carrier; + $this->cart->secure_key = $customer->secure_key; + $this->cart->id_guest = (int) $this->cookie->id_guest; + $this->cart->id_carrier = 0; + if (!empty($idCarrier)) { + $deliveryOption = [$this->cart->id_address_delivery => $idCarrier . ',']; + $this->cart->setDeliveryOption($deliveryOption); + } else { + $this->cart->setDeliveryOption(null); + } + $this->cart->id_customer = (int) $customer->id; + $this->cart->updateAddressId($this->cart->id_address_delivery, (int) Address::getFirstCustomerAddressId((int) ($customer->id))); + $this->cart->id_address_delivery = (int) Address::getFirstCustomerAddressId((int) ($customer->id)); + $this->cart->id_address_invoice = (int) Address::getFirstCustomerAddressId((int) ($customer->id)); + + // update id guest in htl_cart_booking_data for bookings added to the cart as a visitor + $objCartBookingData = new HotelCartBookingData(); + if ($hotelCartBookings = $objCartBookingData->getCartCurrentDataByCartId($this->cart->id)) { + foreach ($hotelCartBookings as $cartBooking) { + $objCartBookingData = new HotelCartBookingData($cartBooking['id']); + $objCartBookingData->id_guest = (int) $this->cookie->id_guest; + $objCartBookingData->id_customer = (int) $customer->id; + $objCartBookingData->save(); + } + } + } + } + if (Validate::isLoadedObject($this->cart)) { + $this->cart->save(); + $this->cart->autosetProductAddress(); + + $this->cookie->id_cart = (int) $this->cart->id; + } + + // if customer is login to account + if ($loginCustomer) { + // Update or merge the guest with the customer id (login and account creation) + $objGuest = new Guest($currentCookieGuest); + if ($customerGuestId = Guest::getFromCustomer((int)$this->cookie->id_customer)) { + if ($objGuest->id != $customerGuestId) { + // The new guest is merged with the old one when it's connecting to an account + $objGuest->mergeWithCustomer($customerGuestId, $this->cookie->id_customer); + + // update the id_guest in the cookie + $this->cookie->id_guest = $customerGuestId; + } + } else { + $objGuest->id_customer = (int)$this->cookie->id_customer; + $objGuest->update(); + } + } + + $this->cookie->write(); + } } diff --git a/classes/Guest.php b/classes/Guest.php index 92adb0a76..15a71165c 100644 --- a/classes/Guest.php +++ b/classes/Guest.php @@ -160,30 +160,35 @@ class GuestCore extends ObjectModel if (!Validate::isUnsignedId($id_customer)) { return false; } - $result = Db::getInstance()->getRow(' - SELECT `id_guest` - FROM `'._DB_PREFIX_.'guest` - WHERE `id_customer` = '.(int)($id_customer)); - return $result['id_guest']; + + if ($result = Db::getInstance()->getRow( + 'SELECT `id_guest` FROM `'._DB_PREFIX_.'guest` WHERE `id_customer` = '.(int)($id_customer) + )) { + return $result['id_guest']; + } + + return false; } - public function mergeWithCustomer($id_guest, $id_customer) + public function mergeWithCustomer($idGuest, $idCustomer) { // Since the guests are merged, the guest id in the connections table must be changed too - Db::getInstance()->execute(' - UPDATE `'._DB_PREFIX_.'connections` c - SET c.`id_guest` = '.(int)($id_guest).' - WHERE c.`id_guest` = '.(int)($this->id)); + Db::getInstance()->update('connections', [ + 'id_guest' => (int) $idGuest, + ], 'id_guest = ' . (int) $this->id); - // The current guest is removed from the database + // Since the guests are merged, the guest id in the cart table must be changed too + Db::getInstance()->update('cart', [ + 'id_guest' => (int) $idGuest, + ], 'id_guest = ' . (int) $this->id); + + // Since the guests are merged, the guest id in the htl_cart_booking_data table must be changed too + Db::getInstance()->update('htl_cart_booking_data', [ + 'id_guest' => (int) $idGuest, + ], 'id_guest = ' . (int) $this->id); + + // The current guest is removed from the database because now we have old customer guest id $this->delete(); - - // $this is still filled with values, so it's id is changed for the old guest - $this->id = (int)($id_guest); - $this->id_customer = (int)($id_customer); - - // $this is now the old guest but filled with the most up to date values - $this->update(); } public static function setNewGuest($cookie) diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index cdd22e7a8..fed3d2679 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -1528,6 +1528,7 @@ class FrontControllerCore extends Controller $this->context->cookie->is_guest = $customer->isGuest(); $this->context->cookie->passwd = $customer->passwd; $this->context->cookie->email = $customer->email; + $this->context->cookie->id_guest = (int) $cart->id_guest; return $id_cart; } } diff --git a/controllers/front/AuthController.php b/controllers/front/AuthController.php index 32ab62ac7..611a1531b 100644 --- a/controllers/front/AuthController.php +++ b/controllers/front/AuthController.php @@ -299,40 +299,7 @@ class AuthControllerCore extends FrontController } elseif (!$authentication || !$customer->id) { $this->errors[] = Tools::displayError('Authentication failed.'); } else { - $this->context->cookie->id_compare = isset($this->context->cookie->id_compare) ? $this->context->cookie->id_compare: CompareProduct::getIdCompareByIdCustomer($customer->id); - $this->context->cookie->id_customer = (int)($customer->id); - $this->context->cookie->customer_lastname = $customer->lastname; - $this->context->cookie->customer_firstname = $customer->firstname; - $this->context->cookie->logged = 1; - $customer->logged = 1; - $this->context->cookie->is_guest = $customer->isGuest(); - $this->context->cookie->passwd = $customer->passwd; - $this->context->cookie->email = $customer->email; - - // Add customer to the context - $this->context->customer = $customer; - - if (Configuration::get('PS_CART_FOLLOWING') && (empty($this->context->cookie->id_cart) || Cart::getNbProducts($this->context->cookie->id_cart) == 0) && $id_cart = (int)Cart::lastNoneOrderedCart($this->context->customer->id)) { - $this->context->cart = new Cart($id_cart); - } else { - $id_carrier = (int)$this->context->cart->id_carrier; - $this->context->cart->id_carrier = 0; - $this->context->cart->setDeliveryOption(null); - $this->context->cart->id_address_delivery = (int)Address::getFirstCustomerAddressId((int)($customer->id)); - $this->context->cart->id_address_invoice = (int)Address::getFirstCustomerAddressId((int)($customer->id)); - } - $this->context->cart->id_customer = (int)$customer->id; - $this->context->cart->secure_key = $customer->secure_key; - - if ($this->ajax && isset($id_carrier) && $id_carrier && Configuration::get('PS_ORDER_PROCESS_TYPE')) { - $delivery_option = array($this->context->cart->id_address_delivery => $id_carrier.','); - $this->context->cart->setDeliveryOption($delivery_option); - } - - $this->context->cart->save(); - $this->context->cookie->id_cart = (int)$this->context->cart->id; - $this->context->cookie->write(); - $this->context->cart->autosetProductAddress(); + $this->context->updateCustomer($customer, 1); Hook::exec('actionAuthentication', array('customer' => $this->context->customer)); @@ -508,7 +475,7 @@ class AuthControllerCore extends FrontController } } - $this->updateContext($customer); + $this->context->updateCustomer($customer, 1); $this->context->cart->update(); Hook::exec('actionCustomerAccountAdd', array( @@ -671,7 +638,7 @@ class AuthControllerCore extends FrontController // we add the guest customer in the guest customer group $customer->addGroups(array((int)Configuration::get('PS_GUEST_GROUP'))); } - $this->updateContext($customer); + $this->context->cart->id_address_delivery = (int)Address::getFirstCustomerAddressId((int)$customer->id); $this->context->cart->id_address_invoice = (int)Address::getFirstCustomerAddressId((int)$customer->id); if (isset($address_invoice) && Validate::isLoadedObject($address_invoice)) { @@ -683,6 +650,7 @@ class AuthControllerCore extends FrontController $this->context->cart->setDeliveryOption($delivery_option); } + $this->context->updateCustomer($customer, 1); // If a logged guest logs in as a customer, the cart secure key was already set and needs to be updated $this->context->cart->update(); @@ -786,30 +754,6 @@ class AuthControllerCore extends FrontController } } - /** - * Update context after customer creation - * @param Customer $customer Created customer - */ - protected function updateContext(Customer $customer) - { - $this->context->customer = $customer; - $this->context->smarty->assign('confirmation', 1); - $this->context->cookie->id_customer = (int)$customer->id; - $this->context->cookie->customer_lastname = $customer->lastname; - $this->context->cookie->customer_firstname = $customer->firstname; - $this->context->cookie->passwd = $customer->passwd; - $this->context->cookie->logged = 1; - // if register process is in two steps, we display a message to confirm account creation - if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE')) { - $this->context->cookie->account_created = 1; - } - $customer->logged = 1; - $this->context->cookie->email = $customer->email; - $this->context->cookie->is_guest = !Tools::getValue('is_new_customer', 1); - // Update cart address - $this->context->cart->secure_key = $customer->secure_key; - } - /** * sendConfirmationMail * @param Customer $customer diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index c45aa2d48..5aee90df5 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -149,7 +149,7 @@ class OrderOpcControllerCore extends ParentOrderController if (!count($this->errors)) { $customer = new Customer($this->context->customer->id); if ($customer->transformToCustomer($this->context->language->id, $passwd)) { - $this->updateContext($customer); + $this->context->updateCustomer($customer); } else { $this->errors[] = Tools::displayError('An error occurred while transforming your account into a registered customer.'); } @@ -1049,20 +1049,4 @@ class OrderOpcControllerCore extends ParentOrderController } $this->context->cart->save(); } - - public function updateContext(Customer $customer) - { - $this->context->cookie->id_customer = (int)$customer->id; - $this->context->cookie->customer_lastname = $customer->lastname; - $this->context->cookie->customer_firstname = $customer->firstname; - $this->context->cookie->passwd = $customer->passwd; - $this->context->cookie->logged = 1; - $this->context->cookie->email = $customer->email; - $this->context->cookie->is_guest = 0; - - $this->context->cart->secure_key = $customer->secure_key; - - $customer->logged = 1; - $this->context->customer = $customer; - } } diff --git a/controllers/front/PasswordController.php b/controllers/front/PasswordController.php index 317818c87..f5c8c38fd 100644 --- a/controllers/front/PasswordController.php +++ b/controllers/front/PasswordController.php @@ -84,6 +84,9 @@ class PasswordControllerCore extends FrontController '{passwd}' => $password ); if (Mail::Send($this->context->language->id, 'password', Mail::l('Your new password'), $mail_params, $customer->email, $customer->firstname.' '.$customer->lastname)) { + + $this->context->updateCustomer($customer); + $this->context->smarty->assign(array('confirmation' => 1, 'customer_email' => $customer->email)); } else { $this->errors[] = Tools::displayError('An error occurred while sending the email.'); diff --git a/modules/statsdata/statsdata.php b/modules/statsdata/statsdata.php index 3e36b4216..cdf36c865 100644 --- a/modules/statsdata/statsdata.php +++ b/modules/statsdata/statsdata.php @@ -49,9 +49,7 @@ class StatsData extends Module public function install() { return (parent::install() - && $this->registerHook('displayFooter') - && $this->registerHook('authentication') - && $this->registerHook('createAccount')); + && $this->registerHook('displayFooter')); } public function getContent() @@ -112,32 +110,6 @@ class StatsData extends Module return ''; } - public function hookCreateAccount($params) - { - return $this->hookAuthentication($params); - } - - public function hookAuthentication($params) - { - // Update or merge the guest with the customer id (login and account creation) - $guest = new Guest($params['cookie']->id_guest); - $result = Db::getInstance()->getRow(' - SELECT `id_guest` - FROM `'._DB_PREFIX_.'guest` - WHERE `id_customer` = '.(int)$params['cookie']->id_customer); - - if ((int)$result['id_guest']) { - // The new guest is merged with the old one when it's connecting to an account - $guest->mergeWithCustomer($result['id_guest'], $params['cookie']->id_customer); - $params['cookie']->id_guest = $guest->id; - } else { - // The guest is duplicated if it has multiple customer accounts - $method = ($guest->id_customer) ? 'add' : 'update'; - $guest->id_customer = $params['cookie']->id_customer; - $guest->{$method}(); - } - } - public function renderForm() { $fields_form = array( From 1bfa256d1e20071e47328c05862f9398d4e52f17 Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Mon, 13 Mar 2023 11:13:20 +0530 Subject: [PATCH 02/18] show service cost seprate from room cost --- .../classes/HotelCartBookingData.php | 28 +++++++++++++++++++ .../hotel-reservation-theme/shopping-cart.tpl | 8 +++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index 3afd75fac..15fc9489b 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -1331,12 +1331,26 @@ class HotelCartBookingData extends ObjectModel $data_v['date_from'], $data_v['date_to'] ); + $roomTypeDateRangePriceWithoutAutoAdd = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( + $product['id_product'], + $data_v['date_from'], + $data_v['date_to'], + 0, + 0, + 0, + 0, + 0, + 0 + ); if (!$price_tax) { $amount = $roomTypeDateRangePrice['total_price_tax_excl']; + $amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_excl']; } else { $amount = $roomTypeDateRangePrice['total_price_tax_incl']; + $amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_incl']; } $cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount'] = $amount * $varQty; + $cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount_without_auto_add'] = $amountWithoutAutoAdd * $varQty; } else { $cartHotelData[$prodKey]['date_diff'][$dateJoin]['demand_price'] = $totalAdditionalServicePrice; $numDays = $objBookingDetail->getNumberOfDays($data_v['date_from'], $data_v['date_to']); @@ -1359,12 +1373,26 @@ class HotelCartBookingData extends ObjectModel $data_v['date_from'], $data_v['date_to'] ); + $roomTypeDateRangePriceWithoutAutoAdd = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( + $product['id_product'], + $data_v['date_from'], + $data_v['date_to'], + 0, + 0, + 0, + 0, + 0, + 0 + ); if (!$price_tax) { $amount = $roomTypeDateRangePrice['total_price_tax_excl']; + $amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_excl']; } else { $amount = $roomTypeDateRangePrice['total_price_tax_incl']; + $amountWithoutAutoAdd = $roomTypeDateRangePriceWithoutAutoAdd['total_price_tax_incl']; } $cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount'] = $amount; + $cartHotelData[$prodKey]['date_diff'][$dateJoin]['amount_without_auto_add'] = $amountWithoutAutoAdd; $cartHotelData[$prodKey]['date_diff'][$dateJoin]['link'] = $context->link->getPageLink( 'order-opc', null, diff --git a/themes/hotel-reservation-theme/shopping-cart.tpl b/themes/hotel-reservation-theme/shopping-cart.tpl index 4c04053b5..48867d4b6 100644 --- a/themes/hotel-reservation-theme/shopping-cart.tpl +++ b/themes/hotel-reservation-theme/shopping-cart.tpl @@ -148,8 +148,14 @@

- {displayPrice price=($rm_v['amount'])} + {displayPrice price=($rm_v['amount_without_auto_add'])} +
+ {if ($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0} + + + {displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])} + + {/if} {if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])} + From d2e03bd8fd5346bba1dc5b63bc9f81042bd9320f Mon Sep 17 00:00:00 2001 From: "lakshya.chauhan193" Date: Wed, 15 Mar 2023 20:02:11 +0530 Subject: [PATCH 03/18] resolved refund request payment calculation --- .../controllers/orders/_product_line.tpl | 2 +- classes/Product.php | 2 +- classes/order/Order.php | 56 +++- classes/order/OrderReturn.php | 61 +--- controllers/admin/AdminOrdersController.php | 45 +-- controllers/front/OrderDetailController.php | 7 +- install/data/xml/configuration.xml | 3 + .../classes/HotelBookingDemands.php | 10 + .../classes/HotelReservationSystemDb.php | 2 + .../RoomTypeServiceProductOrderDetail.php | 16 +- .../admin/AdminOrderRefundRulesController.php | 156 +++++++++- .../helpers/view/view.tpl | 4 +- .../helpers/options/index.php | 29 ++ .../helpers/options/options.tpl | 288 ++++++++++++++++++ .../hotel-reservation-theme/order-return.tpl | 4 +- 15 files changed, 588 insertions(+), 97 deletions(-) create mode 100644 modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/index.php create mode 100644 modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/options.tpl diff --git a/admin/themes/default/template/controllers/orders/_product_line.tpl b/admin/themes/default/template/controllers/orders/_product_line.tpl index 5f0af8220..bbb7ed3fb 100644 --- a/admin/themes/default/template/controllers/orders/_product_line.tpl +++ b/admin/themes/default/template/controllers/orders/_product_line.tpl @@ -245,7 +245,7 @@   {/if} - + {* edit/delete controls *}

- + \ No newline at end of file diff --git a/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/index.php b/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/index.php new file mode 100644 index 000000000..b1297ac0b --- /dev/null +++ b/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2020 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/options.tpl b/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/options.tpl new file mode 100644 index 000000000..6a6edf1a6 --- /dev/null +++ b/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/options.tpl @@ -0,0 +1,288 @@ +{** +* 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 +*} + +{extends file="helpers/options/options.tpl"} + +{block name="input"} + {if $field['type'] == 'select'} +
+ {if $field['list']} + + {elseif isset($input.empty_message)} + {$input.empty_message} + {/if} +
+{elseif $field['type'] == 'group'} + {assign var=groups value=$field['values']} + {if count($groups) && isset($groups)} +
+
+ + + + + + + + + + {foreach $groups as $key => $group} + + + + + + {/foreach} + +
+ + + + {l s='ID'} + + {l s='Order States'} + +
+ {assign var=id_checkbox value=WK_ALLOW_ORDER_STATUS_TO_REFUND|cat:'_'|cat:$group['id_order_state']} + + {$group['id_order_state']} + +
+
+
+ {else} +

+ {l s='No group created'} +

+ {/if} +{elseif $field['type'] == 'bool'} +
+ + {strip} + + + + + {/strip} + + +
+{elseif $field['type'] == 'radio'} +
+ {foreach $field['choices'] AS $k => $v} +

+ {strip} + + {/strip} +

+ {/foreach} +
+ {elseif $field['type'] == 'checkbox'} +
+ {foreach $field['choices'] AS $k => $v} +

+ {strip} + + {/strip} +

+ {/foreach} +
+ {elseif $field['type'] == 'text'} +
{if isset($field['suffix'])}
+ {/if} + + {if isset($field['suffix'])} + + {$field['suffix']|strval} + + {/if} + {if isset($field['suffix'])} +
{/if} +
+ {elseif $field['type'] == 'password'} +
{if isset($field['suffix'])}
+ {/if} + + {if isset($field['suffix'])} + + {$field['suffix']|strval} + + {/if} + {if isset($field['suffix'])} +
{/if} +
+{elseif $field['type'] == 'textarea'} +
+ +
+{elseif $field['type'] == 'file'} +
{$field['file']}
+{elseif $field['type'] == 'color'} +
+
+ +
+
+{elseif $field['type'] == 'price'} +
+
+ {$currency_left_sign}{$currency_right_sign} {l s='(tax excl.)'} + +
+
+{elseif $field['type'] == 'textLang' || $field['type'] == 'textareaLang' || $field['type'] == 'selectLang'} + {if $field['type'] == 'textLang'} +
+
+ {foreach $field['languages'] AS $id_lang => $value} + {if $field['languages']|count > 1} +
+
+ {else} +
+ {/if} + + {if $field['languages']|count > 1} +
+
+ + +
+
+ {else} +
+ {/if} + {/foreach} +
+
+ {elseif $field['type'] == 'textareaLang'} +
+ {foreach $field['languages'] AS $id_lang => $value} +
+
+ +
+
+ + +
+ +
+ {/foreach} + +
+ {elseif $field['type'] == 'selectLang'} + {foreach $languages as $language} +
+ +
+ {/foreach} + {/if} +{/if} +{if isset($field['desc']) && !empty($field['desc'])} +
+
+ {if is_array($field['desc'])} + {foreach $field['desc'] as $p} + {if is_array($p)} + {$p.text}
+ {else} + {$p}
+ {/if} + {/foreach} + {else} + {$field['desc']} + {/if} +
+
+{/if} +{/block} \ No newline at end of file diff --git a/themes/hotel-reservation-theme/order-return.tpl b/themes/hotel-reservation-theme/order-return.tpl index f34eb786f..280918719 100644 --- a/themes/hotel-reservation-theme/order-return.tpl +++ b/themes/hotel-reservation-theme/order-return.tpl @@ -67,7 +67,7 @@ {$booking['date_from']|date_format:"%d-%m-%Y"} {l s='To'} {$booking['date_to']|date_format:"%d-%m-%Y"} {$booking['num_rooms']|escape:'htmlall':'UTF-8'} {displayPrice price=$booking['total_price_tax_incl'] currency=$orderCurrency['id']} - {displayPrice price=$booking['extra_demands_price_tax_incl'] currency=$orderCurrency['id']} + {displayPrice price=$booking['extra_demand_service_total_paid_amount'] currency=$orderCurrency['id']} {if $isRefundCompleted} {displayPrice price=$booking['refunded_amount'] currency=$orderCurrency['id']} @@ -142,4 +142,4 @@ + \ No newline at end of file From 89bdb9871ef56275501f6017c9981f257079cac3 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Thu, 23 Mar 2023 14:39:10 +0530 Subject: [PATCH 04/18] Channel manager connector module issues resolved and images changes --- modules/qlochannelmanagerconnector/logo.gif | Bin 568 -> 1664 bytes modules/qlochannelmanagerconnector/logo.png | Bin 8598 -> 2024 bytes .../qlochannelmanagerconnector.php | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/qlochannelmanagerconnector/logo.gif b/modules/qlochann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+r=<-=+T5_IYw|r7pYsJarLk@hrr-DU~Itu&c6u!EL z|L<$8P2b6;rn5H{qeQzfeZk|%P|ahP*|tBM&1pY3#4K1MEc%F<<6mF*7&6qvX{L}O zwi|v+F6g^#ohXxk*;KaM*ng!$w}r!nqA{SSir6fo7w}6oOQMii8SsgF_8Wn=B@4sh z0R>YOXx|+ZEi6mK4qP8ITX^{qqmIAJ%D#G^8YfMQw19xI*DtZ?zR?YyR^oTf*atKe zMOQPAoFj;PP%`B`$!W|v{~oqad&s9K#9SCQ5Y+)t(w(txO5y@?-6%U=iMaQJXu^?V z$mvs{Ji&VrheDQ^L2Ro^BC9QY9h|5JsK$3X4)E)H^ej1>ZV%rys*YddMfBF$yMjN* zlrMZ_lB!^0!39#+UU-6V{vRp4V>^IPBoqMJDO ViW9MS-zES+O-W0!M&1(fe*n`@0rCI< diff --git a/modules/qlochannelmanagerconnector/qlochannelmanagerconnector.php b/modules/qlochannelmanagerconnector/qlochannelmanagerconnector.php index 0b5c65cfd..82f58b76c 100644 --- a/modules/qlochannelmanagerconnector/qlochannelmanagerconnector.php +++ b/modules/qlochannelmanagerconnector/qlochannelmanagerconnector.php @@ -72,7 +72,7 @@ class QloChannelManagerConnector extends Module public function hookActionValidateOrder($data) { // If the order request is coming from channel manager ip then only enter in database - if (Tools::getRemoteAddr() != '54.216.64.42') { + if (Tools::getRemoteAddr() == '54.216.64.42') { $order = $data['order']; if (!QcmcChannelManagerBooking::getChannelManagerBookings($order->id)) { $objChannelManagerBooking = new QcmcChannelManagerBooking(); From 967b4385aef812efdf648b3d31b95b92149b694f Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Fri, 24 Mar 2023 10:54:51 +0530 Subject: [PATCH 05/18] added room price info on checkout page --- classes/Cart.php | 14 +++++++ classes/controller/FrontController.php | 1 + controllers/front/OrderOpcController.php | 1 + controllers/front/ProductController.php | 2 - themes/hotel-reservation-theme/css/global.css | 8 ++++ .../hotel-reservation-theme/js/order-opc.js | 37 +++++++++++++++++++ .../hotel-reservation-theme/shopping-cart.tpl | 15 +++++--- 7 files changed, 71 insertions(+), 7 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index fe5e5a1a1..06130a302 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -3785,7 +3785,20 @@ class CartCore extends ObjectModel } } + $discountedProducts = array(); foreach ($cart_rules as $key => &$cart_rule) { + $product_rule_groups = $cart_rule['obj']->getProductRuleGroups(); + foreach ($product_rule_groups as $id_product_rule_group => $product_rule_group) { + if (isset($product_rule_group['product_rules']) && $product_rule_group['product_rules']) { + foreach($product_rule_group['product_rules'] as $rule_products) { + if ($rule_products['type'] == 'products') { + $discountedProducts = array_merge($discountedProducts, $rule_products['values']); + } + } + + } + } + if (((float)$cart_rule['value_real'] == 0 && (int)$cart_rule['free_shipping'] == 0)) { unset($cart_rules[$key]); } @@ -3825,6 +3838,7 @@ class CartCore extends ObjectModel 'total_price' => $base_total_tax_inc, 'total_tax' => $total_tax, 'total_price_without_tax' => $base_total_tax_exc, + 'discounted_products' => $discountedProducts, 'is_multi_address_delivery' => $this->isMultiAddressDelivery() || ((int)Tools::getValue('multi-shipping') == 1), 'free_ship' =>!$total_shipping && !count($this->getDeliveryAddressesWithoutCarriers(true, $errors)), 'carrier' => new Carrier($this->id_carrier, $id_lang), diff --git a/classes/controller/FrontController.php b/classes/controller/FrontController.php index cdd22e7a8..012fe6d17 100644 --- a/classes/controller/FrontController.php +++ b/classes/controller/FrontController.php @@ -1083,6 +1083,7 @@ class FrontControllerCore extends Controller $this->addjqueryPlugin('fancybox'); $this->addJS(_PS_JS_DIR_.'hookLiveEdit.js'); } + $this->addJqueryUI('ui.tooltip', 'base', true); if (Configuration::get('PS_QUICK_VIEW')) { $this->addjqueryPlugin('fancybox'); diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index f787834b5..a08bd1cae 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -557,6 +557,7 @@ class OrderOpcControllerCore extends ParentOrderController if (!empty($cartProducts)) { if ($cartBookingInfo = HotelCartBookingData::getHotelCartBookingData()) { + // ddd($cartBookingInfo); $this->context->smarty->assign('cart_htl_data', $cartBookingInfo); } $objHotelServiceProductCartDetail = new HotelServiceProductCartDetail(); diff --git a/controllers/front/ProductController.php b/controllers/front/ProductController.php index 74f8030fc..c20dc67c0 100644 --- a/controllers/front/ProductController.php +++ b/controllers/front/ProductController.php @@ -62,8 +62,6 @@ class ProductControllerCore extends FrontController $this->addCSS(_THEME_CSS_DIR_.'occupancy.css'); $this->addJS(_THEME_JS_DIR_.'occupancy.js'); - $this->addJqueryUI('ui.tooltip', 'base', true); - if (Configuration::get('PS_DISPLAY_JQZOOM') == 1) { $this->addJqueryPlugin('jqzoom'); } diff --git a/themes/hotel-reservation-theme/css/global.css b/themes/hotel-reservation-theme/css/global.css index b04c0d762..16eec4358 100644 --- a/themes/hotel-reservation-theme/css/global.css +++ b/themes/hotel-reservation-theme/css/global.css @@ -8505,6 +8505,14 @@ div.star.star_hover:after { content: "\f057"; font-family: "FontAwesome"; } +body .ui-tooltip { + box-shadow: 0 2px 6px 0 rgb(0 0 0 / 20%); + background: #FFFFFF; + border: unset; + color: #333; + padding: 10px 15px; +} + #facebook_block, #cmsinfo_block { overflow: hidden; diff --git a/themes/hotel-reservation-theme/js/order-opc.js b/themes/hotel-reservation-theme/js/order-opc.js index 23d5f7e26..2180e2bb9 100644 --- a/themes/hotel-reservation-theme/js/order-opc.js +++ b/themes/hotel-reservation-theme/js/order-opc.js @@ -33,6 +33,43 @@ $(document).ready(function() $(this).closest('.card').find('.step-edit').addClass('hidden'); }); + // room price details tooltip + if ($('.room_price_detail_block .room-price-detail').length) { + $('.room_price_detail_block .room-price-detail img').tooltip({ + content: $('.room_price_detail_block .room-price-detail-container').html(), + items: "span", + trigger : 'hover', + tooltipClass: "room-price-detail-tooltip", + open: function(event, ui) + { + if (typeof(event.originalEvent) === 'undefined') + { + return false; + } + + var $id = $(ui.tooltip).attr('id'); + + 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(); + }); + }); + } + }); + } + // BY WEBKUL // FOR ADVANCED PAYMENT var payment_type = $(".payment_type:checked").val(); diff --git a/themes/hotel-reservation-theme/shopping-cart.tpl b/themes/hotel-reservation-theme/shopping-cart.tpl index 48867d4b6..a750fc5b9 100644 --- a/themes/hotel-reservation-theme/shopping-cart.tpl +++ b/themes/hotel-reservation-theme/shopping-cart.tpl @@ -148,13 +148,18 @@

- {displayPrice price=($rm_v['amount_without_auto_add'])} + {displayPrice price=($rm_v['amount'])} -
- {if ($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0} - - + {displayPrice price=($rm_v['amount'] - $rm_v['amount_without_auto_add'])} + {if (($rm_v['amount'] - $rm_v['amount_without_auto_add']) > 0) && in_array($data_v['id_product'], $discounted_products)} + + +

{/if} {if (isset($data_v['extra_demands']) && $data_v['extra_demands']) || (isset($data_v['service_products']) && $data_v['service_products'])} From 08b8d39ad263ca805e57296083b4d294c1487527 Mon Sep 17 00:00:00 2001 From: "lakshya.chauhan193" Date: Fri, 24 Mar 2023 19:50:58 +0530 Subject: [PATCH 06/18] added is_cancelled column in orderdetail table --- .../controllers/orders/_product_line.tpl | 9 + .../orders/_rooms_informaion_table.tpl | 3 + .../controllers/orders/helpers/view/view.tpl | 96 +- classes/order/Order.php | 8 +- controllers/admin/AdminOrdersController.php | 7 + controllers/front/OrderDetailController.php | 28 +- install/data/xml/configuration.xml | 5 +- .../classes/HotelBookingDetail.php | 4 + .../classes/HotelReservationSystemDb.php | 3 +- .../RoomTypeServiceProductOrderDetail.php | 2 + .../admin/AdminOrderRefundRulesController.php | 151 -- .../helpers/options/index.php | 29 - .../helpers/options/options.tpl | 288 ---- .../hotel-reservation-theme/order-detail.tpl | 1326 +++++++++-------- 14 files changed, 774 insertions(+), 1185 deletions(-) delete mode 100644 modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/index.php delete mode 100644 modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/options.tpl diff --git a/admin/themes/default/template/controllers/orders/_product_line.tpl b/admin/themes/default/template/controllers/orders/_product_line.tpl index bbb7ed3fb..820be14dc 100644 --- a/admin/themes/default/template/controllers/orders/_product_line.tpl +++ b/admin/themes/default/template/controllers/orders/_product_line.tpl @@ -231,6 +231,15 @@ {/if} {/if} + {if isset($isCancelledRoom) && $isCancelledRoom} + + {if $data.is_refunded == $orderCancelled} + {l s='Cancelled'} + {else} + {l s='Allotted'} + {/if} + + {/if} {if ($can_edit && !$order->hasBeenDelivered())} {if sizeof($invoices_collection)} diff --git a/admin/themes/default/template/controllers/orders/_rooms_informaion_table.tpl b/admin/themes/default/template/controllers/orders/_rooms_informaion_table.tpl index 0419ec9cd..3447ee940 100644 --- a/admin/themes/default/template/controllers/orders/_rooms_informaion_table.tpl +++ b/admin/themes/default/template/controllers/orders/_rooms_informaion_table.tpl @@ -20,6 +20,9 @@ {l s='Refund State'} {l s='Refunded amount'} {/if} + {if isset($isCancelledRoom) && $isCancelledRoom} + {l s='Room Status'} + {/if} {if ($can_edit && !$order->hasBeenDelivered())} {l s='Edit Order'} {/if} diff --git a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl index 8a2b5b313..ec31d8d51 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -281,55 +281,57 @@ {if isset($htl_booking_order_data) && $htl_booking_order_data} {foreach from=$htl_booking_order_data item=data} - - - {$data['room_num']} - - - - {$data['hotel_name']} - - - - {dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']} - - - - - {l s='Documents'} {$data.num_checkin_documents} - - - -
-
- + {if $data.is_refunded != $orderCancelled} + + + {$data['room_num']} + + + + {$data['hotel_name']} + + + + {dateFormat date=$data['date_from']} - {dateFormat date=$data['date_to']} + + + + + {l s='Documents'} {$data.num_checkin_documents} + + + + +
+ - {if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']} -

{l s='Checked in on'} {dateFormat date=$data['check_in']}

- {elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']} -

{l s='Checked out on'} {dateFormat date=$data['check_out']}

- {/if} + {if $data['id_status'] == $hotel_order_status['STATUS_CHECKED_IN']['id_status']} +

{l s='Checked in on'} {dateFormat date=$data['check_in']}

+ {elseif $data['id_status'] == $hotel_order_status['STATUS_CHECKED_OUT']['id_status']} +

{l s='Checked out on'} {dateFormat date=$data['check_out']}

+ {/if} - {* field for the current date *} - + {* field for the current date *} + - - - - -
-
- -
- - - + + + + +
+
+ +
+ + + + {/if} {/foreach} {else} @@ -2057,4 +2059,4 @@ }); -{/block} +{/block} \ No newline at end of file diff --git a/classes/order/Order.php b/classes/order/Order.php index ae04fcf9d..eefa3bfe7 100644 --- a/classes/order/Order.php +++ b/classes/order/Order.php @@ -2553,8 +2553,8 @@ class OrderCore extends ObjectModel // $refundFlag [ORDER_RETURN_STATE_FLAG_REFUNDED || ORDER_RETURN_STATE_FLAG_DENIED] public function hasCompletelyRefunded($refundFlag = 0) { + $objHotelBooking = new HotelBookingdetail(); if ($refundBookings = OrderReturn::getOrdersReturnDetail($this->id)) { - $objHotelBooking = new HotelBookingdetail(); if ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) { if (count($refundBookings) == count($orderBookings)) { if ($refundFlag) { @@ -2578,6 +2578,12 @@ class OrderCore extends ObjectModel return true; } } + } elseif ($orderBookings = $objHotelBooking->getOrderCurrentDataByOrderId($this->id)) { + if (count(array_unique(array_column($orderBookings, 'is_cancelled'))) === 1 + && array_unique(array_column($orderBookings, 'is_cancelled'))[0] != 0 + ) { + return true; + } } return false; diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index b7e17703a..e5131748c 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -181,6 +181,7 @@ class AdminOrdersControllerCore extends AdminController $this->access_where = ' WHERE hbd.id_hotel IN ('.implode(',', $acsHtls).')'; } + parent::__construct(); } @@ -1660,6 +1661,10 @@ class AdminOrdersControllerCore extends AdminController $bookingOrderRoomInfo['num_checkin_documents'] = HotelBookingDocument::getCountByIdHtlBooking($bookingOrderRoomInfo['id']); } + $objHotelBookingDetail = new HotelBookingDetail(); + $htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id); + $isCancelledRoom = in_array(HotelBookingDetail::ORDER_CANCELED, array_column($htlBookingDetail, 'is_cancelled')); + // hotel booking statuses $htlOrderStatus = HotelBookingDetail::getAllHotelOrderStatus(); $this->tpl_view_vars = array( @@ -1753,6 +1758,8 @@ class AdminOrdersControllerCore extends AdminController 'products' => $products, 'customer' => $customer) ), + 'orderCancelled' => HotelBookingDetail::ORDER_CANCELED, + 'isCancelledRoom' => $isCancelledRoom, ); return parent::renderView(); diff --git a/controllers/front/OrderDetailController.php b/controllers/front/OrderDetailController.php index ab77b6ff0..bdbc51175 100644 --- a/controllers/front/OrderDetailController.php +++ b/controllers/front/OrderDetailController.php @@ -242,7 +242,17 @@ class OrderDetailControllerCore extends FrontController } else { $hasError = 1; } + $res = true; if (!$hasError) { + if ((int)$order->total_paid_real == 0){ + foreach ($bookingRefunds as $idHtlBooking) { + $objHtlBooking = new HotelBookingDetail($idHtlBooking); + $objHtlBooking->is_cancelled = HotelBookingDetail::ORDER_CANCELLED; + $objHtlBooking->save(); + + } + } + $objOrderReturn = new OrderReturn(); $objOrderReturn->id_customer = $order->id_customer; $objOrderReturn->id_order = $order->id; @@ -402,6 +412,8 @@ class OrderDetailControllerCore extends FrontController } } + $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( @@ -575,6 +587,11 @@ class OrderDetailControllerCore extends FrontController $redirectTermsLink = $this->context->link->getCMSLink(new CMS(3, $this->context->language->id), null, $this->context->language->id); } + + $objHotelBookingDetail = new HotelBookingDetail(); + $htlBookingDetail = $objHotelBookingDetail->getOrderCurrentDataByOrderId($order->id); + $isCancelledRoom = in_array(HotelBookingDetail::ORDER_CANCELLED, array_column($htlBookingDetail, 'is_cancelled')); + $this->context->smarty->assign( array( 'id_cms_refund_policy' => Configuration::get('WK_GLOBAL_REFUND_POLICY_CMS'), @@ -590,6 +607,8 @@ class OrderDetailControllerCore extends FrontController 'cart_htl_data' => $cartHotelData, 'cart_service_products' => $cartServiceProducts, 'non_requested_rooms' => $nonRequestedRooms, + 'orderCancelled' => HotelBookingDetail::ORDER_CANCELLED, + 'isCancelledRoom' => $isCancelledRoom, ) ); // } @@ -599,16 +618,11 @@ class OrderDetailControllerCore extends FrontController if ($refundReqBookings = $objOrderReturn->getOrderRefundRequestedBookings($order->id, 0, 1)) { $refundedAmount = $objOrderReturn->getRefundedAmount($order->id); } - $isRefundAllowed = (int)$order->isReturnable(); - if ($isRefundAllowed) { - $allowedOrderStatus = explode(',' ,Configuration::get('WK_ALLOW_ORDER_STATUS_TO_REFUND')); - $isRefundAllowed = $isRefundAllowed && in_array($order->current_state, $allowedOrderStatus); - } $this->context->smarty->assign( array( 'hasOrderPaid' => $order->hasBeenPaid(), // refund info - 'refund_allowed' => $isRefundAllowed, + 'refund_allowed' => (int) $order->isReturnable(), 'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id), 'refundReqBookings' => $refundReqBookings, 'hasCompletelyRefunded' => $order->hasCompletelyRefunded(), @@ -669,4 +683,4 @@ class OrderDetailControllerCore extends FrontController $this->addCSS(_THEME_CSS_DIR_.'addresses.css'); } } -} +} \ No newline at end of file diff --git a/install/data/xml/configuration.xml b/install/data/xml/configuration.xml index 3ba2e8689..935de20ba 100644 --- a/install/data/xml/configuration.xml +++ b/install/data/xml/configuration.xml @@ -904,9 +904,6 @@ 1 - - - 8,2 - + \ No newline at end of file diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 08ee46466..613ecf838 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -44,6 +44,7 @@ class HotelBookingDetail extends ObjectModel public $is_back_order; public $id_status; public $is_refunded; + public $is_cancelled; // public $available_for_order; // hotel information/location/contact @@ -73,6 +74,8 @@ class HotelBookingDetail extends ObjectModel const ALLOTMENT_AUTO = 1; const ALLOTMENT_MANUAL = 2; + const ORDER_CANCELLED = 1; + // Search algorithm: Exact room types reults, All room types const SEARCH_EXACT_ROOM_TYPE_ALGO = 1; const SEARCH_ALL_ROOM_TYPE_ALGO = 2; @@ -107,6 +110,7 @@ class HotelBookingDetail extends ObjectModel 'total_price_tax_incl' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'required' => true), 'total_paid_amount' => array('type' => self::TYPE_FLOAT, 'validate' => 'isPrice', 'default' => 0, 'required' => true), 'is_refunded' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), + 'is_cancelled' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), // 'available_for_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), 'is_back_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), diff --git a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php index e0189cef4..069ca850f 100644 --- a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php +++ b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php @@ -174,6 +174,7 @@ class HotelReservationSystemDb `children` smallint(6) NOT NULL DEFAULT '0', `child_ages` text NOT NULL, `is_refunded` tinyint(1) NOT NULL DEFAULT '0', + `is_cancelled` tinyint(1) NOT NULL DEFAULT '0', -- `available_for_order` tinyint(1) NOT NULL DEFAULT '0', `date_add` datetime NOT NULL, `date_upd` datetime NOT NULL, @@ -567,4 +568,4 @@ class HotelReservationSystemDb `'._DB_PREFIX_.'htl_access`' ); } -} +} \ No newline at end of file diff --git a/modules/hotelreservationsystem/classes/RoomTypeServiceProductOrderDetail.php b/modules/hotelreservationsystem/classes/RoomTypeServiceProductOrderDetail.php index 75fe35ea2..08efd42b0 100644 --- a/modules/hotelreservationsystem/classes/RoomTypeServiceProductOrderDetail.php +++ b/modules/hotelreservationsystem/classes/RoomTypeServiceProductOrderDetail.php @@ -202,7 +202,9 @@ class RoomTypeServiceProductOrderDetail extends ObjectModel } $sql .= ' FROM `'._DB_PREFIX_.'htl_booking_detail` hbd LEFT JOIN `'._DB_PREFIX_.'htl_room_type_service_product_order_detail` rsod ON(rsod.`id_htl_booking_detail` = hbd.`id`)'; + $sql .= ' LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON(od.`product_id` = rsod.`id_product`)'; + $sql .= ' WHERE hbd.`id` = '.(int)$idHotelBookingDetail; if ($getTotalPrice) { diff --git a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php index 42d53f25e..57a8c6965 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminOrderRefundRulesController.php @@ -27,17 +27,6 @@ class AdminOrderRefundRulesController extends ModuleAdminController } } - $orderStates = OrderState::getOrderStates($this->context->language->id); - $allowedOrderStatus = explode(',' ,Configuration::get('WK_ALLOW_ORDER_STATUS_TO_REFUND')); - if (count($allowedOrderStatus)) { - foreach ($orderStates as &$status) { - if (in_array($status['id_order_state'], $allowedOrderStatus)) { - $status['checked'] = true; - } else { - $status['checked'] = false; - } - } - } $this->fields_options = array( 'modulesetting' => array( 'title' => $this->l('Order Refund Setting'), @@ -57,14 +46,6 @@ class AdminOrderRefundRulesController extends ModuleAdminController 'identifier' => 'id_cms', 'hint' => $this->l('Select CMS for detailed refund policy for the customer.'), ), - 'WK_ALLOW_ORDER_STATUS_TO_REFUND' => array( - 'type' => 'group', - 'title' => $this->l('Allow order status for refund'), - 'values' => $orderStates, - 'name'=> 'WK_ALLOW_ORDER_STATUS_TO_REFUND', - 'required' => true, - 'hint' => $this->l('Select the order status at which customer will be able to create refund request.'), - ), ), 'submit' => array('title' => $this->l('Save')) ), @@ -124,138 +105,6 @@ class AdminOrderRefundRulesController extends ModuleAdminController ); } - public function processUpdateOptions() - { - $this->beforeUpdateOptions(); - - $languages = Language::getLanguages(false); - - $hide_multishop_checkbox = (Shop::getTotalShops(false, null) < 2) ? true : false; - foreach ($this->fields_options as $category_data) { - if (!isset($category_data['fields'])) { - continue; - } - - $fields = $category_data['fields']; - - foreach ($fields as $field => $values) { - if (isset($values['type']) && $values['type'] == 'selectLang') { - foreach ($languages as $lang) { - if (Tools::getValue($field.'_'.strtoupper($lang['iso_code']))) { - $fields[$field.'_'.strtoupper($lang['iso_code'])] = array( - 'type' => 'select', - 'cast' => 'strval', - 'identifier' => 'mode', - 'list' => $values['list'] - ); - } - } - } - } - - // Validate fields - foreach ($fields as $field => $values) { - if ($field != 'WK_ALLOW_ORDER_STATUS_TO_REFUND') { - // We don't validate fields with no visibility - if (!$hide_multishop_checkbox && Shop::isFeatureActive() && isset($values['visibility']) && $values['visibility'] > Shop::getContext()) { - continue; - } - - // Check if field is required - if ((!Shop::isFeatureActive() && isset($values['required']) && $values['required']) - || (Shop::isFeatureActive() && isset($_POST['multishopOverrideOption'][$field]) && isset($values['required']) && $values['required'])) { - if (isset($values['type']) && in_array($values['type'], array('textLang', 'textareaLang'))) { - foreach ($languages as $language) { - if (($value = Tools::getValue($field.'_'.$language['id_lang'])) == false && (string)$value != '0') { - $this->errors[] = sprintf(Tools::displayError('field %s is required.'), $values['title']); - } - } - } elseif (($value = Tools::getValue($field)) == false && (string)$value != '0') { - $this->errors[] = sprintf(Tools::displayError('field %s is required.'), $values['title']); - } - } - - // Check field validator - if (isset($values['type']) && in_array($values['type'], array('textLang', 'textareaLang'))) { - foreach ($languages as $language) { - if (Tools::getValue($field.'_'.$language['id_lang']) && isset($values['validation'])) { - $values_validation = $values['validation']; - if (!Validate::$values_validation(Tools::getValue($field.'_'.$language['id_lang']))) { - $this->errors[] = sprintf(Tools::displayError('field %s is invalid.'), $values['title']); - } - } - } - } elseif (Tools::getValue($field) && isset($values['validation'])) { - $values_validation = $values['validation']; - if (!Validate::$values_validation(Tools::getValue($field))) { - $this->errors[] = sprintf(Tools::displayError('field %s is invalid.'), $values['title']); - } - } - - // Set default value - if (Tools::getValue($field) === false && isset($values['default'])) { - $_POST[$field] = $values['default']; - } - } - } - - if (!count($this->errors)) { - foreach ($fields as $key => $options) { - if ($key != 'WK_ALLOW_ORDER_STATUS_TO_REFUND') { - if (Shop::isFeatureActive() && isset($options['visibility']) && $options['visibility'] > Shop::getContext()) { - continue; - } - - if (!$hide_multishop_checkbox && Shop::isFeatureActive() && Shop::getContext() != Shop::CONTEXT_ALL && empty($options['no_multishop_checkbox']) && empty($_POST['multishopOverrideOption'][$key])) { - Configuration::deleteFromContext($key); - continue; - } - - // check if a method updateOptionFieldName is available - $method_name = 'updateOption'.Tools::toCamelCase($key, true); - if (method_exists($this, $method_name)) { - $this->$method_name(Tools::getValue($key)); - } elseif (isset($options['type']) && in_array($options['type'], array('textLang', 'textareaLang'))) { - $list = array(); - foreach ($languages as $language) { - $key_lang = Tools::getValue($key.'_'.$language['id_lang']); - $val = (isset($options['cast']) ? $options['cast']($key_lang) : $key_lang); - if ($this->validateField($val, $options)) { - if (Validate::isCleanHtml($val)) { - $list[$language['id_lang']] = $val; - } else { - $this->errors[] = Tools::displayError('Can not add configuration '.$key.' for lang '.Language::getIsoById((int)$language['id_lang'])); - } - } - } - Configuration::updateValue($key, $list, isset($values['validation']) && isset($options['validation']) && $options['validation'] == 'isCleanHtml' ? true : false); - } else { - $val = (isset($options['cast']) ? $options['cast'](Tools::getValue($key)) : Tools::getValue($key)); - if ($this->validateField($val, $options)) { - if (Validate::isCleanHtml($val)) { - Configuration::updateValue($key, $val); - } else { - $this->errors[] = Tools::displayError('Can not add configuration '.$key); - } - } - } - } elseif ($key == 'WK_ALLOW_ORDER_STATUS_TO_REFUND') { - $allowedOrderStatus = implode(Tools::getValue('WK_ALLOW_ORDER_STATUS_TO_REFUND'), ','); - if (strlen($allowedOrderStatus)) { - Configuration::updateValue('WK_ALLOW_ORDER_STATUS_TO_REFUND', (string)$allowedOrderStatus); - } - } - } - } - } - - $this->display = 'list'; - if (empty($this->errors)) { - Tools::redirectAdmin(self::$currentIndex.'&token='.Tools::getValue('token').'&conf=6'); - } - - } - public function initContent() { parent::initContent(); diff --git a/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/index.php b/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/index.php deleted file mode 100644 index b1297ac0b..000000000 --- a/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/index.php +++ /dev/null @@ -1,29 +0,0 @@ - -* @copyright 2010-2020 Webkul IN -* @license https://store.webkul.com/license.html -*/ - -header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); -header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); - -header('Cache-Control: no-store, no-cache, must-revalidate'); -header('Cache-Control: post-check=0, pre-check=0', false); -header('Pragma: no-cache'); - -header('Location: ../../../'); -exit; diff --git a/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/options.tpl b/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/options.tpl deleted file mode 100644 index 6a6edf1a6..000000000 --- a/modules/hotelreservationsystem/views/templates/admin/order_refund_rules/helpers/options/options.tpl +++ /dev/null @@ -1,288 +0,0 @@ -{** -* 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 -*} - -{extends file="helpers/options/options.tpl"} - -{block name="input"} - {if $field['type'] == 'select'} -
- {if $field['list']} - - {elseif isset($input.empty_message)} - {$input.empty_message} - {/if} -
-{elseif $field['type'] == 'group'} - {assign var=groups value=$field['values']} - {if count($groups) && isset($groups)} -
-
- - - - - - - - - - {foreach $groups as $key => $group} - - - - - - {/foreach} - -
- - - - {l s='ID'} - - {l s='Order States'} - -
- {assign var=id_checkbox value=WK_ALLOW_ORDER_STATUS_TO_REFUND|cat:'_'|cat:$group['id_order_state']} - - {$group['id_order_state']} - -
-
-
- {else} -

- {l s='No group created'} -

- {/if} -{elseif $field['type'] == 'bool'} -
- - {strip} - - - - - {/strip} - - -
-{elseif $field['type'] == 'radio'} -
- {foreach $field['choices'] AS $k => $v} -

- {strip} - - {/strip} -

- {/foreach} -
- {elseif $field['type'] == 'checkbox'} -
- {foreach $field['choices'] AS $k => $v} -

- {strip} - - {/strip} -

- {/foreach} -
- {elseif $field['type'] == 'text'} -
{if isset($field['suffix'])}
- {/if} - - {if isset($field['suffix'])} - - {$field['suffix']|strval} - - {/if} - {if isset($field['suffix'])} -
{/if} -
- {elseif $field['type'] == 'password'} -
{if isset($field['suffix'])}
- {/if} - - {if isset($field['suffix'])} - - {$field['suffix']|strval} - - {/if} - {if isset($field['suffix'])} -
{/if} -
-{elseif $field['type'] == 'textarea'} -
- -
-{elseif $field['type'] == 'file'} -
{$field['file']}
-{elseif $field['type'] == 'color'} -
-
- -
-
-{elseif $field['type'] == 'price'} -
-
- {$currency_left_sign}{$currency_right_sign} {l s='(tax excl.)'} - -
-
-{elseif $field['type'] == 'textLang' || $field['type'] == 'textareaLang' || $field['type'] == 'selectLang'} - {if $field['type'] == 'textLang'} -
-
- {foreach $field['languages'] AS $id_lang => $value} - {if $field['languages']|count > 1} -
-
- {else} -
- {/if} - - {if $field['languages']|count > 1} -
-
- - -
-
- {else} -
- {/if} - {/foreach} -
-
- {elseif $field['type'] == 'textareaLang'} -
- {foreach $field['languages'] AS $id_lang => $value} -
-
- -
-
- - -
- -
- {/foreach} - -
- {elseif $field['type'] == 'selectLang'} - {foreach $languages as $language} -
- -
- {/foreach} - {/if} -{/if} -{if isset($field['desc']) && !empty($field['desc'])} -
-
- {if is_array($field['desc'])} - {foreach $field['desc'] as $p} - {if is_array($p)} - {$p.text}
- {else} - {$p}
- {/if} - {/foreach} - {else} - {$field['desc']} - {/if} -
-
-{/if} -{/block} \ No newline at end of file diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index 5e932891b..b57940698 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -23,684 +23,696 @@ * International Registered Trademark & Property of PrestaShop SA *} {if isset($order)} -
- {if isset($reorderingAllowed) && $reorderingAllowed} -
- - +
+ {if isset($reorderingAllowed) && $reorderingAllowed} + + + - {* {l s='Reorder'} -->