FAQ

  • The schedule doesn’t run at defined time.
    Follow this article  and replace WordPress cron with real cron.
  • I haven’t received any emails.
    Did you choose option “Since Last Run”?
    You will get only new orders in this case, so you should create test order to get the email.

Check Helpdesk to see more solutions…


Hooks/filters

  • We display settings to export orders/items/coupons. So there are following filters
    woe_get_order_fields,woe_get_order_coupon_fields,woe_get_order_product_fields

    Example: we add usermeta field to interface
    add_filter( 'woe_get_order_fields', function( $fields,$format ) { 
      $fields['first_name'] = array(
       'segment'=>'user',
       'label'=>'User Meta Key',
       'colname'=>'User Meta Key',
       'value'=>'',
       'checked'=>1
      );
      return $fields;
    } , 10, 2);

     

  • Each column can be modified by filter before output.
    Hook names depend on type of field  and field name
    for order  – woe_get_order_coupon_value_{$field}
    for product  – woe_get_order_product_value_{$field}
    for coupon  – woe_get_order_value_{$field}
    Switch to “JSON” format to see $field for columns

    Example: we fill usermeta field  
    add_filter('woe_get_order_value_first_name',function( $value,$order ) {
      $user_id = $order->get_user_id();
      return get_user_meta($user_id, 'first_name', true); 
    }
    , 10, 2 );

     

  • It’s possible to filter  row before output using filter woe_fetch_order_row

    Example: we skip rows if order total less than $100 
    add_filter( 'woe_fetch_order_row', function( $row,$order_id ) { 
     return ($row['order_total']<100) ? false : $row;
    } , 10, 2);

     

  • There are extra filters to format final text before output
    woe_xls_output_filter, woe_csv_output_filter, woe_xml_output_filter, woe_json_output_filter

    Example: we add namespace "ns2:" to all tags
    add_filter( 'woe_xml_output_filter', function( $xml, $rec  ) { 
      // for <test> 
      $xml = preg_replace( '/(?<=\<)([^\/].*?)(?=\>)/', 'ns2:$1', $xml);
      // for </test>
     $xml = preg_replace( '/(?<=\<\/)(.*?)(?=\>)/', 'ns2:$1', $xml); 
     return $xml; } , 10, 2);

More examples here