Pseudo-Algorithm for AddToCart
Follow these steps when using a pseudo-algorithm for AddToCart:
Call CanAddToCart method to check whether or not a user can add items to the Shopping Cart:
If the CurrentQuoteId profile attribute is not empty and is a valid quote ID, return TRUE;
else if the AddToCartAutoQuote input argument is TRUE, return TRUE;
else if the AddToCartAutoQuote server component parameter is TRUE, return TRUE;
else return FALSE.
Check the Action input argument:
If Action = AddTrainingItem or AddEventItem or AddEventSessionItem, call the AddTrainingItem method;
Else if Action = QuickAdd, call the QuickAdd method;
Else if Action = AddToCart or Customize:
Call the DefaultAddToCart method.
Call the PostAddToCart method.