News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

choose other product image in category view

Started by johnknit, September 28, 2021, 16:54:07 PM

Previous topic - Next topic

johnknit

I want to show the 3 image in the category view.
In the category template (category/default) i changed the number$product->image[0] from 0 to 2 in this line
But nothing changes.It still showing the first image
      // Show Products
      ?>
      <div class="product floatleft<?php echo $Browsecellwidth . $show_vertical_separator ?>">
         <div class="spacer" style="min-height:auto;">
            <div class="width90 floatleft center">
                <a title="<?php echo $product->link ?>" rel="vm-additional-images" href="<?php echo $product->link; ?>">
                  <?php
                     echo $product->images[0]->displayMediaThumb('class="browseProductImage"', true);
                  ?>
How can this be done?

GJC Web Design

first in config set the number of images

administrator\components\com_virtuemart\virtuemart.cfg

prodimg_browse=3

then the images are available in your template as

echo $product->images[0]->displayMediaThumb('class="browseProductImage"', false);
echo $product->images[1]->displayMediaThumb('class="browseProductImage"', false);
echo $product->images[2]->displayMediaThumb('class="browseProductImage"', false);
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

johnknit

Thanks for your reply.

I follow the instuctions but in the virtuemart.cfg was no prodimg_browse.
So i addid it in the shopfront part.

after i changed echo $product->images[1]->displayMediaThumb('class="browseProductImage"', false);
nothing changed stil using the first image

i emptied the caches.
I am uising VM VirtueMart 3.8.8 10472 Joomla! 3.9.28 Stable [ Amani ] 6-July-2021 15:00 GMT

Jörgen

I guess you are using overrides in the templates directory.

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

johnknit

Yes, indeed.
We need it because it only in 1 category where need to show the 3e image.

Jörgen

Then You have to modify your override file.

Jörgen
Joomla 3.9.18
Virtuemart 3.4.x
Olympiantheme Hera (customized)
This reflects current status when viewing old post.

johnknit

I have copied and renamed the default.php and saved it to the joomla override folder; /tempalte/html/.................
After in made also several other changes these changes are showed but the "image[1]" is still not working.
Gives error  Call to a member function displayMediaThumb() on null
Only when the first image[0] is showed the page is working

GJC Web Design

QuoteI follow the instuctions but in the virtuemart.cfg was no prodimg_browse.
So i addid it in the shopfront part.

what does this mean?

have you now saved your VM config in the admin?
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

Studio 42

If you change as explained by GJC Web Design
administrator\components\com_virtuemart\virtuemart.cfg
prodimg_browse=3
You need to go in admin>virtuemart>config and save it, to be sure this parameter is update