News:

Looking for documentation? Take a look on our wiki

Main Menu

change product thumb in category view

Started by icelucio, May 09, 2013, 02:05:16 AM

Previous topic - Next topic

icelucio

Hi, I don't want the first thumb as default preview of the product in category view... I want the last image/thumb of the product

Where can I edit the db query (from first to last, from "ASC" to "DESC") ?

In $product->images there ins't an array with all the images of the product but only AN IMAGE ($product->images[0]) so I can't take the last or invert the array.

Can you help me please? Thank you, Lucio

icelucio

Hi all, I've found a solution that worked fine for me and for my question

http://forum.virtuemart.net/index.php?topic=97744.0;prev_next=next#new

in the 8th answer there is "the light"  ;)

Edit  "/components/com_virtuemart/views/category/view.html.php" @ about line 170.
change this line:      $productModel->addImages($products,1);
to:                          $productModel->addImages($products);
... now all images of the product will be loaded from db

In my override folder "com_virtuemart\category\default.php"
I've added:              $product->images = array_reverse($product->images);
Just before:             echo $product->images[0]->displayMediaThumb('class="browseProductImage"', false);
... now the first image is the last of the product.

Have a nice day, Lucio