Jump to content

Newly created module, doesn't appear in Back-office


Recommended Posts

I'm creating a new module from scratch by following this tutorial: https://devdocs.prestashop.com/1.7/modules/creation/

  1. created directory and PHP file: /modules/my_featcategories/my_featcategories.php
  2. I added this code: 
<?php

if (!defined('_PS_VERSION_')) {
    exit;
}

class My_FeatCategories extends Module
{
    
}

 

Tutorial says:

Quote

At this stage, if you place the module’s folder on the /modules folder, the module can already be seen in the “Modules” page in the back office, in the “Other modules” section – albeit with no real name nor thumbnail.

Yet when i go to Module manager, it doesn't appear in 'Others' section and I can't find it.

Did I missed something?

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

You must create a construct for your PHP Class

Change

class My_FeatCategories extends Module
{
    
}

to

class My_FeatCategories extends Module
{

    public function __construct()
    {
        $this->name = "my_featcategories";
        $this->tab = "merchandizing";
        $this->version = "1.0.22";
        $this->author = "buy-addons";
        $this->need_instance = 0;
        $this->secure_key = Tools::encrypt($this->name);
        $this->bootstrap = true;
        $this->displayName = $this->l('Test Module Name');
        $this->description = $this->l('this is demo');
        parent::__construct();
    }

}

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