Welcome, Guest
Username: Password: Remember me
Use this Category for your support questions about Virtuemart Zoom Effect(SKU# FLEX-00005)

TOPIC: Plugin not loading in VM 3.0.12

Plugin not loading in VM 3.0.12 6 years 1 week ago #13290

Hi Support,
I upgraded my VM instance to the latest version (3.0.10 -> 3.0.12) but now the plugin doesn't work. In the HTML source I can see js and css seem to be loaded, but the Enlarge text is not displayed, zoom does not work and the additional images are empty.

For an example please check bonumvitae.eu/index.php/catalogus/serviezen/kristallen-glasservies-60-delig-detail

Thanks in advance,
Oscar
The administrator has disabled public write access.

Plugin not loading in VM 3.0.12 6 years 1 week ago #13291

Looks like the issue is caused by the new Multiple thumbsizes in 3.0.12: docs.virtuemart.net/tutorials/templating-layouts/222-different-thumbnail-sizes.html
The administrator has disabled public write access.

Plugin not loading in VM 3.0.12 6 years 1 week ago #13293

I created a workaround by using $product->image[x]->getFileUrlThumb() i.s.o. [...]->file_url_thumb.
This means the link above can't be used as reference anymore; for my site it now works.
The administrator has disabled public write access.

Plugin not loading in VM 3.0.12 6 years 1 week ago #13294

Here's my patch for default_images.php that'll work with both VM <= 3.0.10 and the new thunb handling in 3.0.12 and up:
<?php
/**
 /*------------------------------------------------------------------------
 # Flexible - Zoom Effect for Virtuemart - Version 5.0
 # ------------------------------------------------------------------------
 # Copyright (C) 2014 Flexible Web Design. All Rights Reserved.
 # @license http://www.gnu.org/licenses/gpl-3.0.html GNU/GPLv3
 # Author: Flexible Web Design Team
 # Websites: http://www.flexiblewebdesign.com
 -------------------------------------------------------------------------*/
 
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access..');
jimport( 'joomla.environment.response' );
 
$plugin=JPluginHelper::getPlugin('system','flexibleZoomEffect');
$params=new JRegistry($plugin->params);
?>
<!-- Flexible Web Design Zoom Effect START -->
<?php // Product Main Image
if (method_exists($this->product->images[0], 'getFileUrlThumb')) { // Patched by Oscar, Bonum Vitae
	$thumbUrl = $this->product->images[0]->getFileUrlThumb(); // VM 3.0.12+
} else {
	$thumbUrl = $this->product->images[0]->file_url_thumb; // VM <= 3.0.10
}
if (!empty($thumbUrl)) { ?>
 
<div class="flexible-main-image"> <a class="fancybox2" href="<?php echo JURI::root().$this->product->images[0]->file_url;?>" title="<?php echo $this->product->product_name ?>" > <img src="<?php echo JURI::root().$this->product->images[0]->file_url;?>" id="FlexibleMainImage" <?php if (count($this->product->images) > 1 ) echo 'class="FlexibleGallery"'; ?> data-zoom-image="<?php echo JURI::root().$this->product->images[0]->file_url;?>" alt="<?php echo $this->product->product_name ?>" /> </a> </div>
<?php if ($params->get('enlarge_show')) { ?>
<a id="flexible_enlarge" href="javascript:void(0);"><?php echo $params->get('enlarge_translate'); ?></a>
<?php } ?>
<?php } else { // or show the "picture not available" image
                echo $this->product->images[0]->displayMediaFull('class="medium-image" id="medium-image"', false, "class='modal'", true);
        } // Product Main Image END ?>
<?php // Showing The Additional Images
if(!empty($this->product->images) && count($this->product->images)>1) { 
        if (count($this->product->images) > $params->get('add_visible')) { 
        // if additional images are greater than "visible thumbnail" number you set through module parameters, then below will be visible
?>
<div id="flexible-zoom-additionalImagesWrap" class="flexible-zoom-additionalImagesWrap">
  <div style="cursor: pointer;" class="more-views-arrow prev">&nbsp;</div>
  <div class="flexible-zoom-additionalImages">
    <ul id="FlexibleAdditionalGallery" class="additionalImagesslider" style="position: relative;">
      <?php // List all Images
$i = 0;
foreach ($this->product->images as $image) {
$ImageId = $i++;
if (method_exists($this->product->images[0], 'getFileUrlThumb')) { // Patched by Oscar Bonum Vitae
	$thumbUrl = $this->product->images[$ImageId]->getFileUrlThumb();
} else {
	$thumbUrl = $this->product->images[$ImageId]->file_url_thumb;
}
?>
      <li> <a href="<?php echo JURI::root().$this->product->images[$ImageId]->file_url;?>" rel="<?php echo preg_replace('/[^A-Za-z0-9\-]/', '', $this->product->images[$ImageId]->file_description)?>" title="<?php echo $this->product->images[$ImageId]->file_meta;?>" data-image="<?php echo JURI::root().$this->product->images[$ImageId]->file_url;?>" data-zoom-image="<?php echo JURI::root().$this->product->images[$ImageId]->file_url;?>" class="<?php if ($i=='1') echo 'active';?>"> <span><img src="<?php echo JURI::root().$thumbUrl;?>" alt="<?php echo $this->product->images[$ImageId]->file_meta;?>" />
        <?php if ($params->get('show_subtitle') and !empty($this->product->images[$ImageId]->file_description)) { ?>
        <div class="subTitle"><?php echo $this->product->images[$ImageId]->file_meta;?></div>
        <?php } ?>
        </span> </a> </li>
      <?php     } ?>
    </ul>
  </div>
  <div style="cursor: pointer;" class="more-views-arrow next">&nbsp;</div>
</div>
<?php
        } else {  
        // if additional images are less than "visible thumbnails" you set through module parameters, then below will be visible
?>
<div id="additionalImagesNoScroll">
  <ul id="FlexibleAdditionalGallery" class="additionalImagesslider">
    <?php // List all Images
$i = 0;
foreach ($this->product->images as $image) {
$ImageId = $i++;
if (method_exists($this->product->images[0], 'getFileUrlThumb')) { // Patched by Oscar Bonum Vitae
	$thumbUrl = $this->product->images[$ImageId]->getFileUrlThumb();
} else {
	$thumbUrl = $this->product->images[$ImageId]->file_url_thumb;
}
?>
    <li> <a href="<?php echo JURI::root().$this->product->images[$ImageId]->file_url;?>" rel="<?php echo preg_replace('/[^A-Za-z0-9\-]/', '', $this->product->images[$ImageId]->file_description)?>" title="<?php echo $this->product->images[$ImageId]->file_meta;?>" data-image="<?php echo JURI::root().$this->product->images[$ImageId]->file_url;?>" data-zoom-image="<?php echo JURI::root().$this->product->images[$ImageId]->file_url;?>" class="<?php if ($i=='1') echo 'active';?>"> <span><img src="<?php echo JURI::root().$thumbUrl;?>" alt="<?php echo $this->product->images[$ImageId]->file_meta;?>"/>
      <?php if ($params->get('show_subtitle') and !empty($this->product->images[$ImageId]->file_description)) { ?>
      <div class="subTitle"><?php echo $this->product->images[$ImageId]->file_meta;?></div>
      <?php } ?>
      </span> </a> </li>
    <?php       } ?>
  </ul>
</div>
<?php }
         } // Showing The Additional Images END 
?>
<!-- Flexible Web Design Zoom Effect END -->
Last Edit: 6 years 1 week ago by Oscar van Eijk.
The administrator has disabled public write access.

Plugin not loading in VM 3.0.12 5 years 11 months ago #13378

ZoomEffect has been updated already to support VM3.0.12

instead of using file_url_thumb or getFileUrlThumb, it is better to use native method:
$this->product->images[$ImageId]->displayMediaThumb($imageArgs='',$lightbox=true,$effect="class='modal' rel='group'",$return = true,$withDescr = false,$absUrl = false, $width=0,$height=0);
 
// the clean version of this method is as follow
$this->product->images[$ImageId]->displayMediaThumb('',false,'', true,false,false, 0,0);
 
// this method will print the thumbnail, if thumbnail is not exist no-image.gif would be printed instead. 

So, it won't be necessary to make the if-Statement for $thumbUrl..

Less code is better coding ;) but thanks for the tip.. Yours might work too.

Regards.
Last Edit: 5 years 11 months ago by Support.
The administrator has disabled public write access.
Time to create page: 0.357 seconds

MaterialMart

for Virtuemart 3

Google's Material Design has finally arrived to Virtuemart

Virtumart Template - MaterialMart Virtumart Template - CleanMart Virtumart Template - CleanMart Virtumart Template - CleanMart

Fully responsive!

Buy Now   |   Live Demo