473,569 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Shopping cart problem

1 New Member
Hi ASP masters, I have a shopping cart where customers can buy packages and/or products. so the fist page(packages) customers can buy package and on the second page(products) there is two forms the 1st is to skip product and the second form contains the product list where they can choose product and both of the forms gets submitted to basket.asp.
Now my problem on the 1st form if the skip it doesn't show the package although if they choose product the package gets added. please help I'm getting crazy.Thanks in advance. first form
Expand|Select|Wrap|Line Numbers
  1.         <form action="basket.asp" method="post">
  2.       <!--photoshoot date variables-->
  3.       <input type="hidden" name="selectday1" value="<%=request.Form("selectday1")%>" />
  4.       <input type="hidden" name="selectday2" value="<%=request.Form("selectday2")%>" />
  5.       <input type="hidden" name="selectday3" value="<%=request.Form("selectday3")%>" />
  6.       <!--Package variables-->
  7.       <input type="hidden" name="PackageID" value="<%=session("packageID")%>" />
  8.       <input type="hidden" name="PackageName" value="<%=session("PackageName")%>" />
  9.       <input type="hidden" name="PackageValue" value="<%=session("PackageValue")%>" />
  10.      <input type="submit" name="Product2" value="Skip Products or Buy Later" />
  11.     </form>
  12.     <!--second form-->
  13.     <form action="basket.asp" method="post" >
  14.             <!--Package variables-->
  15.             <input type="hidden" name="PackageID" value="<%=request.Form("packageID")%>" />
  16.             <input type="hidden" name="PackageName" value="<%=request.Form("PackageName")%>" />
  17.             <input type="hidden" name="PackageValue" value="<%=request.Form("PackageValue")%>" />
  18.             <!--Products-->
  19.             <input type="hidden" name="ProductID" value="<%=rs.fields("ProductID")%>" />
  20.             <input type="hidden" name="ProductValue" value="<%=rs.fields("Price")%>" />
  21.             Qty: <input type="text" name="Qty" value="1" size="1" maxlength="2">
  22.             <input type="submit" name="Product" value="Buy now" />
  23.             </form>
  24. Basket.asp
  25.      <%if request.Form("Product") = "Buy now" or request.Form("WhatForm") = "Q" or instr(1,request.Form("Product"),"Skip") > 0 then%>
  26.  
  27.         <%
  28.         selectstudio = session("photoshootstudio")
  29.         selectday1 = session("photoshootdate1")
  30.         selectday2 = session("photoshootdate2")
  31.         selectday3 = session("photoshootdate3")
  32.         PackageID = request.Form("packageID")
  33.         PackageName = request.Form("PackageName")
  34.         PackageValue = request.Form("PackageValue")
  35.         ThemeID = request.Form("ThemeID")
  36.         ThemeName = request.Form("ThemeName")
  37.         ProductID = request.Form("ProductID")
  38.         ProductValue = request.Form("ProductValue")
  39.         Qty = request.Form("Qty")
  40.         CurrentDate = year(Date()) & "-" & month(Date()) & "-" & day(Date()) 
  41.       %>
  42.         <%'add package into basket
  43.         If len(PackageID) > 0 then
  44.             If IsNull(Session("CustomerID")) OR Len(Session("CustomerID")) = 0 then
  45.                 CustomerID = 0
  46.             Else
  47.                 CustomerID = Session("CustomerID")
  48.             End if
  49.             sql = "INSERT INTO basket (CustomerID, ordervia, SessionRef, ProductID, PackageId, Qty, UnitPrice, themeid, ActualCost, DateAdded, TimeAdded, photoshootstudio, photoshootdate1, photoshootdate2, photoshootdate3) VALUES (" & CustomerID & ", 'basket', " & SessionRef & ", 0," & PackageID & ",1," & PackageValue & "," & ThemeID & ", 0.00, '" & CurrentDate & "', '" & Time() & "', '" & selectstudio & "', '" & selectday1 & "', '" & selectday2 & "', '" & selectday3 & "')"
  50.  
Sep 10 '10 #1
1 1582
jhardman
3,406 Recognized Expert Specialist
my first suggestion is to track your data on each page you visit. Is the data there?

Jared
Sep 17 '10 #2

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

Similar topics

12
3785
by: Josef Blösl | last post by:
hi folks! i have a cart link in all of my listed products on the site. when i press this link i will generate a url like this http://www.mysite.com/index.htm?location=shop&view=cart&action=addtocart&productid=3 after i press this link the site cart.php will be included and add the wanted product to the cart, and show the cart.
3
1435
by: Randi | last post by:
Hi, I am trying to write this program to get this shopping cart to work. I need to use the calc function to determine the option prices, using the selectedIndex property for each dropdown list. This is what I have so far, I started with if statements, but I think i need to use a for loop, because of the array. Any help would be appreciated....
1
1300
by: Randi | last post by:
Hi, Thanks David and I got that to work, I guess I still need to get it to work using the arrays and the selectedIndex property. I have to use an alert box that shows the total price like: The cost = the base price + RAM price + Hard Drive Price + Operating System Price The cost = the base price + RAM price + Hard Drive Price + Operating...
17
2332
by: Phil McKraken | last post by:
I am having a problem putting together a shopping cart with the below script. Everything displays fine, adds totals fine, and works perfect EXCEPT if you choose the 9.95 item #5 BY ITSELF the total displayed is $9.94 ! If you add ANYTHING else the total is correct, 9.95 plus whatever you add. That is the only price in these samples that is...
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...
0
7700
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
7924
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. ...
1
7676
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5219
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
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
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
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
938
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.