Jump to content

Image in search results while searching products


dorje

Recommended Posts

Hi, do you talk about google image search?

 

My tips for better image positioning in google search:

Your photo/image should be unique;

Your image name should contain keyword you rank;

Image alt text should include keyword;

Page where is the picture should be with keyword;

Submit picture to pinterest;

Give a time while you will rank! ;)

Link to comment
Share on other sites

  • 4 weeks later...

No i am talking about prestashop internal search module.

i mean when customers search products through search bar. With auto suggestion i want to show product image with it inside the search bar... so any trick or module to do this thing ?

Like this paid module

http://addons.prestashop.com/en/search-filters-prestashop-modules/3461-asearch-autocomplete-search.html

Link to comment
Share on other sites

  • 1 month later...

in blocksearch-top.tpl

 

change

$("#search_query_top")
   .autocomplete(
 '{/literal}{if $search_ssl == 1}{$link->getPageLink('search.php', true)}{else}{$link->getPageLink('search.php')}{/if}{literal}', {
  minChars: 3,
  max: 10,
  width: 500,
  selectFirst: false,
  scroll: false,
  dataType: "json",
  formatItem: function(data, i, max, value, term) {
   return  value;
  },

 

 

to

 

$("#search_query_top")
   .autocomplete(
 '{/literal}{if $search_ssl == 1}{$link->getPageLink('search.php', true)}{else}{$link->getPageLink('search.php')}{/if}{literal}', {
  minChars: 3,
  max: 10,
  width: 500,
  selectFirst: false,
  scroll: false,
  dataType: "json",
  formatItem: function(data, i, max, value, term) {
   return "<img src=\"" + baseDir + "img/tmp/" + "product_mini_" + data.id_product + ".jpg\"  alt=\"" + value + "\" />" + value;
  },

 

Found on internet last year (don't remember where), it works on my shop

  • Like 1
Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

what about the version 1.5.4.0?

I tried to put the same code, but it doesn't seem to work.

 

try changing the following in the file \xampp\htdocs\prestashop\modules\blocksearch\blocksearch-instantsearch.tpl

 

$("#search_query_{$blocksearch_type}")

.autocomplete(

'{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}', {

minChars: 3,

max: 10,

width: 500,

selectFirst: false,

scroll: false,

dataType: "json",

formatItem: function(data, i, max, value, term) {

return value;

}

 

to

 

 

 

$("#search_query_{$blocksearch_type}")

.autocomplete(

'{if $search_ssl == 1}{$link->getPageLink('search', true)}{else}{$link->getPageLink('search')}{/if}', {

minChars: 3,

max: 10,

width: 500,

selectFirst: false,

scroll: false,

dataType: "json",

formatItem: function(data, i, max, value, term) {

return "<img src=\"" + baseDir + "img/tmp/" + "product_mini_" + data.id_product + ".jpg\" alt=\"" + value + "\" />" + value;

}

Edited by ruchit.devil (see edit history)
  • Like 2
Link to comment
Share on other sites

  • 4 weeks later...
  • 4 months later...
  • 4 months 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...