[thelist] CF_Shoppingcart, aligning lists (REPOST?)
Nick Boyce
nick at triplezero.com.au
Thu Jul 12 22:47:53 CDT 2001
Hey.
I dont think this was send out last time as I sent it out to
news://fuseware.com/evolt and I think that is only for reading posts
(right?).
I am working on a shopping cart application using the CF_Shoppingcart custom
tag. The tag adds ids and quantities to a list that is held in the session.
I am adding them like so:
<CF_ShoppingCart
FUNCTION="add"
ITEM="#url.itemid#"
QTY="#url.qty#"
CART="#session.cart#">
This all works fine, and I might end up with something like this:
item: 31,141,66
qty: 1,1,3
Which means that I have one of item 31, one of item 141 and 3 of item 66.
Their order on this list is defined by whe they were added. Everything is
fine so far. Still with me?
I want to grab those ids and use them in a query. Here is how I am doing it
(modulesnip is actually the name btw):
<cfif shoppingcart_items gte 1>
<cfquery name=getall datasource="#db#">
select moduleid, modulesnip
from module
where moduleid in (#shoppingcart_product#)
</cfquery>
Thats grabs the output fine, but outputs them ordered by moduleid asc. So
when I go to output them in loop, the orders dont align. Using the above
example, it outputs in this order: 31,66,141 when I really want it in this
order 31,141,66. I really dont know enough about lists to know if I am using
this correctly, but I just can't think of a way to make the orders align.
Anyone with any ideas? Does anyone use CF_Shoppingcart?
Nick
----------------------------------------------------------------
triple zero digital | upstairs at 200 the parade, norwood 5067
08 332 0545 | www.triplezero.com.au | nick at triplezero.com.au
More information about the thelist
mailing list