I currently have User SEO URL\'s set to Yes in OpenCart Admin.
System -> Settings -> Store -> Server -> User SEO URL\'s
The previous "solutions" are wrong because they are attacking the SEO URL translate. What you want is to deal with the URL generation inside OpenCart.
Let's keep it simple. Go to /system/library/url.php and look at the public function link. Replace the function with this version:
public function link($route, $args = '', $connection = 'NONSSL') {
if ('NONSSL' == $connection) {
$url = $this->url;
} else {
$url = $this->ssl;
}
if ('common/home' == $route) {
if ($args) {
$url .= '?' . str_replace('&', '&', '&' . ltrim($args, '&'));
}
} else {
$url .= 'index.php?route=' . $route;
if ($args) {
$url .= str_replace('&', '&', '&' . ltrim($args, '&'));
}
}
foreach ($this->rewrite as $rewrite) {
$url = $rewrite->rewrite($url);
}
return $url;
}
Simple like that. I can't belive why this is not in OpenCart's core.
EDIT:
I run some tests and if the SEO URLs are enabled, it becomes necessary to make one single edit in the /catalog/controller/common/seo_url.php to avoid an "Undefined index" error.
Inside public function rewrite, replace this line:
parse_str($url_info['query'], $data);
With this one:
if (isset($url_info['query'])) parse_str($url_info['query'], $data);
Now it really works.