Overview of the Shopp API

From Shopp Documentation

Jump to: navigation, search

This article is marked as in need of review and editing. You can help make Shopp's documentation better by editing it.

Understanding the structure of Shopp's objects will help you more effectively learn how to use shopp() tags to customize the shopping pages for your store.


Shopp is organized by several groupings of objects that inter-relate. Making a purchase at a Shopp-powered store is defined by three main phases:

  • Shopping
  • Cart Management
  • Successful Order

There are several objects responsible for managing and reporting data to the shopping templates in each of these phases using the template tag interface, the `shopp()` function. The following diagram shows the objects of each phase and how they relate to each other.

Image:Shopp-Object-Diagram.png

At the top of the object hierarchy is the Catalog object which can be accessed using Catalog Tags. It is called a controller object because it controls the collection of objects below it, the Category objects and Product objects. The Catalog object is the controller object during the Shopping phase.

Similarly, the Cart is the controller object in the Cart Management phase, and controls a collection of Cart Items, the products that have been added to the cart.

Finally, the Purchase object is the controller for Purchased items when an order is successfully placed at the Successful Order phase. The Purchase object is unique in that it is only available after a successful order has been completed. Before the order, all of the information related to an order is tracked in the Cart object.