Class DiscountValueCleanupMethodHook
java.lang.Object
de.hybris.platform.couponservices.order.hooks.DiscountValueCleanupMethodHook
- All Implemented Interfaces:
CommercePlaceOrderMethodHook
-
Constructor Summary
ConstructorsConstructorDescriptionDiscountValueCleanupMethodHook(ModelService modelService, ActionUtils actionUtils, CalculationService calculationService) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterPlaceOrder(CommerceCheckoutParameter parameter, CommerceOrderResult orderModel) Executed after the place ordervoidbeforePlaceOrder(CommerceCheckoutParameter parameter) Executed before the place ordervoidbeforeSubmitOrder(CommerceCheckoutParameter parameter, CommerceOrderResult result) Executed before the submit orderprotected voidRecalculate cart after removed invalid discount values and return user to place order page with an error message
-
Constructor Details
-
DiscountValueCleanupMethodHook
public DiscountValueCleanupMethodHook(ModelService modelService, ActionUtils actionUtils, CalculationService calculationService)
-
-
Method Details
-
afterPlaceOrder
public void afterPlaceOrder(CommerceCheckoutParameter parameter, CommerceOrderResult orderModel) throws InvalidCartException Description copied from interface:CommercePlaceOrderMethodHookExecuted after the place order- Specified by:
afterPlaceOrderin interfaceCommercePlaceOrderMethodHook- Parameters:
parameter- object containing all the information for checkoutorderModel- object containing the order model- Throws:
InvalidCartException
-
beforePlaceOrder
Description copied from interface:CommercePlaceOrderMethodHookExecuted before the place order- Specified by:
beforePlaceOrderin interfaceCommercePlaceOrderMethodHook- Parameters:
parameter- object containing all the information for checkout- Throws:
InvalidCartException
-
beforeSubmitOrder
public void beforeSubmitOrder(CommerceCheckoutParameter parameter, CommerceOrderResult result) throws InvalidCartException Description copied from interface:CommercePlaceOrderMethodHookExecuted before the submit order- Specified by:
beforeSubmitOrderin interfaceCommercePlaceOrderMethodHook- Parameters:
parameter- object containing all the information for checkoutresult- object containing the order model- Throws:
InvalidCartException
-
getModelService
-
getActionUtils
-
getCalculationService
-
recalculateCartWithoutInvalidDiscountValues
protected void recalculateCartWithoutInvalidDiscountValues(CartModel cart) throws InvalidCartException Recalculate cart after removed invalid discount values and return user to place order page with an error message- Parameters:
cart- the cart without invalid discount values- Throws:
InvalidCartException- let the process return to place order page with an error message
-