Skip to content

How to Export Orders, Customers, and Galleries

The Exports add-on lets you download your order, customer, and gallery data as CSV or XML files. This is useful for importing data into accounting software, fulfillment systems, CRM platforms, or spreadsheets.

Getting Started

Once the Exports add-on is installed, go to Sunshine > Exports in your WordPress admin. You'll see tabs for each export type: Orders, Customers, and Galleries.

Every export type includes a File Format option at the bottom where you can choose between CSV and XML output. CSV is the default and works with most spreadsheet and accounting applications. XML is available for systems that require structured XML data.

After configuring your options and clicking the export button, a progress bar shows the file being built. When complete, a download link appears.

Previously exported files are available under the Past Exports tab.

Exporting Orders

The order export includes detailed information about each order: order number, date, status, totals, customer info, shipping and billing addresses, payment method, and line items.

Filtering Options

  • Line Item Format — Controls how products appear in the export (see below)
  • Order Status — Select which order statuses to include (all are checked by default)
  • Dates — Filter by a start and/or end date
  • Gallery — Limit to orders from a specific gallery (includes all child galleries)

Line Item Formats

Choose how line items are organized in your export:

  • Combined (default) — One row per order. All products are listed together in a single "Products" column, separated by commas. Best for a simple overview of orders.
  • Separate Rows — One row per line item. Order information is repeated on each row. Best for analyzing individual items or importing into systems that expect one product per row.
  • Separate Columns — One row per order. Each product gets its own set of columns (Product 1 Name, Product 1 Qty, Product 2 Name, etc.). The number of columns adjusts automatically based on the order with the most items.

Order Fields

Each order row includes: Mode, Order ID, Order Number, Order Date, Order Status, Subtotal, Tax, Discounts, Shipping Cost, Total, Shipping/Delivery Method, Payment Method, First Name, Last Name, Email, Phone, VAT Number, product information (varies by format), shipping address, billing address, and customer notes.

The VAT Number column uses your configured VAT label from Sunshine settings. If you haven't set a custom label, it defaults to "EU VAT Number."

Exporting Customers

The customer export provides a list of all registered customers along with their order history summary.

Filtering Options

  • Registration Dates — Filter by a start and/or end date based on when the customer registered

Customer Fields

Each customer row includes: Customer ID, First Name, Last Name, Favorites Count, Order Count, Order Totals, Email, Phone, Shipping Address, and Billing Address.

Exporting Galleries

The gallery export gives you a complete list of all your galleries with their configuration details.

Filtering Options

  • Dates — Filter by gallery creation date

Gallery Fields

Each gallery row includes: Gallery ID, Gallery Name, Gallery URL, Date Created, Image Count, Gallery Type, Access Type, Access Code, Access Code Hint, Expiration Date, Price Level, and Email Addresses.

Hooks and Filters

sunshine_export_order_headers

Add custom columns to the order export header row.

add_filter( 'sunshine_export_order_headers', function( $headers ) {
    $headers[] = 'My Custom Field';
    return $headers;
});

Learn how to add this custom code to your WordPress website

sunshine_export_order_row

Add data to each order row in the export. Use this alongside sunshine_export_order_headers to populate your custom column.

add_filter( 'sunshine_export_order_row', function( $row, $order ) {
    $row[] = $order->get_meta_value( 'my_custom_field' );
    return $row;
}, 10, 2 );

Learn how to add this custom code to your WordPress website

sunshine_export_order_item_row

Same as above but only fires in the "Separate Rows" format, giving you access to the individual line item as well.

add_filter( 'sunshine_export_order_item_row', function( $row, $order, $item ) {
    $row[] = $item->get_meta_value( 'my_custom_field' );
    return $row;
}, 10, 3 );

Learn how to add this custom code to your WordPress website

sunshine_export_gallery_headers

Add custom columns to the gallery export header row.

add_filter( 'sunshine_export_gallery_headers', function( $headers ) {
    $headers[] = 'My Custom Field';
    return $headers;
});

Learn how to add this custom code to your WordPress website

sunshine_export_gallery_row

Add data to each gallery row in the export.

add_filter( 'sunshine_export_gallery_row', function( $row, $gallery ) {
    $row[] = $gallery->get_meta_value( 'my_custom_field' );
    return $row;
}, 10, 2 );

Learn how to add this custom code to your WordPress website

sunshine_export_xml_tags

Customize the XML tag names used when exporting in XML format. By default, header labels are converted to lowercase underscore format (e.g., "Order ID" becomes order_id).

add_filter( 'sunshine_export_xml_tags', function( $tags, $export_id ) {
    if ( 'orders' === $export_id ) {
        $tags['Order Total'] = 'total_amount';
    }
    return $tags;
}, 10, 2 );

Learn how to add this custom code to your WordPress website

sunshine_export_history_max_files

Control how many past export files are kept. Defaults to 10. Older files beyond this limit are automatically deleted.

add_filter( 'sunshine_export_history_max_files', function( $max ) {
    return 20;
});

Learn how to add this custom code to your WordPress website

Still need help?

If you have not yet found your answer in the documentation articles, please contact support

Sunshine Photo Cart for WordPress