Jump to content

Recommended Posts

Hi everyone,

 

First of all, I want to apologize of my bad english (I'm french).

I'm such a newbie here so I didn't really know where to post it, because this is not a question but a solution ;)

 

I was looking for a tip to add products images in the ajax searchbar in Prestashop, to have the picture and the name of the product. I looked in about one hundred (ok maybe I 'm exaggerating) topics on different forums (Spannish, English, French, Polska...) but nothing worked (and I didn't want to buy a module).

I found a solution working with my version (1.6.1.4) and I wanted to share it with you in case some of us would be looking too!

 

So to do that, I've modified 2 files : the Search.php class and the blocksearch.js

1/ In /classes/Search.php file
 

Line 286 (arround) you have to replace :

if ($ajax) {
  $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname,
              cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.'
          FROM '._DB_PREFIX_.'product p
          INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (
              p.`id_product` = pl.`id_product`
              AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
          )
          '.Shop::addSqlAssociation('product', 'p').'
          INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (
              product_shop.`id_category_default` = cl.`id_category`
              AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
          )
          WHERE p.`id_product` '.$product_pool.'
          ORDER BY position DESC LIMIT 10';
  return $db->executeS($sql, true, false);
  }

by:
 

if ($ajax) {
    $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname,
                cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.', pi.id_image pimg
            FROM '._DB_PREFIX_.'product p
            INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (
                p.`id_product` = pl.`id_product`
                AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
            )
            '.Shop::addSqlAssociation('product', 'p').'
            INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (
                product_shop.`id_category_default` = cl.`id_category`
                AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
            )
                    INNER JOIN `'._DB_PREFIX_.'image` pi ON (
                        p.`id_product` = pi.`id_product`
                        AND position = 1
                    )
            WHERE p.`id_product` '.$product_pool.'
            ORDER BY position DESC LIMIT 10';
    return $db->executeS($sql, true, false);
}

// Explaination : In the SQL request we add a new parameter to find the image's id. Then we take the id_product and we look for his image in the ps_image table. We only took the image in position 1. And we put it all in a variable called pimg

<!-- Extra : You could create an override to the Search.php class -->

2/ In the /themes/myTheme/modules/blocksearch/blocksearch.js file
 

You need to add the image in the ajax data arround the line 51

Replace :

parse: function(data) {
  var mytab = [];
  for (var i = 0; i < data.length; i++)
    mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };
  return mytab;
},

with :

parse: function(data) {
  var mytab = new Array();
  for (var i = 0; i < data.length; i++){
    mytab[mytab.length] = { data: data[i], value: '<img src="http://monpresta.com/img/p/' + data[i].pimg + '-small_default.jpg" /> ' + data[i].pname};
  }
  return mytab;
},

//Explaination : So with the SQL we have the id of the image in the variable pimg so we have to put it in the parse of the data. Don't forget that in prestashop images are in /img/p/id_img-format.jpg and as we want a small image I put the small_default.jpg format because it'll be faster!

<!-- Extra, I wrote {} in the for, but if you don't want just don't do it ;) -->

So that's it, I hope that'll help some of us and if you have any questions, or anything to say (or corrections for my bad english) I'm here ;)

Simon

  • Like 2

Share this post


Link to post
Share on other sites

Yes of course :) With a quick look on database I can tell you that :

 

Search.php

if ($ajax) {
    $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname,
			cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.', pi.id_image pimg, pm.name mname
		FROM '._DB_PREFIX_.'product p
		INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (
			p.`id_product` = pl.`id_product`
			AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
		)
		'.Shop::addSqlAssociation('product', 'p').'
		INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (
			product_shop.`id_category_default` = cl.`id_category`
			AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
		)
        INNER JOIN `'._DB_PREFIX_.'image` pi ON (
            p.`id_product` = pi.`id_product`
            AND position = 1
        )
        INNER JOIN `'._DB_PREFIX_.'manufacturer` pm ON (
            p.id_manufacturer = pm.id_manufacturer
        )
		WHERE p.`id_product` '.$product_pool.'
		ORDER BY position DESC LIMIT 10';
    return $db->executeS($sql, true, false);
}

and blocksearch.js :

parse: function(data) {
  var mytab = new Array();
  for (var i = 0; i < data.length; i++){
     mytab[mytab.length] = { data: data[i], value: '<img class="search-result-img" src="http://staging.lux.mx/tienda/img/p/' + data[i].pimg + '-small_default.jpg" /><p class="search-result-title">' + data[i].mname + '>' + data[i].pname + '</p>'};
  }
  return mytab;
}, 

