Prestashop: Creating a custom page for my module

14,510

Solution 1

Edit: The standard way (for PS1.5 & PS1.6) is to make a controller

Another way (not recommended) is to make a file like this wher you include the header/your content/the footer

<?php 
    global $smarty; 
    include( '../../config/config.inc.php' ); 
    include( '../../header.php' ); 

    $smarty->display( dirname(__FILE__) . '/mymodule_page.tpl' ); 

    include( '../../footer.php' ); 
?> 

what you need to do is save this file in you module folder like newcustompage.php
and then make some link in your .tpl point to it
example:

<a href="{$modules_dir}yourmodulefolder/newcustompage.php">Click this!</a>

Prestashop Developer Guide

Solution 2

Try look at: How to create a custom page -> http://www.prestashop.com/forums/topic/52650-how-to-add-a-custom-page/

How to create hooks in your page -> http://www.smaizys.com/prestashop/how-to-create-custom-prestashop-hook/

I hope this helps you. Kind regards

Share:
14,510
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin almost 2 years

    I looking for code which can create a custom page. The code must include all hooks and I should moderate the "home" hook and put my content there...

    Anything is helpful - sample code for example, tutorials, documentations or something.

    Best regards,

    George!