veritrans / SNAP-Opencart

MIT License
3 stars 12 forks source link

Compability with OpenCart v.2.3 #9

Closed imzers closed 7 years ago

imzers commented 7 years ago

Since OpenCart 2.3 have many changes on directory structure specially with extension, this library need update for Opencart v.2.3 compability. Basic on discussion at http://stackoverflow.com/questions/39442404/opencart-you-do-not-have-permission-to-access-this-page-please-refer-to-your-s by Ashwini Chaudhary there is need path and class name change:

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:

http://forum.opencart.com/viewtopic.php?f=2&t=164930
http://forum.opencart.com/viewtopic.php?f=183&t=165958
harrypujianto commented 7 years ago

Thanks for your concern. we've develop for oc 2.3, but on diffrent repo. please take a loot at this link https://github.com/harrypujianto/SNAP-Opencart-2.3

imzers commented 7 years ago

Hi @harrypujianto thank you for response, i've create from this fork to my repo at https://github.com/imzers/SNAP-Opencart but i will fork your repo since it was officially from Veritrans/MidTrans