|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface OrderService
The general interface for interacting with shopping carts and completed Orders. In Broadleaf Commerce, a Cart and an Order are the same thing. A "cart" becomes an order after it has been submitted. Most of the methods in this order are used to modify the cart. However, it is also common to use this service for "named" orders (aka wishlists).
| Method Summary | |
|---|---|
Order |
addAllItemsFromNamedOrder(Order namedOrder,
boolean priceOrder)
Adds all orderItems to the current cart from the same Customer that owns the named order. |
OrderItem |
addGiftWrapItemToOrder(Order order,
GiftWrapOrderItemRequest itemRequest,
boolean priceOrder)
Adds a GiftWrapItem to the order based on the itemRequest. |
Order |
addItem(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
Initiates the addItem workflow that will attempt to add the given quantity of the specified item to the Order. |
Order |
addItemFromNamedOrder(Order namedOrder,
OrderItem orderItem,
boolean priceOrder)
Adds the passed in orderItem to the current cart for the same Customer that owns the named order. |
Order |
addItemFromNamedOrder(Order namedOrder,
OrderItem orderItem,
int quantity,
boolean priceOrder)
This method performs the same function as addItemFromNamedOrder(Order, OrderItem, boolean) except that instead of adding all of the quantity from the named order to the cart, it will only add/move the specific quantity requested. |
Order |
addOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
Adds the given OfferCode to the order. |
PaymentInfo |
addPaymentToOrder(Order order,
PaymentInfo payment,
Referenced securePaymentInfo)
Associates a given PaymentInfo with an Order. |
void |
cancelOrder(Order order)
Deletes the given order. |
Order |
confirmOrder(Order order)
Changes the OrderStatus to SUBMITTED |
Order |
createNamedOrderForCustomer(String name,
Customer customer)
Creates a new Order for the given customer with the given name. |
Order |
createNewCartForCustomer(Customer customer)
Creates a new Order for the given customer. |
Order |
findCartForCustomer(Customer customer)
Looks up the current shopping cart for the customer. |
OrderItem |
findLastMatchingItem(Order order,
Long skuId,
Long productId)
Looks through the given order and returns the latest added OrderItem that matches on the skuId and productId. |
Order |
findNamedOrderForCustomer(String name,
Customer customer)
Looks up an Order by the given customer and a specified order name. |
Order |
findOrderById(Long orderId)
Looks up an Order by its database id |
Order |
findOrderByOrderNumber(String orderNumber)
Looks up Orders and returns the order matching the given orderNumber |
List<Order> |
findOrdersForCustomer(Customer customer)
Looks up all Orders for the specified customer, regardless of current OrderStatus |
List<Order> |
findOrdersForCustomer(Customer customer,
OrderStatus status)
Looks up all Orders for the specified customer that are in the specified OrderStatus. |
List<PaymentInfo> |
findPaymentInfosForOrder(Order order)
Returns all PaymentInfo objects that are associated with the given order |
boolean |
getAutomaticallyMergeLikeItems()
|
Order |
getNullOrder()
The null order is the default order for all customers when they initially enter the site. |
boolean |
isDeleteEmptyNamedOrders()
|
boolean |
isMoveNamedOrderItems()
|
Order |
removeAllOfferCodes(Order order,
boolean priceOrder)
Removes all offer codes for the given order. |
void |
removeAllPaymentsFromOrder(Order order)
Deletes all the Payment Info's on the order. |
Order |
removeItem(Long orderId,
Long orderItemId,
boolean priceOrder)
Initiates the removeItem workflow that will attempt to remove the specified OrderItem from the given Order |
Order |
removeOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
Remove the given OfferCode for the order. |
void |
removePaymentsFromOrder(Order order,
PaymentInfoType paymentInfoType)
Deletes the Payment Info of the passed in type from the order Note that this method will also delete any associated Secure Payment Infos if necessary. |
Order |
save(Order order,
Boolean priceOrder)
Persists the given order to the database. |
void |
setAutomaticallyMergeLikeItems(boolean automaticallyMergeLikeItems)
When set to true, the system when items are added to the cart, they will automatically be merged. |
void |
setDeleteEmptyNamedOrders(boolean deleteEmptyNamedOrders)
Sets whether or not to delete named orders once all items have been removed. |
void |
setMoveNamedOrderItems(boolean moveNamedOrderItems)
Determines whether or not items will be removed from the named order (wishlist) when they are moved to the Customer's current cart. |
Order |
updateItemQuantity(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
Initiates the updateItem workflow that will attempt to update the item quantity for the specified OrderItem in the given Order. |
| Method Detail |
|---|
Order createNewCartForCustomer(Customer customer)
customer -
CustomerState
Order createNamedOrderForCustomer(String name,
Customer customer)
customer -
Order findNamedOrderForCustomer(String name,
Customer customer)
name - customer -
createNamedOrderForCustomer(String name, Customer customer)Order findOrderById(Long orderId)
orderId -
Order findCartForCustomer(Customer customer)
customer -
List<Order> findOrdersForCustomer(Customer customer)
customer -
List<Order> findOrdersForCustomer(Customer customer,
OrderStatus status)
customer - status -
Order findOrderByOrderNumber(String orderNumber)
orderNumber -
List<PaymentInfo> findPaymentInfosForOrder(Order order)
order -
PaymentInfo addPaymentToOrder(Order order,
PaymentInfo payment,
Referenced securePaymentInfo)
order - payment - securePaymentInfo - - null if it doesn't exist
Order save(Order order,
Boolean priceOrder)
throws PricingException
order - priceOrder -
PricingExceptionvoid cancelOrder(Order order)
order -
Order addOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
throws PricingException,
OfferMaxUseExceededException
order - offerCode - priceOrder -
PricingException
OfferMaxUseExceededException
Order removeOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
throws PricingException
order - offerCode - priceOrder -
PricingException
Order removeAllOfferCodes(Order order,
boolean priceOrder)
throws PricingException
order - priceOrder -
PricingExceptionOrder getNullOrder()
for more informationboolean getAutomaticallyMergeLikeItems()
setAutomaticallyMergeLikeItems(boolean)void setAutomaticallyMergeLikeItems(boolean automaticallyMergeLikeItems)
automaticallyMergeLikeItems - Order confirmOrder(Order order)
order - to confirm
OrderItem findLastMatchingItem(Order order,
Long skuId,
Long productId)
setAutomaticallyMergeLikeItems
is set to true and the last added sku matches on a previously added sku. In this case, the sku that has the
merged items would be returned, so the total quantity of the OrderItem might not match exactly what was
just added.
order - skuId - productId -
OrderItem addGiftWrapItemToOrder(Order order,
GiftWrapOrderItemRequest itemRequest,
boolean priceOrder)
throws PricingException
order - itemRequest - priceOrder -
PricingException
Order addItem(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
throws AddToCartException
orderId - orderItemRequest - priceOrder -
WorkflowException
Throwable
AddToCartExceptionOrderItemRequestDTO
Order updateItemQuantity(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
throws UpdateCartException,
RemoveFromCartException
orderId - orderItemRequest - priceOrder -
UpdateCartException
RemoveFromCartExceptionOrderItemRequestDTO
Order removeItem(Long orderId,
Long orderItemId,
boolean priceOrder)
throws RemoveFromCartException
orderId - orderItemId - priceOrder -
RemoveFromCartExceptionOrderItemRequestDTOboolean isMoveNamedOrderItems()
setMoveNamedOrderItems(boolean)void setMoveNamedOrderItems(boolean moveNamedOrderItems)
moveNamedOrderItems - boolean isDeleteEmptyNamedOrders()
setDeleteEmptyNamedOrders(boolean)void setDeleteEmptyNamedOrders(boolean deleteEmptyNamedOrders)
deleteEmptyNamedOrders -
Order addItemFromNamedOrder(Order namedOrder,
OrderItem orderItem,
boolean priceOrder)
throws RemoveFromCartException,
AddToCartException
setMoveNamedOrderItems flag is set.
Note that if an item was in a wishlist and is no longer able to be added to the cart,
the item will still be removed from the wishlist.
Note that this method does not change the association of the OrderItems to the new
order -- instead, those OrderItems is completely removed and a new OrderItem that mirrors
it is created.
namedOrder - orderItem - priceOrder -
RemoveFromCartException
AddToCartException
Order addItemFromNamedOrder(Order namedOrder,
OrderItem orderItem,
int quantity,
boolean priceOrder)
throws RemoveFromCartException,
AddToCartException,
UpdateCartException
namedOrder - orderItem - quantity - priceOrder -
RemoveFromCartException
AddToCartException
UpdateCartExceptionaddItemFromNamedOrder(Order, OrderItem, boolean)
Order addAllItemsFromNamedOrder(Order namedOrder,
boolean priceOrder)
throws RemoveFromCartException,
AddToCartException
setMoveNamedOrderItems flag is set.
Note that any items that are in the wishlist but are no longer able to be added to a cart
will still be removed from the wishlist.
Note that this method does not change the association of the OrderItems to the new
order -- instead, those OrderItems is completely removed and a new OrderItem that mirrors
it is created.
namedOrder - priceOrder -
RemoveFromCartException
AddToCartExceptionvoid removeAllPaymentsFromOrder(Order order)
order -
void removePaymentsFromOrder(Order order,
PaymentInfoType paymentInfoType)
order - paymentInfoType -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||