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
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
Code:
<form action="basket.asp" method="post">
<!--photoshoot date variables-->
<input type="hidden" name="selectday1" value="<%=request.Form("selectday1")%>" />
<input type="hidden" name="selectday2" value="<%=request.Form("selectday2")%>" />
<input type="hidden" name="selectday3" value="<%=request.Form("selectday3")%>" />
<!--Package variables-->
<input type="hidden" name="PackageID" value="<%=session("packageID")%>" />
<input type="hidden" name="PackageName" value="<%=session("PackageName")%>" />
<input type="hidden" name="PackageValue" value="<%=session("PackageValue")%>" />
<input type="submit" name="Product2" value="Skip Products or Buy Later" />
</form>
<!--second form-->
<form action="basket.asp" method="post" >
<!--Package variables-->
<input type="hidden" name="PackageID" value="<%=request.Form("packageID")%>" />
<input type="hidden" name="PackageName" value="<%=request.Form("PackageName")%>" />
<input type="hidden" name="PackageValue" value="<%=request.Form("PackageValue")%>" />
<!--Products-->
<input type="hidden" name="ProductID" value="<%=rs.fields("ProductID")%>" />
<input type="hidden" name="ProductValue" value="<%=rs.fields("Price")%>" />
Qty: <input type="text" name="Qty" value="1" size="1" maxlength="2">
<input type="submit" name="Product" value="Buy now" />
</form>
Basket.asp
<%if request.Form("Product") = "Buy now" or request.Form("WhatForm") = "Q" or instr(1,request.Form("Product"),"Skip") > 0 then%>
<%
selectstudio = session("photoshootstudio")
selectday1 = session("photoshootdate1")
selectday2 = session("photoshootdate2")
selectday3 = session("photoshootdate3")
PackageID = request.Form("packageID")
PackageName = request.Form("PackageName")
PackageValue = request.Form("PackageValue")
ThemeID = request.Form("ThemeID")
ThemeName = request.Form("ThemeName")
ProductID = request.Form("ProductID")
ProductValue = request.Form("ProductValue")
Qty = request.Form("Qty")
CurrentDate = year(Date()) & "-" & month(Date()) & "-" & day(Date())
%>
<%'add package into basket
If len(PackageID) > 0 then
If IsNull(Session("CustomerID")) OR Len(Session("CustomerID")) = 0 then
CustomerID = 0
Else
CustomerID = Session("CustomerID")
End if
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 & "')"
Comment