__fabrice Posted November 19, 2009 Share Posted November 19, 2009 Bonjour à tous,Je ne trouve pas de tutos pour la création un module. Dans la FAQ, il est écrit de regarder dans le wiki, et puis, plus rien.Je voudrais des infos, concretes si possible , sur le "comment faire" pour developper un adds-on, car j'aurai besoin d'autres fonctionnalités.MerciFabrice Link to comment Share on other sites More sharing options...
Natsu Posted November 19, 2009 Share Posted November 19, 2009 Hello,http://www.prestashop.com/forums/viewthread/4466/developpement_et_modules/doc__creations_de_module_sous_prestashop__partie_i___ii Link to comment Share on other sites More sharing options...
__fabrice Posted November 20, 2009 Author Share Posted November 20, 2009 Bonjour,Merci pour ces infos , je vais étudier tout çà. Par contre, cela date de Aout 2008... c'est toujours d'actualités ou il y a eu des changements dans le code ?Fabrice Link to comment Share on other sites More sharing options...
Olecorre Posted November 20, 2009 Share Posted November 20, 2009 tu as aussi un petit tuto de julien : http://www.julien-breux.com/2009/08/22/tutoriel-prestashop-creer-un-module-avec-onglet/ Link to comment Share on other sites More sharing options...
Natsu Posted November 20, 2009 Share Posted November 20, 2009 Normalement, non Link to comment Share on other sites More sharing options...
__fabrice Posted November 20, 2009 Author Share Posted November 20, 2009 Ok merci Fabrice Link to comment Share on other sites More sharing options...
__fabrice Posted November 20, 2009 Author Share Posted November 20, 2009 Bon, je viens de tester, et j'ai un soucis , voici mes codes : <?php class HelloWorld extends Module { function __construct() { $this->name = 'helloworld'; $this->tab = 'Divers'; $this->version = '1.0'; parent::__construct (); $this->page = basename(__FILE__, '.php'); $this->displayName = $this->l('Hello World'); $this->description = $this->l('Description of my new module Hello World'); } public function install() { if(parent::install() == false) { return false; } return true; } public function getContent() { } public function hookLeftColumn($params) { global $smarty; return $this->display(__FILE__, 'helloworld.tpl'); } public function hookRightColumn($params) { return $this->hookLeftColumn($params); } } ?> le tpl : hello from the world<!-- Block unmodule --> {l s='Block' mod='helloworld'} href="modules/helloworld/classes/helloworld.function.php" title="nouvelles fonctions utilisateurs"> {l s='Nouvelles fonctions' mod='helloworld'} <!-- /Block unmodule --> Le module est bien présent dans l'admin et installé. Mais il en s'affiche pas dans le front.Dans l'arbo, j'ai bien : modules/helloworld/helloworld.phpmodules/helloworld/helloworld.tplmodules/helloworld/logo.gifQu'est ce qui ne va pas ?MerciFabrice Link to comment Share on other sites More sharing options...
__fabrice Posted November 20, 2009 Author Share Posted November 20, 2009 Oups, j'ai rien dis , çà s'affiche bien en bas, tout en bas à gauche. Cela servira d'exemple de base Fabrice Link to comment Share on other sites More sharing options...
__fabrice Posted February 2, 2010 Author Share Posted February 2, 2010 juste pour info, il y a des erreurs dans les fichiers pdf :1er PDF :- Au debut (page 9) on parle class UnModule extends Module, et puis d'un coup (page 13), on change par class BlockUnModule extends Module. Le premier exemple est bien sur "faux", puisqu'on se base sur le "BlockUnModule".- il faut lire <style type="text/css">@import url({$base_dir}modules/blockunmodule/css/module.css);</style> et non <style type="text/css">@import url({$base_dir}modules/unmodule/css/module.css);</style>- ici aussi : $nombre_commande = Db::getInstance() -> ExecuteS($sql); au lieu de $reponse = Db::getInstance() -> ExecuteS($sql);- ensuite, c'est mieux comme çà je pense : $sql = "SELECT count( `id_order` ) as nb_commande FROM `ps_orders` JOIN `ps_customer` ON `ps_customer`.`id_customer` = `ps_orders`.`id_customer` WHERE `ps_customer`.`id_customer` = $cookie->id_customer"; $nombre_commande = Db::getInstance() -> ExecuteS($sql); $nbCommandes = (int)$nombre_commande[0]['nb_commande']; $smarty -> assign('nb_commande',$nbCommandes); switch($nbCommandes) { et dans le tpl : <style type="text/css">@import url({$base_dir}modules/blockunmodule/css/module.css);</style> nouvelles fonctions {$message}, {$customer->firstname} Vous avez {$nb_commande} commande(s) : {$commande} Voilà F. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now