Skip to content
Menu
WebHero | Yahya Mohammadi | Blog
  • Home
  • Web Development
  • Entertainment
WebHero | Yahya Mohammadi | Blog

Opencart Oc blog SEO URL and keyword issue [solved]

Posted on January 10, 2020January 10, 2020

Before giving any solution I should thank Snowman22 on opencart.com as he mentioned truly, OcBlog posts are not accessible via SEO keyword. Here is the solution.

SEO Keywords are interpreting in the seo_url controller. so open catalog\controller\startup\seo_url.php and add this before line 44:

if ($url[0] == 'post_id') {
  $this->request->get['post_id'] = $url[1];
}

and change line 44 from:

if ($query->row['query'] && $url[0] != 'information_id' && $url[0] != 'manufacturer_id' && $url[0] != 'category_id' && $url[0] != 'product_id') {

to:

if ($query->row['query'] && $url[0] != 'information_id' && $url[0] != 'post_id' && $url[0] != 'manufacturer_id' && $url[0] != 'category_id' && $url[0] != 'product_id') {

Then add this after line 63:

elseif (isset($this->request->get['post_id'])) {
  $this->request->get['route'] = 'blog/post';
}

Finally change line 79 from:

if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id')) {

to:

if (($data['route'] == 'product/product' && $key == 'product_id') || (($data['route'] == 'product/manufacturer/info' || $data['route'] == 'product/product') && $key == 'manufacturer_id') || ($data['route'] == 'information/information' && $key == 'information_id') || ($data['route'] == 'blog/post' && $key == 'post_id')) {

You made it!
you can access to blog posts via their SEO keyword now 🙂

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Popular Posts

  • How I built webhero.ir
    January 20, 2019
    I challenged myself to produce a flawless portfolio which has maximum optimization in performance, accessibility and page speed. I did the following steps to achieve the goals I had in my mind!

  • Game of Thrones Season 8 Episode Run Times Reportedly Revealed
    January 23, 2019
    Form unofficial sources it has been reported the final four episodes of Game of Thrones will be as long as a feature film.

  • After a very long absence Opencart is back!
    January 28, 2019
    Almost a year and a half have passed since Opencart has released its 3.0.2.0 version and the failed 3.1.0.0 version!

Recent Posts

  • Opencart Oc blog SEO URL and keyword issue [solved]
  • The CV has been updated!
  • OC blog for Opencart 3.x and up
  • Opencart Root Categories SEO URLs Not Working When Path Contains Zero [SOLVED]
  • After a very long absence Opencart is back!

Categories

  • Entertainment
  • Web Development

Archives

  • January 2020
  • December 2019
  • June 2019
  • January 2019

Most Tags

blog CV ecommerce game-of-thrones GitHub hbo job opencart page-speed seo seo-urls tv-series ui version-update web-design web-development

Social Login

Continue with Google

Sorted By Months

  • January 2020
  • December 2019
  • June 2019
  • January 2019

Topics

  • Entertainment
  • Web Development

Qoutes

“Truth can only be found in one place: the code.”
― Robert C. Martin

©2023 WebHero | Yahya Mohammadi | Blog | Powered by SuperbThemes & WordPress