@Override @Transactional("blTransactionManager") public void deleteOrder(Order order) { orderMultishipOptionService.deleteAllOrderMultishipOptions(order); orderDao.delete(order); }
public List<OrderMultishipOption> getMultiShipOptions() { Order cart = CartState.getCart(); if (!isNullOrder(cart)) { return orderMultishipOptionService.getOrGenerateOrderMultishipOptions(cart); } return new ArrayList<>(); }
EasyMock.expect(fgItemDaoMock.save(EasyMock.isA(FulfillmentGroupItem.class))).andAnswer(OfferDataItemProvider.getSaveFulfillmentGroupItemAnswer()).anyTimes(); EasyMock.expect(multishipOptionServiceMock.findOrderMultishipOptions(EasyMock.isA(Long.class))).andAnswer(new IAnswer<List<OrderMultishipOption>>() { multishipOptionServiceMock.deleteAllOrderMultishipOptions(EasyMock.isA(Order.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(fgServiceMock.collapseToOneShippableFulfillmentGroup(EasyMock.isA(Order.class), EasyMock.eq(false))).andAnswer(OfferDataItemProvider.getSameOrderAnswer()).anyTimes();
@Override @Transactional("blTransactionManager") public Order matchFulfillmentGroupsToMultishipOptions(Order order, boolean priceOrder) throws PricingException { List<OrderMultishipOption> multishipOptions = orderMultishipOptionService.findOrderMultishipOptions(order.getId());
for (Long[] pack : request.getMultishipOptionsToDelete()) { if (pack[1] == null) { orderMultishipOptionService.deleteOrderItemOrderMultishipOptions(pack[0]); } else { orderMultishipOptionService.deleteOrderItemOrderMultishipOptions(pack[0], pack[1].intValue());
/** * Processes the given options for multiship. Validates that all options are * selected before performing any actions. Allows modules to add module specific shipping logic. * * @see #showMultiship(HttpServletRequest, HttpServletResponse, Model) * * @param request * @param response * @param model * @param orderMultishipOptionForm * @return a redirect to the checkout page * @throws PricingException * @throws ServiceException */ public String saveMultiship(HttpServletRequest request, HttpServletResponse response, Model model, OrderMultishipOptionForm orderMultishipOptionForm, BindingResult result) throws PricingException, ServiceException { Order cart = CartState.getCart(); orderMultishipOptionService.saveOrderMultishipOptions(cart, orderMultishipOptionForm.getOptions()); cart = fulfillmentGroupService.matchFulfillmentGroupsToMultishipOptions(cart, true); //Add module specific logic checkoutControllerExtensionManager.getProxy().performAdditionalShippingAction(); return getMultishipSuccessView(); }
orderMultishipOptionService.save(option);
EasyMock.expect(multishipOptionServiceMock.findOrderMultishipOptions(EasyMock.isA(Long.class))).andAnswer(new IAnswer<List<OrderMultishipOption>>() { multishipOptionServiceMock.deleteAllOrderMultishipOptions(EasyMock.isA(Order.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(fgServiceMock.collapseToOneShippableFulfillmentGroup(EasyMock.isA(Order.class), EasyMock.eq(false))).andAnswer(new IAnswer<Order>() {
EasyMock.expect(orderServiceMock.removeItem(EasyMock.isA(Long.class), EasyMock.isA(Long.class), EasyMock.eq(false))).andAnswer(OfferDataItemProvider.getRemoveItemFromOrderAnswer()).anyTimes(); EasyMock.expect(multishipOptionServiceMock.findOrderMultishipOptions(EasyMock.isA(Long.class))).andAnswer(new IAnswer<List<OrderMultishipOption>>() { @Override public List<OrderMultishipOption> answer() throws Throwable { multishipOptionServiceMock.deleteAllOrderMultishipOptions(EasyMock.isA(Order.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(fgServiceMock.collapseToOneShippableFulfillmentGroup(EasyMock.isA(Order.class), EasyMock.eq(false))).andAnswer(OfferDataItemProvider.getSameOrderAnswer()).anyTimes();
/** * Renders the multiship page. This page is used by the user when shipping items * to different locations (or with different FulfillmentOptions) is desired. * * Note that the default Broadleaf implementation will require the user to input * an Address and FulfillmentOption for each quantity of each DiscreteOrderItem. * * @param request * @param response * @param model * @return the return path */ public String showMultiship(HttpServletRequest request, HttpServletResponse response, Model model) { Customer customer = CustomerState.getCustomer(); Order cart = CartState.getCart(); model.addAttribute("orderMultishipOptions", orderMultishipOptionService.getOrGenerateOrderMultishipOptions(cart)); model.addAttribute("customerAddresses", customerAddressService.readActiveCustomerAddressesByCustomerId(customer.getId())); model.addAttribute("fulfillmentOptions", fulfillmentOptionService.readAllFulfillmentOptions()); return getMultishipView(); }
EasyMock.expect(fgItemDaoMock.save(EasyMock.isA(FulfillmentGroupItem.class))).andAnswer(OfferDataItemProvider.getSaveFulfillmentGroupItemAnswer()).anyTimes(); EasyMock.expect(multishipOptionServiceMock.findOrderMultishipOptions(EasyMock.isA(Long.class))).andAnswer(new IAnswer<List<OrderMultishipOption>>() { @Override public List<OrderMultishipOption> answer() throws Throwable { multishipOptionServiceMock.deleteAllOrderMultishipOptions(EasyMock.isA(Order.class)); EasyMock.expectLastCall().anyTimes(); EasyMock.expect(fgServiceMock.collapseToOneShippableFulfillmentGroup(EasyMock.isA(Order.class), EasyMock.eq(false))).andAnswer(OfferDataItemProvider.getSameOrderAnswer()).anyTimes();