
Checking out proceeds from clicking the Checkout Button in the shopping cart. As the customer checks out, two things must happen. Firstly all the items in the shopping cart must be transferred to the Order table and secondly, the items must be deleted from the Shopping cart. While completing the checkout phase, the customer must follow all the required steps, otherwise transaction will not be completed.
In a ASP page, there are three different methods of using transactions, i.e. creating transactional Active Server Pages, creating ADO transactions or using database transactions.
Using transactional ASP page, if one step fails in transaction, all the earlier steps are rolled back, avoiding loss of money.
I created transactional ASP page by including the @TRANSACTION directive at the top of the page in the first line.
Completing the Checkout or Order:
Once the customer finishes shopping and clicks on the Checkout button on the Shopping cart page, the customer is presented with – firstly a page (doCheckout.asp) with a form, which enables the customer to check his/her personal details such as name, address and credit card details and confirm the order. After that, a new page (dpCheckout2.asp) will be displayed thanking the customer for putting the order, whereby the items in the shopping cart are transferred to the Orders table. With this a customer completes putting an order!
Since I have changed the Customer registration information to my own choosing as in the UK, we don not have state, or city or zip in the address, I changed City to County, deleted the State section and changed Zip to Post Code. While doing these changes and tested the page, I did come across few problems of which I intend to discuss below.
In register.asp page, I also had to change as same as the above which I did by changing the code as follows:
<.%
newusername = TRIM( Request( "newusername" ) )
newpassword = TRIM( Request( "newpassword" ) )
email = TRIM( Request( "email" ) )
street = TRIM( Request( "street" ) )
county = TRIM( Request( "county" ) )
postcode = TRIM( Request( "postcode" ) )
cctype = Request( "cctype" )
ccnumber = TRIM( Request( "ccnumber" ) )
ccexpires = TRIM( Request( "ccexpires" ) )
ccname = TRIM( Request( "ccname" ) )
s.ubmitpage = Request.ServerVariables( "SCRIPT_NAME" )
%>
County :
<.input name="county" id="county"
value="<.%=Server.HTMLEncode( county )%>" size=20 maxlength=50>
Post Code:
<.input name="postcode" id="postcode"
value="<%=Server.HTMLEncode( postcode )%>" size=20 maxlength=20>
<./font>
Payment Information:
Similarly I have to change whole lot of codes in the storefunc.asp page as it contains all the routines and functions which manage and take care of all the functionalities in other pages i.e. checking forms, user registrations, check out procedure etc.
No comments:
Post a Comment