fix(oc41): fix eventProductListAfter regex, use key/value for seo_url schema, fix admin_model_path in cron; rebuild zip packages
This commit is contained in:
parent
9078517760
commit
6aa36eff9c
|
|
@ -590,8 +590,8 @@ class EasyImportNat extends \Opencart\System\Engine\Controller {
|
||||||
<a href="' . $nat_fast_import . '" data-bs-toggle="tooltip" title="FAST IMPORT [NAT]" class="btn btn-success ms-1"><i class="fa-solid fa-upload"></i></a>
|
<a href="' . $nat_fast_import . '" data-bs-toggle="tooltip" title="FAST IMPORT [NAT]" class="btn btn-success ms-1"><i class="fa-solid fa-upload"></i></a>
|
||||||
<a href="' . $nat_settings . '" data-bs-toggle="tooltip" title="Settings [NAT]" class="btn btn-light border ms-1 me-3"><i class="fa-solid fa-gear"></i></a>';
|
<a href="' . $nat_settings . '" data-bs-toggle="tooltip" title="Settings [NAT]" class="btn btn-light border ms-1 me-3"><i class="fa-solid fa-gear"></i></a>';
|
||||||
|
|
||||||
if (preg_match('/<a[^>]*href=["'][^"']*catalog\/product\.(add|edit)[^"']*["'][^>]*>/i', $output, $m, PREG_OFFSET_CAPTURE) ||
|
if (preg_match("#<a[^>]*href=[\"\'][^\"\']*catalog/product\.(add|edit)[\"\'][^>]*>#i", $output, $m, PREG_OFFSET_CAPTURE) ||
|
||||||
preg_match('/<a[^>]*href=["'][^"']*catalog\/product\|(add|edit)[^"']*["'][^>]*>/i', $output, $m, PREG_OFFSET_CAPTURE)) {
|
preg_match("#<a[^>]*href=[\"\'][^\"\']*catalog/product\|(add|edit)[\"\'][^>]*>#i", $output, $m, PREG_OFFSET_CAPTURE)) {
|
||||||
$pos = $m[0][1];
|
$pos = $m[0][1];
|
||||||
$output = substr_replace($output, $btns_html, $pos, 0);
|
$output = substr_replace($output, $btns_html, $pos, 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -507,7 +507,7 @@ class EasyImportNat extends \Opencart\System\Engine\Model {
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($table_name === DB_PREFIX . 'seo_url') {
|
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);
|
$query = $this->db->query($sql);
|
||||||
return $query->num_rows ? $query->row['keyword'] : '';
|
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;
|
$languages = $this->db->query("SELECT language_id FROM `" . DB_PREFIX . "language` WHERE status = '1'")->rows;
|
||||||
foreach ($store_ids as $sid) {
|
foreach ($store_ids as $sid) {
|
||||||
foreach ($languages as $lang) {
|
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;
|
$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 !== '') {
|
if ($cat_slug !== '') {
|
||||||
foreach ($store_ids as $sid) {
|
foreach ($store_ids as $sid) {
|
||||||
foreach ($languages as $lang) {
|
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;
|
$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) . "'");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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')) {
|
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';
|
$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')) {
|
} elseif (is_file(DIR_APPLICATION . '../extension/easy_import_nat/admin/model/module/easy_import_nat.php')) {
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue