|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface CartProcessor
Interface for business logic methods having to do with a user's cart.
The Struts layer employs an instance implementing CartProcessor
when a user adds items to his or her cart or edits items. It is also used to
handle processing during checkout.
CartProcessor is similar in intention to
OrderProcessor.
OrderProcessor contains more generic code relating to orders,
while CartProcessor contains code specific to manuipulating a
user's cart.
When the application needs to create an instance that implements
CartProcessor,
BusinessObjectFactory
finds the name of the Java class to instantiate from the
"cartProcessorImplementer" setting in the
appComponents.properties file.
The default "cartProcessorImplementer" is
BasicCartProcessor.
| Method Summary | |
|---|---|
void |
initializeCart()
Initializes a user's cart. |
java.util.Map |
markOrderComplete(java.util.Map parameters)
Marks an order as complete at the very end of the checkout process, after payments have been processed. |
java.util.Map |
postProcessCartChanged()
Hook method which is called any time an item or items changes in the cart. |
java.util.Map |
processAddItems(java.util.Collection newOrderItems)
Given a Collection of initialized OrderItem
objects, adds the items to the user's cart. |
java.util.Map |
processAddItems(java.util.Map parameters)
Processes a request to add items to a user's cart. |
java.util.Map |
processCheckoutAddresses(java.util.Map parameters)
Processes a request to add address information to a user's cart. |
java.util.Map |
processEditItem(java.util.Map parameters)
Processes a request to edit a given item in a user's cart. |
java.util.Map |
processOrderComplete(java.util.Map parameters)
Handles processing at the end of the checkout process, after payments have been processed. |
void |
processQuantities(java.util.Collection newOrderItems)
Given a Collection of OrderItems in the user's cart whose
quantities have been set, updates the totals and weights of each
OrderItem based on the (new) quantity. |
java.util.Map |
processRemoveItem(OrderItem orderItem)
Removes a given OrderItem from the user's cart, updating the cart totals in the process. |
void |
processTotalsAndFormatting(java.util.Collection orderItems)
Given a Collection of OrderItems in the user's cart whose
totals have been set, updates the totals and weights of each
OrderDelivery and Order they are under, and
applies formatting to the totals. |
| Methods inherited from interface com.softslate.commerce.businessobjects.core.BusinessObject |
|---|
initialize |
| Method Detail |
|---|
java.util.Map processAddItems(java.util.Map parameters)
throws java.lang.Exception
initializeCart() to create a new instance of
Order in the
User instance for the
user. It then adds an
OrderDelivery
instance under the Order and
OrderItem instances
under the OrderDelivery.
This method manages the parsing of incoming parameters that identify the
products, quantities, and attribute values of the items to be added. It
populates OrderItem objects with the incoming information
and then hands off the processing to the
processAddItems(Collection) method.
The incoming Map must have the following keys:
orderProductCodes (aString[] holding
the codes of the product(s) to add)orderProductQuantities (aString[]
holding the quantities of the product(s) to add)orderAttributes (aHashMap holding
attribute keys and values, where the attribute keys are in the form of
'productCode|attributeCode')
parameters - A Map representing the items and attributes
being added to the user's cart.
Map representing the results of the processing.
The Map may have one or more of the following keys
related to inventory processing: "lowStockEmails",
"missingAttributes", "rejectedOrderItems", "adjustedOrderItems",
and "newOOSSKUs".
java.lang.ExceptionCartAddAction
java.util.Map processAddItems(java.util.Collection newOrderItems)
throws java.lang.Exception
Collection of initialized OrderItem
objects, adds the items to the user's cart. Manages the processing of
inventory and discounting, updates the user's cart totals, and manages
synchronizing the objects with the database.
newOrderItems - The Collection containing the
OrderItem objects to be added to the user's
cart.
Map containing information on the results of the
processing. The Map may have one or more of the
following keys related to inventory processing: "lowStockEmails",
"missingAttributes", "rejectedOrderItems", "adjustedOrderItems",
and "newOOSSKUs".
java.lang.Exception
void processQuantities(java.util.Collection newOrderItems)
throws java.lang.Exception
OrderItems in the user's cart whose
quantities have been set, updates the totals and weights of each
OrderItem based on the (new) quantity.
newOrderItems - The Collection containing the
OrderItem objects whose quantities and totals
are to be set.
java.lang.Exception
java.util.Map processEditItem(java.util.Map parameters)
throws java.lang.Exception
Map must have the same keys required by
processAddItems(Map), plus a key named orderItem,
which identifies the order item being edited.
parameters - A Map identifying the item being edited and
specifying the item's new properties.
Map containing information on the results of the
processing. The Map may have one or more of the
following keys related to inventory processing: "lowStockEmails",
"missingAttributes", "rejectedOrderItems", "adjustedOrderItems",
and "newOOSSKUs".
java.lang.ExceptionCartItemEditAction
java.util.Map processRemoveItem(OrderItem orderItem)
throws java.lang.Exception
orderItem - The OrderItem being removed.
java.lang.Exception
void initializeCart()
throws java.lang.Exception
Order and
OrderDelivery
representing a user's cart. Sets the current User object's
order property with the newly created Order. Synchronizes
the new cart with the database.
java.lang.Exception
java.util.Map processCheckoutAddresses(java.util.Map parameters)
throws java.lang.Exception
parameters - A Map representing the address information of
the current user.
java.lang.ExceptionCheckoutAction.processCheckoutAddresses(BaseForm)
java.util.Map processOrderComplete(java.util.Map parameters)
throws java.lang.Exception
Map representing the results of the processing.
java.lang.ExceptionCheckoutAction.processOrderComplete(BaseForm)
java.util.Map markOrderComplete(java.util.Map parameters)
throws java.lang.Exception
The order number is an integer given to each completed order, starting at the "orderNumberFloor" database setting (whose default is 1,000).
Map representing the results of the processing.
java.lang.ExceptionCheckoutAction.processOrderComplete(BaseForm)
void processTotalsAndFormatting(java.util.Collection orderItems)
throws java.lang.Exception
OrderItems in the user's cart whose
totals have been set, updates the totals and weights of each
OrderDelivery and Order they are under, and
applies formatting to the totals.
orderItems - The OrderItems whose totals must be added to
the order and order delivery.
java.lang.Exception
java.util.Map postProcessCartChanged()
throws java.lang.Exception
Map representing the results of the processing.
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||