And Voila ;)

Tell me if that work

Edited by trenyture (see edit history)
  • Like 1

Share this post


Link to post
Share on other sites

Nope, didnt work for me :(

 

Am i doing something wrong. BTW the blocksearch.js was in js folder than here 2/ In the /themes/myTheme/modules/blocksearch/blocksearch.js file

Share this post


Link to post
Share on other sites

This (copy / paste) code is fantastic !  and works great!  

i`m just wondering, is it possible to add a "show all" link on the bottom ?

 

really great work trenyture

Edited by clau
typo (see edit history)

Share this post


Link to post
Share on other sites

i'm tring to get it working on ps 1.7 with no luch.

 

This is the default ps_blockserach module variable accessibl eon frontend in the ajax serach autocomplete:

 

  1. active:"1"
  2. add_to_cart_url:"https://store.sixrace.it/it/carrello?add=1&id_product=184&id_product_attribute=0"
  3. canonical_url:"https://store.sixrace.it/it/cerchioni/184-cerchi-oz-gass-rs-a-in-alluminio-per-panigale-v4-ozgaspaniv4.html"
  4. description_short:"<p>Cerchi OZ GASS RS-A in alluminio per Ducati Panigale V4 monobraccio</p>"
  5. discount_amount:"362,16 €"
  6. discount_percentage:"-15%"
  7. discount_percentage_absolute:"15%"
  8. discount_to_display:"362,16 €"
  9. discount_type:"percentage"
  10. has_discount:true
  11. id_product:"184"
  12. label:undefined
  13. labels:{tax_short: "(Tasse incl.)", tax_long: "Tasse incluse"}
  14. link:"https://store.sixrace.it/it/cerchioni/184-cerchi-oz-gass-rs-a-in-alluminio-per-panigale-v4-ozgaspaniv4.html"
  15. link_rewrite:"cerchi-oz-gass-rs-a-in-alluminio-per-panigale-v4-ozgaspaniv4"
  16. main_variants:[]
  17. manufacturer_name:"OZ"
  18. name:"Cerchi OZ GASS RS-A in alluminio per Panigale V4"
  19. price:"2.052,22 €"
  20. price_amount:2052.22
  21. rate:22
  22. reference:"OZGASPANIV4"
  23. regular_price:"2.414,38 €"
  24. regular_price_amount:2414.38
  25. tax_name:"IVA IT 22%"
  26. unit_price:""
  27. url:"https://store.sixrace.it/it/cerchioni/184-cerchi-oz-gass-rs-a-in-alluminio-per-panigale-v4-ozgaspaniv4.html"
  28. value:undefined

 

But in PS 1.7 there is no blocksearch.php but instead /classes/Search.php

 

if ($ajax) {
            $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname,
						cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.', pi.id_image pimg
					FROM '._DB_PREFIX_.'product p
					INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (
						p.`id_product` = pl.`id_product`
						AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
					)
					'.Shop::addSqlAssociation('product', 'p').'
					INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (
						product_shop.`id_category_default` = cl.`id_category`
						AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
					)
                                                 INNER JOIN `'._DB_PREFIX_.'image` pi ON (
                        p.`id_product` = pi.`id_product`
                        AND position = 1
                    )
					WHERE p.`id_product` '.$product_pool.'
					ORDER BY position DESC LIMIT 10';
            return $db->executeS($sql, true, false);
        }

 

 

and this is the ps_searchbar.js module file

 

/* global $ */
$(document).ready(function () {
    var $searchWidget = $('#search_widget');
    var $searchBox    = $searchWidget.find('input[type=text]');
    var searchURL     = $searchWidget.attr('data-search-controller-url');

    $.widget('prestashop.psBlockSearchAutocomplete', $.ui.autocomplete, {
        _renderItem: function (ul, product) {
                console.log(product);
                return $("<li>")
/*manufacturer_name
price*/
                    .append($("<a>")
                    .append($("<span>").html(product.image).addClass("image"))
                    .append($("<span>").html(product.category_name).addClass("category"))
                    .append($("<span>").html(product.manufacturer_name))
                    .append($("<span>").html(' > ').addClass("separator"))
                    .append($("<span>").html(product.name).addClass("product"))
                    .append($("<span>").html(' - '))
                    .append($("<span>").html(product.reference))
                    .append($("<span>").html(' ('))
                    .append($("<span>").html(product.price))
                    .append($("<span>").html(')'))
                   ).appendTo(ul)
            ;
        }
    });

    $searchBox.psBlockSearchAutocomplete({
        source: function (query, response) {
            $.post(searchURL, {
                s: query.term,
                resultsPerPage: 10
            }, null, 'json')
            .then(function (resp) {
                response(resp.products);
            })
            .fail(response);
        },
        select: function (event, ui) {
            var url = ui.item.url;
            window.location.href = url;
        },
    });
});

 

I cant find how to add image to the $product variable, any help?

Share this post


Link to post
Share on other sites

I'm sorry, I had so much trouble to find this solution in Prestashop 1.6 and I don't develop anymore with the 1.7 so I can't help you... maybe another member or administrator... Good Luck, when I found the solution it tooks me about one day of test and intents and mistakes.... That's why I shared it when it was working.... Good luck ;)

Share this post


Link to post
Share on other sites

Thanks dear, in ps 1.7 seem to be simple because we just have a product object with many variable associated, i need to find the right query where to pass an image link. Hope some one can help thanks

Share this post


Link to post
Share on other sites

Wow, I am so sorry @Clau, I didn't see your answer,

Thanks for your comment :)

As I said to Matteo, It took me a while to find the solution so I wanted to share the solution. But now I can't make it work with other versions.

On 25/02/2018 at 2:23 PM, clau said:

This (copy / paste) code is fantastic !  and works great!  

i`m just wondering, is it possible to add a "show all" link on the bottom ?

 

really great work trenyture

 

Share this post


Link to post
Share on other sites

@Matteo, if it can help you, I remember I started from the query, I found the sql request and played with it until I had the good image!

Then I'll go for the view to add the images with debugging the request... If it can help you...

Share this post


Link to post
Share on other sites
On 3/7/2016 at 9:12 PM, trenyture said:

Hi everyone,

 

First of all, I want to apologize of my bad english (I'm french).

I'm such a newbie here so I didn't really know where to post it, because this is not a question but a solution ;)

 

I was looking for a tip to add products images in the ajax searchbar in Prestashop, to have the picture and the name of the product. I looked in about one hundred (ok maybe I 'm exaggerating) topics on different forums (Spannish, English, French, Polska...) but nothing worked (and I didn't want to buy a module).

I found a solution working with my version (1.6.1.4) and I wanted to share it with you in case some of us would be looking too!

 

So to do that, I've modified 2 files : the Search.php class and the blocksearch.js

1/ In /classes/Search.php file
 

Line 286 (arround) you have to replace :


if ($ajax) {
  $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname,
              cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.'
          FROM '._DB_PREFIX_.'product p
          INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (
              p.`id_product` = pl.`id_product`
              AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
          )
          '.Shop::addSqlAssociation('product', 'p').'
          INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (
              product_shop.`id_category_default` = cl.`id_category`
              AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
          )
          WHERE p.`id_product` '.$product_pool.'
          ORDER BY position DESC LIMIT 10';
  return $db->executeS($sql, true, false);
  }

by:
 


if ($ajax) {
    $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname,
                cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.', pi.id_image pimg
            FROM '._DB_PREFIX_.'product p
            INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (
                p.`id_product` = pl.`id_product`
                AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
            )
            '.Shop::addSqlAssociation('product', 'p').'
            INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (
                product_shop.`id_category_default` = cl.`id_category`
                AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
            )
                    INNER JOIN `'._DB_PREFIX_.'image` pi ON (
                        p.`id_product` = pi.`id_product`
                        AND position = 1
                    )
            WHERE p.`id_product` '.$product_pool.'
            ORDER BY position DESC LIMIT 10';
    return $db->executeS($sql, true, false);
}

// Explaination : In the SQL request we add a new parameter to find the image's id. Then we take the id_product and we look for his image in the ps_image table. We only took the image in position 1. And we put it all in a variable called pimg

<!-- Extra : You could create an override to the Search.php class -->

2/ In the /themes/myTheme/modules/blocksearch/blocksearch.js file
 

You need to add the image in the ajax data arround the line 51

Replace :


parse: function(data) {
  var mytab = [];
  for (var i = 0; i < data.length; i++)
    mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };
  return mytab;
},

