News:

Support the VirtueMart project and become a member

Main Menu

how to show additional images into category pages in VM 3.2.1

Started by mfarooqi, April 03, 2017, 18:49:36 PM

Previous topic - Next topic

mfarooqi

How to show additional images into category pages.
There was a way just before update to 3.2.1 and that was told under
https://forum.virtuemart.net/index.php?topic=99699.0

that function has been removed from that file .. I just updated and found it working in some different function.

open the following file
/components/com_virtuemart/views/category/view.html.php: Line number 223

And change following code
$imgAmount = VmConfig::get('prodimg_browse',1);

to

$imgAmount = VmConfig::get('prodimg_browse');

and in category pages.. if sublayout has over-ride then
/templates/yourtemplage/html/com_virtuemart/sublayouts/products.php

or  in default location
/components/com_virtuemart/sublayouts/products.php

apply the following code.

<?php
$start_image 
VmConfig::get('add_img_main'1) ? 1;
for ($i $start_image$i count($product->images); $i++) {
$image $product->images[$i];
?>

<div class="addimages">
<?php
if(VmConfig::get('add_img_main'1)) {
echo $image->displayMediaThumb('class="addimage-'$i .'" data-image_title="'.$image->file_meta.'"',false,$image->file_description);
echo '<a href="'$image->file_url .'"  class="product-image image-'$i .' title="'$image->file_meta .'" rel="vm-additional-images"></a>';
} else {
echo $image->displayMediaThumb("",true,"rel='vm-additional-images'",true,$image->file_description);
}
?>

</div>
<?php
}
?>



UPDATED: I typed 3.5.6 the joomla version instead of VM version. I updated the thread title to "3.2.1" . Please excuse me. 

jenkinhill

There is no VM3.5.6 - the very latest is VM3.2.1  - I presume you mean Joomla 3.5.6, but what is your VM version? Templating has changed since that five year old thread.
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

mfarooqi

You are right. I'm sorry. I typed the wrong version .. from joomla instead of VM. i just edited/updated the title to 3.2.1

stasss

Hi!

Could you please update the solution for VM 3.4.2 ?

The /components/com_virtuemart/views/category/view.html.php: Line number 223
has changed.  ($imgAmount = VmConfig::get('prodimg_browse',1);)

thank you