<% 'Any request to add items to cart? If request("Submit")="BUY NOW" 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"))="others Purchase 1st Class Postage|-2|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("reccess")) & "|" & Trim(request("controls")) & "|" & Trim(request("product_image1")) & "|" & Trim(request("slats")) & "|" & CInt(Trim(request("specialone"))) & "|" & CInt(Trim(request("specialtwo"))) & "|" & CInt(Trim(request("specialthree"))) & "|" & Trim(request("finishtype")) & "|" & Trim(request("headrail")) & "|" & Trim(request("oversize"))) ' End If Else 'Add item entry to basket session("basket")=session("basket") & Trim(request("product")) & "|" & CInt(Trim(request("quantity"))) & "|" & Trim(request("reccess")) & "|" & Trim(request("controls")) & "|" & Trim(request("product_image1")) & "|" & Trim(request("slats")) & "|" & CInt(Trim(request("specialone"))) & "|" & CInt(Trim(request("specialtwo"))) & "|" & CInt(Trim(request("specialthree"))) & "|" & Trim(request("finishtype")) & "|" & Trim(request("headrail")) & "|" & Trim(request("oversize")) & "`" 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 %> Your Shopping Basket Powered by PayPal for Blinds Only Suppliers Of Discount Blinds UK Online Commercial and Domestic Vertical Suede Roller blackout venetian Quality Window Coverings located in leicestershire & Nottinghamshire
    Manufacturers of Quality  Blinds

    YOUR SHOPPING BASKET

    <% If strError<>"" Then %> Errors:-
    <% 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 specialfour=0 finishblind=0 headupgrade=0 largeblind=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))) specialfour=specialfour+(CDbl(ItemArray(10))*CDbl(ItemArray(3))) if ItemArray(11)="Shape1" then finishblind=finishblind elseif ItemArray(11)="n/a" then finishblind=finishblind elseif ItemArray(11)="Shape2" then finishblind=finishblind+10 elseif ItemArray(11)="Shape3" then finishblind=finishblind+10 elseif ItemArray(11)="Shape4" then finishblind=finishblind+10 end if if ItemArray(12)="No Headrail Upgrade" then headupgrade=headupgrade elseif ItemArray(12)="n/a" then headupgrade=headupgrade elseif ItemArray(12)="Headrail-1" then headupgrade=headupgrade+5 elseif ItemArray(12)="Headrail-2" then headupgrade=headupgrade+10 end if largeblind=largeblind+CDbl(ItemArray(13)) %> <% if CDbl(ItemArray(3))=0 then %> <% else %> <% end if %> <% Set ItemArray=Nothing Next 'Set BasketArray=Nothing ''Postage costs If RunningSumPounds<21 Then PostageCharge=0 Elseif RunningSumPounds>20 and RunningSumPounds<51 then PostageCharge=0 else PostageCharge=0 End If if specialone<2 then Discount1=0 elseif specialone=2 then Discount1=21 elseif specialone=3 then Discount1=51 elseif specialone=4 then Discount1=71 elseif specialone=5 then Discount1=91 elseif specialone=6 then Discount1=111 elseif specialone=7 then Discount1=131 end if if specialtwo<2 then Discount2=0 elseif specialtwo=2 then Discount2=41 elseif specialtwo=3 then Discount2=81 elseif specialtwo=4 then Discount2=111 elseif specialtwo=5 then Discount2=144 elseif specialtwo=6 then Discount2=180 elseif specialtwo=7 then Discount2=219 end if if specialfour<2 then Discount3=0 elseif specialfour=2 then Discount3=34 elseif specialfour=3 then Discount3=91 elseif specialthree=4 then Discount3=125 elseif specialthree=5 then Discount3=161 elseif specialthree=6 then Discount3=199 elseif specialthree=7 then Discount3=241 end if Discount=Discount1+Discount2+Discount4 'TEMPORARY!!!! 'PostageCharge=0 %> <% Else %> <% End If %>
    Item £ Each Qty £ Total    
    <%=ItemArray(0)%><%=ItemArray(0)%>
  • <%=ItemArray(4)%>

  • <%=ItemArray(5)%>

  • <%=ItemArray(7)%>

  • Finishing <%=ItemArray(11)%>

  • Headrail Upgrade <%=ItemArray(12)%>
  • <% if ItemArray(13)=10 then %>
  • Oversized Blind
  • <% end if %>
    <%=FormatCurrency(ItemArray(1))%> <%=ItemArray(3)%> <%=FormatCurrency(CDbl(ItemArray(1))*CDbl(ItemArray(3)))%>
       
    Finishing: £<%=FormatNumber(finishblind,2)%>    
    Headrail Upgrade: £<%=FormatNumber(headupgrade,2)%>    
    Oversized Excess: £<%=FormatNumber(largeblind,2)%>    
    Postage: £<%=FormatNumber(PostageCharge,2)%>    
    Discount:
    £<%=FormatNumber(Discount,2)%>
       

    TOTAL:

    £<%=FormatNumber(RunningSumPounds+finishblind+headupgrade+largeblind+PostageCharge-Discount,2)%>

       
         
       
    Basket Empty