Create in the Menu (dashboard) of the Prestashop BackOffice a new Option within the Catalog

0

Friends I'm a newbie in the creation of Modules for PrestaShop and I've been trying for several days to search the network for information on how and where to make my module create a new option or link in the BackOffice menu, this option take me to a window with a form for the creation of a product but with special features that the customer can then add to the shopping cart after the order or purchase.

DIRECTORIOS PARA EL MODULO

nombredelmodulo

controller
    admin
         AdminNombreDelModulo.php
views
    templates
         admin
              nombredelmodulo.tpl
         hook
              getContent.tpl
nombredelmodulo.php
logo.png
logo.gif

This is more or less what I have understood from what I have studied on the web, now in my file

nameofmodule.php

<?php

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

  class NombreDelModulo extends Module {
    public function __construct() {
      $this->name = 'nombredelmodulo';
      $this->displayName = 'Modulo de Testing';
      $this->description = 'Este Módulo permite la creación de una nueva opcion dentro del menu del backoffice dentro de la opción Catálogo y esta opcion llevara a un formulario con datos que van a la base de datos y otros extraidos de ella';
      $this->tab = 'front_office_features';
      $this->author = 'Autodidacta Prestashop';
      $this->version = '0.1';
      $this->bootstrap = true;
      $this->ps_version_compliancy = array('min' => '1.6', 'max' => '1.7');
      $this->need_instance = 0;
      $this->confirmUninstall = ('Estas seguro que deseas desinstalar este Módulo?');
      parent::__construct();
    }

    public function getContent() {
      if (Tools::isSubmit("customstock_form")) {
        $enable_comment = Tools::getValue("enable_comment");
        Configuration::updateValue("CUSTOMSTOCK_COMMENTS", $enable_comment);
      }
      $enable_comment = Configuration::get("CUSTOMSTOCK_COMMENTS");
      $this->context->smarty->assign("enable_comment", $enable_comment);
      return $this->display(__FILE__, "getContent.tpl");
    }
    public function install() {
      if (!parent::install() == false)
      return false;
      return true;
    }
    public function uninstall() {
     if (!parent::uninstall())
     return false;
     return true;           
    }
  }
?>

I also have my getContent.tpl

<fieldset>

Testing Module Configuration

Configuration  Activate Module:  Yes  Do not

I think that in Controller is the AdminName of the Module.php along with its tpl that would create the form and that would help the creation of that menu at the time of installing and deleting at the time of uninstallation, but I have almost not got documentation on this and of I really need a help light to be able to continue.

Something like in the image

    
asked by Navegante2009 08.02.2018 в 08:27
source

0 answers