Hello. I'm on Prestashop version: 1.5.2.0
Here's how to make a custom page. Mines called `testpage`, folow these steps:
1. override/classes/controller/FrontController.php - added template variable to see which controller is used.
<?php
class FrontController extends FrontControllerCore
{
public function init() {
parent::init();
$this->context->smarty->assign(currentController', get_class($this));
}
}
2. testpage.php
<?php
require(dirname(__FILE__).'/config/config.inc.php');
Tools::displayFileAsDeprecated();
Tools::redirect('index.php?controller=testpage'.($_REQUEST ? '&'.http_build_query($_REQUEST, '', '&') : ''), __PS_BASE_URI__, null, 'HTTP/1.1 301 Moved Permanently');
3. testpage.tpl
{include file="$tpl_dir./breadcrumb.tpl"}
{include file="$tpl_dir./errors.tpl"}
<h1>Testpage</h1>
controller: {$currentController} <!-- Should be : TestpageController -->
4. controllers/front/TestpageController.php - NEW FILE!
<?php
class TestpageControllerCore extends FrontController
{
public $php_self = 'testpage';
public function initContent()
{
parent::initContent();
$this->setTemplate(_PS_THEME_DIR_.'testpage.tpl');
}
}
5. Only if you use Friendly URLs :
In PS admin > Prefrences > SEO & URLs
Add new > Page = testpage , Title = Testpage , Friendly URL = testpage
Thats it! Hope it helps someone.