<% '********************************************************************************* ' Version 2.50 This routine displays the shopping cart and does recalculation '******************************************************* Dim prodid, quantity, arrCart, scartItem Dim strAction, pi const ContinueURL2="index.asp" const ContinueURL="shopaddtocart.asp" '****************************** ' This form can call itself. ' We need to know if it is a new product add or just a recalculation ' Inputs are productid, quantity ''******************************* strAction=Request("Continue") if straction<>"" then strAction="CONTI" else strAction=Request("Checkout") if straction<> "" then strAction="PROCE" else strAction=request("Recalculate") if strAction<>"" then strACTION="RECAL" end if end if end if if strAction<>"" then ReprocessForm else ProcessNewadd end if ' new item is to be added to cart Sub ProcessNewAdd() Dim rc ShopInit GetInputValues arrCart = Session("MyCart") scartItem = Session("cartItem") if scartitem="" then Response.Redirect "shopemptycart.asp" end if If scartItem = 0 and prodid="" Then Response.Redirect "shoperror.asp?msg=" & Server.URLEncode (LangError01) End If If prodid <> "" Then If scartItem = MaxCartitems and scartItem>0 then Response.Redirect "shoperror.asp?msg=" & Server.URLEncode (Langerror02) End If CartAddItem prodid, rc if rc > 0 then sError=LangErrorNoProduct & "id=" & prodid end if end if DisplayForm end sub Sub GetInputValues ' Keys are ' productid = a number in the database ' quantity = a number of items ' db = database to change the session database ' Dim sOption, sUserText, sUserTextvalue Dim optionnum Dim maxFeatures dim sMultiOption, sMultiValue Dim i prodid = Request("productid") if prodid="" then prodid=request("catalogid") end if quantity = Request("quantity") If Quantity<>"" then if not isnumeric(Quantity) then quantity=1 end if if quantity< 0 then quantity=-quantity end if if quantity< 1.0 then quantity=1 end if end if If prodid<>"" and quantity="" then quantity=1 end if ' There can be up to 4 different features for a product option1, option2 maxfeatures=cMaxFeatures Session("Maxfeatures")=maxfeatures prodi="" GetProductFeatures prodi ' in shopproductfeatures.asp end sub ' Sub ReprocessForm arrCart = Session("MyCart") scartItem = Session("cartItem") Select Case strAction Case "CONTI" Response.Redirect ContinueURL2 Case "RECAL" ' Response.write "recalculating" dim Newcart Dim Newcount Dim tquantity Dim confirm Dim x newcount=0 ReDim newcart(cartAttributes,maxCartItems) For i = 1 to scartItem confirm = Request.Form("selected" & CStr(i)) tquantity = Request.Form("Quantity" & Cstr(i)) if Not isnumeric(tquantity) then tquantity=1 end if if tquantity< 0.0 then tquantity=1 end if If tquantity < 0 then tquantity = abs(tquantity) end if if tquantity<> 0 then if tquantity< 1.0 then tquantity=1 end if end if arrCart(cQuantity,i)=tquantity If confirm = "yes" or tquantity=0 Then else newcount=newcount+1 for x = 1 to cartAttributes NewCart(x, newcount) = arrCart(x,i) next ProductPrice=Newcart(cOriginalPrice,newcount) NewCart(cUnitPrice,newcount)=ProductPrice DiscountPrice=ProductPrice CalculateUserPrice ProductPrice, tquantity, DiscountPrice, Newcart, Newcount If ProductPrice<>DiscountPrice then Newcart(cUnitPrice,newcount)=DiscountPrice end if end if Next Session("cartItem") = newcount Session("MyCart") = Newcart arrcart=Newcart scartitem=newcount Case "PROCE" Response.Redirect "shopcustomer.asp" End Select DisplayForm End Sub ' Sub display form Sub DisplayForm() CartFormatTax ShopPageHeader arrCart = Session("MyCart") scartItem = Session("cartItem") FormatFormFields ShopPageTrailer end sub ' Format form Sub FormatFormFields %>

Carrito
- Identificación - Comprobar carrito - Seleccionar forma de pago - Finalizar

Su Carrito
<%'=CartHeaderFont%><%'=LangCart01%><%'=scartitem%><%'=CartHeaderEnd%>

<% dim allowdelete allowdelete="TRUE" CartFormat allowdelete %>
España, transporte e I.V.A. incluidos en el precio

Transporte para otros países:
Si compra Bastones haga clic aquí
para calcular el precio del transporte


Precio sin i.v.a. para países no comunitarios (U.E.): <%= Session("taxes")%> Euros

<%=CartInfoFont%><%=LangCart02%><%=CartInfoFontEnd%>


   

<% End Sub %>