What does a NUC OpenCart Change look like?

To further explain the grievance I posted last time about OpenCart NUC changes and how harmful they are to the ecosystem around OpenCart, I though it would be useful to post an example.   We’ll look at how the language file is loaded in Better Together for OpenCart.

The first version of Better Together for OpenCart was created to work with OpenCart 1.5.  The controller for this module is created in

admin/controller/total/better_together.php

which defines the object

class ControllerTotalBetterTogether extends Controller

Here’s how a language file was loaded in that version:

$this->language->load('total/better_together');

But in OpenCart 2.0, this changed!  The code had to be refactored as follows:

$this->load->language('total/better_together');

Again, in OpenCart 2.3 – supposedly a minor version update – the code changed again, because the file system was restructured:

$this->load->language('extension/total/better_together');

Not only that, but the class itself had to be renamed – and this happened in a minor version update.

class ControllerExtensionTotalBetterTogether extends Controller {

Language loading did not change in OpenCart 3.0, but many, many more things did.  The net result is that to fully support my open source contribution, I would have to maintain separate, different copies of all the code files for Better Together for

  • OpenCart 1.5
  • OpenCart 2.0
  • OpenCart 2.3
  • OpenCart 3.0

Such a shame.  A little discipline – or technical project management – could have prevented this situation from arising.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.