Wollie Posted June 30, 2012 Share Posted June 30, 2012 (edited) I am relatively new to prestashop and have been considering using it for a project of mine. Ultimately, I want to achieve the site structure as detialed in the images at the bottom of this post (please note the urls). I am developing on a local wamp server though for the purposes of this post I have assumed that the root is an actual domain (http://www.mydomain.com/). I am using the 'permanent links' module for the main site navigation. Currently, I have prestashop installed in the root (http://www.mydomain.com/). I have edited the home page using the 'Home text editor' module to insert the content I require. I have excluded the modules that I don't wish to appear on the home page in the back office (back office > modules > positions > edit > exceptions). I have created an about-us.php file in the root (root/about-us.php): require(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('AboutUsController')->run(); And associated AboutUsController.php in the controllers folder (root/controllers/AboutUsController.php): class AboutUsControllerCore extends FrontController { public $php_self = 'about-us.php'; public function displayContent() { self::$smarty->display(_PS_THEME_DIR_.'about-us.tpl'); } } I have created an about-us.tpl file in my theme where I added the html code to display the required content. I modified the 'permanent links' module to include a link to about-us.php. I have added about-us.php to the list of urls in the back office (back office > preferences > seo & urls > add new). I have excluded the modules that I don't wish to appear on the about page. I tested it and everything worked fine: http://www.mydomain.com/en/about-us displays the content I want. I then repeat the process for shop.php (root/shop.php): require(dirname(__FILE__).'/config/config.inc.php'); ControllerFactory::getController('ShopController')->run(); And ShopController.php (root/controllers/ShopController.php): class ShopControllerCore extends FrontController { public $php_self = 'shop.php'; public function displayContent() { self::$smarty->display(_PS_THEME_DIR_.'shop.tpl'); } } And shop.tpl in my theme: {$HOOK_HOME} I tested it and everything worked fine: http://www.mydomain.com/en/shop displayed the conetent I wanted. The issue is when I click a link to a product category: The url is: http://www.mydomain....roduct-category The url I want is: http://www.mydomain....oduct-category. Is there an easy solution to what I want to achieve? Appolgies for the long post, I hope it is clear and thank you for any help. Edited June 30, 2012 by Wollie (see edit history) 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