diff --git a/admin/controller/module/easy_import_nat.php b/admin/controller/module/easy_import_nat.php index c19f53d..3f5285a 100644 --- a/admin/controller/module/easy_import_nat.php +++ b/admin/controller/module/easy_import_nat.php @@ -590,8 +590,8 @@ class EasyImportNat extends \Opencart\System\Engine\Controller { '; - if (preg_match('/]*href=["'][^"']*catalog\/product\.(add|edit)[^"']*["'][^>]*>/i', $output, $m, PREG_OFFSET_CAPTURE) || - preg_match('/]*href=["'][^"']*catalog\/product\|(add|edit)[^"']*["'][^>]*>/i', $output, $m, PREG_OFFSET_CAPTURE)) { + if (preg_match("#]*href=[\"\'][^\"\']*catalog/product\.(add|edit)[\"\'][^>]*>#i", $output, $m, PREG_OFFSET_CAPTURE) || + preg_match("#]*href=[\"\'][^\"\']*catalog/product\|(add|edit)[\"\'][^>]*>#i", $output, $m, PREG_OFFSET_CAPTURE)) { $pos = $m[0][1]; $output = substr_replace($output, $btns_html, $pos, 0); } diff --git a/admin/model/module/easy_import_nat.php b/admin/model/module/easy_import_nat.php index 75f0532..fdfcd31 100644 --- a/admin/model/module/easy_import_nat.php +++ b/admin/model/module/easy_import_nat.php @@ -507,7 +507,7 @@ class EasyImportNat extends \Opencart\System\Engine\Model { } if ($table_name === DB_PREFIX . 'seo_url') { - $sql = "SELECT `keyword` FROM `" . DB_PREFIX . "seo_url` WHERE query = 'product_id=" . (int)$product_id . "' AND store_id = 0 AND language_id = '" . (int)$lang_id . "' LIMIT 1"; + $sql = "SELECT `keyword` FROM `" . DB_PREFIX . "seo_url` WHERE `key` = 'product_id' AND `value` = '" . (int)$product_id . "' AND store_id = 0 AND language_id = '" . (int)$lang_id . "' LIMIT 1"; $query = $this->db->query($sql); return $query->num_rows ? $query->row['keyword'] : ''; } @@ -713,9 +713,9 @@ class EasyImportNat extends \Opencart\System\Engine\Model { $languages = $this->db->query("SELECT language_id FROM `" . DB_PREFIX . "language` WHERE status = '1'")->rows; foreach ($store_ids as $sid) { foreach ($languages as $lang) { - $check = $this->db->query("SELECT seo_url_id FROM `" . DB_PREFIX . "seo_url` WHERE keyword = '" . $this->db->escape($man_slug) . "' AND store_id = '" . (int)$sid . "' AND language_id = '" . (int)$lang['language_id'] . "' AND query != 'manufacturer_id=" . (int)$manufacturer_id . "' LIMIT 1"); + $check = $this->db->query("SELECT seo_url_id FROM `" . DB_PREFIX . "seo_url` WHERE keyword = '" . $this->db->escape($man_slug) . "' AND store_id = '" . (int)$sid . "' AND language_id = '" . (int)$lang['language_id'] . "' AND (`key` != 'manufacturer_id' OR `value` != '" . (int)$manufacturer_id . "') LIMIT 1"); $final_man_slug = $check->num_rows ? ($man_slug . '-m' . (int)$manufacturer_id) : $man_slug; - $this->db->query("INSERT IGNORE INTO `" . DB_PREFIX . "seo_url` SET store_id = '" . (int)$sid . "', language_id = '" . (int)$lang['language_id'] . "', query = 'manufacturer_id=" . (int)$manufacturer_id . "', keyword = '" . $this->db->escape($final_man_slug) . "'"); + $this->db->query("INSERT IGNORE INTO `" . DB_PREFIX . "seo_url` SET store_id = '" . (int)$sid . "', language_id = '" . (int)$lang['language_id'] . "', `key` = 'manufacturer_id', `value` = '" . (int)$manufacturer_id . "', keyword = '" . $this->db->escape($final_man_slug) . "'"); } } } @@ -836,9 +836,9 @@ class EasyImportNat extends \Opencart\System\Engine\Model { if ($cat_slug !== '') { foreach ($store_ids as $sid) { foreach ($languages as $lang) { - $check = $this->db->query("SELECT seo_url_id FROM `" . DB_PREFIX . "seo_url` WHERE keyword = '" . $this->db->escape($cat_slug) . "' AND store_id = '" . (int)$sid . "' AND language_id = '" . (int)$lang['language_id'] . "' AND query != 'category_id=" . (int)$category_id . "' LIMIT 1"); + $check = $this->db->query("SELECT seo_url_id FROM `" . DB_PREFIX . "seo_url` WHERE keyword = '" . $this->db->escape($cat_slug) . "' AND store_id = '" . (int)$sid . "' AND language_id = '" . (int)$lang['language_id'] . "' AND (`key` != 'category_id' OR `value` != '" . (int)$category_id . "') LIMIT 1"); $final_cat_slug = $check->num_rows ? ($cat_slug . '-' . (int)$category_id) : $cat_slug; - $this->db->query("INSERT IGNORE INTO `" . DB_PREFIX . "seo_url` SET store_id = '" . (int)$sid . "', language_id = '" . (int)$lang['language_id'] . "', query = 'category_id=" . (int)$category_id . "', keyword = '" . $this->db->escape($final_cat_slug) . "'"); + $this->db->query("INSERT IGNORE INTO `" . DB_PREFIX . "seo_url` SET store_id = '" . (int)$sid . "', language_id = '" . (int)$lang['language_id'] . "', `key` = 'category_id', `value` = '" . (int)$category_id . "', keyword = '" . $this->db->escape($final_cat_slug) . "'"); } } } diff --git a/catalog/controller/module/easy_import_nat_cron.php b/catalog/controller/module/easy_import_nat_cron.php index 12f3a81..917032a 100644 --- a/catalog/controller/module/easy_import_nat_cron.php +++ b/catalog/controller/module/easy_import_nat_cron.php @@ -67,7 +67,7 @@ class EasyImportNatCron extends \Opencart\System\Engine\Controller { } }); - $$admin_model_path = ''; + $admin_model_path = ''; if (defined('DIR_EXTENSION') && is_file(DIR_EXTENSION . 'easy_import_nat/admin/model/module/easy_import_nat.php')) { $admin_model_path = DIR_EXTENSION . 'easy_import_nat/admin/model/module/easy_import_nat.php'; } elseif (is_file(DIR_APPLICATION . '../extension/easy_import_nat/admin/model/module/easy_import_nat.php')) { diff --git a/easy_import_export_nat_OC_41_1_0.ocmod.zip b/easy_import_export_nat_OC_41_1_0.ocmod.zip index 9fea7c8..407f7cc 100644 Binary files a/easy_import_export_nat_OC_41_1_0.ocmod.zip and b/easy_import_export_nat_OC_41_1_0.ocmod.zip differ diff --git a/easy_import_nat.ocmod.zip b/easy_import_nat.ocmod.zip index 9fea7c8..407f7cc 100644 Binary files a/easy_import_nat.ocmod.zip and b/easy_import_nat.ocmod.zip differ