Jump to content

Get all product pictures in product-list.tpl


Recommended Posts

Hi guys.

I need to solve some problem.

How can I get all product images (not one image with different sizes) in product-list.tpl file?

 

Now in this file next line display the image -

<img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" />

 

where:

$product.link_rewrite - is image alias, "ipod-nano" - for example

$product.id_image - image ID, "1-27" - for example

home - is a type of image

 

I tried to find any information on this forum, but anything.

 

Thanks in advance.

Link to comment
Share on other sites

  • 2 months later...
  • 1 month later...

Hi. i urgently need this also. Anybody found solution?

 

Strange, that nobody yet did it, as the code actually is in prestashop: take the corresponding part from productcontroller, add it to categorycontroller and modify the TPL accordingly. Sounds like a 2 hour thing max for the right person :)

 

:P

Link to comment
Share on other sites

  • 1 month later...
  • 1 month later...
  • 1 month later...

maybe this helps I override id_image in search result. with this:

 

 

$search = Search::attribute_id((int)(self::$cookie->id_lang), $attribute_id, false, $this->p, $this->n);

foreach ($search['result'] AS &$product){

$product['id_image'] = $product['id_product'].'-'. $product['id_image'] ;

}

 

and then I get images links like:

img/p/22-105-home.jpg

instead like it was before :

 

img/p/1/0/5/105-home.jpg - only id image in name.

Edited by szamman (see edit history)
Link to comment
Share on other sites

  • 3 months later...

for all who wants to display all images on product-list.tpl

1 follow this thread

http://www.prestashop.com/forums/topic/96085-rollover-image-in-product-list/

2 download rollover.zip provided by DGV Posted 06 August 2012 - 02:07 AM

3 unpack zip upload files

4 open uploaded file override/classes/Category.php

change this:

SELECT * from `'._DB_PREFIX_.'image`

WHERE id_product="'.$product_id.'"

ORDER BY `position`

LIMIT 0,2

 

to that:

SELECT * from `'._DB_PREFIX_.'image`

WHERE id_product="'.$product_id.'"

ORDER BY `position`

 

 

all images should appear on product-list.tpl

Link to comment
Share on other sites

  • 2 months later...

for all who wants to display all images on product-list.tpl

1 follow this thread

http://www.prestasho...n-product-list/

2 download rollover.zip provided by DGV Posted 06 August 2012 - 02:07 AM

3 unpack zip upload files

4 open uploaded file override/classes/Category.php

change this:

SELECT * from `'._DB_PREFIX_.'image`

WHERE id_product="'.$product_id.'"

ORDER BY `position`

LIMIT 0,2

 

to that:

SELECT * from `'._DB_PREFIX_.'image`

WHERE id_product="'.$product_id.'"

ORDER BY `position`

 

 

all images should appear on product-list.tpl

 

Hello janekbar5, I followed the same tutorial about doing this, but it doesn't work for new products, best sales, promotions, etc. Did you know how I can do this? I will be really glad if you can help me, I spent hours and hours to search and try everything I found on the web, but... nothing works..

Link to comment
Share on other sites

  • 10 months later...

I'm trying to do this on Prestashop 1.4.4 and I am getting a blank page after I add the override/controllers/CategoryController.php :/

 

Could anyone tell my why is the override file breaking my page? It really shouldn't do that as is is only supposed to add or extend additional classes without breaking anything, right?

Link to comment
Share on other sites

×
×
  • Create New...