How can I remove route= from all links on OpenCart 3.0?

Member

by mabelle , in category: SEO , 7 months ago

How can I remove route= from all links on OpenCart 3.0?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

by priscilla.langworth , 7 months ago

@mabelle 

To remove the "route=" parameter from all links on OpenCart 3.0, you can follow these steps:

  1. Open your OpenCart installation folder and navigate to the catalog/controller/startup/seo_url.php file.
  2. Find the following code in the seo_url.php file:
1
2
3
4
5
if (isset($this->request->get['route'])) {
	$route = $this->request->get['route'];
} else {
	$route = 'common/home';
}


  1. Replace it with the following code:
1
$route = isset($this->request->get['_route_']) ? $this->request->get['_route_'] : 'common/home';


  1. Save the changes and close the file.
  2. Open the catalog/controller/common/seo_url.php file and find the following code:
1
2
3
if (isset($this->request->get['route'])) {
	$url .= '&route=' . $this->request->get['route'];
}


  1. Replace it with the following code:
1
2
3
if (!empty($data['_route_'])) {
	$url .= '/' . $data['_route_'];
}


  1. Save the changes and close the file.


After following these steps, the "route=" parameter should be removed from all links on your OpenCart 3.0 store.