Tpaairman Posted January 11, 2010 Posted January 11, 2010 I'm setting up a storefront file. I have a bit of an idea of how to do what I need, but I'm just not quite there, so I'm looking for ideas. I have a cash register layout that has a couple tables related to it. One is for items being scanned for checkout. (That will feed the invoice table.) Here's where I'm stuck - Let's say you buy 3 of a certain. I don't want the same item 3 times on the list of items purchased. I want it so that if I scan an item more than once, it shows the quantity as 3 (or however many you bought). I'm OK with having a script that runs after each scan, and I'm thinking I need it to start with the first portal row and see if that item matches what was just scanned, and so on down the list. As I said, I think I'm already on the right track, but I'm just not quite getting there.
IdealData Posted January 11, 2010 Posted January 11, 2010 Yes, I follow you here. So you loop through the portal, if you have an existing item then update the count of that item and EXIT SCRIPT, otherwise create a new entry in the portal. However, as the shopping cart grows, so will the time to loop through the portal, so you could do the following instead. Presuming that you scan the items into a GLOBAL field then set up a SELF JOIN relationship with the GLOBAL field matching the ITEM field in the portal. Now you can simply test for the existence of of an ITEM - the rest should be obvious IF item exists update item count ELSE go to last portal row set item count to 1 END
Recommended Posts
This topic is 5431 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now