Shopping Cart - Add Items
I want to check and see if first Session.Cart.ProductID exist. If no Session.Cart.ProductID exist then do not allow addtocart to take place. I want to force the members to pick a certain item first, before they are allowed to pick certain others. So the code below checks for the existing Session.Cart.ProductID if none exist redirect with an error message. Works fine for the first check.
User selects an item and because there is no ProductId Session yet they get errored out and asked to pick the right item first. That happened because Session.Cart.ProductID did not exixt. So now they go back and choose the right item, Session.Cart.ProductID is GT 0, so they should be able to add anything they want now.
For some reason after the first check, and the correct item has been added first (which means the session is now GT 0) it doesnt recognize Session.Cart.ProductID and should ignore the rest of the current if statement and move on to the cfelseif that follows.
Make sense?
----------------------------------------
Florida Web Design
Orlando Web Hosting
Florida Coldfusion Hosting
I want to check and see if first Session.Cart.ProductID exist. If no Session.Cart.ProductID exist then do not allow addtocart to take place. I want to force the members to pick a certain item first, before they are allowed to pick certain others. So the code below checks for the existing Session.Cart.ProductID if none exist redirect with an error message. Works fine for the first check.
User selects an item and because there is no ProductId Session yet they get errored out and asked to pick the right item first. That happened because Session.Cart.ProductID did not exixt. So now they go back and choose the right item, Session.Cart.ProductID is GT 0, so they should be able to add anything they want now.
For some reason after the first check, and the correct item has been added first (which means the session is now GT 0) it doesnt recognize Session.Cart.ProductID and should ignore the rest of the current if statement and move on to the cfelseif that follows.
Make sense?
Code:
<cfif ListFind(ArrayToList(Session.Cart.ProductID),FORM.ProductID)
EQ 0 AND (
Form.ProductID EQ "FCSS-kgtt"
OR Form.ProductID EQ "FCSS-gfds"
OR Form.ProductID EQ "FCSS-erty"
OR Form.ProductID EQ "FCSS-nbZc"
OR Form.ProductID EQ "FCSS-iyew"
OR Form.ProductID EQ "FCSS-mmbb"
OR Form.ProductID EQ "FCSS-q3fe"
OR Form.ProductID EQ "FCSS-bvcd")>
<cflocation url="#cgi.path_info#?needtoaddconf=yes&type=#URL.type#" addtoken="no">
----------------------------------------
Florida Web Design
Orlando Web Hosting
Florida Coldfusion Hosting