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 8d242d5aa..b3f6b1361 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -673,15 +673,27 @@

{l s='This feature will generate a random password and send an email to the customer.'}

+
+
{l s='Email'}
+
{$customer->email}
+ {if $addresses.invoice->phone_mobile || $addresses.invoice->phone} +
{l s='Phone'}
+
{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}

+ {/if} +
{else}
{l s='A registered customer account has already claimed this email address'}
{/if} {else} -
+
{l s='Email'}
{$customer->email}

+ {if $addresses.invoice->phone_mobile || $addresses.invoice->phone} +
{l s='Phone'}
+
{if $addresses.invoice->phone_mobile}{$addresses.invoice->phone_mobile}{else}{$addresses.invoice->phone}{/if}

+ {/if}
{l s='Account registered'}
{dateFormat date=$customer->date_add full=true}
+ {if $customerGuestDetail} +
+
+ {l s='Traveller detail'} +
+
+
{l s='Name'}
+
{$customerGuestDetail->gender->name} {$customerGuestDetail->firstname} {$customerGuestDetail->lastname}
+
+
{l s='Email'}
+
{$customerGuestDetail->email}

+
{l s='Phone'}
+
{$customerGuestDetail->phone}
+
+ +
+
+ +
+ {/if} {/if} @@ -1674,6 +1747,53 @@ /*END*/ + // for updating customer guest details + $('#edit_guest_details').on('click', function(e) { + e.preventDefault(); + $('#customer-guest-details-form').show(); + $('#customer-guest-details').hide(); + }); + + $('#cancle_edit_guest_details').on('click', function(e) { + e.preventDefault(); + $('#customer-guest-details-form').hide(); + $('#customer-guest-details').show(); + }); + + $('#submit_guest_details').on('click', function(e) { + e.preventDefault(); + $.ajax({ + type: 'POST', + headers: { + "cache-control": "no-cache" + }, + url: "{$link->getAdminLink('AdminOrders')|addslashes}", + dataType: 'JSON', + cache: false, + data: $('#customer-guest-details-form').serialize()+'&ajax=true&id_order='+id_order+'&action=updateGuestDetails', + success: function(result) { + if (result.success) { + if (result.msg) { + showSuccessMessage(result.msg); + } + if (result.data.guest_name) { + $('#customer-guest-details .guest_name').text(result.data.guest_name); + } + if (result.data.guest_email) { + $('#customer-guest-details .guest_email a').attr('href', 'mailto:'+result.data.guest_email).text(result.data.guest_email); + } + if (result.data.guest_phone) { + $('#customer-guest-details .guest_phone a').attr('href', 'tel'+result.data.guest_phone).text(result.data.guest_phone); + } + $('#customer-guest-details-form').hide(); + $('#customer-guest-details').show(); + } else if (result.errors) { + showErrorMessage(result.errors); + } + } + }); + }); + $(".textarea-autosize").autosize(); var date = new Date(); diff --git a/classes/CartCustomerGuestDetail.php b/classes/CartCustomerGuestDetail.php new file mode 100644 index 000000000..d21c56c68 --- /dev/null +++ b/classes/CartCustomerGuestDetail.php @@ -0,0 +1,83 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +class CartCustomerGuestDetailCore extends ObjectModel +{ + public $id_customer_guest_detail; + public $id_cart; + public $id_gender; + public $firstname; + public $lastname; + public $email; + public $phone; + public $date_add; + public $date_upd; + + public static $definition = array( + 'table' => 'cart_customer_guest_detail', + 'primary' => 'id_customer_guest_detail', + 'fields' => array( + 'id_cart' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), + 'id_gender' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), + 'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32), + 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32), + 'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 128), + 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), + 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), + 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), + ), + ); + + public static function getCartCustomerGuest($id_cart) + { + return Db::getInstance()->getValue(' + SELECT `id_customer_guest_detail` + FROM `'._DB_PREFIX_.'cart_customer_guest_detail` + WHERE `id_cart` = '.(int)$id_cart + ); + } + + public static function getCustomerGuestDetail($id_customer_guest_detail) + { + return Db::getInstance()->getRow(' + SELECT `id_gender`, `firstname`, `lastname`, `email`, `phone` + FROM `'._DB_PREFIX_.'cart_customer_guest_detail` + WHERE `id_customer_guest_detail` = '.(int)$id_customer_guest_detail + ); + } + + public function validateGuestInfo() + { + $isValid = true; + if (!trim($this->firstname) || !Validate::isName($this->firstname)) { + $isValid = false; + } + if (!trim($this->lastname) || !Validate::isName($this->lastname)) { + $isValid = false; + } + if (!trim($this->email) || !Validate::isEmail($this->email)) { + $isValid = false; + } + if (!trim($this->phone) || !Validate::isPhoneNumber($this->phone)) { + $isValid = false; + } + return $isValid; + } +} \ No newline at end of file diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 9177ec927..cc9b3adfd 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -384,6 +384,22 @@ abstract class PaymentModuleCore extends Module throw new PrestaShopException('Can\'t save Order'); } + // save customer guest information + if ($id_customer_guest_detail = CartCustomerGuestDetail::getCartCustomerGuest($this->context->cart->id)) { + if (Validate::isLoadedObject($objCartCustomerGuestDetail = new CartCustomerGuestDetail( + $id_customer_guest_detail + ))) { + $objOrderCustomerGuestDetail = new OrderCustomerGuestDetail(); + $objOrderCustomerGuestDetail->id_gender = $objCartCustomerGuestDetail->id_gender; + $objOrderCustomerGuestDetail->firstname = $objCartCustomerGuestDetail->firstname; + $objOrderCustomerGuestDetail->lastname = $objCartCustomerGuestDetail->lastname; + $objOrderCustomerGuestDetail->email = $objCartCustomerGuestDetail->email; + $objOrderCustomerGuestDetail->phone = $objCartCustomerGuestDetail->phone; + $objOrderCustomerGuestDetail->id_order = (int)$order->id; + $objOrderCustomerGuestDetail->save(); + } + } + // Amount paid by customer is not the right one -> Status = payment error // We don't use the following condition to avoid the float precision issues : http://www.php.net/manual/en/language.types.float.php // if ($order->total_paid != $order->total_paid_real) @@ -1044,6 +1060,30 @@ abstract class PaymentModuleCore extends Module null, _PS_MAIL_DIR_, false, (int)$order->id_shop ); } + // send mail to customer guest if customer booked for someone other. + if ($id_customer_guest_detail = OrderCustomerGuestDetail::isCustomerGuestBooking($order->id)) { + if ($objOrderCustomerGuestDetail = new OrderCustomerGuestDetail( + $id_customer_guest_detail + )) { + if (Validate::isEmail($objOrderCustomerGuestDetail->email)) { + $data['{firstname}'] = $objOrderCustomerGuestDetail->firstname; + $data['{lastname}'] = $objOrderCustomerGuestDetail->lastname; + $data['{email}'] = $objOrderCustomerGuestDetail->email; + Mail::Send( + (int)$order->id_lang, + 'order_conf', + Mail::l('Order confirmation', (int)$order->id_lang), + $data, + $objOrderCustomerGuestDetail->email, + $objOrderCustomerGuestDetail->firstname.' '.$objOrderCustomerGuestDetail->lastname, + null, + null, + $file_attachement, + null, _PS_MAIL_DIR_, false, (int)$order->id_shop + ); + } + } + } } if (Configuration::get('PS_ORDER_CONF_MAIL_TO_SUPERADMIN')){ // send superadmin information diff --git a/classes/checkoutProcess/CheckoutCustomerDetailsStep.php b/classes/checkoutProcess/CheckoutCustomerDetailsStep.php index 6b6263651..7ec1fef59 100644 --- a/classes/checkoutProcess/CheckoutCustomerDetailsStep.php +++ b/classes/checkoutProcess/CheckoutCustomerDetailsStep.php @@ -42,9 +42,17 @@ class CheckoutCustomerDetailsStep extends AbstractCheckoutStep } } } elseif (Tools::getValue('proceed_to_payment')) { + $guestInfoComplete = true; + if ($id_customer_guest_detail = CartCustomerGuestDetail::getCartCustomerGuest($this->context->cart->id)) { + $guestInfoComplete = false; + $objCustomerGuestDetail = new CartCustomerGuestDetail($id_customer_guest_detail); + if ($objCustomerGuestDetail->validateGuestInfo()) { + $guestInfoComplete = true; + } + } $this->step_is_reachable = 1; $this->step_is_current = 1; - if ($idAddressDelivery) { + if ($idAddressDelivery && $guestInfoComplete) { if (Validate::isLoadedObject($objAddress)) { $this->step_is_current = 0; $this->step_is_complete = 1; diff --git a/classes/order/OrderCustomerGuestDetail.php b/classes/order/OrderCustomerGuestDetail.php new file mode 100644 index 000000000..9f7013bdd --- /dev/null +++ b/classes/order/OrderCustomerGuestDetail.php @@ -0,0 +1,74 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +class OrderCustomerGuestDetailCore extends ObjectModel +{ + public $id_order_customer_guest_detail; + public $id_order; + public $id_gender; + public $firstname; + public $lastname; + public $email; + public $phone; + public $date_add; + public $date_upd; + + public static $definition = array( + 'table' => 'order_customer_guest_detail', + 'primary' => 'id_order_customer_guest_detail', + 'fields' => array( + 'id_order' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), + 'id_gender' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'), + 'firstname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32), + 'lastname' => array('type' => self::TYPE_STRING, 'validate' => 'isName', 'size' => 32), + 'email' => array('type' => self::TYPE_STRING, 'validate' => 'isEmail', 'size' => 128), + 'phone' => array('type' => self::TYPE_STRING, 'validate' => 'isPhoneNumber', 'size' => 32), + 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), + 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate'), + ), + ); + + public static function isCustomerGuestBooking($id_order) + { + return Db::getInstance()->getValue(' + SELECT `id_order_customer_guest_detail` + FROM `'._DB_PREFIX_.'order_customer_guest_detail` + WHERE `id_order` = '.(int)$id_order + ); + } + + public function validateGuestInfo() + { + $isValid = true; + if (!trim($this->firstname) || !Validate::isName($this->firstname)) { + $isValid = false; + } + if (!trim($this->lastname) || !Validate::isName($this->lastname)) { + $isValid = false; + } + if (!trim($this->email) || !Validate::isEmail($this->email)) { + $isValid = false; + } + if (!trim($this->phone) || !Validate::isPhoneNumber($this->phone)) { + $isValid = false; + } + return $isValid; + } +} \ No newline at end of file diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 99adacbaa..c4b81f1e4 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -1339,6 +1339,13 @@ class AdminOrdersControllerCore extends AdminController $this->toolbar_title .= ' - '.sprintf($this->l('Shop: %s'), $shop->name); } + // get details if booking is done for some other guest + $customerGuestDetail = false; + if ($id_customer_guest_detail = OrderCustomerGuestDetail::isCustomerGuestBooking($order->id)) { + $customerGuestDetail = new OrderCustomerGuestDetail($id_customer_guest_detail); + $customerGuestDetail->gender = new Gender($customerGuestDetail->id_gender, $this->context->language->id); + } + // gets warehouses to ship products, if and only if advanced stock management is activated $warehouse_list = null; @@ -1531,6 +1538,8 @@ class AdminOrdersControllerCore extends AdminController 'cart' => new Cart($order->id_cart), 'customer' => $customer, 'gender' => $gender, + 'customerGuestDetail' => $customerGuestDetail, + 'genders' => Gender::getGenders(), 'customer_addresses' => $customer->getAddresses($this->context->language->id), 'addresses' => array( 'delivery' => $addressDelivery, @@ -1600,6 +1609,49 @@ class AdminOrdersControllerCore extends AdminController return parent::renderView(); } + public function ajaxProcessUpdateGuestDetails() + { + $response = array( + 'success' => false + ); + if (Validate::isLoadedObject($order = new Order(Tools::getValue('id_order')))) { + if ($id_customer_guest_detail = OrderCustomerGuestDetail::isCustomerGuestBooking($order->id)) { + if (Validate::isLoadedObject($objCustomerGuestDetail = new OrderCustomerGuestDetail($id_customer_guest_detail))) { + $id_gender = Tools::getValue('id_gender'); + $firstname = Tools::getValue('firstname'); + $lastname = Tools::getValue('lastname'); + $email = Tools::getValue('email'); + $phone = Tools::getValue('phone'); + $objCustomerGuestDetail->id_gender = $id_gender; + $objCustomerGuestDetail->firstname = $firstname; + $objCustomerGuestDetail->lastname = $lastname; + $objCustomerGuestDetail->email = $email; + $objCustomerGuestDetail->phone = $phone; + if ($objCustomerGuestDetail->validateGuestInfo()) { + if ($objCustomerGuestDetail->save()) { + $response['success'] = true; + $gender = new Gender($objCustomerGuestDetail->id_gender, $this->context->language->id); + $response['data']['guest_name'] = $gender->name.' '.$objCustomerGuestDetail->firstname.' '.$objCustomerGuestDetail->lastname ; + $response['data']['guest_email'] = $objCustomerGuestDetail->email; + $response['data']['guest_phone'] = $objCustomerGuestDetail->phone; + $response['msg'] = $this->l('Guest details are updated.'); + } else { + $response['errors'][] = $this->l('Unable to save guest details.'); + } + } else { + $response['errors'][] = $this->l('Invalid guest details, please check and try again.'); + } + } else { + $response['errors'][] = $this->l('Guest details not found.'); + } + } else { + $response['errors'][] = $this->l('Guest details not found.'); + } + } + + $this->ajaxDie(json_encode($response)); + } + public function ajaxProcessSearchProducts() { Context::getContext()->customer = new Customer((int)Tools::getValue('id_customer')); diff --git a/controllers/front/OrderDetailController.php b/controllers/front/OrderDetailController.php index 120a32022..07d84ff97 100644 --- a/controllers/front/OrderDetailController.php +++ b/controllers/front/OrderDetailController.php @@ -275,6 +275,12 @@ class OrderDetailControllerCore extends FrontController $customer = new Customer($order->id_customer); + $customerGuestDetail = false; + if ($id_customer_guest_detail = OrderCustomerGuestDetail::isCustomerGuestBooking($order->id)) { + $customerGuestDetail = new OrderCustomerGuestDetail($id_customer_guest_detail); + } + + //by webkul to show order details properly on order history page if (Module::isInstalled('hotelreservationsystem')) { @@ -457,6 +463,7 @@ class OrderDetailControllerCore extends FrontController 'shop_name' => strval(Configuration::get('PS_SHOP_NAME')), 'order' => $order, 'guestInformations' => (array)new Customer($order->id_customer), + 'customerGuestDetail' => $customerGuestDetail, 'currency' => new Currency($order->id_currency), 'order_state' => (int) $id_order_state, 'invoiceAllowed' => (int) Configuration::get('PS_INVOICE'), diff --git a/controllers/front/OrderOpcController.php b/controllers/front/OrderOpcController.php index ee6601751..c45aa2d48 100644 --- a/controllers/front/OrderOpcController.php +++ b/controllers/front/OrderOpcController.php @@ -345,6 +345,10 @@ class OrderOpcControllerCore extends ParentOrderController $this->ajaxDie($this->changeRoomDemands()); exit; break; + case 'submitCustomerGuestDetail': + $this->ajaxDie($this->submitCustomerGuestDetail()); + exit; + break; default: throw new PrestaShopException('Unknown method "'.Tools::getValue('method').'"'); } @@ -505,6 +509,15 @@ class OrderOpcControllerCore extends ParentOrderController $this->_assignCarrier(); // PAYMENT $this->_assignPayment(); + // GUEST BOOKING + if ($this->isLogged) { + if ($id_customer_guest_detail = CartCustomerGuestDetail::getCartCustomerGuest($this->context->cart->id)) { + $this->context->smarty->assign( + 'customer_guest_detail', CartCustomerGuestDetail::getCustomerGuestDetail($id_customer_guest_detail) + ); + } + $this->context->smarty->assign('id_customer_guest_detail', $id_customer_guest_detail); + } Tools::safePostVars(); $newsletter = Configuration::get('PS_CUSTOMER_NWSL') || (Module::isInstalled('blocknewsletter') && Module::getInstanceByName('blocknewsletter')->active); @@ -993,6 +1006,50 @@ class OrderOpcControllerCore extends ParentOrderController die('0'); } + public function submitCustomerGuestDetail() + { + $customerGuestDetail = Tools::getValue('customer_guest_detail'); + $this->context->cookie->__set('customer_details_proceeded', 0); + $this->context->cookie->checkedTOS = false; + if ($customerGuestDetail) { + if ($id_customer_guest_detail = CartCustomerGuestDetail::getCartCustomerGuest($this->context->cart->id)) { + $objCustomerGuestDetail = new CartCustomerGuestDetail($id_customer_guest_detail); + } else { + $objCustomerGuestDetail = new CartCustomerGuestDetail(); + } + + $customerGuestDetailGender = Tools::getValue('customer_guest_detail_gender'); + $customerGuestDetailFirstname = Tools::getValue('customer_guest_detail_firstname'); + $customerGuestDetailLastname = Tools::getValue('customer_guest_detail_lastname'); + $customerGuestDetailEmail = Tools::getValue('customer_guest_detail_email'); + $customerGuestDetailPhone = Tools::getValue('customer_guest_detail_phone'); + if (trim($customerGuestDetailGender) && Validate::isUnsignedInt($customerGuestDetailGender)) { + $objCustomerGuestDetail->id_gender = $customerGuestDetailGender; + } + if (trim($customerGuestDetailFirstname) && Validate::isName($customerGuestDetailFirstname)) { + $objCustomerGuestDetail->firstname = $customerGuestDetailFirstname; + } + if (trim($customerGuestDetailLastname) && Validate::isName($customerGuestDetailLastname)) { + $objCustomerGuestDetail->lastname = $customerGuestDetailLastname; + } + if (trim($customerGuestDetailEmail) && Validate::isEmail($customerGuestDetailEmail)) { + $objCustomerGuestDetail->email = $customerGuestDetailEmail; + } + if (trim($customerGuestDetailPhone) && Validate::isPhoneNumber($customerGuestDetailPhone)) { + $objCustomerGuestDetail->phone = $customerGuestDetailPhone; + } + $objCustomerGuestDetail->id_cart = $this->context->cart->id; + $objCustomerGuestDetail->save(); + } else { + if ($id_customer_guest_detail = CartCustomerGuestDetail::getCartCustomerGuest($this->context->cart->id)) { + if (Validate::isLoadedObject($objCustomerGuestDetail = new CartCustomerGuestDetail($id_customer_guest_detail))) { + $objCustomerGuestDetail->delete(); + } + } + } + $this->context->cart->save(); + } + public function updateContext(Customer $customer) { $this->context->cookie->id_customer = (int)$customer->id; diff --git a/install/data/db_structure.sql b/install/data/db_structure.sql index cb48acf03..4e3a882b9 100644 --- a/install/data/db_structure.sql +++ b/install/data/db_structure.sql @@ -673,6 +673,31 @@ CREATE TABLE `PREFIX_customer_thread` ( KEY `id_product` (`id_product`) ) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION; +CREATE TABLE `PREFIX_order_customer_guest_detail` ( + `id_order_customer_guest_detail` int(10) unsigned NOT NULL auto_increment, + `id_order` int(10) unsigned NOT NULL, + `id_gender` int(10) unsigned NOT NULL, + `firstname` varchar(32) NOT NULL, + `lastname` varchar(32) NOT NULL, + `email` varchar(128) NOT NULL, + `phone` varchar(32) DEFAULT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_order_customer_guest_detail`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION; + +CREATE TABLE `PREFIX_cart_customer_guest_detail` ( + `id_customer_guest_detail` int(10) unsigned NOT NULL auto_increment, + `id_cart` int(10) unsigned NOT NULL, + `id_gender` int(10) unsigned NOT NULL, + `firstname` varchar(32) NOT NULL, + `lastname` varchar(32) NOT NULL, + `email` varchar(128) NOT NULL, + `phone` varchar(32) DEFAULT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_customer_guest_detail`) +) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION; CREATE TABLE `PREFIX_customization` ( `id_customization` int(10) unsigned NOT NULL auto_increment, diff --git a/js/validate.js b/js/validate.js index 85b041fbb..a724f516b 100644 --- a/js/validate.js +++ b/js/validate.js @@ -192,12 +192,16 @@ function validate_field(that) } else if($(that).attr('data-validate')) var result = window['validate_' + $(that).attr('data-validate')]($(that).val()); - - if (result) + if (result) { $(that).parent().removeClass('form-error').addClass('form-ok'); - else + return true; + } else { $(that).parent().addClass('form-error').removeClass('form-ok'); + return false; + } + } + return true; } $(document).on('focusout', 'input.validate, textarea.validate', function() { diff --git a/themes/hotel-reservation-theme/js/order-opc.js b/themes/hotel-reservation-theme/js/order-opc.js index 5fa1f80be..6b0cb3963 100644 --- a/themes/hotel-reservation-theme/js/order-opc.js +++ b/themes/hotel-reservation-theme/js/order-opc.js @@ -50,6 +50,44 @@ $(document).ready(function() $("#partial_data").slideDown(); }); + // customer guest booking + function initGuestbookingcontainer() { + if ($("#customer_guest_detail:checked").val() == 1) { + $('#checkout-guest-info-block').hide('slow'); + $('#customer-guest-detail-container').show('slow'); + } else { + $('#customer-guest-detail-container').hide('slow'); + $('#checkout-guest-info-block').show('slow'); + } + } + function validateCustomerGuestDetailForm() { + $('#customer_guest_detail_form input.validate').each(function (index, element) { + if (!validate_field(element)) { + if ($('#cgv').prop('checked') == 1) { + $('#cgv').trigger('click'); + } + } + }); + } + initGuestbookingcontainer(); + $("#customer_guest_detail").on('change',function() { + initGuestbookingcontainer(); + }); + if ($("#customer_guest_detail:checked").val() == 1) { + validateCustomerGuestDetailForm(); + } + + $('#customer_guest_detail_form').on('change', function(e) { + $.ajax({ + type: 'POST', + url: orderOpcUrl, + async: false, + cache: false, + dataType : "json", + data: $(this).serialize()+'&method=submitCustomerGuestDetail&ajax=true&token=' + static_token + }); + }); + // GUEST CHECKOUT / NEW ACCOUNT MANAGEMENT if ((typeof isLogged == 'undefined' || !isLogged) || (typeof isGuest !== 'undefined' && isGuest)) { diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index 701c0dc77..00c15ce20 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -93,23 +93,36 @@
    -
  • {l s='Customer Details'}

  • - {if isset($address_invoice->firstname) && $address_invoice->firstname} -
  • {l s='Name'}
    {$address_invoice->firstname|escape:'html':'UTF-8'} {$address_invoice->lastname|escape:'html':'UTF-8'}
  • - {/if} - {if isset($guestInformations['email']) && $guestInformations['email']} -
  • {l s='Email'}
    {$guestInformations['email']|escape:'html':'UTF-8'}
  • - {/if} - {if isset($address_invoice->phone_mobile) && $address_invoice->phone_mobile} -
  • {l s='Mobile Number'}
    {$address_invoice->phone_mobile|escape:'html':'UTF-8'}
  • - {/if} - {if isset($address_invoice->phone) && $address_invoice->phone} -
  • {l s='Phone Number'}
    {$address_invoice->phone|escape:'html':'UTF-8'}
  • +
  • {l s='Guest Details'}

  • + {if $customerGuestDetail} + {if isset($customerGuestDetail->firstname) && $customerGuestDetail->firstname} +
  • {l s='Name'}
    {$customerGuestDetail->firstname|escape:'html':'UTF-8'} {$customerGuestDetail->lastname|escape:'html':'UTF-8'}
  • + {/if} + {if isset($customerGuestDetail->email) && $customerGuestDetail->email} +
  • {l s='Email'}
    {$customerGuestDetail->email|escape:'html':'UTF-8'}
  • + {/if} + {if isset($customerGuestDetail->phone) && $customerGuestDetail->phone} +
  • {l s='Mobile Number'}
    {$customerGuestDetail->phone|escape:'html':'UTF-8'}
  • + {/if} + {else} + {if isset($address_invoice->firstname) && $address_invoice->firstname} +
  • {l s='Name'}
    {$address_invoice->firstname|escape:'html':'UTF-8'} {$address_invoice->lastname|escape:'html':'UTF-8'}
  • + {/if} + {if isset($guestInformations['email']) && $guestInformations['email']} +
  • {l s='Email'}
    {$guestInformations['email']|escape:'html':'UTF-8'}
  • + {/if} + {if isset($address_invoice->phone_mobile) && $address_invoice->phone_mobile} +
  • {l s='Mobile Number'}
    {$address_invoice->phone_mobile|escape:'html':'UTF-8'}
  • + {/if} + {if isset($address_invoice->phone) && $address_invoice->phone} +
  • {l s='Phone Number'}
    {$address_invoice->phone|escape:'html':'UTF-8'}
  • + {/if} {/if}
+ {$HOOK_ORDERDETAILDISPLAYED} {if !$is_guest}
{/if} diff --git a/themes/hotel-reservation-theme/order-opc.tpl b/themes/hotel-reservation-theme/order-opc.tpl index 3b4154675..41dc50005 100644 --- a/themes/hotel-reservation-theme/order-opc.tpl +++ b/themes/hotel-reservation-theme/order-opc.tpl @@ -78,7 +78,47 @@
{if $is_logged || $isGuest} -
+ {if $is_logged} + +

+ + +

+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
+
+
+ + +
+
+
+ + {/if} +
{l s='Name'}
@@ -111,28 +151,28 @@
{/if} +
- {* proceed only if no order restrict errors are there *} - {if !$orderRestrictErr} -
- + {/if} {else} {include file="$tpl_dir./order-opc-new-account.tpl"}