Prestashop: Creating a custom page for my module

非 Y 不嫁゛ 提交于 2019-12-12 17:06:19

问题


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!


回答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




回答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



来源:https://stackoverflow.com/questions/9451490/prestashop-creating-a-custom-page-for-my-module

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!