Post by cevarief » Fri Jun 04, 2010 11:44 pm

Hi All,

I found that most of the opencart catalog controllers are using 'index.php?route=' everywhere to construct url link. For example take a look at the CommonHeader contoller line 86:

Code: Select all

       $this->data['home'] = HTTP_SERVER . 'index.php?route=common/home';
        $this->data['special'] = HTTP_SERVER . 'index.php?route=product/special';
        $this->data['contact'] = HTTP_SERVER . 'index.php?route=information/contact';
        $this->data['sitemap'] = HTTP_SERVER . 'index.php?route=information/sitemap';
When it runs, if config_seo_url is activated, the link will not change to nice seo, such as http://localhost/opencart/common/home, product/special and so on. I think if config_seo_url is activated, 'index.php?route=' should be removed from the url link. That's the consequence of activationg config seo.

Currently i hack with the following code :

Code: Select all

//Config seo check, if seo then it wont display 'index.php?route=' else it shows normal 'index.php?route='.
if($this->config->get('config_seo_url')){
            $index =  '';
            $extension = URL_EXTENSION; //custom config for page extension, such as .html if any. (global constanta)
        }
        else{
            $index = 'index.php?route=';
            $extension = '';
 }

......... code ........

        $this->data['special'] = HTTP_SERVER . $index . 'product/special' . $extension;
        $this->data['contact'] = HTTP_SERVER . $index . 'information/contact' . $extension;
        $this->data['sitemap'] = HTTP_SERVER . $index . 'information/sitemap' . $extension;
        $this->data['account'] = HTTPS_SERVER . $index . 'account/account' . $extension;
The code will work both with or without defined page extension / suffix.

It would be much simple if the seo check above is part of system controller, so we dont have to put that code in every controller. Since so many controller i should edit, everytime there's a new version of opencart, i should reedit the whole controller again after updating :-\ What do you think ?

Active Member

Posts

Joined
Wed Jun 02, 2010 10:52 pm

Post by JAY6390 » Sat Jun 05, 2010 10:30 pm

I think they're planning to put in something like this again in 1.4.9
Apparently there was something like this previously but it got scrapped
I too thought this would make sense

Image


User avatar
Guru Member

Posts

Joined
Wed May 26, 2010 11:47 pm
Location - United Kingdom

Post by soho335668 » Thu Jun 10, 2010 8:20 pm

I think this function is very good ,in other similar cart already , I don't know for what reason developers do not use
To search and know how many people want that feature..... O0

Newbie

Posts

Joined
Sat Apr 10, 2010 11:09 pm
Who is online

Users browsing this forum: No registered users and 16 guests