Jump to content

Filter Search module style and script hooks


Recommended Posts

Hello, anyone knows how I can replace style and script HTML output of Filter Search block from body to head section of HTML document?

I need this becouse the corner of FilterSearch block output is distorted, becouse of wrong output place of style and javascript declarations (between div`s in body section). It`s in default theme, without module modiffications.

Link to comment
Share on other sites

There is a function, that outputs some JavaScript code for this module in head section, in file modules\coremanager\coremanager.php :

function hookHeader($params) {
 global $protocol_link;
 $output  = "";
 $output .= "[removed]var psModulePath = '" . __PS_BASE_URI__ . "'[removed]";
 $output .= "[removed]function modulePath() {    return psModulePath + 'modules/coremanager/'; }[removed]";
 $output .= "[removed][removed]";
 $output .= "[removed][removed]";
 $output .= "[removed] var $$ = jQuery.noConflict(true);[removed]";        
 $output .= $this->apiObj->loadModules(__FUNCTION__, $params);
 return $output;

And also in file \modules\coremanager\modules\filtersearch\views\filtersearch.tpl there goes JavaScript and CSS output, but it puts it in body section:

{if $ranges OR $attributes OR $features OR $manufacturers}
   {if $stylesheet}
       <link rel="stylesheet" href="{$assets}filtersearch.css" type="text/css" media="screen" charset="utf-8" />
       <link rel="stylesheet" href="{$coreAssets}themes/base/ui.all.css" type="text/css" media="screen" charset="utf-8" />
       {literal}<!--[if IE]> 
           <style type="text/css"> 
               .filterSearchModule ul li, 
               .filterSearchModule ul li a,
               .filterSearchModule h3 { font-family: Arial, Helvetica, sans-serif; margin 0; zoom: 1; font-weight: bold; }
               .filterSearchModule ul li a { font-size:11px; font-weight: bold; }
         var viewLess             = "{l s='View Less' mod='filtersearch'}",
               viewMore            = "{l s='View More' mod='filtersearch'}",
               pagingNext         = "{l s='Next' mod='filtersearch'}",
               pagingPrevious     = "{l s='Previous' mod='filtersearch'}",
               pagingFirst         = "{l s='First' mod='filtersearch'}",
               pagingLast         = "{l s='Last' mod='filtersearch'}",
               showAll             = "{l s='Show All' mod='filtersearch'}",
               productPlural   = "{l s='Product' mod='filtersearch'}",
               productsPlural  = "{l s='Products' mod='filtersearch'}",
               ajaxLoader      = '{$ajaxLoader}',
               currencySign    = '{$currencySign}',
               currentId         = {$currentId},
               productCount     = {$countIds},
               productsPerPage = {$PPPage};

So, how can I move second code near the first code, so it would output it to head section ?

(in place of [removed] there are JavaScript tags)

Link to comment
Share on other sites

  • 5 weeks later...
  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...