Jump to content

simon.bonjean

Members
  • Posts

    11
  • Joined

  • Last visited

About simon.bonjean

  • Birthday 02/27/1984

Contact Methods

Profile Information

  • Location
    Belgium
  • Activity
    Agency

simon.bonjean's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. monmodule/override/classes/CMS.php <?php class CMS extends CMSCore { public $content2; public static $definition = array( 'table' => 'cms', 'primary' => 'id_cms', 'multilang' => true, 'fields' => array( 'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'position' => array('type' => self::TYPE_INT), 'active' => array('type' => self::TYPE_BOOL), // Lang fields 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), 'content2' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), ), ); } monmodule/override/controllers/admin/AdminCmsController.php <?php class AdminCmsController extends AdminCmsControllerCore { public function renderForm() { $this->display = 'edit'; $this->toolbar_btn['save-and-preview'] = array( 'href' => '#', 'desc' => $this->l('Save and preview') ); $this->initToolbar(); if (!$this->loadObject(true)) return; $categories = CMSCategory::getCategories($this->context->language->id, false); $html_categories = CMSCategory::recurseCMSCategory($categories, $categories[0][1], 1, $this->getFieldValue($this->object, 'id_cms_category'), 1); $this->fields_form = array( 'tinymce' => true, 'legend' => array( 'title' => $this->l('CMS Page'), 'image' => '../img/admin/tab-categories.gif' ), 'input' => array( // custom template array( 'type' => 'select_category', 'label' => $this->l('CMS Category'), 'name' => 'id_cms_category', 'options' => array( 'html' => $html_categories, ), ), array( 'type' => 'text', 'label' => $this->l('Meta title:'), 'name' => 'meta_title', 'id' => 'name', // for copy2friendlyUrl compatibility 'lang' => true, 'required' => true, 'class' => 'copy2friendlyUrl', 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'size' => 50 ), array( 'type' => 'text', 'label' => $this->l('Meta description'), 'name' => 'meta_description', 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'size' => 70 ), array( 'type' => 'tags', 'label' => $this->l('Meta keywords'), 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'size' => 70, 'desc' => $this->l('To add "tags" click in the field, write something, then press "Enter"') ), array( 'type' => 'text', 'label' => $this->l('Friendly URL'), 'name' => 'link_rewrite', 'required' => true, 'lang' => true, 'hint' => $this->l('Only letters and the minus (-) character are allowed') ), array( 'type' => 'textarea', 'label' => $this->l('Page content'), 'name' => 'content', 'autoload_rte' => true, 'lang' => true, 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:').' <>;=#{}' ), array( 'type' => 'radio', 'label' => $this->l('Displayed:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled') ) ), ), ), 'submit' => array( 'title' => $this->l(' Save '), 'class' => 'button' ) ); if (Shop::isFeatureActive()) { $this->fields_form['input'][] = array( 'type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso', ); } $this->tpl_form_vars = array( 'active' => $this->object->active ); $this->fields_form['input'][] = array( 'type' => 'textarea', 'label' => $this->l('Page content 2'), 'name' => 'content2', 'autoload_rte' => true, 'lang' => true, 'rows' => 5, 'cols' => 40, 'hint' => $this->l('Invalid characters:').' <>;=#{}' ); return AdminController::renderForm(); } } Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_FUNCTION in /****/httpdocs/classes/module/Module.php(1880) : eval()'d code on line 15 Unable to install override: Class CMSOverrideOriginal does not exist Résultat httpdocs/override/classe/CMS.php : <?php class CMS extends CMSCore { 'table' => 'cms', 'primary' => 'id_cms', 'multilang' => true, 'fields' => array( 'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'position' => array('type' => self::TYPE_INT), 'active' => array('type' => self::TYPE_BOOL), // Lang fields 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), 'content2' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), ), ); } Résultat httpdocs/override/controllers/admin/AdminCmsController.php : <?php /** 2007-2012 PrestaShop .... .... */ class AdminCmsController extends AdminCmsControllerCore {
  2. Tu peux modifier le schema des urls générée dans Preferences -> SEO & URLs -> Schema of URLs Route to category : {id}-{rewrite}.html C'est magique !
  3. Oui j'ai même supprimé les fichier présent dans le dossier override avant d'installé mais rien a faire. Quand je passe par l'installation normal du module il me dit jusque que ça n'a pas marché. Mais j'ai fais un petit script qui désinstalle et installe mon module rapidement. Très pratique pour testé l'installation d'un module. Et là j'ai un fatal error. La classe Module.php fait un eval du code de ma surcharge de classe et forcément sans les déclarations de mes variables et ben ça marche pas. /httpdocs/classes/module/Module.php(1880) : eval()'d code on line 31 Mon script d'install rapide : <?php // a ne pas laisser en production bien évidement define('_PS_ADMIN_DIR_', getcwd()); require(dirname(dirname(__FILE__)).'/config/config.inc.php'); $modules = array('monmodule'); foreach($modules as $module) { echo "<h1>" . $module ."</h1>"; $module_instance = Module::getInstanceByName($module); if(Module::isInstalled($module)) { echo "<h3>" . $module ." is installed</h3>"; if($module_instance->uninstall()) { echo "<h2>uninstall $module Success</h2>"; } } if($module_instance->install()) { echo "<h2>install $module Success</h2>"; } else { foreach($module_instance->getErrors() as $error) { echo "<h3 style='color: red'> $error </h3>"; } echo "<h3 style='color: red'> unable to install</h3>"; } }
  4. if(_PS_MODE_DEV_) { Module::getInstanceByName('monmodule')->installLibs(); } J'ajoute ceci dans config.inc.php histoire pas me faire chier en dev.
  5. C'est effectivement ce qu'avais fait ... (J'ai mal recopié le chemin) J'ai trouvé une solution temporaire mais j'aimerai utiliser la fonction native de prestashop public function installLibs() { foreach ($this->_classes_add as $class) { $class = $class . '.php'; if (!is_dir(_PS_CLASS_DIR_ . $this->name)) mkdir(_PS_CLASS_DIR_ . $this->name); if (file_exists(_PS_CLASS_DIR_ . $class)) { if (!is_dir(_PS_CLASS_DIR_ . $class)) mkdir(_PS_CLASS_DIR_ . $class, 0777, true); copy(_PS_CLASS_DIR_ . '/classes/' . $class, $this->getLocalPath() . 'libs/backup/' . $class); } copy($this->getLocalPath() . 'libs/classes/' . $class, _PS_CLASS_DIR_ . $this->name . '/' . $class); } foreach ($this->_classes_override as $class) { $class = $class . '.php'; if (file_exists(_PS_OVERRIDE_DIR_ . 'classes/'. $class)) { if (!is_dir($this->getLocalPath() . 'libs/backup/override/')) mkdir($this->getLocalPath() . 'libs/backup/override', 0777, true); copy(_PS_OVERRIDE_DIR_ . 'classes/' . $class, $this->getLocalPath() . 'libs/backup/override/' . $class); } copy($this->getLocalPath() . 'libs/override/classes/' . $class, _PS_OVERRIDE_DIR_ . 'classes/' . $class); } foreach ($this->_controller_override_front as $class) { $class = $class . '.php'; if (file_exists(_PS_OVERRIDE_DIR_ . 'controllers/front/'. $class)) { if (!is_dir($this->getLocalPath() . 'libs/backup/override/controllers/front/')) mkdir($this->getLocalPath() . 'libs/backup/override/controllers/front', 0777, true); copy(_PS_OVERRIDE_DIR_ . 'controllers/front/' . $class, $this->getLocalPath() . 'libs/backup/override/controllers/front/' . $class); } copy($this->getLocalPath() . 'libs/override/controllers/front/' . $class, _PS_OVERRIDE_DIR_ . 'controller/front/' . $class); } foreach ($this->_controller_override_admin as $class) { $class = $class . '.php'; if (file_exists(_PS_OVERRIDE_DIR_ . 'controllers/admin/'. $class)) { if (!is_dir( $this->getLocalPath() . 'libs/backup/override/controllers/admin/')) mkdir( $this->getLocalPath() . 'libs/backup/override/controllers/admin', 0777, true); copy(_PS_OVERRIDE_DIR_ . 'controllers/admin/' . $class, $this->getLocalPath() . 'libs/backup/override/controllers/admin/' . $class); } copy($this->getLocalPath() . 'libs/override/controllers/admin/' . $class, _PS_OVERRIDE_DIR_ . 'controllers/admin/' . $class); } Autoload::getInstance()->generateIndex(); return true; } class PdwDoubleCMSContent extends PdwModule { public function __construct() { $this->_controller_override_admin = array('AdminCmsController'); $this->_classes_override = array('CMS'); } }
  6. Bonjour, J'essaie de faire une module pour prestashop 1.5 mais je n'arrive pas a surchargé le coeur de prestashop dans mon module. modules/doublecmscontent/override/controller/AdminCmsController.php modules/doublecmscontent/override/classes/CMS.php class CMS extends CMSCore { public $content2; public static $definition = array( 'table' => 'cms', 'primary' => 'id_cms', 'multilang' => true, 'fields' => array( 'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'position' => array('type' => self::TYPE_INT), 'active' => array('type' => self::TYPE_BOOL), // Lang fields 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), 'content2' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), ), ); } Je ne suis pas certain que le code fonctionne mais a l'installation du module il me donne le messages suivant : /httpdocs/classes/module/Module.php(1880) : eval()'d code on line 31 Après ça le fichier CMS.php dans le dossier override racine ressemble à ça : class CMS extends CMSCore { 'table' => 'cms', 'primary' => 'id_cms', 'multilang' => true, 'fields' => array( 'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'position' => array('type' => self::TYPE_INT), 'active' => array('type' => self::TYPE_BOOL), // Lang fields 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), 'content2' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), ), ); } Pourquoi la ligne de déclaration de ma variable a disparue ? Ca fait pareil pour les fonctions. Est-ce que je fait quelque chose de mal ? Quelqu'un sait-il m'aider ?
  7. Le module "Mise à jour en 1 clic" fonctionne avec la 1.3 Lors de la mise à jour le module propose de sélectionné les modules que tu souhaites garder. Mais au pire du les supprimes après la mise à jour s'il pose problème.
  8. Tu peux faire facilement une mise à jour avec le module "Mise à jour en 1 clic" Voici un petit tuto. http://doc.prestasho...pageId=11272345 Il y a la possibilité avec ce module de faire un roll-back (retour en arrière) mais je te conseil de ne pas faire la mise à jour en production. La seul chose qui ne sera plus compatible c'est ton thème et certain module. En effet de la version 1.3 à un 1.4 la version de smarty à changé sans compté qu'il faut ajouter et supprimer certain élément a certain endroit pour pouvoir profiter pleinement des fonctionnalités de la 1.5.
  9. Hello. I try to make a prestashop1.5 module but i can't override any core class in my module. modules/doublecmscontent/override/controller/AdminCmsController.php modules/doublecmscontent/override/classes/CMS.php class CMS extends CMSCore { public $content2; public static $definition = array( 'table' => 'cms', 'primary' => 'id_cms', 'multilang' => true, 'fields' => array( 'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'position' => array('type' => self::TYPE_INT), 'active' => array('type' => self::TYPE_BOOL), // Lang fields 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), 'content2' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), ), ); } I do not know if the code works perfectly but the installation gives the following message : /httpdocs/classes/module/Module.php(1880) : eval()'d code on line 31 After that CMS.php file in override root directory become like that: class CMS extends CMSCore { 'table' => 'cms', 'primary' => 'id_cms', 'multilang' => true, 'fields' => array( 'id_cms_category' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), 'position' => array('type' => self::TYPE_INT), 'active' => array('type' => self::TYPE_BOOL), // Lang fields 'meta_description' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_keywords' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'size' => 255), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), 'link_rewrite' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isLinkRewrite', 'required' => true, 'size' => 128), 'content' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), 'content2' => array('type' => self::TYPE_HTML, 'lang' => true, 'validate' => 'isString', 'size' => 3999999999999), ), ); } Why my variable declarations and function disappear? Is what I'm doing something wrong? Anyone can help me ?
  10. Peux tu nous afficher les premières lignes de ton fichier csv ? As tu activé l'affichage des bugs ?
  11. Support answered quickly with module archive attached. The module is very effective, my clients love it
  12. Hello, I bought your plugin but I find nowhere to download it. Can you help me ?
  13. Mettre la clé paramplus en majuscule fonctionne mais la validation de ma commande ne marche pas. Que faut il faire exactement dans le fichier validation.php ? ?
×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More