S
S
SpideR-KOSS2014-04-17 11:15:19
opencart
SpideR-KOSS, 2014-04-17 11:15:19

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);
    }

$max_level = 10; set the value to 1 instead of 10, helped partially.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2014-04-17
@SpideR-KOSS

In the settings, you can make products either nested or not:

CNC products with categories:
/category/subcategory/product
(SeoPro only)
* Yes * No
At least this is the case in the latest versions.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question