In this section, we will be creating the basic files necessary to run a cart. Later in the chapter, we will be adding greater functionality to it, but first let's prepare. We will be creating the following four files:
path/to/codeigniter/application/controllers/shop.php
: This controller will handle any customer interaction between the views and the model, such as handling any forms and controlling the customer's journey through the cart.path/to/codeigniter/application/models/shop_model.php
: This model will handle any database interaction between the controller and the database. It will contain functions to fetch products and, product categories, and later in the chapter, to save the cart to the database.path/to/codeigniter/application/views/shop/display_cart.php
: This view will display a summary of a customer's cart at any one time, and allow that customer to amend the quantities of items in their cart.path/to/codeigniter/application/views/shop/view_products.php
...