Building an E-commerce Website With ExpressionEngine, Part 2
Tags: expressionengine, eecms, ecommerce
Published: 2022-06-08 12:42:31

---
title: Building an E-commerce Website With ExpressionEngine, Part 2
series: Building an E-commerce Website With ExpressionEngine
published: true
date: 2022-06-08 10:04:00 UTC
tags: ExpressionEngine,eecms,ecommerce
canonical_url: https://u.expressionengine.com/course/building-an-e-commerce-website-with-expressionengine/building-an-e-commerce-website-with-expressionengine-part-2
cover_image: https://u.expressionengine.com/asset/article-images/building-ecommerce-with-expression-engine.jpg

---

# Part 2: Channel installation and Discounts

## 2a) Orders/Discount Channel Installation

{% embed https://player.vimeo.com/video/631309736?h=980bc01c64&amp;badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479 %}

Back in the ExpressionEngine backend, go to the CartThrob add-on, and then the “Installation” tab. (We’re not going to Orders Tab which would be the logical next step)

Of these available installation options, we actually skip most of them because we’re starting with pretty basic templates that we’ve created. Our store is not really complicated enough for Packages or Discounts channels. Instead, we will only choose **Store - Orders** and then **Store - Coupon Codes** channels. (Remember, our FakeBowling.shop ExpressionEngine site already had a Products channel) If you’re curious, **Store - Purchased** items would be used to if you want to show “Customers Also Bought..” on a product page, which is a cool feature.

We are not installing any templates, as we already have those completed.

![CartThrob test channels install](https://creativearc.com/images/uploads/blog/4-c-CT-channel-install.jpg)

Click **Install Templates & Channels**.

Navigate to the Channels menu, and you’ll hopefully see that the two new channels were created.

Now, head back to CartThrob, navigate to the **Orders** tab, and this one’s sort of settle. You have to first click your order channel, **Store - Orders** , and then be sure to select “Yes” for “Save completed orders to a channel?”

![CartThrob channel mapping](https://creativearc.com/images/uploads/blog/4-d-CT-channel-map.jpg)

Upon submitting these changes, we should see statuses that need to be assigned. Scroll down to the **Order Status** section and map each status accordingly.

![CartThrob status mapping](https://creativearc.com/images/uploads/blog/4-e-CT-status-map.jpg)

We’ll follow suit with **Order Data Fields**. (this one takes a while!)

![CartThrob field mapping](https://creativearc.com/images/uploads/blog/4-e-CT-field-map.jpg)

Now CartThrob knows about our Orders channel and its Status and Data fields.

## 2b) Coupon Code (Discounts)

{% embed https://player.vimeo.com/video/631310236?h=0fd001a88b&amp;badge=0&amp;autopause=0&amp;player_id=0&amp;app_id=58479 %}

Next, we’re going to make some fields to store coupon codes. In the Fields menu, there’s now a field group called **Coupon Codes** with a default field `{coupon_code_type}`. We’re going to supplement this with two more fields of our own.

![Coupon Code field](https://creativearc.com/images/uploads/blog/4-f-CT-coupon-field.jpg)

Add a text input field, we’ll call it just “Coupon Code”, shortname `{coupon_code}`. This will be the field that we put the actual code the customer would type in on the cart page, e.g. “Black Friday” coupon.

![Coupon Code field](https://creativearc.com/images/uploads/blog/4-g-CT-coupon-code.jpg)

Follow up by creating another text field as the `{coupon_description}`. This field would be for a frontend display, such as, “You now have a 10% off your order” to display in the cart.

![Coupon Description Field](https://creativearc.com/images/uploads/blog/4-g-CT-coupon-desc.jpg)

With the discount fields created, it’s back CartThrob settings and then the **Discounts** tab. Our fields haven’t yet been assigned to the new channel, so we’ll add that setting and click **Submit**.

![Coupon Mapping](https://creativearc.com/images/uploads/blog/4-h-CT-map-desc.jpg)

Now we are ready to make a coupon code entry within the **Store - Coupon Codes** channel. Our title is “Ten Percent Off EE CONF Special,” a Type of “Percentage Off,” and **Percentage Off** value of 10. And finally, a **Coupon Code** of “abc123” and a **Coupon Description**.

![Coupon entry creation](https://creativearc.com/images/uploads/blog/4-i-CT-coupon-entry.jpg)

We’re done! These coupon codes can be tested on the frontend.

**Have questions or comments about this course?** Be sure to join the discussion and post in the [ExpressionEngine Forums](https://expressionengine.com/forums/topic/253239/building-an-e-commerce-website-with-expressionengine)!

 -- 

Originally published by [Paul Larson](https://u.expressionengine.com/author/paul-larson) at [u.expressionengine.com](https://u.expressionengine.com//article/building-an-e-commerce-website-with-expressionengine-part-2)