Access to PrestaShop corporate website
Bonjour, Invité |
| S'inscrire
Se souvenir de moi Mot de passe oublié ?
Site Map Plan du site Contact us Contactez-nous
PrestaShop
  539 Membres en ligne
Forum  >  English Forum  >  Third party modules  >  Fil

 
Répondre
Nouveau sujet
how to create a new module? any kind!

offline
Publié : 09 Février 2008 11:06 PM   [ Ignorer ]
Regular
RankRank

Messages :

  • au total : 67
  • 7 derniers jours : 0
Inscrit: 2008-01-22

Hi if anybody there know how to create a new module for prestashop please explain here or leave a tutorial adress…

i want to create a new payment module, cause in brazil, prestashop payments modules doesn't work, paypal doesn't have our currency. :/

waiting for suggestions.

thx

 
offline
Publié : 30 Octobre 2008 07:08 AM   [ Ignorer ]   [ # 1 ]
Regular
RankRank

Messages :

  • au total : 97
  • 7 derniers jours : 0
Inscrit: 2008-08-14

Are Oscommerce modulles to adjust Prestashop ?

Please ….?

 Signature 

http://www.presta-tr.com

 
offline
Publié : 03 Novembre 2008 01:59 AM   [ Ignorer ]   [ # 2 ]
V.I.P.
RankRankRankRank
Avatar

Messages :

  • au total : 781
  • 7 derniers jours : 0
Inscrit: 2008-08-03

The answer is that it’s either very easy to do (if you’re used to programming in PHP using objects and classes) or very difficult!

The best way to learn is to take one of the simpler modules and play with the basic code until you understand the basics of how it works. You don;t need much code for a “minimal” implementation.

It terms of porting osCommerce code….. it’s almost entirely a different thing, except in terms of payment modules where certain blocks of code could be easily re-used.

Paul

 Signature 

Free Prestashop modules and developer resources

follow me on Twitter for news and updates.

Latest Free Prestashop Module updates:
* GoogleBase 0.6.3.1 Hotfix <- didn’t fix what is was intended to. :(
* The Ultimate Prestashop Module and Theme Development Tool

My French is terrible, so feel free to laugh when I attempt to post en français.

 
offline
Publié : 26 Novembre 2008 05:12 PM   [ Ignorer ]   [ # 3 ]
Newcomer
Rank
Avatar

Messages :

  • au total : 5
  • 7 derniers jours : 0
Inscrit: 2008-10-08

And if I don’t want to re-use any existent module but create an own one from the scratch?
What are the basics for creating modules? What do I have to mind to, if I create a module?

Are there any Tutorials or faqs regarding to that that topic?

Thanks for your help.
davadda

 Signature 

… just refactoring ...

 
offline
Publié : 26 Novembre 2008 05:25 PM   [ Ignorer ]   [ # 4 ]
V.I.P.
RankRankRankRank
Avatar

Messages :

  • au total : 781
  • 7 derniers jours : 0
Inscrit: 2008-08-03

Well the most basic one (non payment):

<?php

class mymodule extends Module {


}

?>

Not sure what you’re asking apart from that?? smile

Paul

 Signature 

Free Prestashop modules and developer resources

follow me on Twitter for news and updates.

Latest Free Prestashop Module updates:
* GoogleBase 0.6.3.1 Hotfix <- didn’t fix what is was intended to. :(
* The Ultimate Prestashop Module and Theme Development Tool

My French is terrible, so feel free to laugh when I attempt to post en français.

 
offline
Publié : 26 Novembre 2008 05:35 PM   [ Ignorer ]   [ # 5 ]
Newcomer
Rank
Avatar

Messages :

  • au total : 5
  • 7 derniers jours : 0
Inscrit: 2008-10-08

Thanks for your quick answer. The code you submitted was my first idea, but it does not work.

class test extends Module
{
    
public function __construct()
    
{
        $this
->name 'test';
        
$this->tab 'Tools';
        
$this->version "0.1";
        
        
parent::__construct();
        
        
/* The parent construct is required for translations */
        
$this->page basename(__FILE__'.php');
        
$this->displayName $this->l('Test');
        
$this->description $this->l('Just a test!');
    
}
}

Thats my code, but it does not get listed in the modules list. Any idea?

(If I change the name of the google adsense Module for example it works – the name changes in the modules list – but if I change the folder name it is not listed anymore. Is there any Config that I have to edit?)

 Signature 

… just refactoring ...

 
offline
Publié : 26 Novembre 2008 06:03 PM   [ Ignorer ]   [ # 6 ]
V.I.P.
RankRankRankRank
Avatar

Messages :

  • au total : 781
  • 7 derniers jours : 0
Inscrit: 2008-08-03

OK, create a file containing the following, and call it test.php.

<?php 
class test extends Module
{
    
public function __construct()
    
{
        $this
->name 'test';
        
$this->tab 'Tools';
        
$this->version "0.1";
        
        
parent::__construct();
        
        
/* The parent construct is required for translations */
        
$this->page basename(__FILE__'.php');
        
$this->displayName $this->l('Test');
        
$this->description $this->l('Just a test!');
    
}

    
function install()
    
{
       
if (!parent::install())
      return 
false;

       return 
true;
    
}


?>

Make a directory /modules/test and put the above file in it, and it should show up in the back office smile

The $this->name member variable must match the directory and filename (case sensitive). The Class name must also match, but isn’t case sensitive.

Paul

 Signature 

Free Prestashop modules and developer resources

follow me on Twitter for news and updates.

Latest Free Prestashop Module updates:
* GoogleBase 0.6.3.1 Hotfix <- didn’t fix what is was intended to. :(
* The Ultimate Prestashop Module and Theme Development Tool

My French is terrible, so feel free to laugh when I attempt to post en français.

 
offline
Publié : 26 Novembre 2008 06:13 PM   [ Ignorer ]   [ # 7 ]
Newcomer
Rank
Avatar

Messages :

  • au total : 5
  • 7 derniers jours : 0
Inscrit: 2008-10-08

Thank you very much. I found that out about some minutes ago.
A short faq about that would make it easier to create the first module :D

 Signature 

… just refactoring ...

 
 
 
Réponse rapide
Nouveau sujet