Jump to content

Page not loading


Recommended Posts

Could someone help me find what is wrong  with this code? I am trying to learn from Prestashop Module Development book but can not pass this step. Prestashop1.6.1.10
 
Controller:

<?php
class MyModCommentsCommentsModuleFrontController extends ModuleFrontController
{
 
protected function initList()
{ 
$this->setTemplate('list.tpl');
}

public function initContent()
{
parent::initContent();
$id_product = (int)Tools::getValue('id_product');
$module_action = Tools::getValue('module_action');
$actions_list = array('list' => 'initList');
if ($id_product > 0 && isset($actions_list[$module_action]))
$this->$actions_list[$module_action]();
}
}
  

Template:

<h1>
{l s='Comments on product' mod='mymodcomments'}
"{$product->name}"
</h1>

 
And in displayProductTabContent I have link:
 
 

<div class="rte">
{assign var=params value=[
'module_action' => 'list',
'id_product'=> $smarty.get.id_product
]}
<a href="{$link->getModuleLink('mymodcomments', 'comments', $params)}">
{l s='See all comments' mod='mymodcomments'}
</a>
</div>
Edited by gargu (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...