473,396 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to create a shopping cart?

I am trying to create a shopping cart.
on the first page the user will select which items to buy, next page they will confirm all purchases and on the last page an invoice must be displayed

Im having alot of trouble with the first page. I dont know how to select the items in a gridview store and them into an array or session variable. I tried using doin this:
Expand|Select|Wrap|Line Numbers
  1.  Dim row As GridViewRow = grdProducts.SelectedRow
  2.  
  3. AddItem(i).ID = CInt(grdProducts.SelectedRow.Cells(0).Text)
  4. AddItem(i).Name = grdProducts.SelectedRow.Cells(1).Text
  5. AddItem(i).Code = grdProducts.SelectedRow.Cells(2).Text
  6. AddItem(i).Price = CInt(grdProducts.SelectedRow.Cells(3).Text)
  7.  
  8. Session("AddedItem") = AddItem
  9.  
  10. Dim NewData As New TableCell
  11. Dim NewRow As New TableRow
  12.  
  13. NewData.Text = CStr(AddItem(1).ID)
  14. NewRow.Cells.Add(NewData)
  15. NewData = New TableCell
  16. NewData.Text = AddItem(1).Name
  17. NewRow.Cells.Add(NewData)
  18. NewData = New TableCell
  19. NewData.Text = AddItem(1).Code
  20. NewRow.Cells.Add(NewData)
  21. NewData = New TableCell
  22. NewData.Text = CStr(AddItem(1).Price)
  23. NewRow.Cells.Add(NewData)
  24.  
  25. Table1.Rows.Add(NewRow)
  26.  
but it still does not work
Oct 20 '10 #1
0 1561

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Fnark! | last post by:
I am creating a shopping cart using PHP Version 4.1.2. I am creating and registering a cart object in a session. The cart object contains an array of arrays called $order whose elements are a...
2
by: Don Grover | last post by:
I am retrieving costs and product id's from a sql db. and need to build a shopping cart around it. How do I store the selected items and qty req so I can move into another catalog and total up as...
5
by: VM | last post by:
I'm interested in creating a simple shopping cart in C#. Are there sites that show you, step by step, how to create a simple cart? The sites I've found only show you pre-made shopping carts that...
7
by: isaac2004 | last post by:
hi i have a basic asp page that acts as an online bookstore. on my cart page i am having trouble generating 3 numbers; a subtotal, a shipping total, and a final price. here is my code i would...
5
by: =?Utf-8?B?Q2hpV2hpdGVTb3g=?= | last post by:
i just finished creating an asp.net application named booksApp. during the testing phase uploaded live ( ex: www.bookies.com) , i tried to purchase something and add it to my shopping cart. ...
1
by: jecha | last post by:
I'm implementing a shopping cart but am having a problem in checking out a person who has added item in his/her shopping busket.The code for the checkout.php script is given below <?...
0
by: Shanthini Ganesh | last post by:
hi all. now i m creating shopping cart. i would like to make when the user click the add to basket button, item added visually shown to user. i found one script for this in net.. but i couldnt pass...
3
by: deepaks85 | last post by:
Dear Friends, I am developing a web hosting website and will be providing web space to the customers. I think its possible with Shopping cart but I never did it before. Even I don't have any idea...
11
by: ashraf02 | last post by:
basicaly i am creating a shopping cart for my website however creating a shopping cart for one table of items is easy but can someone direct me on how to create a shopping cart that can handle more...
1
by: BenKen | last post by:
Hi all pls I'm having great difficulty in making my shopping cart work. I am a newbie in php with little understanding of it. Add to cart button doesn't work and shopping cart in general doesn't. Pls...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.