with :


parse: function(data) {
  var mytab = new Array();
  for (var i = 0; i < data.length; i++){
    mytab[mytab.length] = { data: data[i], value: '<img src="http://monpresta.com/img/p/' + data[i].pimg + '-small_default.jpg" /> ' + data[i].pname};
  }
  return mytab;
},

//Explaination : So with the SQL we have the id of the image in the variable pimg so we have to put it in the parse of the data. Don't forget that in prestashop images are in /img/p/id_img-format.jpg and as we want a small image I put the small_default.jpg format because it'll be faster!

<!-- Extra, I wrote {} in the for, but if you don't want just don't do it ;) -->

So that's it, I hope that'll help some of us and if you have any questions, or anything to say (or corrections for my bad english) I'm here ;)

Simon

Hmm, don't work for me and I modified all files. I use Prestashop v1.6.1.11. Url site: https://axel-company.ro . Please if you can watch at my site :D 

Thanks in advance!

Share this post


Link to post
Share on other sites

Bonjour, 

 

 

Voici le code pour afficher les images.

V1.7> fichier: ps_searchbar.js

celui-ci affiche l'image puis la référence et le nom de l'article

Bonne programmation ...

 

Voici le code pour afficher les images.
V1.7> fichier: ps_searchbar.js
celui ci affiche image

