Jump to content

Probleme Sur Module Back-Office


Recommended Posts

Bonjour,

 

• version prestashop : 1.5.2

 

J'ai installé un module en back-office pour gérer un nouveau module en Front. Je ne parle pas ici de contenu de Hook mais de positionnement déjà. Comme vous pouvez le voir sur la capture d'écran, le block du module est tout en haut (au-dessus du header prestashop).

 

Le code du fichier php du module :


<?php
class PromotionPopin extends Module{
function __construct()
{
$this->name = 'promotionpopin';
$this->tab = 'front_office_features';
$this->version = '1.1.1';
$this->author = 'Ritepac';
$this->displayName = $this->l('Block Promotion Popin');
$this->description = $this->l('Affiche une popin sur l\'index pour afficher promotions');

parent::__construct();
}

function install()
{
if (!parent::install())
return false;
if (!$this->registerHook('header'))
return false;
if (!$this->registerHook('promotionPopin'))
return false;
return true;
}

public function uninstall()
 {
   if (!parent::uninstall())
   return false;
 }

public function getContent()
{
if (isset($_POST['submit'])){
if (!empty($_POST['promotiontext']))
echo '<p>Bonjour '.$_POST['promotiontext'].'</p>';
else
echo '<span class="warning" style="display:block;" >Erreur : Veuillez entrer un texte</span>';
} else {
echo '<fieldset>
<legend>Administration du module :</legend>
     <form method="post" action="">
     Texte :<br /><textarea name="promotiontext"></textarea>
     <input type="submit" value="Envoyer" name="submit" />
     </form>
</fieldset>';
 }
}

 function hookPromotionPopin($params)
 {
return $this->display(__FILE__, 'promotionpopin.tpl');
}

public function hookHeader($params)
{
$this->context->controller->addCSS(($this->_path).'promotionpopin.css', 'all'); 
$this->context->controller->addJS($this->_path.'promotionpopin.js'); 
}
}
?>

 

Pouvez-vous m'aiguiller ?

 

Merci par avance

P.

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