Sep 20, 2016

Migrating payment extensions to OpenCart 2.2 and 2.3

This is an incomplete list of changes.

In OpenCart 2.2.x
  • In catalog/model/ there is no function currency->getCode()
    (Fatal error: Call to undefined method Cart\Currency::getCode() in ...on line ...)
    //$currency = $this->currency->getCode(); // OC <= 2.1
    $currency = $this->config->get('config_currency'); // OC 2.2
  • In controllers, the prefix to default templates has been automatically added.
    Remove the "default/template" from load->view()
In OpenCart 2.3.x
Along with the listed changes for OpenCart 2.2.x we have noticed these changes:
  • Directory structure has been changed, from catalog/controller/payment/ to catalog/controller/extension/payment. This affects view files, breadcrumbs in the admin as well as the controller class name, files and URL routes.



No comments: