Jump to content

New Page Module Using Front Controller is not workin on 1.6.1.5


usasat

Recommended Posts

This code works perfectly on 1.6.1.4 but not on 1.6.1.5 also works on previews versos. I cannot fine a reason why it does not work on this new version.

 

I created a new module using this code:

 

  • listproducts
    • controllers
      • front
        • list.php
    • views
      • templates
        • front
          • list.tpl
    • listproduct.php
    • logo.png

 

listproducts/listproducts.php

 

<?php
if (!defined('_PS_VERSION_'))
    exit;

class Listproducts extends Module
{
    public function __construct()
    {
        $this->name = 'listproducts';
        $this->tab = 'front_office_features';
        $this->version = '1.0.0';
        $this->author = 'Vipul Hadiya';
        $this->controllers = array('list');
        $this->bootstrap = true;
        parent::__construct();
        $this->displayName = $this->l('List Products');
        $this->description = $this->l('List all the product in front page.');
        $this->confirmUninstall = $this->l('Are you sure about removing these details?');
    }

    public function install()
    {
        if (!parent::install() ||
            !$this->registerHook('backOfficeHeader'))
            return false;
        return true;
    }
    public function uninstall()
    {
        if (!$this->unregisterHook('backOfficeHeader') ||
            !parent::uninstall())
            return false;
        return true;
    }
    public function hookBackOfficeHeader()
    {
        if(!Tools::getIsset('configure') || Tools::getValue('configure') != $this->name)
            return;

        $this->context->controller->addCSS(array());
        $this->context->controller->addJquery();
        $this->context->controller->addJS(array());
    }
    public function getContent()
    {
        $this->context->smarty->assign(array());
        return $this->display(__FILE__, 'views/templates/admin/configure.tpl');
    }
}

 

 

listproducts/controllers/front/list.php

 

<?php
class listproductsListModuleFrontController extends ModuleFrontController
{
    public $ssl = true;

    public function __construct()
    {
        parent::__construct();
        $this->context = Context::getContext();
    }
    
    public function initContent()
    {
        parent::initContent();
        $this->context->smarty->assign(array());
        $this->setTemplate('list.tpl');
    }
    public function setMedia()
    {
        parent::setMedia();
        $this->addjQuery();
    }
}

 

listproducts/views/front/list.tpl

 

<h3>
    Some HTML content to show on page
</h3>

 

 

Please Help!

Edited by usasat (see edit history)
Link to comment
Share on other sites

Thank you for your help:

 

I use this link: /module/listproducts/list.

 

http://www.usasat.net/presta/module/listproducts/list

 

I see: This page is not available We're sorry, but the Web address you've entered is no longer available.
 

No, I did not turn the debug mode, I will try to do that now.

Edited by usasat (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...