From 0d64da3315e29b0095cec6742f71df529b3f2e44 Mon Sep 17 00:00:00 2001 From: "vishalsingh.qlo325" Date: Tue, 21 May 2024 10:48:42 +0530 Subject: [PATCH] Removed: Non required email templates from the order status email template dropdrown --- controllers/admin/AdminStatusesController.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/controllers/admin/AdminStatusesController.php b/controllers/admin/AdminStatusesController.php index e10140b77..01a1d9c0d 100644 --- a/controllers/admin/AdminStatusesController.php +++ b/controllers/admin/AdminStatusesController.php @@ -707,6 +707,14 @@ class AdminStatusesControllerCore extends AdminController $theme = new Theme($this->context->shop->id_theme); $default_path = '../mails/'; $theme_path = '../themes/'.$theme->directory.'/mails/'; // Mail templates can also be found in the theme folder + $templatesToIgnore = array( + 'footer.html', + 'header.html', + 'shipped.html', + 'in_transit.html', + 'download_products.html', + 'test.html' + ); $array = array(); foreach (Language::getLanguages(false) as $language) { @@ -722,7 +730,9 @@ class AdminStatusesControllerCore extends AdminController // We merge all available emails in one array $templates = array_unique(array_merge(scandir(_PS_ADMIN_DIR_.'/'.$default_path.$iso_code), $theme_templates)); foreach ($templates as $key => $template) { - if (!strncmp(strrev($template), 'lmth.', 5)) { + if (!strncmp(strrev($template), 'lmth.', 5) + && !in_array($template, $templatesToIgnore) + ) { $search_result = array_search($template, $theme_templates); $array[$iso_code][] = array( 'id' => substr($template, 0, -5),