VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: harryagamez on May 26, 2017, 04:49:08 AM

Title: How to disable right clic on the product image fancybox?
Post by: harryagamez on May 26, 2017, 04:49:08 AM
Greetings,

My name is Harry and recently I started to use VirtueMart. I am developing this site (extraimpresores.com) but I am having a problem. I need to disable the right clic on the image that appear inside a fancybox when I click in the product image.

I manage to disable the right click on all the site images, but the one that appear inside the fancybox in virtuemart.

How can I achieve it?
Title: Re: How to disable right clic on the product image fancybox?
Post by: jenkinhill on May 26, 2017, 13:07:08 PM
Never heard anyone want to do that - and disabling rmc is rarely used these days as image thievery occurs far less. Anyone determined to steal an image simply looks at the page code and extracts the URL.
eg

http://extraimpresores.com/images/stories/virtuemart/product/TABO-PRE 90.jpg


You also are using a commercial template so we cannot know how it is currently coded.  http://forum.virtuemart.net/index.php?topic=108212.0
Title: Re: How to disable right clic on the product image fancybox?
Post by: harryagamez on May 26, 2017, 16:15:41 PM
mmm... Is there a way to disable FancyBox? I unchecked the option in virtuemart but it still appear.
Title: Re: How to disable right clic on the product image fancybox?
Post by: jenkinhill on May 26, 2017, 16:42:44 PM
If you uncheck Fancybox then Facebox is loaded and used instead.
Title: Re: How to disable right clic on the product image fancybox?
Post by: harryagamez on May 30, 2017, 18:16:54 PM
Is there a way to disable/remove the image link so it doesnt open the full size of the image?
Title: Re: How to disable right clic on the product image fancybox?
Post by: jenkinhill on May 31, 2017, 13:11:10 PM
Edit and override components/com_virtuemart/views/productdetails/tmpl/default_images.php

<div class="main-image">
      <?php echo $image->displayMediaFull("",false,"rel='vm-additional-images'"); ?>
      <div class="clear"></div>
Title: Re: How to disable right clic on the product image fancybox?
Post by: Ghost on June 01, 2017, 14:23:22 PM
To answer your original question, you can do that by editing Fancybox JS (jquery.fancybox-1.3.4.pack.js or jquery.fancybox-1.3.4.js). Find this:
<div id="fancybox-content"></div>
and change to this:
<div id="fancybox-content" oncontextmenu="return false"></div>
Title: Re: How to disable right clic on the product image fancybox?
Post by: jenkinhill on June 01, 2017, 15:53:28 PM
The file edit suggested by Ghost will work for you but would have to be redone every time that VirtueMart is updated.  Be aware that none of this will stop the simple drag and drop of an image from the displayed page.
Title: Re: How to disable right clic on the product image fancybox?
Post by: K&K media production on June 01, 2017, 21:27:54 PM
QuoteBe aware that none of this will stop the simple drag and drop of an image from the displayed page.

you can add a transparent png image  over the original image ... so with drag and drop you will get only the transparent png
Title: Re: How to disable right clic on the product image fancybox?
Post by: Ghost on June 02, 2017, 07:34:33 AM
Quote from: jenkinhill on June 01, 2017, 15:53:28 PM
The file edit suggested by Ghost will work for you but would have to be redone every time that VirtueMart is updated.
No, just create Fancybox override in templates/yourtemplate/js/fancybox/jquery.fancybox-1.3.4.pack.js (or jquery.fancybox-1.3.4.js).