UriMarti Posted July 1, 2016 Share Posted July 1, 2016 Hello everyone, I have been all day reading tutorials about how to create a new page in Prestashop using my own php Class. All i have found on Internet is about older Prestashop versions and don't talk about create a new Class .php What i exactly need is to create a new page (new-page.tpl) with a classes/NewPage.php I have already created: - new-page.php: [on root folder] <?php require(dirname(__FILE__).'/config/config.inc.php'); Controller::getController('NewPageController')->run(); - NewPageController.php: [on controllers/front/ folder] <?php class NewPageControllerCore extends FrontController { public $php_self = 'newpage'; public $page_name = 'New Page'; public function initContent() { parent::initContent(); $this->setTemplate(_PS_THEME_DIR_.'new-page.tpl'); } } - new-page.tpl [on themes/MyTheme/ folder] Here is the problem. It works perfectly, but i need to use my own php file [already creating it]. How can i use it? I want it like classes/Product.php functions. But being classes/NewPage.php functions. Thank you very much for your responses. Link to comment Share on other sites More sharing options...
codetheweb Posted July 2, 2016 Share Posted July 2, 2016 You should implement your php code on the controller and call it with functions and variables... Take a look to the other controllers on how it works. 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