1. Directory structure of prestashop :- Prestashop work on MVC pattern
M = MODEL(In prestashop classes folder is model)
V = View (Themes folder is view )
C = Controller ( and controller folder itself controller )
Config : – Folder contain all the configuration .
Css : – contain all the css file.
Modules:- Folder contains all Module
Controllers : – Folder contain two different folder
1) Front (contain all controller for front ).
2) Admin (contain all controller for admin).
Themes : – Folder contain default themes available for prestashop.
Directory structure of prestashop modules :-
For creating a new module you just create a folder and rename it as my module name is “simplemodule” then folder name is “simplemodule”
And the “simplemodule” folder contain a “simplemodule.php” file(it is necessary to have one file with same name as folder name which will have module install and uninstall functions.)
First write the code for installation in my case my module name is “simplemodule” hence I am writting installation code within “simplemodule.php”.
1. simplemodule.php contain Simplemodule class which extends module class
2.__contructor is the constructor.
3. we use two function here install() and uninstall in
install function:- we call all the function which we need at the time of installation in installation function
Uninstall function : we need to uninstall all the functionality which we are install at the time of installation.
Hook calling (simple hook calling) refer image-below
Front end Display for hook
Be the first to comment.