Jump to content

[SOLVED] Ajax search css?


Recommended Posts

Ok I changed 500 to 250 but no change on the front end?

<!-- Block search module TOP -->

   <form method="get" action="{$base_dir}search.php" id="searchbox">


<!-- image on background -->
       <input type="hidden" name="orderby" value="position" />
       <input type="hidden" name="orderway" value="desc" />
       <input type="text" id="search_query" name="search_query" value="{if isset($smarty.get.search_query)}{$smarty.get.search_query|htmlentities:$ENT_QUOTES:'utf-8'|stripslashes}{/if}" />
       <input type="submit" name="submit_search" value="{l s='Search' mod='blocksearch'}" class="button" />

   </form>

{if $ajaxsearch}
   [removed]{literal}
       $('document').ready( function() {
           $("#search_query")
               .autocomplete(
                   '{/literal}{if $search_ssl == 1}{$base_dir_ssl}{else}{$base_dir}{/if}{literal}search.php', {
                       minChars: 3,
                       max: 10,
                       width: 250,
                       selectFirst: false,
                       scroll: false,
                       dataType: "json",
                       formatItem: function(data, i, max, value, term) {
                           return value;
                       },
                       parse: function(data) {
                           var mytab = new Array();
                           for (var i = 0; i < data.length; i++) {
                               mytab[mytab.length] = { 
                                   data: data[i], 
                                   value: data[i].cname + ' > ' + data[i].pname 
                               };
                           }
                           return mytab;
                       },
                       extraParams: {
                           ajaxSearch: 1,
                           id_lang: {/literal}{$cookie->id_lang}{literal}
                       }
                   }
               )
               .result(function(event, data, formatted) {
                   $('#search_query').val(data.pname);
                   document.location.href = data.product_link;
               })
       });{/literal}
   [removed]
{/if}
<!-- /Block search module TOP -->

Link to comment
Share on other sites

That should work. Try changing modules/blocksearch/blocksearch.tpl. Also, check whether the files have been overridden inside your theme. So there 4 files you need to check: themes//modules/blocksearch/blocksearch.tpl, themes//modules/blocksearch/blocksearch-top.tpl, modules/blocksearch/blocksearch.tpl and modules/blocksearch/blocksearch-top.tpl.

Link to comment
Share on other sites

  • 4 weeks later...

Hi, regarding this issue...
how do you change the position of the box results, by default I have these Style Attributes:

left: 818px;
position: absolute;
top: 124px;
width: 500px;

After reading this topic I know now where's the widht, but what about left and top, where can I change these values??

Thanks

Link to comment
Share on other sites

Never mind, I figured out...

I created a new css style at jquery.autocomplete.css called div.ac_results
and I overrided the style attributes with my own values using !important
here's how:

div.ac_results {
   display: block!important;
   left: 618px!important;
   position: absolute!important;
   top: 135px!important;
   width: 430px!important;
}

Link to comment
Share on other sites

  • 1 month later...
  • 6 months later...

Never mind, I figured out...

I created a new css style at jquery.autocomplete.css called div.ac_results

and I overrided the style attributes with my own values using !important

here's how:

div.ac_results {
display: block!important;
left: 618px!important;
position: absolute!important;
top: 135px!important;
width: 430px!important;
}

 

if i put this into jquery.autocomplete.css it works but it doesn't hide the box when you click outside...the box always remains visible after you type something to search.

How to avoid?

Thanks

 

OK, found...it's enough to remove display: block!important;

SOLVED... thanks

Link to comment
Share on other sites

  • 4 months later...

Hello,

 

please take a look at my top search box: www.reinoplantae.com ... it's messed up. I can't move the text field without moving the "Search" button also... it doesn't move independently. I've tried all the css involved (global and blocksearch css) and php and nothing have worked.

 

SOLVED: used blocksearch.php from older PS version (1.4.5.1) - jquery.autocomplete.css in private function (_hookCommon($params)), not in the public function as it was in my 1.4.6.2

Link to comment
Share on other sites

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...