News:

Support the VirtueMart project and become a member

Main Menu

Additional image on the list of products (VM4)

Started by hazael, May 07, 2022, 18:10:57 PM

Previous topic - Next topic

hazael

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?

GJC Web Design

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
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

hazael

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

Jumbo!

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.

GJC Web Design

and clear all your caches ...  cat views are cached
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

pinochico

how custom filed realated with additional images?

is mystification for others in future?

Why do you not create new issue with right name?
www.minijoomla.org  - new portal for Joomla!, Virtuemart and other extensions
XML Easy Feeder - feeds for FB, GMC,.. from products, categories, orders, users, articles, acymailing subscribers and database table
Virtuemart Email Manager - customs email templates
Import products for Virtuemart - from CSV and XML
Rich Snippets - Google Structured Data
VirtueMart Products Extended - Slider with products, show Others bought, Products by CF ID and others filtering products

hazael

Problem solved. Everything works as it should. ThX All