Years ago I created a webstore for one of my company's customers using CFShopKartLite. It's been working great, but now they want reporting (i.e. How many products sold?). The CFShopKartLite application inputs the shopping cart contents to 3 fields (CrtProductID, CrtProductName, CrtProductQuantity) of the database as a delimited string created by using CF's ListAppend function. Displaying a single order is easy using ListGetAt in a loop. I just can't wrap my mind around how to go through multiple orders and generate a total quantity for each product.
Here's a typical scenario (simplified):
John Sample orders 10 Books, 20 Decals and 30 Posters.
Jane Doe orders 15 Decals, 25 Posters, 5 Books and 5 Flash Drives
Here's the database view (simplified):
OrderNo CustName CrtProductID CrtProductName CrtProductQuantity
1 John Sample BK^DL^PS Book^Decal^Poster 10^20^30
2 Jane Doe DL^PS^BK^FD Decal^Poster^Book^Flash 15^25^5^5
I know I'm supposed to have at least some code to show I've been trying to solve this but nothing I've tried even comes close so I'm too embarassed to post it. I've scoured Tek-Tips and the internet and haven't found anything to help me. Any help would be greatly appreciated.
Here's a typical scenario (simplified):
John Sample orders 10 Books, 20 Decals and 30 Posters.
Jane Doe orders 15 Decals, 25 Posters, 5 Books and 5 Flash Drives
Here's the database view (simplified):
OrderNo CustName CrtProductID CrtProductName CrtProductQuantity
1 John Sample BK^DL^PS Book^Decal^Poster 10^20^30
2 Jane Doe DL^PS^BK^FD Decal^Poster^Book^Flash 15^25^5^5
I know I'm supposed to have at least some code to show I've been trying to solve this but nothing I've tried even comes close so I'm too embarassed to post it. I've scoured Tek-Tips and the internet and haven't found anything to help me. Any help would be greatly appreciated.