Jump to content

(SOLVED)Remove category in Ajax search results


Recommended Posts

blocksearch-top.tpl located in modules/blocksearch/ directory

change

mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };

to

mytab[mytab.length] = { data: data[i], value: data[i].pname };
Link to comment
Share on other sites

  • 6 months later...

Hello vekia,

 

You are doing a wonderful job.Helping people build their websites.I have a problem too.

I also want to hide categories from ajax search.

How can it be achieved in prestashop 1.6.0.9?

I cannot find this kind of code in my blocksearch-top.tpl

 

mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };

 

Thanks

Link to comment
Share on other sites

Hello vekia,

 

You are doing a wonderful job.Helping people build their websites.I have a problem too.

I also want to hide categories from ajax search.

How can it be achieved in prestashop 1.6.0.9?

I cannot find this kind of code in my blocksearch-top.tpl

 

mytab[mytab.length] = { data: data, value: data.cname + ' > ' + data.pname };

 

Thanks

 

what theme you use?

Link to comment
Share on other sites

  • 2 weeks later...

guys, any update on 1.6?

 

i found this on modules/blocksearch/blocksearch-instantsearch.tpl

 

line 80: mytab[mytab.length] = { data: data, value: data.cname + ' > ' + data.pname };

 

but i tried to edit the values and its not working...

 

Also, i tried to check jquery.autocomplete.js file, i don't fine the particular string instead of that, i came across

 

Line 645: var formatted = options.formatItem(data.data, i+1, max, data.value, term);

 

i hope someone can really help out on this :-)

 

Cheers!!

Edited by Ash.Krish (see edit history)
Link to comment
Share on other sites

guys, any update on 1.6?

 

i found this on modules/blocksearch/blocksearch-instantsearch.tpl

 

line 80: mytab[mytab.length] = { data: data, value: data.cname + ' > ' + data.pname };

 

but i tried to edit the values and its not working...

 

Also, i tried to check jquery.autocomplete.js file, i don't fine the particular string instead of that, i came across

 

Line 645: var formatted = options.formatItem(data.data, i+1, max, data.value, term);

 

i hope someone can really help out on this :-)

 

Cheers!!

solved

by editing themes/yourthemefolder/js/module/blocksearch/blocksearch.js

 

go to line 63: change var i =0 to var i=1

then, go to line 64 and remove data.cname

 

dont change anything else and its works like a gem :-)

 

cheers!!

Link to comment
Share on other sites

  • 1 month later...

solved

by editing themes/yourthemefolder/js/module/blocksearch/blocksearch.js

 

go to line 63: change var i =0 to var i=1

then, go to line 64 and remove data.cname

 

dont change anything else and its works like a gem :-)

 

cheers!!

 

Thanks ! I was looking for this too but why changing var i to 1 ?

 

You are loosing the first result doing this. Am I wrong ?

Link to comment
Share on other sites

  • 11 months later...

what theme you use?

Hi vekia how can i print category and product name seperately in this context and category must appear only once.

what theme you use?

 

 

blocksearch-top.tpl located in modules/blocksearch/ directory

change

mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };

to

mytab[mytab.length] = { data: data[i], value: data[i].pname };

Hi vekia how can i print category and product name seperately in this context and category must appear only once.

Link to comment
Share on other sites

×
×
  • Create New...