Advertisement
mbcreation

Quick Export : reorder columns

Aug 19th, 2014
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. // functions.php
  2.  
  3. function my_custom_csv_order($keys)
  4. {
  5.  
  6. /* to reorder : just change the order of the keys here.
  7. * except for the fields "others" : their position is fixed.
  8. */
  9.  
  10. $keys = array(
  11. //general
  12. 'id', 'status', 'order_date',
  13.  
  14. //billing infos
  15. 'billing_first_name', 'billing_last_name',
  16. 'billing_company', 'billing_address_1', 'billing_address_2','billing_city',
  17. 'billing_postcode', 'billing_country', 'billing_state', 'billing_email',
  18. 'billing_phone',
  19.  
  20. //shipping infos
  21. 'shipping_first_name', 'shipping_last_name',
  22. 'shipping_company', 'shipping_address_1', 'shipping_address_2',
  23. 'shipping_city', 'shipping_postcode', 'shipping_state', 'shipping_country',
  24.  
  25. //note
  26. 'customer_note',
  27.  
  28. //payment, shipping and total
  29. 'shipping_method_title', 'payment_method_title', 'order_discount',
  30. 'cart_discount', 'order_tax', 'order_shipping', 'order_shipping_tax',
  31. 'order_total', 'order_tax_detail', 'completed_date',
  32.  
  33. //others
  34. 'number_of_different_items',
  35. 'total_number_of_items',
  36. 'used_coupons',
  37. 'coupon_name',
  38. 'coupon_discount'
  39. );
  40.  
  41. return $keys;
  42. }
  43.  
  44. add_filter( 'wqep_included_order_keys_filter', 'my_custom_csv_order' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement