You can keep those "keys" in your shoping cart as a list and make compare
them.

cart = {};
cart.products = "1,2,3";

then when user try add new product into the cart, you can just check your
list and see if product already there.

if ( NOT ListFindNoCase(cart.products,productid) ){

 // a new product

}else{

 // product exists

}

but that will work if you can have a unique ID for product, in apparel world
for example it can be a UPC or unique ID in your warehouse DB.

sorry need to step out, but the idea is keeping a list of all your unique
product ID's then you can easy make a search against the list.




On Fri, Jul 31, 2009 at 12:19 PM, Eric Nicholas Sweeney <
[email protected]> wrote:

>
> Misha,
>
> I already have Uniq identifiers with the database keys... Those products
> "may have" UPC entries - but if I only used UPC they couldn't list the same
> product twice. (Which would be handy for trying to see how listing the same
> product in different ways affected sales... But again, not every product
> will have a UPC)
>
> The structs are currently being built correctly with Uniq Identifiers - I
> am
> just having issues comparing newly added products to the cart - to items
> that "may" already exist in the cart...
>
> All I need to do is ask:
>
> Does MerchIDX Exist in my Cart Array?
> If True, Compare Structs
>
> For Choices:
> Does Struct A = Struct B?
> If False, This is a New Cart Item
> If True, Compare Options
>
> For options:
> Does Struct C = Struct D?
> If False, This is a New Cart Item
> If True, Return Cart Position X (This adds more quantity rather than new
> item)
>
> Does that make sense?
>
> My problem, is that I do not really know how to compare the structs... it
> is
> sort of at the fringes of my comprehension and skill level.  :(
>
> - Nick
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4679
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to