Class PromotionOrderChangeDeliveryModeAction

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable
    Direct Known Subclasses:
    GeneratedCachedPromotionOrderChangeDeliveryModeAction

    public class PromotionOrderChangeDeliveryModeAction
    extends GeneratedPromotionOrderChangeDeliveryModeAction
    PromotionOrderChangeDeliveryModeAction. Action to change the order delivery mode on the order to the specified value. Applying this action causes the delivery mode on the order to be changed to the specified delivery mode. The original delivery mode is stored on the order in the PreviousDeliveryMode attribute. Undoing this action restores the PreviousDeliveryMode back onto the order. If the delivery cost should be updated, please set the orderThresholdChangeDeliveryMode.updateDeliveryCost to true in the project.properties. This is valid for 4.4 or later versions.
    See Also:
    Serialized Form
    • Constructor Detail

      • PromotionOrderChangeDeliveryModeAction

        public PromotionOrderChangeDeliveryModeAction()
    • Method Detail

      • apply

        public boolean apply​(SessionContext ctx)
        Description copied from class: AbstractPromotionAction
        Apply the action to the order. Do not call AbstractOrder.recalculate() to update the totals as this disposes of all applied discounts and the promotions engine is unable to intercept the recalculate call to reinstate these.
        Specified by:
        apply in class AbstractPromotionAction
        Parameters:
        ctx - The hybris context
        Returns:
        true if discounts have been applied and calculateTotals needs to be called, false otherwise.
      • undo

        public boolean undo​(SessionContext ctx)
        Description copied from class: AbstractPromotionAction
        Unapply the action from the order.
        Specified by:
        undo in class AbstractPromotionAction
        Parameters:
        ctx - The hybris context
        Returns:
        true if discounts have been removed and calculateTotals needs to be called, false otherwise.
      • getValue

        public double getValue​(SessionContext ctx)
        Description copied from class: AbstractPromotionAction
        Get the total value of this action. For actions providing a discount this should be a positive value.
        Specified by:
        getValue in class AbstractPromotionAction
        Parameters:
        ctx - The hybris context
        Returns:
        The double value that is the value of this action