Loading...

Techologies Used

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:
  • 3.0.x

Working on CS-Cart we tried to use the technologies that are reliable and proven. We also wanted CS-Cart to be easily customizable, so the technologies behind it must be well-documented and generally popular. We found that the perfect choice here is the classic approach, which is LAMP (Linux-Apache-MySQL-PHP).

MVC

CS-Cart follows the general MVC (Model-View-Controller) approach.

Data model is stored directly in the database. The database engine used is MySQL, so the program components get data from the model using the MySQL SQL-query language with the help of placeholders. Example:

1
2
3
4
5
$data = array (
    'payment_id' => 5
);
$order_id = 3;
db_query('UPDATE ?:orders SET ?u WHERE order_id = ?i', $data, $order_id);

 

Controllers are written in PHP. Generally all CS-Cart controllers are placed in the controllers directory, although add-ons can define their own controllers to be put in the respective add-on folders.

Data is presented to the user by views. CS-Cart uses Smarty template engine and JavaScripting to represent data. An example of a Smarty template with some JavaScript code embedded in it:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{** block-description:my_twitter_addon **}
 
<script src="http://widgets.twimg.com/j/2/widget.js"></script>
<script>
new TWTR.Widget({ldelim}
    version: 2,
    type: 'profile',
    rpp: {$addons.my_twitter_addon.number_of_tweets},
    interval: 6000,
    width: 'auto',
    height: 300,
    theme: {ldelim}
        shell: {ldelim}
            background: '#FFFFFF',
            color: '#373737'
        {rdelim},
        tweets: {ldelim}
            background: '#D9EFF3',
            color: '#373737',
            links: '#005865'
        {rdelim}
    {rdelim},
    features: {ldelim}
        scrollbar: true,
        loop: true,
        live: true,
        hashtags: true,
        timestamp: true,
        avatars: true,
        behavior: 'default'
    {rdelim}
{rdelim}).render().setUser('{$addons.my_twitter_addon.username}').start();
</script>

MySQL

MySQL is the most popular relational database management system used across the Web nowadays. CS-Cart uses MySQL, because it's a high-performance and yet highly user-friendly software. MySQL queries are used directly inside CS-Cart controllers (with the help of placeholders), so one needs to know the syntax at least on the basic level to successfully extend CS-Cart.

PHP

CS-Cart is written in PHP. It is now by far the most extensively used web-oriented programming language.

Smarty

Instead of using raw HTML CS-Cart deals with Smarty templates. It gives more freedom in data representing and makes it possible to build complex structures using Smarty markup language.

JavaScript

Dynamic page content is made possible by the extensive use of AJAX and JavaScript.

 

Home / Docs / Introduction / Techologies Used