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

How to disable right clic on the product image fancybox?

Started by harryagamez, May 26, 2017, 04:49:08 AM

Previous topic - Next topic

harryagamez

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?

jenkinhill

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
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

harryagamez

mmm... Is there a way to disable FancyBox? I unchecked the option in virtuemart but it still appear.

jenkinhill

If you uncheck Fancybox then Facebox is loaded and used instead.
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

harryagamez

Is there a way to disable/remove the image link so it doesnt open the full size of the image?

jenkinhill

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>
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

Ghost

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>

jenkinhill

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.
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

K&K media production

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

Ghost

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).