From e5c997daa4f999153307026f852590cba32e7429 Mon Sep 17 00:00:00 2001 From: Pradeep Date: Fri, 4 Jan 2019 18:28:14 +0530 Subject: [PATCH 1/2] COMDEVNL-1700 -- Fixed Setting Issue --- admin/controller/payment/mollie/base.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin/controller/payment/mollie/base.php b/admin/controller/payment/mollie/base.php index 2b834df1..8cde85ba 100644 --- a/admin/controller/payment/mollie/base.php +++ b/admin/controller/payment/mollie/base.php @@ -274,9 +274,9 @@ public function clearData() { public function index () { // Double-check if clean-up has been done - For upgrades - if (empty($this->config->get('payment_mollie_version')) || $this->config->get('payment_mollie_version') < MOLLIE_VERSION) { + if (empty($this->config->get('mollie_payment_version')) || $this->config->get('mollie_payment_version') < MOLLIE_VERSION) { $this->cleanUp(); - Util::config(0)->set('payment_mollie', 'payment_mollie_version', MOLLIE_VERSION); + Util::config(0)->set('mollie_payment', 'mollie_payment_version', MOLLIE_VERSION); } $adminThemeDir = DIR_APPLICATION . 'view/template/'; From 3a5813190273d97ab42a53ad477db33207bfb45a Mon Sep 17 00:00:00 2001 From: Pradeep Date: Mon, 7 Jan 2019 14:08:40 +0530 Subject: [PATCH 2/2] COMDEVNL-1691 -- Added OCMod Support --- system/comercia/load.php | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/system/comercia/load.php b/system/comercia/load.php index e29c3b57..41c0fd97 100644 --- a/system/comercia/load.php +++ b/system/comercia/load.php @@ -22,9 +22,9 @@ function library($library) $bestOption = $this->findBestOption($libDir, $library, "php"); if (!class_exists($className)) { if (class_exists("VQMod")) { - @include_once(\VQMod::modCheck($libDir . $bestOption["name"] . ".php")); + @include_once(\VQMod::modCheck(modification($libDir . $bestOption["name"] . ".php"), $libDir . $bestOption["name"] . ".php")); } else { - @include_once($libDir . $bestOption["name"] . ".php"); + @include_once(modification($libDir . $bestOption["name"] . ".php")); } } @@ -108,9 +108,9 @@ function model($model) $className = $route["class"]; if (!class_exists($className)) { if (class_exists("VQMod")) { - @include_once(\VQMod::modCheck($modelDir . $route["file"] . ".php")); + @include_once(\VQMod::modCheck(modification($modelDir . $route["file"] . ".php"), $modelDir . $route["file"] . ".php")); } else { - @include_once($modelDir . $route["file"] . ".php"); + @include_once(modification($modelDir . $route["file"] . ".php")); } } @@ -234,9 +234,9 @@ function view($view, $data = array()) } $fakeControllerFile = __DIR__ . "/fakeController.php"; if (class_exists("VQMod")) { - require_once(\VQMod::modCheck($fakeControllerFile)); + require_once(\VQMod::modCheck(modification($fakeControllerFile), $fakeControllerFile)); } else { - require_once($fakeControllerFile); + require_once(modification($fakeControllerFile)); } $controller = new FakeController($registry); $result = $controller->getView($view, $data); @@ -326,9 +326,9 @@ function controller($controller) $className = $route["class"]; if (!class_exists($className)) { if (class_exists("VQMod")) { - @include_once(\VQMod::modCheck($controllerDir . $route["file"] . ".php")); + @include_once(\VQMod::modCheck(modification($controllerDir . $route["file"] . ".php"), $controllerDir . $route["file"] . ".php")); } else { - @include_once($controllerDir . $route["file"] . ".php"); + @include_once(modification($controllerDir . $route["file"] . ".php")); } } @@ -393,6 +393,27 @@ private function rewriteLanguage($model) ] ); } + + // Modification Override + function modification($filename) { + if (defined('DIR_CATALOG')) { + $file = DIR_MODIFICATION . 'admin/' . substr($filename, strlen(DIR_APPLICATION)); + } elseif (defined('DIR_OPENCART')) { + $file = DIR_MODIFICATION . 'install/' . substr($filename, strlen(DIR_APPLICATION)); + } else { + $file = DIR_MODIFICATION . 'catalog/' . substr($filename, strlen(DIR_APPLICATION)); + } + + if (substr($filename, 0, strlen(DIR_SYSTEM)) == DIR_SYSTEM) { + $file = DIR_MODIFICATION . 'system/' . substr($filename, strlen(DIR_SYSTEM)); + } + + if (is_file($file)) { + return $file; + } + + return $filename; + } } ?>