Add to Shopping Cart with Checkboxes, Qty

Add to Shopping Cart with Checkboxes, Qty

am 27.06.2005 14:36:54 von realraven2000

Hi,

I have an ASP page that prints out search results from a product
catalog (in a HTML table) - the resultset is returned from a SQL Server
stored procedure. The customer wants to be able to select multiple
items using checkboxes and maybe an Editbox for quantity. There is an
Add to shopping cart button at the bottom of the page.

I have the resultset in an array (used recordset.getRows to populate
it), so I am able to enumerate it. How do I enumerate the checkboxes to
pass on information to the shopping cart? Ideally I would like to read
the values of the checkboxes & editboxes while iterating through the
products array (?). I assume I have to make them unique by naming them
or somehow build an array of checkboxes that runs parallel to my
resultset array.

Here is part of my existing code:

Set rs = CmdSP.Execute( )
rsArray = rs.GetRows
' 1st dimension: number of fields
lRecCount=UBound(rsArray, 2)

%>
....

Search Results:


 


<%=lRecCount%> Products found containing the string <%=sSearch%>
.



<% If lRecCount>0 Then %>











<% For nCount=1 To lRecCount
' rsArray: ProductName, ProductId, ProductGroupCode, ChapterCode
%>


<%' we should create a link using product name!%>








Thanks in advance for any help
Axel

Re: Add to Shopping Cart with Checkboxes, Qty

am 27.06.2005 14:47:34 von realraven2000

one more question that I forgot: do I need to wrap the table into a
form?

Re: Add to Shopping Cart with Checkboxes, Qty

am 27.06.2005 19:24:23 von Adrienne

Gazing into my crystal ball I observed "Axel"
writing in news:1119875814.190649.201530@o13g2000cwo.googlegroups.com:

> Hi,
>
> I have an ASP page that prints out search results from a product
> catalog (in a HTML table) - the resultset is returned from a SQL Server
> stored procedure. The customer wants to be able to select multiple
> items using checkboxes and maybe an Editbox for quantity. There is an
> Add to shopping cart button at the bottom of the page.
>
> I have the resultset in an array (used recordset.getRows to populate
> it), so I am able to enumerate it. How do I enumerate the checkboxes to
> pass on information to the shopping cart? Ideally I would like to read
> the values of the checkboxes & editboxes while iterating through the
> products array (?). I assume I have to make them unique by naming them
> or somehow build an array of checkboxes that runs parallel to my
> resultset array.
>
> Here is part of my existing code:
>
> Set rs = CmdSP.Execute( )
> rsArray = rs.GetRows
> ' 1st dimension: number of fields
> lRecCount=UBound(rsArray, 2)
>
> %>
> ...
>
>

Search Results:


>

 


>

<%=lRecCount%> Products found containing the string <%=sSearch%>
>
.


>
> <% If lRecCount>0 Then %>
>
>
Part Number Model Description Price Add Qty
<%=rsArray(0, nCount)%> <%=rsArray(1, nCount)%> <%=rsArray(2, nCount)%> <%=rsArray(3, nCount)%>

>
>
>
>
>
>
>
>
>
><% For nCount=1 To lRecCount
> ' rsArray: ProductName, ProductId, ProductGroupCode, ChapterCode
> %>
>
>
><%' we should create a link using product name!%>
>
>
>
>
>
>
>
>
> Thanks in advance for any help
> Axel
>


Part NumberModelDescriptionPriceAddQty
<%=rsArray(0, nCount)%> <%=rsArray(1, nCount)%><%=rsArray(2, nCount)%><%=rsArray(3, nCount)%>








<% looping through the recordset%>







<% end looping %>

Product ID Group Chapter
<%=rsarray(1, ncount) <%=rsarray(2, ncount) <%=rsarray(3, ncount) Add




Then when the information is posted to your script, request.form("cart")
will be an array and you can do what you need.
--
Adrienne Boswell
http://www.cavalcade-of-coding.info
Please respond to the group so others can share