473,572 Members | 3,085 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1580

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

Similar topics

6
2263
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 collection of $orderline associative arrays which, in turn, hold the global POST values key 'order_code' and value 'qty' as passed in from another page....
2
2847
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 im going. Just a couple of hints will do, Im familiar with vb script but not java based code , and im wondering how to store what they select so I...
5
20500
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 you can reuse. Those are good but I'd like to learn how to create one from scratch. Thanks. VM
7
2622
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 like it to work properly so that a record count counts through all the books and genertates these numbers. watch out for line breaks <%@...
5
1369
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. then, i tried opening the application on a different client computer. I just randomly checked the shopping cart and there i found the same items i...
1
7274
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 <? require_once('functions.inc.php'); session_start(); do_html_header("Checkout"); $cart = $_SESSION; if($cart&&array_count_values($cart)) {...
0
1799
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 dynamic productid to that addtobasket javascript function. this is my function.. function addToBasket(productId) {...
3
1398
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 about it, how it works and what are the requirements for this. Can anybody help me that........... - How shopping cart works? - Is there any...
11
2346
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 than one table of items. i really need ur help on this thanks ashraf
1
7659
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 help. Below is the code for both shopping cart, products and function.php shopping cart code: <? include("db.php");...
0
7733
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7640
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7957
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6337
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5248
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3685
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2138
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
975
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.