2

Every time I installed a new extension, I got this error:

error: You do not have permission to access this page, please refer to your system administrator.

I've already gone to System > User Group, and Add permission to new extension modules (both Access Permission and Modify Permission) but no luck.

I tried to install "2checkout" "Ajax Quick CheckOut" " and get the same error.

Ashwini Chaudhary
  • 244,495
  • 58
  • 464
  • 504
DannyPak
  • 21
  • 1
  • 2

3 Answers3

7

Most likely you're trying to install an extension that is not compatible with OpenCart 2.3.0.2. OpenCart 2.3.X introduced some changes related to extension structure, so you will have to make those changes first


Path change:

All of the extension types have now moved under a new directory named extension.

For example if you have a payment extension then its old structure looked like:

admin/controller/payment/xxx.php
admin/model/payment/xxx.php
admin/language/en-gb/payment/xxx.php
admin/view/template/payment/xxx.php

Now you must change it to:

admin/controller/extension/payment/xxx.php
admin/model/extension/payment/xxx.php
admin/language/en-gb/extension/payment/xxx.php
admin/view/template/extension/payment/xxx.php

Module load path and URL changes:

And while loading the module you must include extension in the path. i.e $this->load->model('module/:') now becomes$this->load->model('extension/module/mymod').

This is true for admin URL links as well. $this->url->link('payment/mymod', 'token=' . $this->session->data['token'], 'SSL') now becomes $this->url->link('extension/payment/mymod', 'token=' . $this->session->data['token'], 'SSL').

Class name changes:

Next change is related to class names. A class named ControllerModuleMyMod should be renamed to ControllerExtensionModuleMyMod.

These changes are applicable to both admin and catalog.


Related threads:

Ashwini Chaudhary
  • 244,495
  • 58
  • 464
  • 504
  • Hi Ashwini, I am new to opencart. I changed all the folder structure, but don't know where to change the module load path and url changes. Please guide me. – Sandeep Pattanaik Dec 19 '16 at 10:34
0

It may be required to change in validate() routine of admin controller in module:

if (!$this->user->hasPermission('modify', 'module/oldmodule')) {

}

to:

if (!$this->user->hasPermission('modify', 'extension/module/oldmodule')) {

}
Ivan P.
  • 832
  • 2
  • 9
  • 26
0

Go to admin - system - users - user groups Edit your administrator and select all then save it. Problem will be solved.

Neeraj Kumar
  • 771
  • 2
  • 16
  • 37