Jump to content

Adding custom module page


GONGOTA

Recommended Posts

Following this official guide 

<a href="http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module">Guide</a>

create display.php and add 'module_link' => $this->context->link->getModuleLink('nmo', 'display') this in my module code.But when trying to open link http://mydomain.com/ru/module/nmo/display it's 404 also tryed mydomain.com/modules/nmo/display.php (505) and mydomain.com/ru/index.php?module=nmo&controller=display (505)

Error from log: Fatal error: Class 'display' not found in /www/mydomain.com/classes/controller/Controller.php on line 135

Also tried solutions from this topic

http://www.prestashop.com/forums/topic/290064-solved-link-not-working-creating-a-prestashop-15-module/

Generally this:

 

Ok, solved.

There is an error in the official guide, where it says

Let's create the display.php file that it targets, with a minimal content, and put it in the module's root folder.

If you put display.php in the module's root folder, you will have "page not found" error like me. After some rows, the guide says:

Let's explore display.php, our first PrestaShop front-end controller, stored in the /controllers/front folder of the module's main folder:

If you put display.php in /controllers/front, this will work!

Maybe that is a section of the old version (1.4) of the guide that nobody has removed. Furthermore, it's not specified where I should put the template file, but trying, I found that it has to be put in /views/templates/front

It would be good to modify the guide to teach the right steps <_<

Thanks anyway for help!

Any ideas?

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...