Basics - Components of Zen Cart

How the pieces fit together

Zen Cart is what’s called a database-backed web application.

This means it doesn’t run on your computer, the way Microsoft Excel does - instead, it is set up on a web host and uses web technologies like PHP, MySQL and Apache to create your store.

What is a database?

The database is a collection of tables. Tables are like spreadsheets, storing data in rows and columns, related to whatever the structure of that table is for. For customers, it means email addresses, passwords, etc. For address books, it means all the address info for each customer. For orders, all the order details. For products, the details of each aspect of each product. And so on. You could look at a database as a multi-sheet spreadsheet, but way more optimized and efficient in how it automatically handles indexing and storage/retrieval.

Unlike a file, which you view through an editor like Notepad++, a database must be viewed through a tool which provides a database interface. One such tool is phpMyAdmin.

Here’s a screenshot of phpMyAdmin viewing the records in the specials table, which contains a list of all the products on special.

Specials table

You can view the database schema for Zen Cart to learn more about how the data is structured .

What about all the files in Zen Cart?

The files contain computer code that allows you to access the database, and code that displays the data that’s in the database. So for example, admin/customers.php is a file, which allows the administrator to access the customers table in the database.

How is the website broken up?

The website created by Zen Cart has two parts:

  • Storefront - Visible to everyone. The part of the website that allows products to be viewed and purchased. Also called the catalog.
  • Admin - Only visible to the store administrator. Provides the back-office functions of order processing and inventory management.

Is there a file that corresponds to each page in the storefront?

Zen Cart pages are dynamically created, so there’s no single file like (say) specials.html for the specials page. Instead, the specials page

https://YOURSITE.com/index.php?main_page=specials 

is created on the fly by executing a number of PHP files. One part of your template is the template page for specials. It controls how the specials are displayed, and you can modify it as you see fit.




Still have questions? Use the Search box in the upper right, or try the full list of FAQs. If you can't find it there, head over to the Zen Cart support forum and ask there in the appropriate subforum. In your post, please include your Zen Cart and PHP versions, and a link to your site.

Is there an error or omission on this page? Please post to General Questions on the support forum. Or, if you'd like to open a pull request, just review the guidelines and get started. You can even PR right here.
Last modified August 21, 2020 by Scott C Wilson (e1a7dbc).