Author Topic: change popup image on product view to displayMediaThumb  (Read 883 times)

soura123

  • Beginner
  • *
  • Posts: 19
change popup image on product view to displayMediaThumb
« on: February 27, 2019, 12:28:28 pm »
hello
is it possible and how to change popup image from product view
from fullimage to displayMediaThumb

vm version 3.4.2 joomla 3.9.3

thanks in advanced

soura123

  • Beginner
  • *
  • Posts: 19
Re: change popup image on product view to displayMediaThumb
« Reply #1 on: February 28, 2019, 09:14:10 am »
Mod edit:  impatient bump message removed. Please read http://forum.virtuemart.net/index.php?topic=104795.0

GJC Web Design

  • 3rd party VirtueMart Developer
  • Super Hero
  • *
  • Posts: 9650
  • Virtuemart, Joomla & php developer
    • GJC Web Design
  • VirtueMart Version: 3.6.8
Re: change popup image on product view to displayMediaThumb
« Reply #2 on: February 28, 2019, 09:39:48 am »
its already there in the template...

if (!empty($this->product->images)) {
   $image = $this->product->images[0];
   ?>
   <div class="main-image">
      <?php
      $width = VmConfig::get('img_width_full', 0);
      $height = VmConfig::get('img_height_full', 0);
      if(!empty($width) or !empty($height)){
         echo $image->displayMediaThumb("",true,"rel='vm-additional-images'", true, true, false, $width, $height);
      } else {
         echo $image->displayMediaFull("",true,"rel='vm-additional-images'");
      }
       ?>
      <div class="clear"></div>
   </div>
   <?php
}
?>
GJC Web Design
VirtueMart and Joomla Developers - php developers http://www.gjcwebdesign.com
VM3 AusPost Shipping Plugin - e-go Shipping Plugin - VM3 Postcode Shipping Plugin - Radius Shipping Plugin - VM3 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
http://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

soura123

  • Beginner
  • *
  • Posts: 19
Re: change popup image on product view to displayMediaThumb
« Reply #3 on: February 28, 2019, 10:05:36 am »
hello
thanks for your reply
you misunderstand
on the product view i have managed to display the mediathumb
if (!empty($this->product->images)) {
   $image = $this->product->images[0];
   //$title_file = $image->file_name;
   $title_file = '';
   $title_file = ($image->file_meta == '') ? ' title="'. $image->file_name .'"' : ' title="'. $image->file_meta .'"';
   ?>
      <?php echo $image->displayMediaThumb( 'id="zoom-image"',true, 'data-rel="vm-additional-images"'.$title_file ); ?>
      <?php //echo $image->displayMediaFull("",true,"rel='vm-additional-images'"); ?>
   <?php
}
?>

but on click to see bigger image (fancybox) i see the full image
i want on the popup to change to thumb and not full image

i have find in jquery.custom.fancybox-1.3.4.pack.js
.attr({id:"fancybox-img",src:v.src,alt:e.title})

i dont know js and if this is the one i have to edit

soura123

  • Beginner
  • *
  • Posts: 19
Re: change popup image on product view to displayMediaThumb
« Reply #4 on: February 28, 2019, 10:51:55 am »
i found from where the link to the popup is generated

on administrator/components/com_virtuemart/helpers/mediahandler.php
on line 612
if($lightbox){
         $image = '<img src="' . $root.$file_url . '" alt="' . $file_alt . '" ' . $args . ' />';//JHtml::image($file_url, $file_alt, $imageArgs);
         if ($file_alt ) $file_alt = 'title="'.$file_alt.'"';
         if ($this->file_url and pathinfo($this->file_url, PATHINFO_EXTENSION) and substr( $this->file_url, 0, 4) != "http") {
            if($this->file_is_forSale){
               $href = $this->file_url ;
            } else {
               $href = JURI::root() .$this->file_url ;
            }

         } else {
            $href = $root.$file_url ;
         }
i try out file_url_thumb but it is blank
any ideas?

soura123

  • Beginner
  • *
  • Posts: 19
Re: change popup image on product view to displayMediaThumb
« Reply #5 on: February 28, 2019, 10:57:18 am »
change this
$href = JURI::root() .$this->file_url ;
to
$href = $file_url ;

and fixed it

lol
thanks any way