Page 1 of 1

Disable Right Click & CTRL + C OC 2.0.1.1

Posted: Mon Apr 27, 2015 4:27 pm
by Abdullazizsaid
hello

Disable Right Click & CTRL + C OC 2.0.1.1

thanks in advace

Re: Disable Right Click & CTRL + C OC 2.0.1.1

Posted: Mon Apr 27, 2015 8:04 pm
by viethemes
You can use my extension Custom JavaScript and add code below

Code: Select all

$(document).ready(function(){ 
  document.oncontextmenu = function() {return false;};

  $(document).mousedown(function(e){ 
    if( e.button == 2 ) { 
      return false; 
    } 
    return true; 
  }); 
});

Re: Disable Right Click & CTRL + C OC 2.0.1.1

Posted: Mon Apr 27, 2015 10:19 pm
by IP_CAM
But, just to mention it, it's of no real use. Anyone can use the Browser Control Functions to see the Source, and you just prevent Visitors to call, i.E. a Product Page, in a new WIndow. Or just switch of the JavaScripting, by use of the Noscript-Browser Mod... ::)

It's so, at best, not very Customer-friedly acting, in my opinion! ;)
Ernie

Re: Disable Right Click & CTRL + C OC 2.0.1.1

Posted: Mon Apr 27, 2015 10:39 pm
by yodapt
Maybe worth to mention text selection can be disabled with CSS, although it can still be copied from the source code.

Re: Disable Right Click & CTRL + C OC 2.0.1.1

Posted: Thu Apr 30, 2015 9:56 pm
by Abdullazizsaid
does it work at any theme cuze i using this theme http://themeforest.net/item/journal-adv ... talAtelier and its not working :(

Re: Disable Right Click & CTRL + C OC 2.0.1.1

Posted: Fri May 01, 2015 10:10 am
by IP_CAM

Re: Disable Right Click & CTRL + C OC 2.0.1.1

Posted: Mon May 04, 2015 10:29 pm
by sanshay
Use simple code in body tag, dont use java for this.
In your template catalog/view/theme/YOURTHEME/template/common/header.tpl
Find:

Code: Select all

<body class="<?php echo $class; ?>">
Replace with

Code: Select all

<body oncontextmenu="return false" class="<?php echo $class; ?>">
Hope this help you further

Re: Disable Right Click & CTRL + C OC 2.0.1.1

Posted: Tue May 05, 2015 12:09 am
by Dhaupin
Changing the body tag like that may break mods that use it as a verbatim target, just saying.