Jump to content

[Gave Up] Remove lang-en part of the web address and override question


Recommended Posts

My store will only be available in English, so having the /lang-en/ part of the web address is unnecessary. Is there a way to remove it from BO or configuration? The only way I found so far is by changing the getLangLink function in the Link.php class to return a blank value, but the .htaccess generator still creates redirects that reference the language.

Link to comment
Share on other sites

OK. I'll stick to changing the original functionality. Any guidance on how to use the new override feature of 1.4 to accomplish this? Do I just create a new file in the override folder and define the one method (getLangLink)? Do I name the file Link.php, or does it need a unique name? If the name is different, how does the app know how to call it and not the original?

Link to comment
Share on other sites

One last shot at this. I've been trying to figure out on my own with limited OO and PHP programming experience, and I'm not getting anywhere, so any help would be appreciated. I would like to override the Link.php class instead of modifying it to get rid of the "lang-en" or "en" (1.4.0.8) part of the web address.

I created a Link.php file in the /override/classes directory. I know it is being read by the app somehow, because at first I forgot the <?php tag, and I got an error in the browser. Here's what I put in the php file:

<?php
class Link extends LinkCore
{
   /**
     * Constructor (initialization only)
     */
   public function __construct()
   {
       parent::__construct();
   }

   private function getLangLink($id_lang = NULL)   
   {
       if (!$this->allow)
           return NULL;
       return '';
   }
}



But nothing is different in the app. Is it a scope thing? Does the function need to be protected? Is my whole approach wrong?

Link to comment
Share on other sites

uncomment return Language::getIsoById((int)($id_lang)).'/';
in function getLangLink

private function getLangLink($id_lang = NULL)
   {
       if (!$id_lang)
       {
           global $cookie;
           $id_lang = (int)($cookie->id_lang);
       }

       if (!$this->allow)
           return NULL;
       // return Language::getIsoById((int)($id_lang)).'/';

   }




works for me.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...