CS-Cart Architecture Overview
We no longer maintain the Knowledge Base since version 4.3.x. All the latest user and developer documentation for 4.3.x and newer versions is now available at docs.cs-cart.com.
- This article applies to CS-Cart versions:
CS-Cart follows a modular architecture philosophy: there is a core part, which is responsible for the basic functionality, and numerous add-ons that extend it using the API tools.
Below are listed the basic parts of CS-Cart software with short descriptions and the according API methods used to affect their behavior.
CS-Cart core functions are stored in the directory core. These functions implement all the core functionality of the software and are grouped into files according to their purpose: fn.catalog.php, fn.cart.php, etc.
PHP hooks are used to extend and override the default behavior or core functions. Read more about PHP hooks in the Hooks section. Practical usage of hooks is explained in the Advanced CS-Cart Add-on tutorial.
Scheme is a special file describing certain object structure. There are schemes for blocks, settings, promotions, etc. All schemes are stored in the directory schemas.
An add-on can extend and partially (or fully) override schemes. Proceed to the Extend Schemes section to learn how.
Following the MVC pattern, CS-Cart uses controllers for data manipulation.
All default controllers are stored in the directory controllers. Add-on controllers are stored in add-on folders — addons/[add-on_name].You can find detailed information on CS-Cart controllers in the Controllers section.
In order to interfere with a controller behavior pre- and postcontrollers are used. Go to the Precontrollers and Postcontrollers section to learn more about this technique. Also, practical usage of postcontrollers is described in the Advanced CS-Cart Add-on tutorial.
CS-Cart uses Smarty templates to render data. Some basic information about Smarty can be found in the Appendix. CS-Cart stores templates for all skins and for both admin and customer areas in the directory skins.
Templates can be extended with the use of TPL hooks. An example of practical usage of template hooks is given in the Advanced CS-Cart Add-on tutorial.