VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: mfarooqi on April 03, 2017, 18:49:36 PM

Title: how to show additional images into category pages in VM 3.2.1
Post by: mfarooqi on April 03, 2017, 18:49:36 PM
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 (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. 
Title: Re: how to show additional images into category pages in VM 3.5.6
Post by: jenkinhill on April 03, 2017, 23:13:19 PM
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.
Title: Re: how to show additional images into category pages in VM 3.2.1
Post by: mfarooqi on April 06, 2017, 13:46:34 PM
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
Title: Re: how to show additional images into category pages in VM 3.2.1
Post by: stasss on January 23, 2019, 22:17:16 PM
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