{"id":1915,"date":"2018-09-04T09:00:07","date_gmt":"2018-09-04T13:00:07","guid":{"rendered":"http:\/\/www.thatsoftwareguy.com\/blog\/?p=1915"},"modified":"2018-09-04T09:00:07","modified_gmt":"2018-09-04T13:00:07","slug":"what-does-a-nuc-opencart-change-look-like","status":"publish","type":"post","link":"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/09\/04\/what-does-a-nuc-opencart-change-look-like\/","title":{"rendered":"What does a NUC OpenCart Change look like?"},"content":{"rendered":"<p>To further explain the grievance I posted last time about <a href=\"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/09\/02\/opencart-and-the-nuc-problem\/\">OpenCart NUC changes<\/a>\u00a0and how harmful they are to the ecosystem around OpenCart, I though it would be useful to post an example.\u00a0 \u00a0We&#8217;ll look at how the language file is loaded in <a href=\"https:\/\/www.thatsoftwareguy.com\/opencart_better_together.html\">Better Together for OpenCart<\/a>.<\/p>\n<p>The first version of Better Together for OpenCart was created to work with OpenCart 1.5.\u00a0 The controller for this module is created in<\/p>\n<pre>admin\/controller\/total\/better_together.php<\/pre>\n<p>which defines the object<\/p>\n<pre>class ControllerTotalBetterTogether extends Controller<\/pre>\n<p>Here&#8217;s how a language file was loaded in that version:<\/p>\n<pre>$this-&gt;language-&gt;load('total\/better_together');<\/pre>\n<p>But in OpenCart 2.0, this changed!\u00a0 The code had to be refactored as follows:<\/p>\n<pre>$this-&gt;load-&gt;language('total\/better_together');<\/pre>\n<p>Again, in OpenCart 2.3 &#8211; supposedly a minor version update &#8211; the code changed again, because the file system was restructured:<\/p>\n<pre>$this-&gt;load-&gt;language('extension\/total\/better_together');<\/pre>\n<p>Not only that, but the class itself had to be renamed &#8211; and this happened\u00a0<strong>in a minor version update<\/strong>.<\/p>\n<pre>class ControllerExtensionTotalBetterTogether extends Controller {<\/pre>\n<p>Language loading did not change in OpenCart 3.0, but many, many more things did.\u00a0 The net result is that to fully support my open source contribution, I would have to maintain <em>separate, different copies<\/em>\u00a0of all the code files for Better Together for<\/p>\n<ul>\n<li>OpenCart 1.5<\/li>\n<li>OpenCart 2.0<\/li>\n<li>OpenCart 2.3<\/li>\n<li>OpenCart 3.0<\/li>\n<\/ul>\n<p>Such a shame.\u00a0 A little discipline &#8211; or technical project management &#8211; could have prevented this situation from arising.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To further explain the grievance I posted last time about OpenCart NUC changes\u00a0and how harmful they are to the ecosystem around OpenCart, I though it would be useful to post an example.\u00a0 \u00a0We&#8217;ll look at how the language file is loaded in Better Together for OpenCart. The first version of Better Together for OpenCart was &hellip; <a href=\"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/09\/04\/what-does-a-nuc-opencart-change-look-like\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">What does a NUC OpenCart Change look like?<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[83,58],"tags":[],"class_list":["post-1915","post","type-post","status-publish","format-standard","hentry","category-opencart","category-that-software-guy"],"_links":{"self":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/comments?post=1915"}],"version-history":[{"count":3,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1915\/revisions"}],"predecessor-version":[{"id":1918,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1915\/revisions\/1918"}],"wp:attachment":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/media?parent=1915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/categories?post=1915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/tags?post=1915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}