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.



1 comment:

John McStone said...

Hello, thank you for the post, but I have a question. How to do this with wordpress and joomla. I need to transfer the payment extension from the old site made on wordpress, to the site made on the joomla platform. I used the ready-made joomla template https://www.templatemonster.com/ru/opencart-templates-type/, did not alter anything, while moving the extension conflicts with joomla. Tell me how to solve this problem.