A common use case for websites is selling goods and services online. As a general purpose web framework, GenHelm is not intended to be a full blown e-commerce solution. Nevertheless, there are sufficient components provided to build a store and accept payments. In this help, we provide links to the various components you can use to implement an e-commerce site.

Since GenHelm does not have any database dependencies, the solutions presented here do not require (or utilize) a database. One of the recommendations of the Agile Development Methodology is to seek to implement something called an MVP which stands for Minimum Viable Product. An MVP is a product that has just enough features to satisfy the needs of your customers and give them something on which to provide feedback to shape the future of the product early in the process.

This philosophy applies to online stores as well. Statistics show that only about 1 in 10 ecommerce sites are successful. This is generally not because of the technology used to support online sales but rather due to issues surrounding the products and/or services being sold or challenges in getting enough native traffic to your site to make it viable without having to run expensive pay-per-click advertising campaigns.

GenHelm has all the features you need to build attractive, responsive, SEO friendly websites. By leveraging the e-commerce components of the framework you can easily and quickly build a viable online store without the complexity of setting up and maintaining a database. This will allow you to sell your products and services online in a timely, cost-effective manner to provide the viability of your online business without investing in expensive technology or consultants. Within the first year or two after launching your store you should have sufficient information to know whether your store will be profitable. At that point you may decide to develop or purchase a more comprehensive solution that may include advanced features such as inventory management, permanent shopping carts, reviews, coupons, accounts receivable management, etc.

In this help series we will walk you through the building of all of the following components of a typical online store:

  1. A shopping cart
  2. Product objects
  3. Customer information
  4. Credit card payment processors
  5. A simple account management facility

Data Backups

Please be aware that the GenHelm framework does not included any automated backup facility. When customers interact with your online store, information is saved within files located under your site's private_data data folder. It is up to you to ensure that the files and folders under the data folder are backed up on a regular basis. Ideally, these backups should be saved on a separate storage device so that the data can be recovered in the event of a catastrophic failure of your web server's hard drive.

Using Transactions To Manage Checkout Flow

Recall that the transaction object can be used to simplify form navigation and to perform some logic when the user completes one or more forms. Typically, multiple transactions are used in order to provide a flexible checkout process. The following diagram depicts the various transactions that are commonly used during an order and checkout sequence:

Typical Order and Checkout Process

Let's discuss the different transactions that are usually involved.

1. Product Item Configuration

This transaction is used to present forms to specify the product or service to be ordered. Depending on the nature of what you are selling there could be different transactions defined for each different product.  These transactions take the user through the order forms associated with the product and return them to the cart page after specifying the order item details.

2. Checkout

There is typically only one checkout transaction. This collects information about the order as a whole, rather than the individual items. This would be where you would typically:

The final step of the checkout transaction (after the user submits the last page) is where you commit the order by writing the order details to a database or sequential file. This is also the point at which you would record that fund are due in an accounting system.

3. Payment

The payment transaction is used to allow the user to select a payment method and, when paying by credit card, perform the actual payment. We want to keep this payment transaction separate from the Checkout transaction so that customers can place their order and if they decide not to pay right away they can come back later to pay for it.

In the next steps we describe the various components that you will be building to develop your store.

Defining Products

The first step in building an online store is defining what you want to sell. Products and services are items that visitors can add to their cart in order to make a purchase. Follow this link to learn how to define cart items as php classes.

Building a Shopping Cart

One of the important components of most e-commerce applications is a shopping cart. GenHelm supplies a built-in class called cart that you can configure to create a page such as the following:

Sample Shopping Cart Page

Follow this link to to learn how to build a shopping cart.

Working with Text Files

Small stores can be implemented without the benefit of a database. To do so you will need to know how to store information within flat files. Follow this link to learn how to read and write text files.

Working With Database Tables

If you think your e-commerce site will get very busy, with thousands of transactions per year, you should strongly consider using a database to store your transactions. Follow this link to learn how to read and write database tables using the GenHelm framework.

Entering and Saving Customer Data

As part of your store you will most likely want to save information about your customer. If you have access to a database, you should define a table to store your customer information and use the db_object model to develop a PHP class which is able to read and write your customer object. This technique is similar to what we described in the help linked to above.

An alternative method is to save your customer information in flat files. To learn more about this option please follow this link which speaks to saving customer data in XML format.

Accepting Payments

Before accepting online payments you will need to establish an account with a payment gateway provider. The GenHelm framework supports the following payment services.

PayPal

PayPal is likely the most convenient solution to implement since accepting payments through PayPal does not require your site to be validated for PCI compliance. This is not too arduous a process however your site generally needs to be revalidated every six months so it can be time consuming. One of the downsides of PayPal is that it does not reimburse merchants for fees collected on refunded purchases. 

Authorize.net

Authorize.net can be used to accept US Dollar denominated credit card transactions.

Payflow Pro Payment Gateway

Payflow Pro can be used to accept credit card payments in Canadian, Australian and New Zealand Dollars.

Stripe

Stripe offers credit card transactions in a number of currencies and countries. Like PayPal, Stripe also feels they are entitled to keep the fees on refunds and returns.

If you landed here from our help on working with text files you have learned how GenHelm can build fairly sophisticated websites without the need for a database. In some cases you might want to start out using text files to store certain data and then transition over to database tables after the traffic to your site has expanded to the point where you need to manage more data. In this help we repeat a similar process to what was covered in the previous help except, this time, we will be storing our payment records in a database.

Follow this link to learn about collecting online payments.

To review all of the help in this series, navigate the help menu to the right or click on the link to the next help at the bottom right of each help page.

Ecommerce Help Index

E-Commerce Overview Features and components used to build an online store.
Cart Items Defining products and services.
Shopping Cart Interacting with a shopping cart.
Working with Text Files How to store and process transactional data using text files.
Working with Databases Saving and retrieving database table data.
Transaction Numbers Generating identifiers for invoices and other transactions.
Taxes and Fees Configuring sales taxes and other cart fees.
Saving Customer Information Reading and writing customer information.
Accounting Data Managing account records.
Collecting Payments Processing credits cards as order payments.