ozztrigz Posted February 14, 2022 Share Posted February 14, 2022 I can't seem to find where my search bar has gone when I go to any other page than the home page. Any Ideas. https://espacehabitationgbi.com/ Prestashop Version 1.6.1.18. Thanks! Link to comment Share on other sites More sharing options...
ComGrafPL Posted February 14, 2022 Share Posted February 14, 2022 Check search module setting either hooks. Link to comment Share on other sites More sharing options...
SmartDataSoft Posted February 15, 2022 Share Posted February 15, 2022 You can check module position and that particular module hooks exception. Is their any exception set or not. Secondly you can reset the module and re-possition the hook. Because their is no data related to this module ,which will lost when reset. Thank you Link to comment Share on other sites More sharing options...
ozztrigz Posted February 15, 2022 Author Share Posted February 15, 2022 Thank you for your suggestions. I played with the hooks but wasn't able to solve my initial problem. It turns out it's a module called “savvy search autocomplete”. Anyhow, I can get it to show up on the homepage no problem but for some reason, It won't display in other pages. It has parts of it in the product pages, but it's missing the main input field ?!?!?! Home page code: <form method="get" action="https://espacehabitationgbi.com/en/search" _lpchecked="1"> <input type="hidden" name="controller" value="search"> <input type="hidden" name="orderby" value="position"> <input type="hidden" name="orderway" value="desc"> <input type="text" class="ssa-search-query ssa-search-query-input form-control" name="search_query" value="" placeholder="Search"> <button type="submit" name="ssa_submit" class="btn btn-default button-search ssa-button-search"> <span class="material-icons search">Search</span> </button> </form> Other page code: <form method="get" action="https://espacehabitationgbi.com/en/search"> <input type="hidden" name="controller" value="search"> <input type="hidden" name="orderby" value="position"> <input type="hidden" name="orderway" value="desc"> </form> I'm guessing there could have been some customization done, but I can't seem to figure out where to look first. Link to comment Share on other sites More sharing options...
Piotr3qx Posted February 15, 2022 Share Posted February 15, 2022 Why do you have two different codes for displaying the form? Does the module have different hooks for each page? Try to copy code from the first form to the second form. It should resolve the problem PS. Have you thought about improving the website's UX Link to comment Share on other sites More sharing options...
ozztrigz Posted February 15, 2022 Author Share Posted February 15, 2022 3 minutes ago, Piotr3qx said: Why do you have two different codes for displaying the form? Does the module have different hooks for each page? Try to copy code from the first form to the second form. It should resolve the problem What I posted there is inspected code. So I'm not sure where it's coming from and where to copy to 🤷♂️. I really thought this section was going to help me, but it has not. 11 minutes ago, Piotr3qx said: PS. Have you thought about improving the website's UX Of course, I just need to re-establish normal functionality of the backend, and I'm right on it! Link to comment Share on other sites More sharing options...
Piotr3qx Posted February 15, 2022 Share Posted February 15, 2022 Do you have access to module files? Look for .tpl files and check if they have a search field and button in their code Link to comment Share on other sites More sharing options...
ozztrigz Posted February 16, 2022 Author Share Posted February 16, 2022 I looked in the .tpl file, and it's all there but it seems the problem lies else where. I turned on debugging and found this error: Notice: Undefined index: id_lang in /home/rootgbiinter/public_html/cache/smarty/compile/8f/60/f6/8f60f620ee24b0220f23809bfb9af52c5af71a33.file.ac-input.tpl.php and if I look in that smarty cache file you can clearly see this code: <?php if ($_smarty_tpl->tpl_vars['id_lang']->value == 1) { ?> <input type="text" class='ssa-search-query ssa-search-query-input form-control' name="search_query" value="<?php echo stripslashes(mb_convert_encoding(htmlspecialchars($_smarty_tpl->tpl_vars['ssa_search_query']->value, ENT_QUOTES, 'UTF-8', true), "HTML-ENTITIES", 'UTF-8')); ?> " placeholder="<?php echo smartyTranslate(array('s' => 'Recherche', 'mod' => 'savvysearch'), $_smarty_tpl); ?> " /> <button type="submit" name="ssa_submit" class='btn btn-default button-search ssa-button-search'> <span class='material-icons search'> Rechercher </span> </button> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['id_lang']->value == 2) { ?> <input type="text" class='ssa-search-query ssa-search-query-input form-control' name="search_query" value="<?php echo stripslashes(mb_convert_encoding(htmlspecialchars($_smarty_tpl->tpl_vars['ssa_search_query']->value, ENT_QUOTES, 'UTF-8', true), "HTML-ENTITIES", 'UTF-8')); ?> " placeholder="<?php echo smartyTranslate(array('s' => 'Search', 'mod' => 'savvysearch'), $_smarty_tpl); ?> " /> <button type="submit" name="ssa_submit" class='btn btn-default button-search ssa-button-search'> <span class='material-icons search'> Search </span> </button> <?php } ?> So for some reason the id_lang is missing, and I don't know where it has gone. I checked the contents of $_smarty_tpl->tpl_vars, and it has just about everything except for the variables I'm looking for. I've placed a temporary workaround in the cached file, but would really like some help to find out why some of my data is gone. Thanks! Link to comment Share on other sites More sharing options...
Piotr3qx Posted February 16, 2022 Share Posted February 16, 2022 Do you have these if statements in .tpl module files? Link to comment Share on other sites More sharing options...
ozztrigz Posted February 16, 2022 Author Share Posted February 16, 2022 No, it just looks like the full form with some class conditionals: {strip} {if !isset($ssa_typeblock) } {assign var="ssa_typeblock" value="custom" nocache} {/if} {assign var="ssa_add_class_container" value="" nocache} {if $ssa_typeblock === 'top' || $ssa_typeblock === 'nav'} {assign var="ssa_add_class_container" value="col-sm-4" nocache} {/if} {if isset($ssa_mobilemode) && $ssa_mobilemode} {assign var="ssa_add_class_container" value="" nocache} {/if} {if $ssa_typeblock === 'column' } <div class='block'> <p class='title_block'>{l s='Search' mod='savvysearch'}</p> {/if} {/strip} <div class='ssa-searchblock ssa-searchblock-{$ssa_typeblock|escape:'htmlall':'UTF-8'|stripslashes} {$ssa_add_class_container|escape:'htmlall':'UTF-8'|stripslashes} clearfix'> <form method="get" action="{$search_url|escape:'html':'UTF-8'|stripslashes}"> <input type="hidden" name="controller" value="search" /> <input type="hidden" name="orderby" value="position" /> <input type="hidden" name="orderway" value="desc" /> <input type="text" class='ssa-search-query ssa-search-query-input form-control' name="search_query" value="{$ssa_search_query|escape:'htmlall':'UTF-8'|stripslashes}" placeholder="{l s='Search' mod='savvysearch'}" /> <button type="submit" name="ssa_submit" class='btn btn-default button-search ssa-button-search'><span class='material-icons search'>search</span></button> </form> </div> {strip} {if $ssa_typeblock === 'column' } </div> {/if} {/strip} Link to comment Share on other sites More sharing options...
ozztrigz Posted February 16, 2022 Author Share Posted February 16, 2022 Nevermind, I found it. There was an override of the FrontController class that included this code : <?php class FrontController extends FrontControllerCore { public function initHeader() { //create your variable self::$smarty->assign('id_lang', $this->context->language->id); self::$smarty->assign('id_shop', $this->context->shop->id); //call original method, to maintain default behaviour: return parent::initHeader(); } } ?> Apparantly self::$smarty is deprecated and needs to be replaced with this: <?php class FrontController extends FrontControllerCore { public function initHeader() { //create your variable $this->context->smarty->assign('id_lang', $this->context->language->id); $this->context->smarty->assign('id_shop', $this->context->shop->id); //call original method, to maintain default behaviour: return parent::initHeader(); } } ?> Thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now