codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  shopping cart scripts/models..  Stryker at 18:24 on Tuesday, November 16, 2004
 

Hi there, I was wondering if anyone could direct me to a link/source that provides script for a shopping cart model, possibly similar to the one offered by this site (i'm not a coadtoad plus member). I'm using VB and asp.net with an sql database, and I'm just looking for some helpful sources before I get started on building a shopping cart function for my site. Thanks !



  Re: shopping cart scripts/models..  tgreer at 14:46 on Wednesday, November 17, 2004
 

I noticed you didn't have any replies. While I can't speak for everyone, I can give you my reasons for not jumping in with an answer:

1) The question is very general. You can find hundreds of links to ASP.NET shopping carts with a simple Google Search.

2) I've never used any off-the-shelf package for this. Every eCommerce system I've ever worked on was unique to the company, and so I wrote unique software.

3) Writing a truly robust eCommerce system is HARD. There is an enormous number of things to contemplate. While I am happy and willing to answer specific questions, an open-ended discussion of the intricacies of eCommerce is outside the scope of an online forum dicussion.

Good luck with your application. As you proceed, if you have specific questions, please post them!


  Re: shopping cart scripts/models..  Stryker at 23:03 on Thursday, November 25, 2004
 

I've been using this site
http://www.sitepoint.com/article/ne...rt-datatables/2
as a starting point to help me build this shopping cart.. I've ran into a problem. I can successfully add one row to the shopping cart, but when I go back to attempt to add a second row, it simply overwrites the first and displays only one row with the last product I added to the cart. I think it may have something to do with storing the data table in the session. Maybe you will be able to see something I'm overlooking.


If Not IsPostBack Then
makeCart()
End If



'check if the customer is adding something to the cart or just browsing
Dim AddCheck As Integer = CType(Session.Item("CallAdd"), Integer)

If AddCheck = 1 Then

Dim part As Integer = CType(Session.Item("partAdd"), Integer)
Dim quant As Integer = CType(Session.Item("quanadd"), Integer)

objDT = Session("Cart")
Dim Product = part

objDR = objDT.NewRow
objDR("Quantity") = quant
objDR("Product") = Product
objDR("Cost") = 69
objDT.Rows.Add(objDR)
Session("Cart") = objDT

shopGrid.DataSource = objDT
shopGrid.DataBind()
AddCheck = 0
End If
End Sub

Private Sub makeCart()
objDT = New System.Data.DataTable("Cart")
objDT.Columns.Add("ID", GetType(Integer))
objDT.Columns("ID").AutoIncrement = True
objDT.Columns("ID").AutoIncrementSeed = 1

objDT.Columns.Add("Quantity", GetType(Integer))
objDT.Columns.Add("Product", GetType(String))
objDT.Columns.Add("Cost", GetType(Decimal))

Session("Cart") = objDT

End Sub










CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  validation of two text fields on a search page
•  validation of two text fields on a search page
•  Re: iframe targeting
•  Re: javascript to validate an entry is in URL format.
•  How to retrieve file from hard disk and display on a list?
•  Isolating Memory Leaks
•  DirectShow: Help me debug please
•  DirectShow: Help me debug please
•  How to dynamically create a calendar when I click a button?


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005