User:Katyonysh/Sandbox

The X-Cart source code is written in PHP and is contained in separate files located in different directories as follows:
 * Customer related scripts are located in the ./ (root) directory.
 * Administrator related scripts are located in the ./admin directory.
 * Provider related scripts are located in the ./provider directory.
 * Common scripts are located in the ./include directory.
 * Modules related scripts are located in the ./modules directory.
 * Customer/Administrator/Provider related scripts location is configured in the ./top.inc.php script.

The X-Cart contains Smarty templates which make it possible to separate the design from the code, that means, that all cart components including design elements, fonts, texts and internal functions can be used as is or can be modified based on the default templates or the client's wish. Smarty class scripts are located in ./include/lib/smarty directory. CSS styles are described in ./skin1/*.css file. The Smarty templates configuration can be found in ./skin1/skin1.conf file. Configuration variables from this file are used in templates and affect the look and feel of the store.

Templates directory:
 * Common templates are located in the ./skin1 and ./skin1/main directories.
 * Templates for the Customer area are located in the ./skin1/customer directory.
 * Templates for the Admin area are located in the ./skin1/admin directory.
 * Templates for the Provider area are located in the ./skin1/provider directory.
 * Mail templates are located in the ./skin1/mail directory.
 * Templates for X-Cart modules are located in the ./skin1/modules directory.

Compiled templates (for cache and Smarty internal use) are located in ./var/templates_c directory.

All information on products, customers, orders etc. is stored in the MySQL database. Dump of MySQL database can be found in ./sql/*.sql file.

Website images are located in ./skin1/images directory.

Product images, category images, manufacturer images etc are located in the ./images directory.

Files related to integrated shipping modules are located in the ./shipping directory.

The X-Cart system configuration is divided into several files. The X-Cart main configuration file is config.php and is located in the main X-Cart directory. This file contains variables for the following:
 * SQL DB information
 * Single Store operation mode flag
 * Safe Administrator mode flag
 * Customer titles
 * Credit Card types accepted by the store
 * etc.

Scripts contains the following classes:

The products class is used for products listed in the store.

The giftcerts class is used for gift certificates.

The users class is used for the users information.

The customers class is used for the customers information.

The ctBlowfish class is used for Blowfish encryption keys automatically generated by X-Cart during installation.

The following functions are used in scripts:

The fopen function is used to open a file.

The fclose function is used to close an open file.

The file_exists function is used to check whether or not a file or directory exists.

The fwrite function is used to write to an open file.

The include function takes all the content in a specified file and includes it in the current file.

The require function is identical to include, except that it handles errors differently.

The func_translit function is used to initialize a character set of the database.

The isset function is used to check up whether a variable is set or not.

The unset function is used to free the specified session variable.

The array function is used to create an array.

The func_array_merge function is used to merge one or more arrays into one array.

The date_default_timezone_get function returns the default time zone.

The date_default_timezone_set function sets the default time zone.

The func_add_to_cart function is used to add a product to the cart.

The func_products_in_cart function is used to recalculate products added to the cart.