From 80b9a58bcf94dda2c560bce1cfdc8786dc2ecaf9 Mon Sep 17 00:00:00 2001 From: Hugo - PliciWeb Date: Fri, 15 Nov 2024 12:11:57 +0100 Subject: [PATCH] Fix : Module "pm_advancedsearch4" needs jQueryUi for price slider --- src/Hook/Assets.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Hook/Assets.php b/src/Hook/Assets.php index ce07a6f..133a3f8 100644 --- a/src/Hook/Assets.php +++ b/src/Hook/Assets.php @@ -20,9 +20,13 @@ public function hookActionProductSearchAfter(): void $this->context->controller->unregisterJavascript('facetedsearch_front'); $this->context->controller->unregisterStylesheet('facetedsearch_front'); - $this->context->controller->unregisterJavascript('jquery-ui'); - $this->context->controller->unregisterStylesheet('jquery-ui'); - $this->context->controller->unregisterStylesheet('jquery-ui-theme'); + $needsJQueryUi = \Module::isEnabled('pm_advancedsearch4') && $this->context->controller instanceof \ProductListingFrontController; + + if (!$needsJQueryUi) { + $this->context->controller->unregisterJavascript('jquery-ui'); + $this->context->controller->unregisterStylesheet('jquery-ui'); + $this->context->controller->unregisterStylesheet('jquery-ui-theme'); + } } public function hookActionFrontControllerSetMedia()