Bon programmation ... 

 

$(document).ready(function () {
    var $searchWidget = $('#search_widget');
    var $searchBox    = $searchWidget.find('input[type=text]');
    var searchURL     = $searchWidget.attr('data-search-controller-url');

    $.widget('prestashop.psBlockSearchAutocomplete', $.ui.autocomplete, {
        _renderItem: function (ul, product) {
            return $("<li>")
						
                .append($("<a>")
					.append($('<img />').attr('src',product.cover.small.url).width('38px').height('38px').addClass("media-object"))
					.append($("<span>").html(product.reference_to_display).addClass("reference_to_display"))
					.append($("<span>").html(' - ').addClass("separator"))
                    .append($("<span>").html(product.name).addClass("product"))
                ).appendTo(ul)
            ;
        }
    });

    $searchBox.psBlockSearchAutocomplete({
        source: function (query, response) {
            $.post(searchURL, {
                s: query.term,
                resultsPerPage: 10
            }, null, 'json')
            .then(function (resp) {
                response(resp.products);
            })
            .fail(response);
        },
        select: function (event, ui) {
            var url = ui.item.url;
            window.location.href = url;
        },
    });
});

 

Edited by blondel.da (see edit history)
  • Like 4

Share this post


Link to post
Share on other sites

To all of you that don't had success, don't forget to exchage the website addres in "blocksearch.js" new code, by your website.

 

Now, the cherry on the top of the cake would be if the price of each product could also be visible on the same search.

 

If you can do it, i'll appreciate it so much.

 

Working like a charm on Prestashop 1.6.1.17

 

P.S.: The correct path to "blocksearch.js" in my version is:

/themes/default-bootstrap (or your theme folder)/js/modules/blocksearch

Edited by Sergio (see edit history)

Share this post


Link to post
Share on other sites

hello, 

To add the price put its two lines after the line product 
.append($("<span>").html(product.name).addClass("product"))

 

lines add :

.append($("<span>").html(' - ').addClass("separator"))
.append($("<span>").html(product.price).addClass("price"))

 

 

  • Like 1

Share this post


Link to post
Share on other sites

Salut Blondel.da,

juste un truc peut-être bête, mais il y a un moyen de modifier l'affichage? style photo et nom du produit à coté... j'ai déjà modifié les trucs de base sur la qualité et la dimension de la photo mais je maitrise pas du tout ...

je te remercie en tout cas

Share this post


Link to post
Share on other sites
On 9/8/2018 at 12:09 AM, blondel.da said:

Bonjour, 

 

 

Voici le code pour afficher les images.

V1.7> fichier: ps_searchbar.js

celui-ci affiche l'image puis la référence et le nom de l'article

Bonne programmation ...

 

Voici le code pour afficher les images.
V1.7> fichier: ps_searchbar.js
celui ci affiche image

Bon programmation ... 

 


$(document).ready(function () {
    var $searchWidget = $('#search_widget');
    var $searchBox    = $searchWidget.find('input[type=text]');
    var searchURL     = $searchWidget.attr('data-search-controller-url');

    $.widget('prestashop.psBlockSearchAutocomplete', $.ui.autocomplete, {
        _renderItem: function (ul, product) {
            return $("<li>")
						
                .append($("<a>")
					.append($('<img />').attr('src',product.cover.small.url).width('38px').height('38px').addClass("media-object"))
					.append($("<span>").html(product.reference_to_display).addClass("reference_to_display"))
					.append($("<span>").html(' - ').addClass("separator"))
                    .append($("<span>").html(product.name).addClass("product"))
                ).appendTo(ul)
            ;
        }
    });

    $searchBox.psBlockSearchAutocomplete({
        source: function (query, response) {
            $.post(searchURL, {
                s: query.term,
                resultsPerPage: 10
            }, null, 'json')
            .then(function (resp) {
                response(resp.products);
            })
            .fail(response);
        },
        select: function (event, ui) {
            var url = ui.item.url;
            window.location.href = url;
        },
    });
});

 

