web.geek Posted January 5, 2011 Share Posted January 5, 2011 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 More sharing options...
web.geek Posted January 12, 2011 Author Share Posted January 12, 2011 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 More sharing options...
web.geek Posted January 14, 2011 Author Share Posted January 14, 2011 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 More sharing options...
web.geek Posted January 16, 2011 Author Share Posted January 16, 2011 I gave up. Version 1.4.0.8 changed it from "lang-en" to just "en," so I can live with that instead of the learning curve I was facing. Sill interested in how to override controllers and classes if anyone has any info on that. Link to comment Share on other sites More sharing options...
vinsud Posted January 20, 2011 Share Posted January 20, 2011 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 More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now