Multi Level Push menu pour Prestashop 1.5 ou 1.6

Rendre le module prestashop 1.7 « Multi Level Push Menu » compatible pour les version Prestashop 1.5 et 1.6

C’est simple 😉

Dans le fichier mlpushmenu.php (ligne 47)
Prestashop 1.5

$this->ps_versions_compliancy = array('min' => '1.5.0.0', 'max' => _PS_VERSION_);

Prestashop 1.6

$this->ps_versions_compliancy = array('min' => '1.6.0.0', 'max' => _PS_VERSION_);

Dans la Base De Données

INSERT INTO `ps_hook` (
`id_hook` ,
`name` ,
`title` ,
`description` ,
`position` ,
`live_edit`
)
VALUES (
NULL ,  'displayAfterBodyOpeningTag',  'Very top of pages',  'Use this hook for advertisement or modals you want to load first.',  '1',  '1'
);

INSERT INTO `ps_hook` (
`id_hook` ,
`name` ,
`title` ,
`description` ,
`position` ,
`live_edit`
)
VALUES (
NULL ,  'displayBeforeBodyClosingTag',  'Very bottom of pages',  'Use this hook for your modals or any content you want to load at the very end.',  '1',  '1'
);

Dans le fichier header.tpl de votre thème (juste au dessous de la balise body)

{hook h='displayAfterBodyOpeningTag'}

Dans le fichier Footer.tpl de votre thème (juste au dessus de la balise body)

{hook h='displayBeforeBodyClosingTag'}

Créer un fichier FrontController.php dans (override\classes\controller)

<?php
/*
* 2007-2014 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author PrestaShop SA <contact@prestashop.com>
*  @copyright  2007-2014 PrestaShop SA
*  @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*/

class FrontController extends FrontControllerCore
{
    
    /**
     * Initializes common front page content: header, footer and side columns
     */
    public function initContent()
    {
        $this->process();

        if (!isset($this->context->cart)) {
            $this->context->cart = new Cart();
        }

        if (!$this->useMobileTheme()) {
            // These hooks aren't used for the mobile theme.
            // Needed hooks are called in the tpl files.
            $this->context->smarty->assign(array(
                'HOOK_HEADER'       => Hook::exec('displayHeader'),
                'HOOK_TOP'          => Hook::exec('displayTop'),
                'HOOK_BeforeBodyClosingTag'          => Hook::exec('hookdisplayBeforeBodyClosingTag'),
                'HOOK_AfterBodyOpeningTag'          => Hook::exec('hookdisplayAfterBodyOpeningTag'),
                'HOOK_LEFT_COLUMN'  => ($this->display_column_left  ? Hook::exec('displayLeftColumn') : ''),
                'HOOK_RIGHT_COLUMN' => ($this->display_column_right ? Hook::exec('displayRightColumn', array('cart' => $this->context->cart)) : ''),
            ));
        } else {
            $this->context->smarty->assign('HOOK_MOBILE_HEADER', Hook::exec('displayMobileHeader'));
        }
    }

	

}

 

Prestashop 1.5
Prestashop 1.6

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *