Creating a simple shopping cart in SharePoint
Vladi Gubler
Vladi Gubler
May 30, 2012 | Sample Applications

Hi,

A few days ago I was asked if it was possible to create a shopping cart mechanism in SharePoint using our product. Well, after some thinking I sat down and built it and I want to show you how something like that can be easily accomplished.

Our shopping cart is based on a blank site and offers the following functionality:

  • Manage product categories, products and price lists
  • Create shopping carts and add multiple products to them
  • Automatically calculate tax and totals
  • Print out the cart or create a PDF document.

We will need the following Infowise products

  • Smart List Pro - will allow us to control permissions of certain columns, based on the shopping cart's lifecycle
  • Associated Tasks Field - will allow us to create relationships between the cart and its content
  • Connected Field - will allow us to create advanced lookup columns, with cascading functionality
  • Smart Print Pro - will allow us to print the shopping cart content or convert it into PDF
  • Smart ID Pro  - will allow us to generate custom IDs (such as cart ID)
  • Color Field - will allow us color-code cart based on status

Tip: All of the product (except Smart Print Pro) are part of the Ultimate Forms bundle and can be downloaded together.

I used SharePoint Foundation 4.0, but you can use WSS 3.0, MOSS 2007 or SharePoint Server 2010.

We will start with a blank site template and create the following lists:

  • Product Categories (custom list) - contains the product categories, no changes are required to this list.
  • Products (custom list) - contains the product names. Add a lookup field pointing to Product Categories. You can use the built-in lookup field or Connected Field. Connected Field will also allow you to add new categories on-the-fly while adding new products, which is very convenient. This column cannot be blank (required).
  • Pricelist (custom list) - contains the product prices. Add the following columns to the list:
    • Category - lookup to Product Categories. Can be a built-in lookup column or a Connected Field. Required.
    • Product - Connected Field pointing to Products with Category being the parent column. Selecting a category filters the list of products. Required.
    • Price - single line of text, required. In the simple scenario each product will have just one price, but you can also extend the site to have multiple prices (for example, temporary discounts). We will convert the column to Currency once we are done setting up all the lists, as we won't be able to use it in lookups unless it is a single line of text.
    • Title - the Title column is already present, but we don't really need it. To make it uneditable, add an item ID pattern "[Category] - [Product]" for the column in Item ID Settings and select Prevent manual editing. That will fill the column in automatically with the selected product category and product name without the column having to appear on the data entry forms.

Pricelist

  • Items (custom list) - contains the shopping cart line items. To enable relationship with the shopping carts, we need to replace the default content type "Item" with our custom content type "Associated Item". To do so:
    • Go to List Settings
    • Go to Advanced Settings
    • Enable content type management (first option at the top) and save
    • You should now see the content type listing, it should only contain Item.
    • Click to add an existing content type and select Associated Item under Infowise. Save.
    • Click on Item and delete this content type
    • You can now disable content type management
    • Add the following columns to the list
      • Category - lookup to Product Categories list. Required
      • Product - Connected Field pointing to Products with Category being the parent column. Required.
      • Price Connected Field pointing to Pricelists with Category being the parent column. Required.
      • List Price - single line of text. We need to copy the price value from the lookup column into a currency column to be able to use the value in calculations. We will convert this column to be Currency once we are done setting up the list.
      • Qty - number, required.
      • Line Total - calculated column, [List Price] * [Qty]. We will format this column as currency.
    • Create an item ID to fill in the List Price column using the Price column value. Select Prevent manual editing to hide the column from data entry forms.
  • Shopping Carts (custom list) - contains the actual shopping carts. You should limit the user to only view their own items in the list settings. Add the following columns to the list:
    • Title (already exists) - create an item ID to fill in this column with an ID pattern of your liking. I used "SP-$Year([Created])-[#]", which will produce values such as "SP-2012-2", but you can do whatever you like. Prevent the column from being manually edited. Rename the column to "Cart #".
    • Bill to - multiple lines of text. Billing address.
    • Ship to - multiple lines of text. Shipping address.
    • Products - Associated Items. The column will show the related items from Items list. You can leave the default settings intact.
    • Calculated Subtotal - Associated Items Summary. Calculate the sum of Line Total values of the Products column 
    • Subtotal - calculated column using the value of Calculated Subtotal column and formatting it as Currency. This column is needed because Associated Items Summary column produces its result as number and we should show it as currency.
    • Tax - number as percentage. Use the default value according to your local laws. You can also skip this column if tax is not applicable.
    • Total - calculated column. Use the formula [Subtotal]+[Subtotal]*[Tax].
    • Status - Color Choice field. Enter the shopping cart status values such as Open, Processing and Shipped. You can also use the regular choice field if you don't need to color-coding capability.

Shopping Cart Columns

We are done creating all the lists. This would be a good time to convert some of the field from single line of text to Currency, as mentioned above.

We can also add tabs to Shopping Cart list to make the data entry easier. Also, you should set column permissions of the Status column to prevent data entry in New form (we will be using the default value there at this point, no user input is required).

Shopping Cart

This is how our Shopping Carts list looks like:

Carts

Also create a print template for the Shopping Cart list to make the print-out look respectable (add your logo, contact info and maybe some rules and conditions).

Print-out

We are done. Fill in Product Categories, Products and Pricelist lists and your users can start shopping!

Loading...

Add your comment

Comments are not designed to replace support calls. If you have a specific issue with one of our products, please send an email to support@infowisesolutions.com to open a support ticket.

UltimateForms

Build powerful business applications in SharePoint using only your browser.
100% No-Code Solution

It's never been easier, to create, innovate and share, all you need is your web browser!

Cost-effective

Address business process pain points immediately. Save time and money.

Fantastic Support Team

Facing difficulties installing the application? Contact our fantastic support team.

support@infowisesolutions.com

Related Topics

What is right for you?

Online Trial

Not ready to install yet? Create a trial site in our environment
  • Full control of the site and its settings
  • Optionally pre-install one of our solution templates
  • Site provisioned instantly
  • Automatically removed after 30 days
  • Available to everyone!

Error!

There was an error processing your request.
Please contact us for further details.

Installation

Install in your own environment, on Microsoft 365 and on premises
  • Start working with real users and data
  • Install online or on premises
  • Register for 30 day trial
  • Seemlessly convert to paid license
  • Requires administrator permissions

Success!

Download link has been emailed to .
If you do not receive it within 5 minutes, please check your spam.
The link is valid for 72 hours.
If you are having problems, please contact us.

Error!

There was an error processing your request.
Please contact us for further details.
Technical details:

Request a Live Demo

Book an appointment for a one-on-one with an ULTIMATEforms expert trainer.

Test drive the awesome power of ULTIMATEforms

Learn how to quickly and easily turn time-consuming business processes into automated, efficient workflows.

Have a strong start

Only thirty minutes of well-coached time can translate into great future savings in time and money. So, sit back and enjoy the ride.

It's Free

Learn how to address business process pain points immediately. Save time and money.