News:

Support the VirtueMart project and become a member

Main Menu

Always the same image in a lightbox.

Started by litvines, February 11, 2015, 20:36:17 PM

Previous topic - Next topic

litvines

Hi, I'm very sorry for my rubbish English.
I have installed this quick start template http://portmone.co.ua/index.php/products/sumki/sumka-kozhanaya-001-detail and have some trouble with an image in lightbox. It is always the same – the main image of a product. If product has few images and you click on them they appeared in preview, but when you click to enlarge it in lightbox it is always  main image.


Here is my default_images.php file:
<?php
/**
 *
 * Show the product details page
 *
 * @package VirtueMart
 * @subpackage
 * @author Max Milbers, Valerie Isaksen

 * @link http://www.virtuemart.net
 * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: default_images.php 6188 2012-06-29 09:38:30Z Milbo $
 */
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
?>


<script type="text/javascript">
jQuery.noConflict();
jQuery(document).ready(function() {
    jQuery('#additional-images').jcarousel({
      //  vertical: true,
// wrap: 'circular',
        scroll: 1
    });
});

</script>

<?php

// Product Main Image
if (!empty($this->product->images[0])) {
    
?>

    <div class="main-image">
<?php  echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"'true"class='modal'"true);  ?>
   
   
   
    </div>
<?php // Product Main Image END ?>

<?php





// Showing The Additional Images
// if(!empty($this->product->images) && count($this->product->images)>1) {
if (!empty($this->product->images) and count ($this->product->images)>1) {
    
?>


      <ul id="additional-images">
<?php
// List all Images
if (count($this->product->images) > 0) {
    foreach ($this->product->images as $image) {  ?>

            <li> <img src="<?php echo $image->file_url?>" onclick="changeMainImage(this);" alt="" /></li>
           
    <?php  }
}
?>

  </ul>
<script type="text/javascript">
function changeMainImage(el){
$('medium-image').src = el.src;
}
</script>
<?php
// Showing The Additional Images END ?>

jenkinhill

Worked OK for me with Firefox 35.0.1

If you still have problems ask the template supplier about it. http://forum.virtuemart.net/index.php?topic=108212.0
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