コード例 #1
0
  @Override
  public List<Map<String, Object>> createRows(final OrderModel order) {
    final Map<String, Object> row = new HashMap<>();

    row.put(OrderCsvColumns.ORDER_ID, order.getCode());
    row.put(OrderCsvColumns.DATE, order.getDate());
    row.put(OrderCsvColumns.ORDER_CURRENCY_ISO_CODE, order.getCurrency().getIsocode());
    final DeliveryModeModel deliveryMode = order.getDeliveryMode();
    row.put(OrderCsvColumns.DELIVERY_MODE, deliveryMode != null ? deliveryMode.getCode() : "");
    row.put(OrderCsvColumns.BASE_STORE, order.getStore().getUid());
    return Arrays.asList(row);
  }
コード例 #2
0
  protected boolean checkDeliveryOptions(final OrderModel order) {
    if (order.getDeliveryMode() == null) {
      // Order must have an overall delivery mode
      return false;
    }

    if (order.getDeliveryAddress() == null) {
      for (final AbstractOrderEntryModel entry : order.getEntries()) {
        if (entry.getDeliveryPointOfService() == null && entry.getDeliveryAddress() == null) {
          // Order and Entry have no delivery address and some entries are not for pickup
          return false;
        }
      }
    }

    return true;
  }