, fields: string[], rows?: string, format?: string}> */ public static function all(): array { $default_fields = Fields::default_keys(); $presets = [ [ 'key' => 'all', 'label' => __( 'All orders', 'modulary-export' ), 'description' => __( 'Every order, the essentials.', 'modulary-export' ), 'filters' => [ 'statuses' => [], 'date' => 'all', ], 'fields' => $default_fields, ], [ 'key' => 'last_30_days', 'label' => __( 'Last 30 days', 'modulary-export' ), 'description' => __( 'Recent orders for a quick look.', 'modulary-export' ), 'filters' => [ 'statuses' => [], 'date' => 'last_30_days', ], 'fields' => $default_fields, ], [ 'key' => 'completed_month', 'label' => __( 'Completed this month', 'modulary-export' ), 'description' => __( 'For bookkeeping and monthly reports.', 'modulary-export' ), 'filters' => [ 'statuses' => [ 'completed' ], 'date' => 'this_month', // By completion date: an order created last month and // completed this month belongs to this month's books. 'date_field' => 'completed', ], 'fields' => [ 'order_number', 'date_created', 'customer_name', 'customer_email', 'total', 'total_tax', 'payment_method' ], ], [ 'key' => 'products_last_month', 'label' => __( 'Products sold last month', 'modulary-export' ), 'description' => __( 'One row per product line, for your accountant or stock count.', 'modulary-export' ), 'filters' => [ 'statuses' => [ 'completed', 'processing' ], 'date' => 'last_month', ], 'rows' => 'item', // The accountant wants a spreadsheet: real numbers, no separator guessing. 'format' => Format::XLSX, 'fields' => [ 'order_number', 'date_created', 'customer_name', 'line_product', 'line_sku', 'line_quantity', 'line_total', 'total' ], ], [ 'key' => 'needs_shipping', 'label' => __( 'Needs shipping', 'modulary-export' ), 'description' => __( 'Processing orders with addresses and items.', 'modulary-export' ), 'filters' => [ 'statuses' => [ 'processing' ], 'date' => 'all', ], 'fields' => [ 'order_number', 'date_created', 'shipping_name', 'shipping_address', 'customer_phone', 'items', 'skus', 'shipping_method' ], ], ]; /** * Filter the preset list. Add-ons add their own one-click starting points * here. Merchants' saved templates are separate (see Templates). * * @param array> $presets Presets. */ return (array) apply_filters( 'modulary_export_presets', $presets ); } }