Repeat data on each product line

When you choose to export each product (item data) on is own line, you might want to copy some data from the parent line. (For example, order ID).

To do that, you can use the qwep_data_to_repeat filter, and return the array of the data you want to repeat.

//columns to repeat for each item
add_filter('qwep_data_to_repeat', 'custom_columns_to_repeat');
function custom_columns_to_repeat()
{
	return array('id', 'status', 'order_date', 'billing_first_name', 'billing_last_name');
}

Here is the list of the pieces of data you can repeat :

General:

  • 'id'
  • 'status'
  • 'order_date',

Billing data:

  • 'billing_first_name'
  • 'billing_last_name'
  • 'billing_company'
  • 'billing_address_1'
  • 'billing_address_2'
  • 'billing_city'
  • 'billing_postcode'
  • 'billing_country'
  • 'billing_state'
  • 'billing_email'
  • 'billing_phone'

Shipping data:

  • 'shipping_first_name'
  • 'shipping_last_name'
  • 'shipping_company'
  • 'shipping_address_1'
  • 'shipping_address_2'
  • 'shipping_city'
  • 'shipping_postcode'
  • 'shipping_state'
  • 'shipping_country'

Payment, shipping and total:

  • 'shipping_method_title'
  • 'payment_method_title'
  • 'order_discount'
  • 'cart_discount'
  • 'order_tax'
  • 'order_shipping'
  • 'order_shipping_tax'
  • 'order_total'
  • 'order_tax_detail'
  • 'completed_date'

Others:

  • 'number_of_different_items'
  • 'total_number_of_items'