Custom Back Office Tab Doesn't Visible in Prestashop

Asked
Active3 hr before
Viewed126 times

4 Answers

custom
90%

Hello everyone, I'm new on developing module of Prestashop and I use version of 1.7.4.2. I'm trying to develeping a module and I have to create a custom tab in left menu in back office. I tried this way which in the Prestashop official documentation(https://devdocs.prestashop.com/1.7/modules/concepts/controllers/admin-controllers/tabs/). But custom tab doesn't visible in the back office. Here I add my code and my file names. Can anyone help me about where is my mistake? Thank you so much. , Custom Back Office Tab Doesn't Visible , And there is driveorder.php file which is I created custom tab. , Go back to prestashop.com Project on GitHub Build blog Dev Docs User Docs User Club Addons Marketplace More

And there is driveorder.php file which is I created custom tab.

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

class driveorder extends Module {
   public
   function __construct() {
      $this - > name = 'driveorder'; /* This is the 'technic' name, this should equal to filename (mycustommodule.php) and the folder name */
      $this - > tab = 'administration'; /* administration, front_office_features, etc */
      $this - > version = '1.0.0'; /* Your module version */
      $this - > author = 'Sertac Bazancir'; /* I guess it was clear */
      $this - > need_instance = 0; /* If your module need an instance without installation */
      $this - > controllers = array('driveProducts');
      $this - > ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); /* Your compatibility with prestashop(s) version */
      $this - > bootstrap = true; /* Since 1.6 the backoffice implements the twitter bootstrap */

      parent::__construct(); /* I need to explain that? */

      $this - > displayName = $this - > l('Drive Order'); /* This is the name that merchant see */
      $this - > description = $this - > l('Google Drive integration for virtual products.'); /* A short description of functionality of this module */

      $this - > confirmUninstall = $this - > l('Are you sure you want to uninstall?'); /* This is a popup message before the uninstall */

      $this - > tabs = array(
         array(
            'name' => 'Drive Order', // One name for all langs
            'class_name' => 'AdminDriveOrder',
            'visible' => true,
            'parent_class_name' => 'AdminCatalog',
         )
      );

   }

   public
   function install() {
      if (Shop::isFeatureActive()) {
         Shop::setContext(Shop::CONTEXT_ALL);
      }
      $sql = "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_.
      "drive_product`(
      `id_product`
      INT(10) NOT NULL PRIMARY KEY,
         `id_drive`
      VARCHAR(255) NOT NULL)
   ";
   $result = Db::getInstance() - > Execute($sql);
   if (!parent::install() OR!$result OR!$this - > registerHook('actionPaymentConfirmation')) {
      return false;
   }
   return true;
}

public
function uninstall() {
   $sql = "DROP TABLE `"._DB_PREFIX_.
   "drive_product`";
   $result = Db::getInstance() - > Execute($sql);
   if (!parent::uninstall() OR!$result OR!Configuration::deleteByName('driveorder')) {
      return false;
   }
   return true;
}

public
function hookActionPaymentConfirmation($params) {
   global $smarty;
}
} ?
>
88%

I want to create a custom module in prestashop but it does not show up in the modules-tab in the back-office.,As far as I understand this is enough for a basic module to show up in the back-offices's modules tab., Stack Overflow Public questions & answers ,I created a very basic test-module but even this does not show up in back-office.

I think you are calling the parent before setting enough information. I would also suggest using a different name for your test module, something less generic.

< ? php

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

class Test extends Module {
   public
   function __construct() {

      $this - > name = 'Test';
      $this - > tab = 'Test';
      $this - > version = 1.0;
      $this - > author = 'Test';
      $this - > need_instance = 0;

      parent::__construct();

      $this - > displayName = 'TEST';
      $this - > description = 'TEST';
   }

   public
   function install() {
      return (parent::install());
   }
}
72%

Create tpl files to output information in the admin panel and front-end,displayAdminProductsExtra is required to output content into the tab, such as, for instance, a form to load images or some personal custom fields etc.,As well as the information of the tab/mobule being searchable, I cant see it within the exported CSV… I need to be able to import large amounts of products with these additional fields/information… is this possible ?,In this article we will create a sample module Belvg_Sample to serve as an example for how to create a custom tab and output its content for a product page. You can download the ready-made module at the end of the article.

Prestashop version 1.5.6 –
There is a Customize tab already available and would be perfect if it would except the type of text that I need. Unfortunately, it throws an error. No code, just an error.
It excepts a short sentence, but what I need is a copy of a customization for a wedding invitation and this is what it looks like…
1165-19-c24Traditional – Parents InvitingA[bride parent names] along with[groom parent names]request the honour of your presenceat the marriage of their children[bride name]- and -[groom name]on [date][year]at [ceremony time][ceremony location][ceremony city], [ceremony prov/state]Cocktails, Dinner, and Dancingat [reception time]at [reception location][reception address], [reception city], [reception prov/state]…
I do not need any code interpretation. Just need this to post as text, exactly like it is.
Am at a loss. do not know what to do.
Can you help me?

1165 - 19 - c24
load more v
65%

For SEO improvement, our seo specialist asked me add a text field on category page in the prestashop admin backend. He needs a field for add a conditional canonical url to some categories., admin11/05/2018 at 9:19 am Hi, can you give me some more info, prestashop version, in wich phase of the tutorial you have the error ? Can you add the custom fields in category ( backend ) ?, can you save them ? Andrea , First step is create needed fields in the database, in my case database is a mySql db, so, open phpMyAdmin.,Hi prestashop version is 1.7.2.1. Yes, I’m able to add custom field in category backend “Canonical URL” and “visible yes”, but when I activate the module, in the front end of the store (homepage) I see No template found for module bp_baseoptimization

Open the prestashop root folder in your prefered editor, open the “override/controllers/admin/” folder ( if you cant finde the folders inside “override”, create them ).
Create new file “AdminCategoriesController.php”, and paste this code:

< ? php

class AdminCategoriesController extends AdminCategoriesControllerCore {

   public
   function renderForm() {
      $this - > fields_form_override = array(
         array(
            'type' => 'text',
            'label' => $this - > l('Canonical URL'),
            'name' => 'canonical_url',
            'lang' => true,
            'autoload_rte' => true,
            'hint' => $this - > l('Invalid characters:').
            ' <>;=#{}',
         ),
         array(
            'type' => 'switch',
            'label' => $this - > trans('Visible', array(), 'Admin.Global'),
            'name' => 'visible_url',
            'lang' => false,
            'required' => false,
            'is_bool' => true,
            'values' => array(
               array(
                  'id' => 'visible_url_on',
                  'value' => 1,
                  'label' => $this - > trans('Enabled', array(), 'Admin.Global')
               ),
               array(
                  'id' => 'visible_url_off',
                  'value' => 0,
                  'label' => $this - > trans('Disabled', array(), 'Admin.Global')
               )
            )
         ),
      );

      return parent::renderForm();
   }

}
load more v

Other "custom-undefined" queries related to "Custom Back Office Tab Doesn't Visible in Prestashop"