Hello
Please, follow to https://docs.algolplus.com/algol_order_export/fields/
add field affiliate_id
use this code
add_filter( "woe_fetch_order", function($row, $order ){
global $wpdb;
$custom = maybe_unserialize( $wpdb->get_var( "SELECT custom FROM {$wpdb->prefix}affiliate_wp_referrals WHERE context='woocommerce' AND reference=".$order->get_id() ) );
if($custom){
$row["affiliate_id"]= $custom['mla']['args']['affiliate_id']; //EDIT
}
return $row;
},10,2);
Warning, this reply is 2-3 years old!
if it won’t work – please, submit Affiliate WP plugin as new ticket to https://algolplus.freshdesk.com/
Hi @algolplus
Thanks to you yes still work with a little bit of customization and change in code.
Add my custom SQL statement and joined with other table manage to pull all the info I needed