Zouheir Posted April 26, 2013 Share Posted April 26, 2013 (edited) bonjour, j'aimerai ajouter un champs de prix global dans le formulaire du prix de chaque produit et de changer l affichage du produit dans la boutique. j'ai arriver a realise ca mais par des modifications au niveau des fichiers prestashop 1.5 mais on me demmande de creer un module qui s'occupe de ca. donc mon probleme c'est en fait comment ajouter un champs depuis le module et comment repartir mes fichier sur le modele mvc que utilise prestashop. j'ai place : AdminImportController.php dans monmodule/controller/admin AdminProductsController.php dans monmodule/controller/front Product.php dans monmodule/models product.tpl + product_list.tpl + dossier (js) + dossier (css) tout ca dans monmodule/views/front prices.tpl dans monmodule/views/templates/admin/monmodule/ et voici ma classe module <?php if (!defined('_CAN_LOAD_FILES_')) exit; class monmodule extends Module { public function __construct() { global $cookie; $this->name = 'monmodule'; $this->tab = ''; $this->version = 1.5; $this->displayName = $this->l(''); $this->description = $this->l(''); $this->confirmUninstall = $this->l('Are you sure you want to uninstall the module ').$this->name; parent::__construct(); } public function install() { return (parent::install() AND $this->installModuleTab('AdminProducts', array(1=>'mymodule',2=>'monmodule') , 'AdminCatalog') ); } public function uninstall() { return (parent::uninstall() AND $this->uninstallModuleTab('AdminProducts') ); } private function installModuleTab($tabClass, $tabName, $nameTabParent) { $idTabParent = Db::getInstance()->getValue("SELECT `id_tab` FROM `"._DB_PREFIX_."tab` WHERE `class_name`='".$nameTabParent."'"); $tab = new Tab(); $languages=Language::getLanguages(false); $tabNameAllLanguages=array(); foreach($languages as $language) { if(isset($tabName[$language['id_lang']])) $tabNameAllLanguages[$language['id_lang']]=$tabName[$language['id_lang']]; else $tabNameAllLanguages[$language['id_lang']]=$tabName[1]; } $tab->name = $tabNameAllLanguages; $tab->class_name = $tabClass; $tab->module = $this->name; $tab->id_parent = $idTabParent; return ($tab->save()); } private function uninstallModuleTab($tabClass) { $idTab = Tab::getIdFromClassName($tabClass); if($idTab != 0) { $tab = new Tab($idTab); $tab->delete(); return true; } return false; } } ?> que dois je faire alors? Edited April 26, 2013 by Zouheir (see edit history) 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