use of org.broadleafcommerce.core.order.extension.PostUpdateOrderExtensionHandler in project BroadleafCommerce by BroadleafCommerce.
the class MergeOrdersByEmailPostRegistrationObserver method processRegistrationEvent.
@Override
public void processRegistrationEvent(Customer customer) {
List<Order> orders = orderService.findOrdersByEmail(customer.getEmailAddress());
List<Order> updOrders = new ArrayList<>();
for (Order o : orders) {
if (!o.getCustomer().isRegistered()) {
o.setCustomer(customer);
updOrders.add(o);
}
}
List<PostUpdateOrderExtensionHandler> handlers = extensionManager.getHandlers();
for (PostUpdateOrderExtensionHandler h : handlers) {
ExtensionResultStatusType status = h.postUpdateAll(updOrders);
if (!extensionManager.shouldContinue(status, null, null, null)) {
break;
}
}
}
Aggregations