spc Posted August 27, 2021 Share Posted August 27, 2021 Hello I follow this tutorials: https://www.linkedin.com/pulse/prestashop-how-create-custom-page-without-cms-iftakhar-hasan/ First i create a file called custom-page.php and upload it to /root code: <?php include(dirname(__FILE__).'/config/config.inc.php'); Tools::displayFileAsDeprecated(); include(dirname(__FILE__).'/header.php'); $smarty->display(_PS_THEME_DIR_.'custom-page.tpl'); include(dirname(__FILE__).'/footer.php'); later i create a file called: CustomPageController.php an upload it to /controllers/front/ code: <?php class CustomPageControllerCore extends FrontController { public $php_self = 'custom-page'; public $ssl = true; public function init(){ parent::init(); } public function initContent() { parent::initContent(); $this->setTemplate('custom-page'); } } the last file i create i name it custom-page.tpl and upload it to themes/templates/custom-page.tpl my code: {extends file='page.tpl'} <div> <h1>Sök och hitta A-mått</h1> <p> Alla A-mått är vägledande mått. <br /> Var uppmärksam på ändrat A-mått när du ändrar totalvikten på husvagnen. Vi rekommenderar alltid att du dubbelkollar måtten hos din återförsäljare.<br /><br /> {widget name="pm_advancedsearch4" id_search_engine="2"}</p> </div> I reset cache and check the page. I go to page/index.php?controller=custom-page but i only get 404 error. what have i done wrong. using ps 1.7.6.0 Link to comment Share on other sites More sharing options...
spc Posted August 27, 2021 Author Share Posted August 27, 2021 I manage to fix it my self.. change my custom-page.tpl: {extends file='page.tpl'} {block name='page_title'} {l s='Sök och hitta A-mått' d='Shop.Theme'} {/block} {block name='page_content'} <p> Alla A-mått är vägledande mått. <br /> Var uppmärksam på ändrat A-mått när du ändrar totalvikten på husvagnen. Vi rekommenderar alltid att du dubbelkollar måtten hos din återförsäljare.<br /><br /> {widget name="pm_advancedsearch4" id_search_engine="2"}</p> {/block} Link to comment Share on other sites More sharing options...
spc Posted August 27, 2021 Author Share Posted August 27, 2021 (edited) add the code to the root/controllers/front/ not root/classes/controllers/ And change the class CustomPageControllerCore extends FrontController to class CustomPageController extends FrontController Edited August 27, 2021 by spc (see edit history) Link to comment Share on other sites More sharing options...
spc Posted August 28, 2021 Author Share Posted August 28, 2021 (edited) Have u register a New page in seo and trafic tab in B.O Edited August 28, 2021 by spc (see edit history) Link to comment Share on other sites More sharing options...
spc Posted August 28, 2021 Author Share Posted August 28, 2021 No i needed to add in the seo and trafic to make it work. 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