From cc514c1dea1614b268c99c35cb16612410f8a771 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 5 Jun 2025 18:42:58 +0530 Subject: [PATCH] Added option to select standard produts while sending a query from the order detail front controller --- .../customer_threads/helpers/view/message.tpl | 2 +- .../admin/AdminCustomerThreadsController.php | 17 +++++++++--- .../helpers/view/view.tpl | 2 +- .../hotel-reservation-theme/order-detail.tpl | 26 +++++++++++++------ 4 files changed, 33 insertions(+), 14 deletions(-) diff --git a/admin/themes/default/template/controllers/customer_threads/helpers/view/message.tpl b/admin/themes/default/template/controllers/customer_threads/helpers/view/message.tpl index 77b4f2d8e..d11710c85 100644 --- a/admin/themes/default/template/controllers/customer_threads/helpers/view/message.tpl +++ b/admin/themes/default/template/controllers/customer_threads/helpers/view/message.tpl @@ -55,7 +55,7 @@   - {dateFormat date=$message.date_add full=0} - {$message.date_add|substr:11:5} {if $message.private}{l s='Private'}{/if} {if isset($message.file_name)}   {l s="Attachment"}{/if} - {if isset($message.product_name)}   {l s="Room type:"} {$message.product_name|escape:'html':'UTF-8'} {/if} + {if isset($message.product_name)}   {if isset($message.booking_product) && $message.booking_product}{l s="Room type:"}{else}{l s="Product:"}{/if} {$message.product_name|escape:'html':'UTF-8'} {/if}

{$message.message|escape:'html':'UTF-8'|nl2br}

diff --git a/controllers/admin/AdminCustomerThreadsController.php b/controllers/admin/AdminCustomerThreadsController.php index 63771fda5..ea35a45ff 100644 --- a/controllers/admin/AdminCustomerThreadsController.php +++ b/controllers/admin/AdminCustomerThreadsController.php @@ -860,7 +860,12 @@ class AdminCustomerThreadsControllerCore extends AdminController $product = new Product((int)$mess['id_product'], false, $this->context->language->id); if (Validate::isLoadedObject($product)) { $messages[$key]['product_name'] = $product->name; - $messages[$key]['product_link'] = $this->context->link->getAdminLink('AdminProducts').'&updateproduct&id_product='.(int)$product->id; + $messages[$key]['booking_product'] = $product->booking_product; + if ($product->booking_product) { + $messages[$key]['product_link'] = $this->context->link->getAdminLink('AdminProducts').'&updateproduct&id_product='.(int)$product->id; + } else { + $messages[$key]['product_link'] = $this->context->link->getAdminLink('AdminNormalProducts').'&updateproduct&id_product='.(int)$product->id; + } } } } @@ -981,8 +986,6 @@ class AdminCustomerThreadsControllerCore extends AdminController $timeline = array(); foreach ($messages as $message) { $product = new Product((int)$message['id_product'], false, $this->context->language->id); - $link_product = $this->context->link->getAdminLink('AdminOrders').'&vieworder&id_order='.(int)$product->id; - $content = ''; if (!$message['private']) { $customerName = false; @@ -1000,7 +1003,13 @@ class AdminCustomerThreadsControllerCore extends AdminController } if (Validate::isLoadedObject($product)) { - $content .= $this->l('Room type: ').''.$product->name.'

'; + if ($product->booking_product) { + $content .= $this->l('Room type:'); + } else { + $content .= $this->l('Product:'); + } + + $content .= ' '.$product->name.'

'; } $content .= Tools::safeOutput($message['message']); diff --git a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl index 7d8987fc4..d8cadf9e9 100644 --- a/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/order_refund_requests/helpers/view/view.tpl @@ -275,7 +275,7 @@ {/if} {$product['name']|escape:'htmlall':'UTF-8'}{if isset($product['option_name']) && $product['option_name']} : {$product['option_name']|escape:'htmlall':'UTF-8'}{/if} - {$product['quantity']|escape:'htmlall':'UTF-8'} + {if $product['allow_multiple_quantity']}{$product['quantity']|escape:'htmlall':'UTF-8'}{else}--{/if} {displayPrice price=$product['total_price_tax_incl'] currency=$orderCurrency['id']} {displayPrice price=$product['paid_amount'] currency=$orderCurrency['id']} {if $hasOrderDiscountOrPayment || $isRefundCompleted} diff --git a/themes/hotel-reservation-theme/order-detail.tpl b/themes/hotel-reservation-theme/order-detail.tpl index 222e6e978..d1a4cbae1 100644 --- a/themes/hotel-reservation-theme/order-detail.tpl +++ b/themes/hotel-reservation-theme/order-detail.tpl @@ -595,18 +595,28 @@ {block name='order_detail_add_order_messages_form'}
- +

- {l s='To add a comment about a room type, please select one first.'} + {if $service_products_formatted} + {l s='To add a comment about a room type/product, please select one first.'} + {else} + {l s='To add a comment about a room type, please select one first.'} + {/if}

-