VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: hazael on May 07, 2022, 18:10:57 PM

Title: Additional image on the list of products (VM4)
Post by: hazael on May 07, 2022, 18:10:57 PM
I have a problem with the original (VM3/4) bootstrap 3 template for product listing.
By default, each item displays only one thumbnail in the product list.
I wanted to add an extra image one and it doesn't work for me. How to solve it?

in /com_virtuemart/sublayouts/bs3-products.php

This displays first thumbnail:
$product->images[0]->displayMediaThumb(); or
$product->images[0]->getFileUrlThumb()

This record should display the second thumbnail:
$product->images[1]->displayMediaThumb(); or
$product->images[1]->getFileUrlThumb();

Unfortunately, an error message appears for the second image

Call to a member function getFileUrlThumb() on null

How do I display it now?
Title: Re: Additional image on the list of products (VM4)
Post by: GJC Web Design on May 07, 2022, 22:15:43 PM
you need to also add in the config

prodimg_browse=2

administrator\components\com_virtuemart\virtuemart.cfg

save the file then the config via the admin to enable
Title: Re: Additional image on the list of products (VM4)
Post by: hazael on May 09, 2022, 10:45:41 AM
Great, thanks - it worked, but not right away. Maybe Virtuemart is not reading this file right away? I manually added this entry to the database table in #_virtuemart_configs
Title: Re: Additional image on the list of products (VM4)
Post by: Jumbo! on May 09, 2022, 16:09:00 PM
Quote from: hazael on May 09, 2022, 10:45:41 AM
I manually added this entry to the database table in #_virtuemart_configs

You need to click on the Save button in VirtueMart Configuration after adding the entry in virtuemart.cfg. Then it inserts it into the database.
Title: Re: Additional image on the list of products (VM4)
Post by: GJC Web Design on May 09, 2022, 16:45:04 PM
and clear all your caches ...  cat views are cached
Title: Re: Additional image on the list of products (VM4)
Post by: pinochico on May 10, 2022, 11:48:42 AM
how custom filed realated with additional images?

is mystification for others in future?

Why do you not create new issue with right name?
Title: Re: Additional image on the list of products (VM4)
Post by: hazael on May 10, 2022, 11:52:01 AM
Problem solved. Everything works as it should. ThX All