Jump to content

Product images in quick search results in Prestashop 1.5.5.0?


way1

Recommended Posts

I would like show pictures of the products along with the name of their names in the fast search results . For Prestashop 1.5.4.1 I used the following hack in the file \ modules \ blocksearch \ blocksearch-instantsearch.tpl ( 75th row) :

 

replaced :

 

 

return value;

 

on

 

 

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

 

 

NOTE : As the pictures of the products used a picture with the name product_mini_, that Prestashop are used to display images of the products in the catalog of the admin area. Let me explain: they are generated automatically in the folder \ img \ tmp \ when your open products listing in the admin area. They can be removed and they will be automatically regenerated at the first re-entry administrator to catalog in the admin area .

 

Everything worked perfectly on 1.5.4.1 - see enclosed picture.

 

But in Prestashop 1.5.5.0. this hack does not work.

 

I noticed that the numbering product_mini images from the folder \ img \ tmp \ changed its format in Prestashop 1.5.5.0.

 

In Prestashop 1.5.4.1 files are numbered as follows:

 

product_mini_1.jpg

product_mini_2.jpg

product_mini_3.jpg

 

etc.

 

 

In Prestashop 1.5.5.0 numbering was this:

 

product_mini_1_1.jpg

product_mini_2_1.jpg

product_mini_3_1.jpg

 

etc.

 

What _1 at the end of names ? The developers have added some ID? For exampleб ID store (as 1.5.x - is multishop)?

 

I can not understand how to change this hack that product's images to be shown again in Prestashop 1.5.5.0?

 

Can someone tell me how to correct the hack for Prestashop 1.5.5.0? Or maybe you advice how to use any a small product's image instead product_mini_?

 

It would be nice to add a hack not only to results of a fast search for products, but also when editing the order. For example, when adding a new item in the order. Visual image facilitates quick selection from a list of similar names.

 

Also in other parts of Prestashop like adding accessories or related products.

 

So the hack will be useful to everyone. Please help!

post-385044-0-18141000-1378036226_thumb.jpg

post-385044-0-49295200-1378036230_thumb.jpg

  • Like 1
Link to comment
Share on other sites

Hi Lion1,

 

Try this one:

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

 

I modified the code, and try it.

The prefix "_1" is hardcoded since I'm newbie and still do not know what the meaning of it.

Possibly it is shop id, but I only tried on 1 shop setting only.

Good luck.

Link to comment
Share on other sites

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