Jump to content

Search the Community

Showing results for tags 'MVC'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community Help and Support
    • PrestaShop Download
    • PrestaShop Addons
  • News and Announcements
    • PrestaShop news and releases
    • PrestaShop Beta
    • PrestaShop Blogs
    • PrestaShop Meetups
  • International community (English)
    • General topics
    • PrestaShop Merchants
    • PrestaShop Developers
    • Taxes, Translations & Laws
    • Community Modules and Themes
  • Forum francophone
    • Discussion générale
    • Aide et support communautaire
    • PrestaShop pour les marchands
    • PrestaShop pour les développeurs
    • Adaptation aux lois Québécoises
    • Modules et thèmes gratuits
    • Modules et thèmes payants
  • Foro en Español
    • Discusión general
    • Soporte de la comunidad y ayuda
    • Comerciantes PrestaShop
    • Desarrolladores PrestaShop
    • Módulos y plantillas gratuitas
  • Forum italiano
    • Forum generale
    • Aiuto e supporto della Community
    • Commercianti PrestaShop
    • Sviluppatori PrestaShop
    • Aspetti legali sull'eCommerce
    • Moduli e template gratuiti
  • Deutsches Forum
    • Generelle Fragen
    • Support und Hilfe aus der Community
    • e-Commerce/Versand-Handel mit Prestashop
    • Prestashop-Entwickler
    • Anpassung an deutsches Recht
    • Kostenlose Module und Templates
    • Generelle Fragen Copy
  • Nederlandstalig forum
    • Algemeen
    • Hulp en ondersteuning, van en voor de community
    • PrestaShop-winkeliers
    • PrestaShop-ontwikkelaars
    • Het aanpassen van PrestaShop
    • Gratis modules en templates
  • Fórum em Português
    • Fórum Geral
    • Ajuda e Suporte da Comunidade
    • Lojistas que utilizam o PrestaShop
    • Desenvolvedores PrestaShop
    • Legislação específica
    • Módulos e temas gratuitos
  • Polskie forum
    • Forum ogólne
    • Wsparcie i pomoc użytkowników
    • Oferty twórców PrestaShop
    • Deweloperzy PrestaShop
    • Darmowe Moduły i Szablony
  • Dansk forum
    • Generelt forum
    • Hjælp og support fra fællesskabet
    • PrestaShop for købmænd
    • PrestaShop for udviklere
    • Love og regler
    • Gratis moduler og temaer
  • České fórum
    • Instalasi, Konfigurasi dan upgrade
    • Obecná diskuze
    • Bezplatné moduly a šablony
    • PrestaShop vývojáři
    • PrestaShop obchodníci
  • Bahasa Indonesia
    • Diskusi Umum
    • Podpora a pomoc komunity
    • Laporan Bug
    • Jasa, Promosi & Lowongan Kerja
  • Svenskt forum
    • Allmän diskussion
    • Installation, konfigurering och uppdatering
  • Forumul românesc
    • Discuţii generale
    • Instalare, configurare şi upgrade
  • Pусский язык
    • Обсуждение скрипта
    • Установка, Настройка, Обновление
    • Прием багов
  • Slovenské fórum
    • Všeobecná diskusia
    • Podpora a pomoc komunity
    • PrestaShop obchodníci
    • PrestaShop vývojári
    • Bezplatné moduly a šablóny
  • Türkçe Topluluğu
    • Genel Konular
    • Topluluk desteği ve yardım
    • PrestaShop Tüccarları
    • Prestashop Geliştiricileri
    • Ücretsiz Modül ve Temalar
  • Diễn đàn tiếng Việt
    • Thảo luận chung
    • Hỗ trợ từ cộng đồng
    • Dành cho chủ doanh nghiệp / cửa hàng
    • Dành cho lập trình viên
  • PrestaShop Communities
    • اللغه العربيه [Arabic]
    • Ελληνικά [Greek]
    • עִבְרִית [Hebrew]
    • 中文
    • Magyar [Hungarian]
    • 日本語 [Japanese]
    • Lietuviškai [Lithuanian]
    • انجمن فارسی [Persian]
    • ไทย [Thai]
    • Malaysia [Malaysian]
    • Eesti [Estonian]
    • Slovenščina [Slovenian]
    • Српски [Serbian]
  • IP. Board Forum
    • IP. Board Forum Questions and Issues
  • Archive
    • Zapłać Moduły i Szablony [ARCHIVE]
    • Moduly, upravy a dizajn [ARCHIVE]
    • Phát triển và các mô-đun [ARCHIVE]
    • Yazılım, Modül ve Tema [ARCHIVE]
    • Модули, Шаблоны [ARCHIVE]
    • Module şi teme [ARCHIVE]
    • Pengembangan dan Modul [ARCHIVE]
    • Moduler och teman [ARCHIVE]
    • Ecommerce x PrestaShop [ARCHIVE BOARD]
    • Vývoj a moduly [ARCHIVE]
    • Kostenpflichtige Module, Templates [ARCHIVE]
    • Módulos y temas pagos [ARCHIVE]
    • Módulos e temas pagos [ARCHIVE]
    • Servizi commerciali [ARCHIVE]
    • Forum - Feedback Contributor
    • PrestaShop Cloud

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 22 results

  1. I am a professional developer who is new to PrestaShop and PHP. Would anyone like to recommend any books or tutorials related to PHP that would help with my learning curve related to PrestaShop (MVC and OO principles used. I have been asked to take on some maintenance work (bug fixings) related to a Theme). Any ideas will be most appreciated.
  2. Hi folks, I am wondering if using in .tpl files code that will break mvc rules, something like this <strong>{Product::getProductCategories($product->id|intval)}</strong> instead of proper method like passing those values into smarty variable is affecting performance?
  3. I want check if ID reserved in DB, delete it and add new record with this ID. It's for if not (for example) ID 2 in database create record with ID 2. It's need to our current task. Thank you. have any ideas? $model = new TaxRulesGroup(2); $model->delete(); $model->id = 2; $model->id_tax_rules_group = 2; $model->name = 'new name'; $model->active = 1; $model->add();
  4. Which is the correct way to name, place and call an ajax front controller? I have found some responses, but I would like to find one which doesn't break the prestashop's MVC. This includes, how to name the controller? Where to place it? How should the .tpl be linked to it? Thank you very much in advance. Blessings, Miquel.
  5. Bonjour tout le monde, Etant nouveau dans le monde de Prestashop, j'ai une question à vous poser. Je tente de développer un module en MVC, j'ai donc suivi l’excellent tuto http://www.prestarocket.com/blog/creer-module-mvc-prestashop-1-5/. Pas de problème donc, j'arrive au résultat espéré. L'installation se passe très bien, ainsi que l'affichage des données dans le Back Office grâce aux HelperList, etc... Mais j'ai tout de même une question : est-il possible d'afficher un simple .tpl dans l'admin, sans utiliser les Helper ? Voici la structure de mon module : Et le code de AdminQuotationController.php où je tente d'afficher content.tpl (dans views/templates/admin/) grâce à la méthode initContent(). <?php class AdminQuotationController extends ModuleAdminController{ public function __construct() { $this->table = 'quotation'; $this->className = 'Quotation'; //$this->lang = true; $this->deleted = false; $this->colorOnBackground = false; $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?'))); $this->context = Context::getContext(); // définition de l'upload, chemin par défaut _PS_IMG_DIR_ $this->fieldImageSettings = array('name' => 'image', 'dir' => 'example'); parent::__construct(); } /*public function renderList(){ //... du code //affichage avec HelperList (ça fonctionne bien) } */ //affichage d'un .tpl (ne fonctionne pas) public function initContent(){ parent::initContent(); return $this->display($this->getTemplatePath().'/content.tpl'); //print_r($this->getTemplatePath().'/content.tpl');/*chemin_ftp/www/modules/quotationmod/views/templates/admin//content.tpl*/ //die(); } } Et voici les belles erreurs que cela me renvoie Notice à la ligne 39 du fichier chemin_ftp/www/cache/smarty/compile/91/3f/e7/913fe7644d43fb4edea83773d8ffbba85c7abab2.file.footer.tpl.php [8] Undefined index: ps_version Notice à la ligne 39 du fichier chemin_ftp/www/cache/smarty/compile/91/3f/e7/913fe7644d43fb4edea83773d8ffbba85c7abab2.file.footer.tpl.php [8] Trying to get property of non-object Notice à la ligne 43 du fichier chemin_ftp/www/cache/smarty/compile/91/3f/e7/913fe7644d43fb4edea83773d8ffbba85c7abab2.file.footer.tpl.php [8] Undefined index: timer_start Notice à la ligne 43 du fichier chemin_ftp/www/cache/smarty/compile/91/3f/e7/913fe7644d43fb4edea83773d8ffbba85c7abab2.file.footer.tpl.php [8] Trying to get property of non-object Notice à la ligne 95 du fichier chemin_ftp/www/cache/smarty/compile/91/3f/e7/913fe7644d43fb4edea83773d8ffbba85c7abab2.file.footer.tpl.php [8] Undefined index: iso_is_fr Notice à la ligne 95 du fichier chemin_ftp/www/cache/smarty/compile/91/3f/e7/913fe7644d43fb4edea83773d8ffbba85c7abab2.file.footer.tpl.php [8] Trying to get property of non-object Alors est-ce que je n'utilise pas la bonne méthode, ou est ce que c'est $this->display() qui n'est pas bon ? J'ai essayé beaucoup de choses différentes mais sans trouver (ni sur le forum, ni ailleurs) Je m'en remet donc à vous si vous avez une solution En vous remerciant de votre aide.
  6. Bonjour, J'ai un module qui contient une classe "maclasse" qui extends d'ObjectModel, J'ai remarqué que si tous les champs sont multilangue, l'ajout d'une instance (méthode add()) ne fonctionne pas correctement. (ID toujours à 0 et donc duplicate primary key dans la table "maclasse_lang"). si je rajoute un champ dans la table "maclasse", tout fonctionne correctement. Est-ce normal ? Cordialement.
  7. Je suis en train de creer un module et j'ai une question sur la méthode renderform() qui sert a mettre en place le formulaire a l'aide d'un helper... Je ne trouve pas comment affecter une value a un element de formulaire : $this->fields_form = array( 'tinymce' => true, 'legend' => array( 'title' => $this->l('lorem'), 'image' => '../img/admin/lorem.gif' ), 'input' => array( array( 'type' => 'text', 'label' => $this->l('lorem:'), 'name' => 'lorem', 'size' => 40, 'value'=> "testtestest" // ne fonctionne pas ) );
  8. I have a tpl to my custom module frontcontroller. I need know to include a tpl file into the frontcroller tpl. Something like ...code of my frontcontroller tpl... {include file="menu.tpl"} ... more code of frontcontroller tpl I have both of the tpls in the same folder (mymodules/views/templates/front/[...]) but im not capable to make the include work. I´ve tried using the global smarty variables, and adding manually the uri. Does anyone know how could this be done? Thanks.
  9. Bonjour les gens, Rien de méchant hein, Prestashop rocks ya aucun problème avec ca. Je me demande juste -du point de vue du code- si ca a pas été poussé un peu (trop) loin. Personnellement, je trouve. Des corrections de petits bugs redondants de la 1.4, la mise en place des override d'adminTab, le templating du BO aurait peut être été suffisants... J'aimerais juste avoir des retours d'autres codeurs sur le framework.
  10. If PrestaShop is based on a 3-tier architecture (MVC), what is the name of the controller that renders the .tpl files inside a theme? e.g myProject/themes/default("Default theme in Prestashop")/(.tpl files) or maybe where I can find the location of the controller that renders the .tpl files? So that I can add more smarty tags //Assume this file is the controller that renders the .tpl files in a theme //I got this code for converting a php value to a smarty tag in creating a module http://doc.prestashop.com/display/PS15/Creating+a+PrestaShop+module $this->context->smarty->assign(array( 'Hello' => "Hello", 'World' => "World", 'another_smarty_tag' => "Im another smarty tag" ));
  11. Bonjour à tous. Je suis actuellement en train de développer un module permettant de mettre à disposition sur le front des fichiers à télécharger avec administration dans le back. Mon module s'installe bien, j'ai la liste des fichiers (vide pour l'instant) mais quand je veux créer un fichier, il y a une erreur qui apparaît : Fatal error: Class 'DownloadFiles' not found in /home/koziel_dev/public_html/classes/controller/AdminController.php on line 1159 Le fichier de ma classe se trouve dans le dossier models/ de mon module. Je précise aussi que j'ai crée un dossier classes/ dans le module, sans changement. J'ai trouvé une solution temporaire en mettant mon fichier dans override/classes/modules mais je voudrais à terme qu'il soit dans le dossier de mon module. Quelqu'un a-t-il une idée ? Merci d'avance
  12. Bonjour. Dans le cadre du développement d'un site e-commerce sous Prestashop, je dois faire un module qui gère 7 produits affichés sur la page d’accueil en fonction du groupe du client. J'ai donc créé un onglet pour pouvoir accéder plus facilement à la mise à jour des ces produits. Hors je n'arrive pas à trouver la fonction à utiliser dans le controller. Le résultat final devrait ressembler au fichier joint. Est-ce réalisable ? Si oui, quelqu'un aurait-il une idée à me proposer ? Merci d'avance. Christian
  13. Bonjour, J'ai progressé dans les helper et maintenant je me débrouilles, mais comme conseillé dans le topic où je posais ma question je me suis mis à l'architecture MVC. J'ai bien compris la relation entre modules\monmodule\controllers\admin et modules\monmodule\views\templates\admin\moncontroller\helpers\form\form.tpl. En revanche j'ai moins bien compris la relation entre \monmodule\controllers\front et \monmodule\views\templates\front et \monmodule\views\templates\hook. Mes questions: - Pour le front on met le controller dans \monmodule\controllers\front mais pour le hook on ne peut le mettre qu'à la racine du module dans le source principal du module, dans un prepareHook et displayHook, ou alors il faut le mettre dans un controlleur et où ? - Quelle est la différence d'utilisation entre le hook et le front pour le front office ? J'ai regardé cette explication mais ça ne répond pas complétement à mes questions. Car je ne cherche pas à faire un module de saisie en front-office mais seulement à afficher des données passives via un tpl et des données à lui fournir. Merci d'avance edit: présentation (la balise List d'ipb ne s'affiche pas bien)
  14. Something is wrong with my validation.php in the controllers. When i click, Place my order i'm redirected to http://127.0.0.1/uthenga/index.php?fc=module&module=mobilewallet&controller=validation But then i get the page saying that something went wrong. Pasted below is my validation.php code <?php class MobilewalletValidationModuleFrontController extends ModuleFrontController { public function postProcess() { $cart = $this->context->cart; if ($cart->id_customer == 0 || $cart->id_address_delivery == 0 || $cart->id_address_invoice == 0 || !$this->module->active) Tools::redirect('index.php?controller=order&step=1'); // Check that this payment option is still available in case the customer changed his address just before the end of the checkout process $authorized = false; foreach (Module::getPaymentModules() as $module) if ($module['name'] == 'mobilewallet') { $authorized = true; break; } if (!$authorized) die($this->module->l('This payment method is not available.', 'validation')); $customer = new Customer($cart->id_customer); if (!Validate::isLoadedObject($customer)) Tools::redirect('index.php?controller=order&step=1'); $total = (float)$cart->getOrderTotal(true, Cart::BOTH); $this->module->validateOrder($cart->id,$total, $this->module->displayName, NULL, false, $customer->secure_key); Tools::redirect('index.php?controller=order-confirmation&id_cart='.$cart->id.'&id_module='.$this->module->id.'&id_order='.$this->module->currentOrder.'&key='.$customer->secure_key); } }
  15. Bonjour. Dans le cadre du développement d'un site e-commerce sous Prestashop, je dois faire un module qui gère 7 produits affichés sur la page d’accueil en fonction du groupe du client. J'ai donc créé un onglet pour pouvoir accéder plus facilement à la mise à jour des ces produits. Hors je n'arrive pas à trouver la fonction à utiliser dans le controller. Le résultat final devrait ressembler au fichier joint. Est-ce réalisable ? Si oui, quelqu'un aurait-il une idée à me proposer ? Merci d'avance. Christian
  16. Bonjours, je suis en train de développer un module backoffice pour mon stage de fin d'étude. Mon module est structuré en MVC et je suis sur le point de terminer la partie configuration qui présente un formulaire. Je suis plutôt spécialisé dans le C# et dans ce langage j'abonne les contrôleur aux évenement des vues pour effectuer les traitement en consequence. En php quand on sousmet un formulaire et qu'il appel une page avec les traitement adéquats... là où je bloque c'est quand le traitement en question est une méthode de mon objet contrôleur... comment instancier un contrôleur (ou récupérer une instance déjà créée) à partir de la vue (action="???"). Après avoir vu pas mal de tuto sans trouver de réponse je m'adresse à la communauté... si quelqu'un pouvait m'aiguiller je lui en serais reconnaissant! Merci d'avance
  17. We have an issue with a new module we created. We use the standard MVC pattern for PS1.5. - tpl files in views/templates/... - css files in views/css... - controllers in controllers/front... The module works perfectly on wampp server (local). The, we moved to a production server. On the production server : - PS can't find path to the various files. Then, we had to add in the module.php file the following : $this->context->controller->addCSS(($this->_path).'views/css/map.css', 'all'); We suspect a chmod issue with some core files. Can you please explain how Prestashop is finding files in module and which core file chmod we should pay attention to?
  18. Hi, Don't get it wrong I'm a Prestashop Developer, and I'm happy with it. But I think that new platform increases complexity of coding and doesn't have that 'natural way of coding' which made Prestashop so popular (in my point of view). Having to create all those files and repository to code a simple News module for example (and not having it working if you name your controller the wrong way) is what made me not go on with Magento. What are your thoughts ?
  19. Hello everybody, I'm trying to implement a module using the new MVC pattern available on admin part of Prestashop. The thing is, ulike some tuto found on the web, I don't have any database table or model linked to it. So far I'm quite infortunate because I manage to set up an admin tab linked with my controller, but for some reason I cannot overload the form.tpl. Here below is my module archive. It's very small an I would be eternally grateful if someone could just have a llok at it and make this admin tab display the form.tpl in the views folder. At least, any pointing in right direction would be deeply appreciated... Thanks again guys ! volume.zip
  20. Bonjour, à tous, Je tente de créer un module. Comme je débute je demarre de : http://www.prestarocket.com/blog/creer-module-mvc-prestashop-1-5/ J'ai téléchargé le module en question et fait mes modifications. Concernant l'arbo : +--oloproductplayer |oloproductplayer.php |views +... |models +--Oloplayer.php |controllers |admin +... +--adminoloplayer.php J'ai une table : ps_oloplayer adminoloplayer.php : <?php class AdminOloplayerController extends ModuleAdminController { public function __construct() { $this->table = 'oloplayer'; $this->className = 'Oloplayer'; parent :: __construct(); $this->fields_list = array( 'id_mp3' => array( 'title' => '#' ), 'id_product' => array( 'title' => $this->module->l('Product') ), 'title' => array( 'title' => $this->module->l('link Track') ), 'active' => array( 'title' => $this->module->l('Valider'), 'active' => 'status' ) ); $this->actions = array('delete'); } } Dans le model Oloplayer.php <?php class Oloplayer extends ObjectModel { public $id_mp3; public $id_product; public $title; public $url; public $active; public static $definition = array( 'table' => 'oloplayer', 'primary' => 'id_mp3', 'multilang' => false, 'fields' => array( 'id_mp3' => array( 'type' => ObjectModel :: TYPE_INT ), 'id_product' => array( 'type' => ObjectModel :: TYPE_INT, 'required' => true ), 'title' => array( 'type' => ObjectModel :: TYPE_STRING, 'required' => true ), 'active' => array( 'type' => ObjectModel :: TYPE_BOOL, 'required' => true ) ), ); } Pourtant cela ne fonctionne pas. j'ai l'entête et footer du back office au milieu : blanc. Pire si je met une table ps_opinion et que je modifie dans l'adminoloplayer : $this->table = 'oloplayer'; en $this->table = 'opinion; là je retrouve bien la liste modifiable du tuto. Quelqu'un peu m'aider ?
  21. Bonjour, Je suis pour la première fois sur un presta 1.5 et souhaite comprendre au mieux le fonctionnement des nouveautés apportées par le portage du MVC sur la partie admin. Je créé un module d'import/export qui n'a pas à intéragir avec la base pour le moment et souhaite pouvoir gérer la configuration de ce module via un onglet d'admin. Pour le moment je ne parviens qu'à une page vide (j'ai bien le header et footer Presta, pais impossible d'afficher quoi que ce soit...). Les différents tuto que j'ai trouvé imposent d'avoir une table en base mais ce n'est pas mon cas... Voici l'arbo de mon module volume controllers admin AdminVolume.php [*]config.xml [*]volume.php Mon code : ->volume.php (j'arrive bien à afficher ce que je veux "à l'ancienne" dans la partie configuration du module): <?php if (!defined('_PS_VERSION_')) exit; class Volume extends Module { public function __construct() { $this->name = 'volume'; $this->tab = 'export'; $this->version = 1.0; $this->author = '72300 studio'; $this->need_instance = 0; parent::__construct(); $this->displayName = $this->l('Passerelle avec VOLUME'); $this->description = $this->l('Contient les outils nécessaires pour lire/générer les fichiers d\'échanges avec l\'ERP VOLUME.'); } public function install() { $tab = new Tab(); $tab->name = 'Passerelle VOLUME'; $tab->module = 'volume'; $tab->class_name = 'AdminVolume'; $tab->id_parent = 18; // Root tab $tab->add(); return parent::install(); } public function getContent() { $output = 'text'; return $output; } /** * Displays admin form * @return string */ public function displayForm() { $output = 'text'; return $output; } -> AdminVolume.php class AdminVolumeController extends ModuleAdminController { /** * * @var string type : le type de parser souhaité : IMPORT pour lire un fichier en provenance de VOLUME, EXPORT pour créer un fichier à destination de VOLUME */ var $type; /** * * @var Array $profil : contient le tableau associatif qui indique comment lire/construire chaque ligne du fichier */ var $profil; public function __construct() { // Manque? parent :: __construct(); } public function renderForm() { $this->fields_form = array( 'legend' => array( 'title' => $this->l('Zones'), 'image' => '../img/admin/world.gif' ) ); return parent::renderForm(); } } Je ne vois pas comment compléter ce que j'ai... Il y a des assignation de table et de classe dans le constructeur controller, là ou j'ai écris "// manque ?", sur les exemples que j'ai trouvés. Mais quoi mettre ou comment faire si l'on n'a pas de table liée et/ou de modèle? Merci pour vos éclairages Nicolas
  22. Hola a todos! Estaba leyendo un tutorial de creacion de un modulo http://www.ecartserv...-module-part-3/ Y usa la siguiente función para mostrar un formulario en la pagina de configuracion del modulo: private function _displayForm() { $this->_html .= ' <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <label>'.$this->l('Message to the world').'</label> <div class="margin-form"> <input type="text" name="our_message" /> </div> <input type="submit" name="submit" value="'.$this->l('Update').'" class="button" /> </form>'; } ¿Es correcto hacerlo así o se deberia usar un archivo tpl? ¿Si es mediante tpl como se haría? Saludos
×
×
  • Create New...