From 7f5e1559dc24359c72552cd311a6e9007322d4b4 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Fri, 24 Jan 2025 18:54:00 +0530 Subject: [PATCH 01/18] Added: option for admin to send order confirmation mails while creating an order from the book now page in the back office --- .../default/template/controllers/orders/form.tpl | 13 +++++++++++++ controllers/admin/AdminOrdersController.php | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 105e6b608..ed226e61e 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -2202,6 +2202,19 @@

{l s='Keep this option enabled for full payment and disable it to take partial payment of the booking.'}

+
+ +
+ + + + + + + +

{l s='Keep this option enabled for to send order confirmation mails.'}

+
+
diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 6dfcdaced..9d37c5800 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -1774,6 +1774,7 @@ class AdminOrdersControllerCore extends AdminController $amountPaid = Tools::ps_round($amountPaid, 6); $objEmployee = new Employee($this->context->cookie->id_employee); + $sendMails = Tools::getValue('send_mails', true); $objPaymentModule->validateOrder( $objCart->id, @@ -1784,7 +1785,9 @@ class AdminOrdersControllerCore extends AdminController $extraVars, null, false, - $objCart->secure_key + $objCart->secure_key, + null, + $sendMails ); if (isset($this->context->cookie->id_cart)) { From 64097b47c62b0df0818bd6366d36360cc81efc96 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Wed, 5 Feb 2025 18:14:32 +0530 Subject: [PATCH 02/18] Added: Configuration for Admin to inclued website name in the email subject --- classes/Mail.php | 5 ++++- controllers/admin/AdminEmailsController.php | 7 +++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/classes/Mail.php b/classes/Mail.php index 2e321aa6a..0f96954b7 100644 --- a/classes/Mail.php +++ b/classes/Mail.php @@ -296,7 +296,10 @@ class MailCore extends ObjectModel } /* Create mail and attach differents parts */ - $subject = '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject; + if (Configuration::get('SHOP_AS_SUBJECT_PREFIX')) { + $subject = '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject; + } + $message->setSubject($subject); $message->setCharset('utf-8'); diff --git a/controllers/admin/AdminEmailsController.php b/controllers/admin/AdminEmailsController.php index b933780ad..58b60b3ec 100644 --- a/controllers/admin/AdminEmailsController.php +++ b/controllers/admin/AdminEmailsController.php @@ -126,6 +126,13 @@ class AdminEmailsControllerCore extends AdminController 'cast' => 'intval', 'type' => 'bool' ), + 'SHOP_AS_SUBJECT_PREFIX' => array( + 'title' => $this->l('Add Website name to email subject'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'type' => 'bool', + 'desc' => $this->l('Enable to prefix email subjects with the Website name') + ), ), 'submit' => array('title' => $this->l('Save')) ), From d5b2f1477d53e9cd47930becf90672d63cb93b0a Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 10 Feb 2025 14:55:13 +0530 Subject: [PATCH 03/18] Updated: The mail subject confiuration --- classes/Mail.php | 4 ++-- controllers/admin/AdminEmailsController.php | 15 +++++++-------- install/data/xml/configuration.xml | 3 +++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/classes/Mail.php b/classes/Mail.php index 0f96954b7..6483afabd 100644 --- a/classes/Mail.php +++ b/classes/Mail.php @@ -296,8 +296,8 @@ class MailCore extends ObjectModel } /* Create mail and attach differents parts */ - if (Configuration::get('SHOP_AS_SUBJECT_PREFIX')) { - $subject = '['.Configuration::get('PS_SHOP_NAME', null, null, $id_shop).'] '.$subject; + if (Configuration::get('PS_MAIL_SUBJECT_PREFIX')) { + $subject = '[' . strip_tags($configuration['PS_SHOP_NAME']) . '] ' . $subject; } $message->setSubject($subject); diff --git a/controllers/admin/AdminEmailsController.php b/controllers/admin/AdminEmailsController.php index 58b60b3ec..ccda545e2 100644 --- a/controllers/admin/AdminEmailsController.php +++ b/controllers/admin/AdminEmailsController.php @@ -109,6 +109,12 @@ class AdminEmailsControllerCore extends AdminController 2 => $this->l('Set my own SMTP parameters (for advanced users ONLY)') ) ), + 'PS_MAIL_SUBJECT_PREFIX' => array( + 'title' => $this->l('Enable the store name as a prefix in the email\'s subject'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'type' => 'bool', + ), 'PS_MAIL_TYPE' => array( 'title' => '', 'validation' => 'isGenericName', @@ -125,14 +131,7 @@ class AdminEmailsControllerCore extends AdminController 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool' - ), - 'SHOP_AS_SUBJECT_PREFIX' => array( - 'title' => $this->l('Add Website name to email subject'), - 'validation' => 'isBool', - 'cast' => 'intval', - 'type' => 'bool', - 'desc' => $this->l('Enable to prefix email subjects with the Website name') - ), + ) ), 'submit' => array('title' => $this->l('Save')) ), diff --git a/install/data/xml/configuration.xml b/install/data/xml/configuration.xml index 490e2b691..9376c3c5c 100644 --- a/install/data/xml/configuration.xml +++ b/install/data/xml/configuration.xml @@ -785,6 +785,9 @@ 1 + + 1 + Animaux From 7d0f824531f5f095ee9cb92052a5a9ef8fcb9b31 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 11 Feb 2025 16:31:28 +0530 Subject: [PATCH 04/18] Updated: HOOK_DISPLAY_PDF will now fill the whole page in the PDF --- pdf/delivery-slip.tpl | 3 +-- pdf/invoice-b2b.tpl | 3 +-- pdf/invoice.tpl | 3 +-- pdf/order-return.tpl | 3 +-- pdf/order-slip.tpl | 3 +-- 5 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pdf/delivery-slip.tpl b/pdf/delivery-slip.tpl index 9cc26faf4..d8da68d8d 100644 --- a/pdf/delivery-slip.tpl +++ b/pdf/delivery-slip.tpl @@ -81,8 +81,7 @@ -   - + {$HOOK_DISPLAY_PDF} diff --git a/pdf/invoice-b2b.tpl b/pdf/invoice-b2b.tpl index 2e34eb9fc..2f6fe2232 100644 --- a/pdf/invoice-b2b.tpl +++ b/pdf/invoice-b2b.tpl @@ -294,8 +294,7 @@
 
- - +
{$HOOK_DISPLAY_PDF}{$HOOK_DISPLAY_PDF}
{/if} diff --git a/pdf/invoice.tpl b/pdf/invoice.tpl index ab06f1a86..95d57b1ee 100644 --- a/pdf/invoice.tpl +++ b/pdf/invoice.tpl @@ -131,8 +131,7 @@ -   - + {$HOOK_DISPLAY_PDF} diff --git a/pdf/order-return.tpl b/pdf/order-return.tpl index 61de672e3..b834ef0ad 100644 --- a/pdf/order-return.tpl +++ b/pdf/order-return.tpl @@ -81,8 +81,7 @@ -   - + {$HOOK_DISPLAY_PDF} diff --git a/pdf/order-slip.tpl b/pdf/order-slip.tpl index fd878758c..4833142f3 100644 --- a/pdf/order-slip.tpl +++ b/pdf/order-slip.tpl @@ -103,8 +103,7 @@ -   - + {$HOOK_DISPLAY_PDF} From f0f80aec4f7a857f96ca7bb2ae403fdb7003c857 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Fri, 14 Feb 2025 17:33:47 +0530 Subject: [PATCH 05/18] Fixed:Should not allow the admin to select the tax rule for the auto added service product --- .../controllers/products/serviceproduct.tpl | 149 +++++++++++------- 1 file changed, 88 insertions(+), 61 deletions(-) diff --git a/admin/themes/default/template/controllers/products/serviceproduct.tpl b/admin/themes/default/template/controllers/products/serviceproduct.tpl index ac93c1ed9..c16eab0ea 100644 --- a/admin/themes/default/template/controllers/products/serviceproduct.tpl +++ b/admin/themes/default/template/controllers/products/serviceproduct.tpl @@ -1,7 +1,7 @@ {if isset($product->id)}
- -

{l s='Service Products'}

+ +

{l s='Service Products'}

{if (isset($associated_service_products) && $associated_service_products) || (isset($unassociated_service_products) && $unassociated_service_products)}
@@ -33,7 +33,10 @@ {foreach from=$associated_service_products item=service_product} - + {assign var=inputs_prefix value="service_product_`$service_product.id_product`_"} @@ -42,13 +45,14 @@ {$service_product.id_product|escape:'html':'UTF-8'} - + {$service_product.name} - + {if $service_product.auto_add_to_cart}{l s='Yes'}{else}{l s='No'}{/if} @@ -73,7 +77,8 @@ {assign var=price_value value=$service_product.association_info.default_price} {/if} {/if} - +
@@ -85,16 +90,21 @@ {l s='-'} {else}
- {foreach from=$tax_rules_groups item=tax_rules_group} - {/foreach}
-
{l s='Default tax rule: %s' sprintf=$service_product.association_info.default_tax_rules_group_name}
+
+ {l s='Default tax rule: %s' sprintf=$service_product.association_info.default_tax_rules_group_name} +
{/if} @@ -106,59 +116,76 @@ - + - {$service_product.id_product|escape:'html':'UTF-8'} + {$service_product.id_product|escape:'html':'UTF-8'} {$service_product.name} - {if $service_product.auto_add_to_cart}{l s='Yes'}{else}{l s='No'}{/if} - {l s='--'} - -
-
- {$currency->prefix}{$currency->suffix} - + {if $service_product.auto_add_to_cart}{l s='Yes'}{else}{l s='No'}{/if} + {l s='--'} + +
+
+ {$currency->prefix}{$currency->suffix} + +
-
-
- {l s='Default price: %s' sprintf={displayPrice price=$service_product.price currency=$currency->id}} -
- - -
- -
-
{l s='Default tax rule: %s' sprintf=$service_product.tax_rules_group_name}
- - - {/foreach} - - -
- + - {else} -
- {l s='No services are attached with this room type'} -
- {/if} -
-{/if} \ No newline at end of file + +
+ {else} +
+ {l s='No services are attached with this room type'} +
+ {/if} +
+ {/if} \ No newline at end of file From 3c328c281e9c620e0339cfb327a77ff248f78677 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Fri, 14 Feb 2025 17:58:45 +0530 Subject: [PATCH 06/18] Fixed:Should not allow the admin to select the tax rule for the auto added product --- .../controllers/products/serviceproduct.tpl | 151 ++++++++---------- 1 file changed, 64 insertions(+), 87 deletions(-) diff --git a/admin/themes/default/template/controllers/products/serviceproduct.tpl b/admin/themes/default/template/controllers/products/serviceproduct.tpl index c16eab0ea..4d62dfea7 100644 --- a/admin/themes/default/template/controllers/products/serviceproduct.tpl +++ b/admin/themes/default/template/controllers/products/serviceproduct.tpl @@ -1,7 +1,7 @@ {if isset($product->id)}
- -

{l s='Service Products'}

+ +

{l s='Service Products'}

{if (isset($associated_service_products) && $associated_service_products) || (isset($unassociated_service_products) && $unassociated_service_products)}
@@ -33,10 +33,7 @@ {foreach from=$associated_service_products item=service_product} - + {assign var=inputs_prefix value="service_product_`$service_product.id_product`_"} @@ -45,14 +42,13 @@ {$service_product.id_product|escape:'html':'UTF-8'} - + {$service_product.name} - + {if $service_product.auto_add_to_cart}{l s='Yes'}{else}{l s='No'}{/if} @@ -77,8 +73,7 @@ {assign var=price_value value=$service_product.association_info.default_price} {/if} {/if} - +
@@ -90,21 +85,16 @@ {l s='-'} {else}
- {foreach from=$tax_rules_groups item=tax_rules_group} - {/foreach}
-
- {l s='Default tax rule: %s' sprintf=$service_product.association_info.default_tax_rules_group_name} -
+
{l s='Default tax rule: %s' sprintf=$service_product.association_info.default_tax_rules_group_name}
{/if} @@ -116,76 +106,63 @@ - + - {$service_product.id_product|escape:'html':'UTF-8'} + {$service_product.id_product|escape:'html':'UTF-8'} {$service_product.name} - {if $service_product.auto_add_to_cart}{l s='Yes'}{else}{l s='No'}{/if} - {l s='--'} - + {if $service_product.auto_add_to_cart}{l s='Yes'}{else}{l s='No'}{/if} + {l s='--'} + +
+
+ {$currency->prefix}{$currency->suffix} + +
+
+
+ {l s='Default price: %s' sprintf={displayPrice price=$service_product.price currency=$currency->id}} +
+ + + {if $service_product.auto_add_to_cart} + {l s='-'} + {else}
-
- {$currency->prefix}{$currency->suffix} - -
+
-
- {l s='Default price: %s' sprintf={displayPrice price=$service_product.price currency=$currency->id}} -
- - - {if $service_product.auto_add_to_cart&&$service_product.price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM} - {l s='-'} - {else} -
- -
-
- {l s='Default tax rule: %s' sprintf=$service_product.tax_rules_group_name}
- {/if} - - - {/foreach} - - -
- + - {else} -
- {l s='No services are attached with this room type'} -
- {/if} - - {/if} \ No newline at end of file + + + {else} +
+ {l s='No services are attached with this room type'} +
+ {/if} + +{/if} \ No newline at end of file From e942f46475013c4101a36adc1c1e2fce647ea710 Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Fri, 14 Feb 2025 18:02:13 +0530 Subject: [PATCH 07/18] price addition type condition added --- .../default/template/controllers/products/serviceproduct.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/template/controllers/products/serviceproduct.tpl b/admin/themes/default/template/controllers/products/serviceproduct.tpl index 4d62dfea7..501fdf54c 100644 --- a/admin/themes/default/template/controllers/products/serviceproduct.tpl +++ b/admin/themes/default/template/controllers/products/serviceproduct.tpl @@ -124,7 +124,7 @@ - {if $service_product.auto_add_to_cart} + {if $service_product.auto_add_to_cart&& $service_product.association_info.price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM} {l s='-'} {else}
From 5e2b266c99c8a2d18c08fe6f04046353357cc324 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Mon, 17 Feb 2025 11:12:56 +0530 Subject: [PATCH 08/18] Fixed: getList is called twice if the action is set to export, causing issues in hook LisitingFieldsModifier --- classes/controller/AdminController.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/classes/controller/AdminController.php b/classes/controller/AdminController.php index 12bef797f..3e6e7d1e3 100644 --- a/classes/controller/AdminController.php +++ b/classes/controller/AdminController.php @@ -1155,6 +1155,7 @@ class AdminControllerCore extends Controller header('Cache-Control: no-store, no-cache'); header('Content-disposition: attachment; filename="'.$this->table.'_'.date('Y-m-d_His').'.csv"'); + $fd = fopen('php://output', 'wb'); $headers = array(); foreach ($this->fields_list as $key => $datas) { if ('PDF' === $datas['title']) { @@ -1167,9 +1168,10 @@ class AdminControllerCore extends Controller } } } - $content = array(); + + fputcsv($fd, $headers, ';', $text_delimiter); foreach ($this->_list as $i => $row) { - $content[$i] = array(); + $content = array(); $path_to_image = false; foreach ($this->fields_list as $key => $params) { $field_value = isset($row[$key]) ? Tools::htmlentitiesDecodeUTF8(Tools::nl2br($row[$key])) : ''; @@ -1189,21 +1191,16 @@ class AdminControllerCore extends Controller $field_value = call_user_func_array(array($callback_obj, $params['callback']), array($field_value, $row)); } } - $content[$i][] = $field_value; + $content[] = $field_value; } + fputcsv($fd, $content, ';', $text_delimiter); } - $this->context->smarty->assign(array( - 'export_precontent' => "", - 'export_headers' => $headers, - 'export_content' => $content, - 'text_delimiter' => $text_delimiter - ) - ); - - $this->layout = 'layout-export.tpl'; + @fclose($fd); + die; } + /** * Object Delete * From e7aafa4c8e4d076ce120fabe311ab950819c576c Mon Sep 17 00:00:00 2001 From: azhar bhat Date: Thu, 20 Feb 2025 15:15:56 +0530 Subject: [PATCH 09/18] condition modified --- .../default/template/controllers/products/serviceproduct.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/themes/default/template/controllers/products/serviceproduct.tpl b/admin/themes/default/template/controllers/products/serviceproduct.tpl index 501fdf54c..15b7d51d0 100644 --- a/admin/themes/default/template/controllers/products/serviceproduct.tpl +++ b/admin/themes/default/template/controllers/products/serviceproduct.tpl @@ -124,7 +124,7 @@
- {if $service_product.auto_add_to_cart&& $service_product.association_info.price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM} + {if $service_product.auto_add_to_cart&& $service_product.price_addition_type == Product::PRICE_ADDITION_TYPE_WITH_ROOM} {l s='-'} {else}
From e08649c3055689abd2c50b796f1787be8503e9bb Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 25 Feb 2025 10:41:21 +0530 Subject: [PATCH 10/18] Fixed the mails suffix lable --- controllers/admin/AdminEmailsController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/admin/AdminEmailsController.php b/controllers/admin/AdminEmailsController.php index ccda545e2..3d86ecc9c 100644 --- a/controllers/admin/AdminEmailsController.php +++ b/controllers/admin/AdminEmailsController.php @@ -110,7 +110,7 @@ class AdminEmailsControllerCore extends AdminController ) ), 'PS_MAIL_SUBJECT_PREFIX' => array( - 'title' => $this->l('Enable the store name as a prefix in the email\'s subject'), + 'title' => $this->l('Enable the website name as a prefix in the email\'s subject'), 'validation' => 'isBool', 'cast' => 'intval', 'type' => 'bool', From 4d59e6cf3fc0104167e32ce0eb8785b0a253706c Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 25 Feb 2025 10:49:37 +0530 Subject: [PATCH 11/18] Updated the hint and lablel for the send email button on the book now page --- admin/themes/default/template/controllers/orders/form.tpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index ed226e61e..7633a4e1f 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -2203,7 +2203,7 @@
- +
@@ -2212,7 +2212,7 @@ -

{l s='Keep this option enabled for to send order confirmation mails.'}

+

{l s='If disabled, no email related to this order will be sent during order creation.'}

From 7b164f04a99ce55e69dfc8fde3b9a6bfb260b7e2 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Thu, 10 Apr 2025 13:22:37 +0530 Subject: [PATCH 12/18] Fixed: translation issue in searchForm.tpl --- modules/wkroomsearchblock/views/templates/hook/searchForm.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl index 087033914..0b560896f 100644 --- a/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl +++ b/modules/wkroomsearchblock/views/templates/hook/searchForm.tpl @@ -85,7 +85,7 @@