Which one would you would go for:
-
Click on the Item, javascript will get the ID from clicked item and then validate the ID via ajax (php/database). If the ID is correct and then save the ID in the session cart.
-
Click on the Item, javascript will get the ID from clicked item and then save the ID in the session (PHP) via ajax without ID validation. When user clicked on the proceed button, it will then validate all the ID’s from the session..
-
Your method?
If I understand you correctly, you are asking whether the ID’s in the shopping basket (i.e session) are validated one-by-one as the user adds them, or at checkout.
Am not sure that it really matters. Perhaps by doing validation at checkout you can do it all in one database call, but apart from this small consideration I can’t think of a big reason to do one or the other.