Skip to content

Commit

Permalink
Merge pull request #2004 from opencart-russia/master
Browse files Browse the repository at this point in the history
Update seo_url.php fix for another route
  • Loading branch information
Daniel Kerr committed Oct 15, 2014
2 parents 7b0a0e0 + 6e18ce5 commit 68d56e8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions upload/catalog/controller/common/seo_url.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ public function index() {
if ($url[0] == 'information_id') {
$this->request->get['information_id'] = $url[1];
}

if ($query->row['query'] && $url[0] != 'information_id' && $url[0] != 'manufacturer_id' && $url[0] != 'category_id' && $url[0] != 'product_id') {
$this->request->get['route'] = $query->row['query'];
}

} else {
$this->request->get['route'] = 'error/not_found';

Expand Down Expand Up @@ -100,8 +105,14 @@ public function rewrite($link) {
}

unset($data[$key]);
} elseif ($key == 'route' && $value == 'common/home') {
$url = '/';
} else {
$query = $this->db->query("SELECT * FROM " . DB_PREFIX . "url_alias WHERE `query` = '" .$data['route'] . "'");

if ($query->num_rows) {
$url .= '/' . $query->row['keyword'];

unset($data[$key]);
}
}
}
}
Expand Down

0 comments on commit 68d56e8

Please sign in to comment.