Click to See Complete Forum and Search --> : Small issue with asp shopping cart


mojo3120
02-15-2006, 11:08 AM
I'm working on a new asp shopping cart for my company. Some of the items we sell have a core charge...for example
http://www.mojo3120.com/store/comersus_viewItem.asp?idProduct=291

I wanted the core charge to be a seperate item added to the cart when you add the original item. I figured out a way to do by adding a field to the products table and using the following code. Now the problem is that someone could add the product to the cart, then remove the core charge and check out. Anyone have any ideas on how I could tie the 2 products together (the original item and the core charge) so if one is removed both are?

Thanks
-Andrew
' insert new row line, is not in the cart
'Core Charge chenges -Andrew
if not pCore="" then
mySQL="INSERT INTO cartRows (idProduct, quantity, unitPrice, unitCost, unitWeight, idDbSessionCart, personalizationDesc) VALUES (293,1," &pCore& ",0,0," &pIdDbSessionCart& ",'" &pPersonalizationDesc& "')"
call updateDatabase(mySQL, rstemp, "addItem")
end if
'End Core Charge changes

mySQL="INSERT INTO cartRows (idProduct, quantity, unitPrice, unitCost, unitWeight, idDbSessionCart, personalizationDesc) VALUES (" &pIdProduct& "," &pQuantity& "," &pUnitPrice& "," &pUnitCost& "," &pUnitWeight& "," &pIdDbSessionCart& ",'" &pPersonalizationDesc& "')"
call updateDatabase(mySQL, rstemp, "addItem")

Master Shake
02-15-2006, 01:22 PM
It appears that you have a standard or pre-determined id for the core charge. What about using the same id as the product and then when one is ticked for removal the removal process will delete all that have that id. Unless that would be a problem when submitting the data to whomever will process it. In that case you could always add the core to the base price and then indicate such by appending a note to the description. I reckon I don't have an actual solution but maybe one of these methods will suffice.

Master Shake

mojo3120
02-15-2006, 04:46 PM
Making the product id the same is a good idea I haven't thought of. I'll mess around with that and see what I can do.
Thanks
-Andrew
It appears that you have a standard or pre-determined id for the core charge. What about using the same id as the product and then when one is ticked for removal the removal process will delete all that have that id. Unless that would be a problem when submitting the data to whomever will process it. In that case you could always add the core to the base price and then indicate such by appending a note to the description. I reckon I don't have an actual solution but maybe one of these methods will suffice.

Master Shake