Shopping Cart Tutorial PHP Shopping Cart Tutorial
Learn how to create an online store with PHP and MySQL
Free shopping cart    Download:
Shop-Script FREE
Shop-Script FREE User Guide (PDF; 0 Kb)
View Live Demo    View online store demo
 Introduction
 Basic concepts
 Technologies
 File structure
 Database structure
 Back end
   Password protection
   Products catalog: structure
   Product catalog: viewing
   Managing categories
   Managing products
   Special offers
   Managing orders
 Front end
   Viewing products catalog
   Product search
   Shopping cart
   Checkout
   PayPal integration
 Security
 Live Demo
 Author
 Terms Of Use

Shopping cart software

 

File structure

Following picture outlines folder structure of Shop-Script FREE shopping cart script:

Shop-Script FREE file structure

cfg folder contains files with store configuration, such as MySQL database connection settings, administrator login and password (md5).
This folder must be protected from public HTTP access!
If you use Apache web server, folder protection is performed using .htaccess files, which are already included in Shop-Script FREE archive (in this case you shouldn't bother about folders protection).
If you use some other web server software, e.g. IIS, please refer to its manual and support resources to learn more about protecting folders from public access.

extra: this folder contains auxiliary routines, e.g. administrator’s password reminder. Please refer to Shop-Script FREE User Guide for more information concerning this issue.

images: shopping cart images, e.g. “add to cart” button, “company name” logos, etc.

includes: in this folder there are many files responsible for different shopping cart facilities, e.g. product detailed information page, shopping cart info page, administrative mode screens, etc.
All files from this folder are automatically included and executed by core index.php script when you run your online store.

includes/database: this folder contains files with the definition of database functions. In Shop-Script FREE, it contains the only file mysql.php, which defines calls to MySQL functions, e.g. mysql_query(), mysql_connect().
If you would like to use a database system other than MySQL (e.g. mSQL, MS SQL Server, Oracle, etc.), you may edit this file and update functions calls (e.g. replace mysql_ prefix with msql_, mssql_). For different database management systems changing certain SQL queries around the whole Shop-Script FREE may also be required (e.g. installation queries).

languages: language files are stored in this folder. To make store interface multi-lingual we put definition of all language phrases in a separate file. This gives the ability for store administrator to easily translate store interface in a preferable language and/or to correct spelling of individual phrases depending on store specificity.

products_pictures: product images and category thumbnails are uploaded and stores in this folder.

smarty: Smarty source files.

templates: HTML template files (both storefront and back end).

templates_c: this folder is used for Smarty templates compilation (temporary files are created in this folder by Smarty engine).

Root folder of Shop-Script FREE archive contains core files which are responsible for online store function:

  • index.php is the core front end script; the whole storefront is operating through this file
  • admin.php operates shopping cart back end
  • category.php - product categories management tools
  • products.php - products management tool

 

 


Copyright © 2006 WebAsyst LLC