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()