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

on click remplace additional images with main-image

Started by Diegooliv, November 08, 2013, 17:46:13 PM

Previous topic - Next topic

Diegooliv

HI! when I click on the image the page open a new tab :(
I need that remplace additional images with main-image
this is the code on
components/com_virtuemart/views/productdetails/tmpl/default_images.php

Joomla! 2.5.14
virtualmart 2.024
PHP 5.3.19

<?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');
vmJsApi::js'fancybox/jquery.fancybox-1.3.4.pack');
vmJsApi::css('jquery.fancybox-1.3.4');
$document JFactory::getDocument ();
$imageJS '
jQuery(document).ready(function() {
jQuery("a[rel=vm-additional-images]").fancybox({
"titlePosition"  : "inside",
"transitionIn" : "elastic",
"transitionOut" : "elastic"
});
jQuery(".additional-images .product-image").click(function() {
jQuery(".main-image img").attr("src",this.src );
jQuery(".main-image img").attr("alt",this.alt );
jQuery(".main-image a").attr("href",this.src );
jQuery(".main-image a").attr("title",this.alt );
}); 
});
'
;
$document->addScriptDeclaration ($imageJS);

if (!empty(
$this->product->images)) {
$image $this->product->images[0];
?>

<div class="main-image">

<?php
echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
?>


<div class="clear"></div>
</div>
<?php
$count_images count ($this->product->images);
if ($count_images 1) {
?>

    <div class="additional-images">
<?php
for ($i 0$i $count_images$i++) {
$image $this->product->images[$i];
?>

            <div class="floatleft">
            <?php
                echo 
$image->displayMediaFull('class="additional-images"''style="cursor: pointer"',true,true);
            ?>

            </div>
<?php
}
?>

        <div class="clear"></div>
    </div>
<?php
}
}
  
// Showing The Additional Images END ?>

jenkinhill

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

Diegooliv


jenkinhill

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

Diegooliv