public interface OrderService
| Modifier and Type | Method and Description |
|---|---|
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 |
addItemWithPriceOverrides(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 |
addOfferCode(Order order,
OfferCode offerCode,
boolean priceOrder)
Adds the given OfferCode to the order.
|
Order |
addOfferCodes(Order order,
List<OfferCode> offerCodes,
boolean priceOrder)
Adds the given OfferCodes to the order.
|
OrderPayment |
addPaymentToOrder(Order order,
OrderPayment payment,
Referenced securePaymentInfo)
Associates a given OrderPayment with an Order and then saves the 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.
|
void |
deleteOrder(Order cart) |
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 |
findOrderById(Long orderId,
boolean refresh)
Looks up an Order by its database id
and optionally calls refresh to ensure that the entity manager pulls the instance from the DB and not from cache
|
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<OrderPayment> |
findPaymentsForOrder(Order order)
Returns all OrderPayment 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() |
void |
preValidateCartOperation(Order cart)
Invokes the extension handler of the same name to provide the ability for a module to throw an exception
and interrupt a cart operation.
|
void |
printOrder(Order order,
org.apache.commons.logging.Log log)
This debugging method will print out a console-suitable representation of the current state of the order, including
the items in the order and all pricing related information for the order.
|
Order |
reloadOrder(Order order)
Detaches the given order from the current entity manager and then reloads a fresh version from
the database.
|
Order |
removeAllOfferCodes(Order order,
boolean priceOrder)
Removes all offer codes for the given order.
|
void |
removeAllPaymentsFromOrder(Order order)
Deletes all the OrderPayment Info's on the order.
|
Order |
removeInactiveItems(Long orderId,
boolean priceOrder) |
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 |
removePaymentFromOrder(Order order,
OrderPayment paymentInfo)
Deletes the OrderPayment Info from the order.
|
void |
removePaymentsFromOrder(Order order,
PaymentType paymentInfoType)
Deletes the OrderPayment Info of the passed in type from the order
Note that this method will also delete any associated Secure OrderPayment 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.
|
Order |
updateProductOptionsForItem(Long orderId,
OrderItemRequestDTO orderItemRequestDTO,
boolean priceOrder)
Since required product option can be added after the item is in the cart, we use this method
to apply product option on an existing item in the cart.
|
Order createNewCartForCustomer(Customer customer)
customer - CustomerStateOrder createNamedOrderForCustomer(String name, Customer customer)
name - the wishlist namecustomer - args - additional arguments to be used by Broadleaf extensionsOrder findNamedOrderForCustomer(String name, Customer customer)
name - customer - args - additional arguments to be used by Broadleaf extensionscreateNamedOrderForCustomer(String name, Customer customer)Order findOrderById(Long orderId)
orderId - Order findOrderById(Long orderId, boolean refresh)
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<OrderPayment> findPaymentsForOrder(Order order)
order - OrderPayment addPaymentToOrder(Order order, OrderPayment payment, Referenced securePaymentInfo)
order - payment - securePaymentInfo - - null if it doesn't existOrder 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 - PricingExceptionOfferMaxUseExceededExceptionOrder addOfferCodes(Order order, List<OfferCode> offerCodes, boolean priceOrder) throws PricingException, OfferMaxUseExceededException
order - offerCodes - priceOrder - PricingExceptionOfferMaxUseExceededExceptionOrder removeOfferCode(Order order, OfferCode offerCode, boolean priceOrder) throws PricingException
order - offerCode - priceOrder - PricingExceptionOrder 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 confirmOrderItem 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 - PricingExceptionOrder addItem(Long orderId, OrderItemRequestDTO orderItemRequestDTO, boolean priceOrder) throws AddToCartException
addItemWithPriceOverrides(Long, OrderItemRequestDTO, boolean) in that it
will clear any values set on the OrderItemRequestDTO for the overrideSalePrice or overrideRetailPrice.
This design is intended to ensure that override pricing is not called by mistake. Implementors should
use this method when no manual price overrides are allowed.orderId - orderItemRequest - priceOrder - WorkflowExceptionThrowableAddToCartExceptionOrderItemRequestDTOOrder addItemWithPriceOverrides(Long orderId, OrderItemRequestDTO orderItemRequestDTO, boolean priceOrder) throws AddToCartException
addItem(Long, OrderItemRequestDTO, boolean) method, this method allows
the passed in OrderItemRequestDTO to contain values for the overrideSale or overrideRetail
price fields.
This design is intended to ensure that override pricing is not called by mistake. Implementors should
use this method when manual price overrides are allowed.orderId - orderItemRequest - priceOrder - WorkflowExceptionThrowableAddToCartExceptionOrderItemRequestDTOOrder updateItemQuantity(Long orderId, OrderItemRequestDTO orderItemRequestDTO, boolean priceOrder) throws UpdateCartException, RemoveFromCartException
orderId - orderItemRequest - priceOrder - UpdateCartExceptionRemoveFromCartExceptionOrderItemRequestDTOOrder 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 - RemoveFromCartExceptionAddToCartExceptionOrder addItemFromNamedOrder(Order namedOrder, OrderItem orderItem, int quantity, boolean priceOrder) throws RemoveFromCartException, AddToCartException, UpdateCartException
namedOrder - orderItem - quantity - priceOrder - RemoveFromCartExceptionAddToCartExceptionUpdateCartExceptionaddItemFromNamedOrder(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 - RemoveFromCartExceptionAddToCartExceptionvoid removeAllPaymentsFromOrder(Order order)
order - void removePaymentsFromOrder(Order order, PaymentType paymentInfoType)
order - paymentInfoType - void removePaymentFromOrder(Order order, OrderPayment paymentInfo)
order - paymentInfo - void deleteOrder(Order cart)
Order removeInactiveItems(Long orderId, boolean priceOrder) throws RemoveFromCartException
RemoveFromCartExceptionOrder updateProductOptionsForItem(Long orderId, OrderItemRequestDTO orderItemRequestDTO, boolean priceOrder) throws UpdateCartException
orderId - orderItemRequestDTO - priceOrder - UpdateCartExceptionvoid printOrder(Order order, org.apache.commons.logging.Log log)
order - the order to debuglog - the Log to use to print a debug-level messagevoid preValidateCartOperation(Order cart)
cart - Copyright © 2015. All Rights Reserved.