<% 'Any request to add items to cart? If request("Submit")="Confirm?" or request("submit")="Add to Basket" Then 'Validate purchase details If Trim(request("product"))="" Then strError=strError & "
  • You have not selected a pack type.
  • " End If If Trim(request("quantity"))="" Then strError=strError & "
  • You have not specified a quantity.
  • " ElseIf Not IsNumeric(Trim(request("quantity"))) Then strError=strError & "
  • Quantity must be a number.
  • " Else If CDbl(Trim(request("quantity")))<1 Then strError=strError & "
  • Quantity must 1 or more.
  • " End If If Cdbl(Trim(request("quantity")))<>Cdbl(CInt(Trim(request("quantity")))) Then strError=strError & "
  • Quantity must be a whole number.
  • " End If End If 'Valid purchase details? If strError="" Then 'Check item is not already in basket If InStr(session("basket"), Trim(request("product"))) Then If (Trim(request("product"))="Redeem Voucher|-5|0" or Trim(request("product"))="Redeem Voucher|-10|0" or Trim(request("product"))="Redeem Voucher|-15|0" or Trim(request("product"))="Redeem Voucher|-20|0" or Trim(request("product"))="Redeem Voucher|-25|0" or Trim(request("product"))="Redeem Voucher|-30|0" or Trim(request("product"))="Redeem Voucher|-35|0" or Trim(request("product"))="Redeem Voucher|-40|0" or Trim(request("product"))="Redeem Voucher|-45|0" or Trim(request("product"))="Redeem Voucher|-50|0" or Trim(request("product"))="Redeem Voucher|-55|0" or Trim(request("product"))="Redeem Voucher|-60|0" or Trim(request("product"))="Redeem Voucher|-65|0" or Trim(request("product"))="Redeem Voucher|-70|0" or Trim(request("product"))="Redeem Voucher|-75|0" or Trim(request("product"))="Redeem Voucher|-80|0" or Trim(request("product"))="Redeem Voucher|-85|0" or Trim(request("product"))="Redeem Voucher|-90|0" or Trim(request("product"))="Redeem Voucher|-95|0" or Trim(request("product"))="Redeem Voucher|-100|0") Then 'do not add duplicate postage refund Else 'normal item -increment quantity StartOfQuantity=InStr(session("basket"), Trim(request("product")))+Len(Trim(request("product")))+1 'StartOfQuantity=len(Trim(request("product")))+1 'EndOfQuantity=Instr(StartOfQuantity, session("basket"), "`")-1 'EndOfQuantity=len(Trim(request("product")))+1 'LenQuantity=EndOfQuantity-StartOfQuantity+1 LenQuantity=1 ExistingQuantity=CInt(Mid(session("basket"), StartOfQuantity, LenQuantity)) NewQuantity=ExistingQuantity+CInt(Trim(request("quantity"))) session("basket")=Replace(session("basket"), Trim(Trim(request("product")) & "|" & ExistingQuantity), Trim(Trim(request("product")) & "|" & NewQuantity)& "|" & Trim(request("canvas")) & "|" & Trim(request("coating")) & "|" & Trim(request("product_image1")) & "|" & Trim(request("frame"))) End If Else 'Add item entry to basket session("basket")=session("basket") & Trim(request("product")) & "|" & CInt(Trim(request("quantity"))) & "|" & Trim(request("canvas")) & "|" & Trim(request("coating")) & "|" & Trim(request("product_image1")) & "|" & Trim(request("frame")) & "`" End If End If ElseIf request("checkout")="Checkout" Then Response.redirect "/checkout.asp" Else 'Look for any remove requests For Each Item In Request.Form If Left(Item,7)="remove_" And Request.Form(Item)="Remove" Then 'Get Product index from button name ProductIndex=Right(Item, Len(Item)-7) 'Split basket into array BasketArray=Split(session("basket"), "`", -1, 1) 'construct string to remove RemoveString=Trim(BasketArray(ProductIndex)) & "`" Set BasketArray=Nothing End If Next 'Have to do removal here as doing it above will alter indexes in basket array If RemoveString<>"" Then session("basket")=Replace(session("basket"), RemoveString, "") End If End If 'forbid adding of postage refund on its own 'If Left(Trim(session("basket")),39)="others Purchase 1st Class Postage|-2|0|" And Len(Trim(session("basket")))<45 Then ' session("basket")="" 'End If %> Shopping Basket - Feature Art
    Solution Graphics
    <% If strError<>"" Then %> Errors:-
      <%=strError%>

    <% End If %>
    <% 'Anything in the basket currently? If Trim(session("basket"))<>"" and Trim(Replace(session("basket"), ",", ""))<>"" Then BasketArray=Split(session("basket"), "`", -1, 1) RunningSumPounds=0 specialone=0 specialtwo=0 specialthree=0 For iItem=0 to Ubound(BasketArray)-1 'For iItem=0 to Ubound(BasketArray) ItemArray=Split(BasketArray(iItem), "|", -1, 1) RunningSumPounds=RunningSumPounds+CDbl(ItemArray(1))*CDbl(ItemArray(3)) 'specialone=specialone+(CDbl(ItemArray(8))*CDbl(ItemArray(3))) 'specialtwo=specialtwo+(CDbl(ItemArray(9))*CDbl(ItemArray(3))) 'specialthree=specialthree+(CDbl(ItemArray(10))*CDbl(ItemArray(3))) if ItemArray(5)="Yes" then specialtwo=specialtwo + Cdbl(ItemArray(3))*5 elseif ItemArray(5)="No" then specialtwo=specialtwo end if if ItemArray(7)="Premium Frame" then specialone=specialone + Cdbl(ItemArray(3))*25 elseif ItemArray(7)="Standard Frame" then specialone=specialone end if if ItemArray(4)="Premium Canvas" then specialthree=specialthree + Cdbl(ItemArray(3))*15 elseif ItemArray(4)="Standard Frame" then specialthree=specialthree end if %> <% if CDbl(ItemArray(3))=0 then %> <% else %> <% end if %> <% Set ItemArray=Nothing Next 'Set BasketArray=Nothing ''Postage costs 'If RunningSumPounds<21 Then PostageCharge=10 'Elseif RunningSumPounds>20 and RunningSumPounds<51 then 'PostageCharge=0 'else ' PostageCharge=0 'End If 'TEMPORARY!!!! 'PostageCharge=0 %> <% if FormatNumber(RunningSumPounds+specialone+specialtwo+specialthree+PostageCharge,2)<0 then %> <% else %> <% end if %> <% Else %> <% End If %>
    Item £ Each Qty £ Total    
    <%=ItemArray(0)%><%=ItemArray(0)%> <% if not (ItemArray(4)="Standard Canvas") then %>
  • <%=ItemArray(4)%>
  • <% end if %> <% if not (ItemArray(5)="No") then %>
  • Coating Required - <%=ItemArray(5)%>
  • <% end if %> <% if not (ItemArray(7)="Standard Frame") then %>
  • <%=ItemArray(7)%>
  • <% end if %>
    <%=FormatCurrency(ItemArray(1))%> <%=ItemArray(3)%> <%=FormatCurrency(CDbl(ItemArray(1))*CDbl(ItemArray(3)))%> <% if ItemArray(0)="Redeem Voucher" then %>  <% else %> <% end if %>
       
    Frame: £<%=FormatNumber(specialone,2)%>    
    Coating: £<%=FormatNumber(specialtwo,2)%>    
    Canvas: £<%=FormatNumber(specialthree,2)%>    
    Postage: £<%=FormatNumber(PostageCharge,2)%>    

    TOTAL:

    £0.00

       

    TOTAL:

    £<%=FormatNumber(RunningSumPounds+specialone+specialtwo+specialthree+PostageCharge,2)%>

       
         
       
    Basket Empty    

    Please print a copy of this page if you require a record of the order you are about to place. This will not however act as a receipt.