Answer the question
In order to leave comments, you need to log in
Opencart - how to make cnc view site/product instead of site/category/subcategory/product?
Good afternoon.
I'm interested in the question - how to make short CNCs like "website/product" instead of "website/category/subcategory/product".
In seo_pro.php I changed the function:
if (!isset($path[$category_id])) {
$max_level = 10;
$sql = "SELECT CONCAT_WS('_'";
for ($i = $max_level-1; $i >= 0; --$i) {
$sql .= ",t$i.category_id";
}
$sql .= ") AS path FROM " . DB_PREFIX . "category t0";
for ($i = 1; $i < $max_level; ++$i) {
$sql .= " LEFT JOIN " . DB_PREFIX . "category t$i ON (t$i.category_id = t" . ($i-1) . ".parent_id)";
}
$sql .= " WHERE t0.category_id = '" . $category_id . "'";
$query = $this->db->query($sql);
$path[$category_id] = $query->num_rows ? $query->row['path'] : false;
$this->cache->set('category.seopath', $path);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question