Search in sources :

Example 1 with IllegalCartOperationException

use of org.broadleafcommerce.core.order.service.exception.IllegalCartOperationException in project BroadleafCommerce by BroadleafCommerce.

the class BroadleafCheckoutController method preValidateCartOperation.

protected void preValidateCartOperation(Model model) {
    try {
        Order cart = CartState.getCart();
        orderService.preValidateCartOperation(cart);
    } catch (IllegalCartOperationException ex) {
        model.addAttribute("cartRequiresLock", true);
    }
}
Also used : Order(org.broadleafcommerce.core.order.domain.Order) IllegalCartOperationException(org.broadleafcommerce.core.order.service.exception.IllegalCartOperationException)

Example 2 with IllegalCartOperationException

use of org.broadleafcommerce.core.order.service.exception.IllegalCartOperationException in project BroadleafCommerce by BroadleafCommerce.

the class OrderServiceImpl method preValidateCartOperation.

@Override
public void preValidateCartOperation(Order cart) {
    ExtensionResultHolder erh = new ExtensionResultHolder();
    extensionManager.getProxy().preValidateCartOperation(cart, erh);
    if (erh.getThrowable() instanceof IllegalCartOperationException) {
        throw ((IllegalCartOperationException) erh.getThrowable());
    } else if (erh.getThrowable() != null) {
        throw new RuntimeException(erh.getThrowable());
    }
}
Also used : IllegalCartOperationException(org.broadleafcommerce.core.order.service.exception.IllegalCartOperationException) ExtensionResultHolder(org.broadleafcommerce.common.extension.ExtensionResultHolder)

Example 3 with IllegalCartOperationException

use of org.broadleafcommerce.core.order.service.exception.IllegalCartOperationException in project BroadleafCommerce by BroadleafCommerce.

the class OrderServiceImpl method preValidateUpdateQuantityOperation.

@Override
public void preValidateUpdateQuantityOperation(Order cart, OrderItemRequestDTO dto) {
    ExtensionResultHolder erh = new ExtensionResultHolder();
    extensionManager.getProxy().preValidateUpdateQuantityOperation(cart, dto, erh);
    if (erh.getThrowable() instanceof IllegalCartOperationException) {
        throw ((IllegalCartOperationException) erh.getThrowable());
    } else if (erh.getThrowable() != null) {
        throw new RuntimeException(erh.getThrowable());
    }
}
Also used : IllegalCartOperationException(org.broadleafcommerce.core.order.service.exception.IllegalCartOperationException) ExtensionResultHolder(org.broadleafcommerce.common.extension.ExtensionResultHolder)

Aggregations

IllegalCartOperationException (org.broadleafcommerce.core.order.service.exception.IllegalCartOperationException)3 ExtensionResultHolder (org.broadleafcommerce.common.extension.ExtensionResultHolder)2 Order (org.broadleafcommerce.core.order.domain.Order)1