Sunday, 3 May 2009

CW2: Shopping Cart not working in IE

Recently changed the url forwarding of my domain to mask, so that the user will be able to see only one domain name instead of the long domain name that was used. However implementing this part created problem, as the shopping cart was not working when the items were being updated. shown below.


Searching online for the solution I found this article whic explained it well.

http://www.ekmpowershop.com/support/userguide/urlmasking_and_uids.asp

Thursday, 30 April 2009

CW2: Validate Register Page

When the user is directed to the register page, this is due for the new users of the website, they will need to register and log-in to the website before they can purchase any item.


In Dreamweaver there is a facility from the data menu to insert records from the form directly into the database, however this did not validate data, showne below is the form used for registering new users, it was not designed because it was still in testing stage.




When the user clicked the insert record button without inputting the necessary fields, it did not give any warning, and instead gave this error.



To validate this page, another webpage was created, without using the template, as using the template interferred with the javascript function validation,


The form from the webpage is transferred to an asp page, consisting only of VBscript code , this asp page was specifically used to get the form field values from the other page and then save the data in the database.






The development of the page is shown above, without the use of template as it created problem with the javascript , when testing the page, it validated the fields shown below



CW2: Problem solving logging session

After creating a login form, for users to log-in before they are able to access the checkout page. The user was not able to return to the checkout after going to the shopping cart page, as the login session did not save the log-in details when the user logs-in.




This was done manually, throught the help of books and online resources, however having looked at the google groups for answers, there was mention of using the Dreamweaver facility of creating login-form as well as restricting users.












Under the data menu there is the facility of creating restrict users selection, this automated a lot of the work.



As stated earlier the manual way of creating the login session, it was not properly initialised, so the Dreamweaver facility provided a much better way to carry out this task.










The page shows a log-in form that was initialized by Dreamweaver, the form fields had to be created manually, textfields, labels, etc but the coding was handled by Dreamwever, where options were given to choose the table to authenticate the users who log-in,









By creating the log-in and restrict users, the session is realted, and much quicker to integrate.

CW2: Google Analytics

Google Analytics a useful tool to get reports on how the website traffic is getting.

It gives detailed information on the traffic generated for the website.




It shows the traffic the website has gotten each day month by month, this is shown graphically on the dashboard. It also shows the number of visits.



A pie chart shows the different methods of accessing the site, which states direct traffice, search enginges, and referal sites.

Tuesday, 28 April 2009

CW2: Problem email not working

After creating the order page, the email is sent to customers, about the order but it was not working instead it gave this error.

Mail was Sent to your user from cctmdev2
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object: 'CDONTS.NewMail'
/mim0444/coursework2/Post.asp, line 60

Monday, 27 April 2009

CW2: Problem Solving shopping Cart quantity


There was a problem with the shopping cart quantity, as it expected values which are not proper quantity like -negative numbers, decimal values, and also very large numbers. Message was posted on google groups for help in this area.





The answer posted was by me, as I had put javascript code to validate the quanity, however it gave another error later that was not showin the shopping cart page correctly after the validation occured.

So to make things simple, I have implemented a list box, loaded with values, with the list box the user will not be able to input any kind of wrong values.

in the name field this is put: "localCart(CARTPID, i )"


This sets the quantity field to default 1,


Then in the next field this is put: localCart(CARTPQUANTITY, i )


Gets the quantity from the VB Script variable. Then in the options pre-loaded values are put, from 1 - 5.


Having researched the market area, in one transactions it is very rare to have more than one 9 quantity for a product, espcially in this clothing area, for customers.


Shopping car which has the quantity list box is shown below.



CW2 Creating shopping Cart

To create the shopping cart first a table was created.







The table has columns, for product description, price, quantity, total, and the picture.


Then the fields were set, it includes hidden fields, like for the quantity field, as well ordertotal.


It was developed according to the process shown on the UltraEasy Shopping Cart hosted at http://cctmdev2.londonmet.ac.uk/WebthangTutorials/shop_cart/uecart_12.asp



Code used was provided by the webpage hosted above. Changes were made at necessary parts to equip with the webpage.



Shopping cart shown below.







Creating the image field as well as the delete option, not provided in the UltraEasy Shopping Cart


First additional CONST needs to be declared

CONST CARTPICTURE = 4

Then it is called from the product details page by

picture = TRIM(Request("picture"))

Added to the shopping cart by

localCart(CARTPICTURE, i) = picture

Finally putting the img field with the code provdied,

( localCart(CARTPICTURE, i))%>

In the img tag it's written item from 'add item to cart' so it containts the field from VB script.

Creating the delete option

For the delete checkbox code was taken from the textbook, in the checkbox field name this is put.

localCart(CARTPID, i )

In the update quantity part of the VB Script, this code is inserted,

deleteProduct = TRIM( Request("pd" & localCart(CARTPID, i)))

Since the input name was given with pd, it is calling for the name in the trim request,

This is set at :

IF newQ = "" or newQ = "0" or deleteProduct <> "" THEN
localCart( CARTPID, i ) = ""

So either quanity field is blank, or zero, or the deleteproduct is checked it removes the record from the shopping cart which is "".

Showing the Total for each product

Total value of each product was not shown on the shopping cart, only the toal value of all products, so to show the customer the total value of each product, this code is put :

productTotal = ( localCart( CARTPPRICE, i ) * localCart( CARTPQUANTITY, i ) )

This is put right above the order total calculation, then the 'productTotal' is put in the column where the total of each product is shown.