Code snippets allow you to override the default behavior of Store Exporter Deluxe by hooking into the Plugin code.
Add a custom User field to the Orders export type
To add a custom User field that uses the User ID linked to individual Orders within the Orders export type add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdd a single Order export field with all Billing or Shipping address details
To add a single custom Order field that collates all of the Billing or Shipping address details add the following PHP snippets to your current WordPress Theme’s functions.php file. Note: If you are applying both PHP snippets use different PHP function names, if you need help reach out on Support. Billing address fields View Code Shipping address fields View CodeAdding a custom Last Modified field to the Orders export type
To add a custom Last Modified Order field within the Orders export type add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdding a custom Order filter to the Edit Scheduled Export screen
To add a new custom Order Filter to the Edit Scheduled Export screen add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdding a custom Order filter to the Orders export type
You can add your own Order filters (e.g. Filter Orders by Shipping Postcode) the Orders export by hooking into our exposed WordPress Actions and Filters. To add a custom Order filter to the Order export type in Store Exporter Deluxe add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdding a custom Product filter to the Edit Scheduled Export screen
To add a new custom Product Filter to the Edit Scheduled Export screen add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdding a custom Subscription field to the Subscriptions export type
To add a custom Subscription field within the Subscriptions export type add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdding a Custom Term Taxonomy-linked export field to the Products export type
To add a new Custom Term Taxonomy-linked export field to the Products export type in Store Exporter Deluxe add the following PHP snippet to your current WordPress Theme’s functions.php file replacing $term_taxonomy with the Custom Term Taxonomy name of your choosing: View Code Here's a extended example of adding multiple Custom Term Taxonomy-linked export fields to the Products export type from different Custom Term Taxonomies (that's a mouthful): View CodeAdding a custom Term Taxonomy-linked export field to the Users export type
To add a new Custom Term Taxonomy-linked export field to the Users export type in Store Exporter Deluxe add the following PHP snippet to your current WordPress Theme’s functions.php file replacing $term_taxonomy with the Custom Term Taxonomy name of your choosing: View CodeAdding custom Order Item fields to the Order export type
This code snippet builds on Adding static Order Item fields to the Orders export type, now we will add a dynamic custom Order Item field to the Order export type. The custom Order Item meta that we want to export is saved against the Order Item with a meta name of "departure_date". You can use Store Toolkit for WooCommerce to easily expose custom Order and Order Item meta assigned to Orders. Note: You need to declare each of the different Order Items Formatting rules with the "unique" Order Items Formatting rule being the most complex, if you don't use the "unique" rule then it can be ignored for simplicity. View CodeAdding static Order fields to the Orders export type
Our Store Exporter Deluxe > Usage document explains how to add custom export fields to the Product export type, this same technique can add custom export fields to other export types except Orders. This tutorial will explain how to add a static export field to the Order export type. The Orders export type is made up of two types of export fields:- Order fields - Export fields related to the Order
- Order Item fields - Export fields related to the Order Items that make up an Order
Adding a single static Order field
To add a new static Order field add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdding multiple static Order fields
To add multiple static Order fields add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdding static Order Item fields to the Orders export type
Following up from our last Store Exporter Deluxe snippet about Adding static Order fields to the Orders export type we will add a static Order Item field to the Orders export type. The 3 different Order Items Formatting rules (combined, individual and unique) require different WordPress Filters to be accessed in order to correctly format the export. We will cover each Order Items Formatting option separately; starting with the simplest. First let's add the static Order Item field to the Order fields list before looking at each Order Items Formatting rule. View CodePlace Order Items within a grouped single Order row (combined)
Add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodePlace each Order Item within their own Order row (individual)
Add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodePlace Order Items on individual cells within a single Order row (unique)
Add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAdding static Product fields to the Product export type
To add a new static Product field to the Products export type in Store Exporter Deluxe add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeAllow partial Order refunds to populate the Refund Date column in Order exports
By default the Refund Date column within the Order export type is only populated on fully refunded Orders, to override this behaviour to include any partial Order refund add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeChange the default WooCommerce currency delimiter and thousand separator in exports
By default export columns that contains currencies are formatted using the WooCommerce currency settings, to override this behaviour add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeChanging the e-mail subject and content of Scheduled Exports
By default, Store Exporter Deluxe includes the following e-mail subject and content text in Scheduled Exports making use of the "Send as e-mail" Export method. Subject: Daily Product stock levels Content: Please find attached your export ready to review. The e-mail subject can be edited within the Edit Scheduled Export screen but to modify the Content element you'll need to hook into our exposed WordPress Filter. I have made a task to include a text field on the Edit Scheduled Export > Method tab to edit this content just like the e-mail subject field above. Add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeCreating a custom WordPress Plugin to extend Store Exporter Deluxe
This tutorial will show you how to create a custom WordPress Plugin that extends the Store Exporter Deluxe Plugin without making changes to your Theme or Child Theme's functions.php file. This solution is strongly recommended where a Child Theme is not in use. The action within this tutorial removes the first part of the Order Items: Product Name export column's contents where this store has setup their Product Name to have a '/' (forward slash) to separate Product Name details (e.g. Store Exporter Deluxe / WooCommerce where only Store Exporter Deluxe is required). You can replace the action within this Custom Add-on Plugin with any Code Snippet available on this website.The code snippet
View CodeGeneral instructions
Here's how we do it:- Connect to your WordPress site using your preferred FTP/SFTP manager
- Navigate to the /wp-content/plugins/... directory
- Create a new directory named 'woocommerce-store-exporter-deluxe-custom'
- Open the 'woocommerce-store-exporter-deluxe-custom' directory
- Create a new file named 'custom.php'
- Edit the 'custom.php' file with your preferred file editor
- Paste the contents of the code snippet at the top of this tutorial
- Save the modified file and upload the file changes
- Open the WordPress Administration of your WordPress site
- Open the Plugins screen from the Plugins sidebar menu
- Scroll down to 'WooCommerce - Store Exporter Deluxe (Custom Add-on)'
- Click Activate to activate this custom Plugin add-on
Disable Product Attributes support within Store Exporter Deluxe
You can disable Product Attributes support within Store Exporter Deluxe when diagnosing export issues related to PHP form field limitations. Add the following PHP snippets to your current WordPress Theme’s functions.php file to disable Product Attributes support within Store Exporter Deluxe. This will hide all export fields across all Export Types related to Product Attributes and is handy in store's with a large volume of Global Attributes. View CodeEmbed Featured Image thumbnails in Product exports
There's an easter egg in Store Exporter Deluxe that only select beta testers have known about. It's come time to share this new Product export field with the community as it's received very positive feedback since it's quiet introduction and will be listed as "Featured Image (Embed)" in the 2.1.2 minor Plugin update due this fortnight. Include embedded Featured Image Product thumbnails within XLSX exports by adding the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeExport all field data in uppercase characters
To force all export data to be in uppercase characters add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeFlush the Extra Product Options export fields Transient in Store Exporter Deluxe
By default Store Exporter Deluxe refreshes it's list of known Extra Product Option (EPO) export fields hourly, you can force refresh this on demand by clicking "Refresh counts" from the Export Types section on the Quick Export screen but you may wish to do this programmatically. The following PHP snippet will clear the Transient and on the next screen refresh of the Quick Export screen this list will be re-generated. Add the following PHP snippet to your Child Theme's functions.php file: View CodeInclude Quantity and Cost details in TM Extra Product Options columns
By default the Order export type includes the TM Extra Product Options value detail in the export column. To include the Quantity and Cost details that can also be assigned to an Order Item by TM Extra Product Options add the following PHP snippet to your current WordPress Theme’s functions.php file: View CodeModify the Order Items export to show individual Product quantity per row
To export individual Order Items per row, divided by quantity add the following PHP snippet to your current WordPress Theme’s functions.php file. View CodeOverride the default %date% and %time% export filename Tags
By default Store Exporter Deluxe uses the following PHP date and time formats to populate the %date% and %time% filename Tags when generating the export filename:- %date% - Y_m_d
- %time% - H_i_s