Thank you so much :) 

Can you please let me know how can i show price and category ?

Share this post


Link to post
Share on other sites
On 3/7/2016 at 8:12 PM, trenyture said:

Hi everyone,

 

First of all, I want to apologize of my bad english (I'm french).

I'm such a newbie here so I didn't really know where to post it, because this is not a question but a solution ;)

 

I was looking for a tip to add products images in the ajax searchbar in Prestashop, to have the picture and the name of the product. I looked in about one hundred (ok maybe I 'm exaggerating) topics on different forums (Spannish, English, French, Polska...) but nothing worked (and I didn't want to buy a module).

I found a solution working with my version (1.6.1.4) and I wanted to share it with you in case some of us would be looking too!

 

So to do that, I've modified 2 files : the Search.php class and the blocksearch.js

1/ In /classes/Search.php file
 

Line 286 (arround) you have to replace :


if ($ajax) {
  $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname,
              cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.'
          FROM '._DB_PREFIX_.'product p
          INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (
              p.`id_product` = pl.`id_product`
              AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
          )
          '.Shop::addSqlAssociation('product', 'p').'
          INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (
              product_shop.`id_category_default` = cl.`id_category`
              AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
          )
          WHERE p.`id_product` '.$product_pool.'
          ORDER BY position DESC LIMIT 10';
  return $db->executeS($sql, true, false);
  }

by:
 


if ($ajax) {
    $sql = 'SELECT DISTINCT p.id_product, pl.name pname, cl.name cname,
                cl.link_rewrite crewrite, pl.link_rewrite prewrite '.$score.', pi.id_image pimg
            FROM '._DB_PREFIX_.'product p
            INNER JOIN `'._DB_PREFIX_.'product_lang` pl ON (
                p.`id_product` = pl.`id_product`
                AND pl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('pl').'
            )
            '.Shop::addSqlAssociation('product', 'p').'
            INNER JOIN `'._DB_PREFIX_.'category_lang` cl ON (
                product_shop.`id_category_default` = cl.`id_category`
                AND cl.`id_lang` = '.(int)$id_lang.Shop::addSqlRestrictionOnLang('cl').'
            )
                    INNER JOIN `'._DB_PREFIX_.'image` pi ON (
                        p.`id_product` = pi.`id_product`
                        AND position = 1
                    )
            WHERE p.`id_product` '.$product_pool.'
            ORDER BY position DESC LIMIT 10';
    return $db->executeS($sql, true, false);
}

// Explaination : In the SQL request we add a new parameter to find the image's id. Then we take the id_product and we look for his image in the ps_image table. We only took the image in position 1. And we put it all in a variable called pimg

<!-- Extra : You could create an override to the Search.php class -->

2/ In the /themes/myTheme/modules/blocksearch/blocksearch.js file
 

You need to add the image in the ajax data arround the line 51

Replace :


parse: function(data) {
  var mytab = [];
  for (var i = 0; i < data.length; i++)
    mytab[mytab.length] = { data: data[i], value: data[i].cname + ' > ' + data[i].pname };
  return mytab;
},

with :


parse: function(data) {
  var mytab = new Array();
  for (var i = 0; i < data.length; i++){
    mytab[mytab.length] = { data: data[i], value: '<img src="http://monpresta.com/img/p/' + data[i].pimg + '-small_default.jpg" /> ' + data[i].pname};
  }
  return mytab;
},

//Explaination : So with the SQL we have the id of the image in the variable pimg so we have to put it in the parse of the data. Don't forget that in prestashop images are in /img/p/id_img-format.jpg and as we want a small image I put the small_default.jpg format because it'll be faster!

<!-- Extra, I wrote {} in the for, but if you don't want just don't do it ;) -->

So that's it, I hope that'll help some of us and if you have any questions, or anything to say (or corrections for my bad english) I'm here ;)

Simon

 

Hi Simon,

thank you for the solution. But I have a problem on PS 1.6.1.24, the url of images in the search is not correct. Testing url is http://shop.tonerkseft.sk/.

 

Thanks,

 

Martina

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More