+92-322-4028612 sales@najeebmedia.com

How to export PPOM order fields

Here we setup a quick tutorial to export PPOM fields in order using Advanced Order Export For WooCommerce plugin. Make sure you have install it follow see these steps:

  1. Go to Export order main setting page under WooCommerce like in screenshot-1
  2. On same page you will see ‘Setup fields to export‘ (screenshot-1)
screenshot-1

screenshot-1

3. On next page, scroll down to Products and click ‘Setup fields to export’ like screenshot-2

screenshot-2

4. In popup  select see option ‘Order item fields’. Under this drop down you will all fields created by PPOM like in screenshot-3

screenshot-3

5. You can add all/required PPOM fields into order for export.

6. Save Settings.

How to display radio,select and checkbox input value in strings

Since version 12.6, all options (radio,select and checkbox) values are saved in json. But we display in orders/email using hooks to make it readable. To get same view in exports you need to add following code inside your functions.php file:

add_filter("woe_fetch_order", 'ppom_convert_option_json_to_string', 10, 2);
function ppom_convert_option_json_to_string($row, $order) {
    
    $new_row = array();
    foreach($row as $key => $value) {
        
        // Scanning only key prefix products_
        if (strpos($key, 'products_') !== false) {
            
            $row[$key] = apply_filters('ppom_order_display_value', $value);
        }
    }
    return $row;
}