First off, OpenCart's root directory looks something like this:
admin - the admin directory path is all the code on the backend of your site. This is completely separate from the catalog area and can even be stored on a different host if you prefer.
catalog - the catalog directory path stores all the code on the front end of your site
image - the image directory path is where all the product images are stored
download - the download directory path is where all the downloads are stored
system - the system path has all the common libraries and engine code. Both admin and catalog use this folder, so if storing admin on another server, you will also need to copy the system folder there.
In the catalog and admin directories, a common tree based on the MVC architecture is formed:
Model - Database layer - All calls to the database are done here, referenced from the controller. The purpose of a model is to always have structured db calls so that all other files have access to the same db queries.
View - Template display - This is where the HTML and designing is done in the respective tpl files.
Controller - Main controlling code base - This is where the functional code logic is processed and variables for the view are setup
Language - Localization/Language - This is where you set which constants translate to text for things like heading titles, static links and text, etc. Note that this is not part of MVC, just another variable layer that makes using multiple language easier.
Most files follow the naming pattern of the main controller...
So for example, for the product page on the frontend, there are 4 main files:
Similarly, on the admin side, to set those fields, there are 4 main files as well:
Try to follow those files for existing fields, like 'model number' and see if you can duplicate all the places you find model number being used and replace it with your new field(s). Don't forget to also add the new columns to the product table in the database.
- Posts: 19445
- Joined: Mon Jul 21, 2008 1:02 pm