transferbion.blogg.se

Prestashop devdocs
Prestashop devdocs






If the store version does not fit in the range, the module will not even install. $this->ps_versions_compliancy table specifies the value of PrestaShop versions for which the module will work. $this->need_instance call (or not) modules class when loading the module page in the administration panel $this->author we enter the signature identifying the author, which will be visible in the administrative panel More attribute values can be found on the PrestaShop website In our case, we set the value to 'front_office_features' because the module is designed to display additional text on the front-end side. $this->tab defines in which section in the modules back office list the PrestaShop addon will be displayed. $this->name is the module ID, its value must be the same as the extension directory name You can leave the rest of the attributes as in the example. In addition, you can change $ this-> author.

prestashop devdocs

If the name of your module differs from that in the article, change the value $ this-> name. Let's take a look at the construction of the constructor. This is the action required for the extension to work properly. Then we create a class named "prestapros_demo" that extends the Module class. If the _PS_VERSION_ constant is not defined when the file is invoked, the script will exit. The first condition (if) prevents the file from being called directly from outside. $this->confirmUninstall = $this->l('Are you sure you want to uninstall?') $this->description = $this->l('Display demo content.') $this->displayName = $this->l('PrestaPros demo module') This is a file that secures access to the directory from outside. The following content should be pasted into the file. We create a module for version 1.7, which is why we add a logo file with a resolution of 128 x 128 px in png format. You should also add a graphic file (displayed in the administration panel). Next, inside the directory add a php file with the same name. Now, create there a directory with a previously invented name. Extensions are located in the "modules" directory.

prestashop devdocs prestashop devdocs

In our case, we will give a name "prestapros_demo". It is worth to describe the function that the add-on will perform. The tutorial is an excellent base for working on more advanced PrestaShop modules. The extension will contain the most basic options along with displaying sample content hooked on the main page. In this article, we'll create the simplest PrestaShop module for version 1.7.








Prestashop devdocs