web design malta, dnn, dotnetnuke, website design, seo

Follow DotNetMushroom on TwitterFollow DotNetMushroom on LinkedIN
 

Search

Author Title  
Search by Blog Author / Keywords from above tabs or search by Blog Tags by selecting the respective tag below

Blog TagsSelect to Filter Entries

Entries Filtered byDNM

DotNetMushroom Blog

 

All Blog including side menu filters were {Built with DNM RAD}

Loading ...
01/11/2009
Building an E-Shop with DotNetMushroom RAD (Part 1)
Posted By:Camilleri Evan/Tags:PANELTAGS

A powerful feature in DotNetMushroom RAD is the facility to build an e-shop 'out of the box'. Since RAD is a development tool, this means that you can build the e-shop customised to your needs. To build an e-shop you need to follow the following steps:

  1. Create the nescessary table for the Items which will be sold throught the e-shop
  2. Create the nescessary tables for the Cart which will contain the order of the client. The cart is divided into 2 tables: the cart header, which will contain information such as delivery address, etc; and the cart lines, which will contain the actual items that are being ordered.

The basic fields for the Items table are:

Field NameDescription
CodeOptional. The code of the item.
DescriptionThe description of the item. This is required so that the user know what is being ordered in the cart.
PriceThe price of the item.

The basic fields for the Cart Header are:

Field NameDescription
dnm_Status 

The basic fields for the Cart Lines are:

Field NameDescription
dnm_HeaderFkA field of type Relation (Foreign Key) which will contain a link to the Cart Header Table's primary key.
dnm_ItemFkA field of type Relation (Foreign Key) which will contain a link to the Items Table's primary key.
dnm_Status
QtyWill contain the quantity of the items being ordered in this transaction
DescriptionWill contain a copy of the description of the item being ordered. While we are keeping a foreign key to the Items table we are still copying the description of that item, to be faster when displaying the cart as well as to keep history of the actual item description at the time of order - should it be changed in the future.
PriceThe price of the item, kept since the item's price may change in the future.

Ordering Items

After creating the nescessary form by which the user will add the items in the table, the next form that we need to create is the item list which the user will use to add items to the cart. So create a form, set the datasource as the items table. Save the form, and then generate a View Form Template. Add a button, say, let's name it btnAddToCart.

The item list form template

The item list form template

In the form properties, set the 'Form Cart & Wish List Data' section with the following values:

Property NameDescription
Cart Data SourceSelect the cart lines table
Cart Header Data SourceSelect the cart header table
Items Data SourceSelect the items table
Cart Quantity FieldSelect the name of the quantity field in the cart lines table

Form Cart Section

Set also the properties for the following controls:

Control Name/TypeProperty NameValueDescription
Description ControlCart SourceDescription fieldWe are instructing the Add To Cart control to get the description value from items list and save it to the description field in the cart lines.
Price ControlCart SourcePrice fieldWe are instructing the Add To Cart control to get the price value from items list and save it to the price field in the cart lines.

Set the 'Button Event' of the btnAddToCart button to 'Add to Cart'. Set the 'Button Text' to 'Add to Cart'.

Running The Form

If you now run the form you will get a list of items in the database. If you click the 'Add to Cart' button RAD will add the selected item into the cart.

Add to cart...

Check manually by checking the SQL table 'Cart Lines', which in SQL will be named something like tb_DNM_X_CartLines, where X is your application id.

Checking the cart lines in the database table

Part 2

The next steps will be to display the cart and then use the check out button.


DotNetMushroom offers
DotNetNuke © (DNN) based web
design in Malta and Worldwide
Copyright (c) 2008 - 2012

Holistic IT Group

web design malta, dnn, dotnetnuke, website design, seo