Hey @villdaniel,
Thank you for reaching out! Currently, this is not possible out of the box.
However, I believe that I may be able to help you out with this via custom code.
Can you please let me know which eCommerce plugin your client is using?
Thank you and best wishes,
Mihai
Hi Mihai,
Thank you!
My client is using WooCommerce and WooCommerce Subscriptions are also in place.
Daniel
Hey @villdaniel,
I believe the following code should help:
function slicewp_custom_list_table_columns_affiliate_account_commissions( $columns ) {
$columns = _slicewp_array_assoc_push_after_key( $columns, 'amount', array( 'customer' => 'Customer' ) );
return $columns;
}
add_filter( 'slicewp_list_table_columns_affiliate_account_commissions', 'slicewp_custom_list_table_columns_affiliate_account_commissions' );
function slicewp_custom_list_table_row_item_affiliate_account_customers( $item ) {
if ( empty( $item['reference'] ) ) {
return $item;
}
$order = wc_get_order( $item['reference'] );
if ( empty( $order ) ) {
return $item;
}
$item['customer'] = $order->get_billing_first_name() . ' ' . $order->get_billing_last_name();
return $item;
}
add_filter( 'slicewp_list_table_row_item_affiliate_account_commissions', 'slicewp_custom_list_table_row_item_affiliate_account_customers' );
The code does the following:
- Registers a new column, named “Customer”, in the commissions table from the affiliate’s account.
- Outputs the customer data saved in the WooCommerce order that is linked to the commission.
I believe the code could help with this particular scenario your client needs.
Please add the code to your client’s website and let me know how it goes.
Thank you and best wishes,
Mihai
Hi Mihai,
Thank you very much. It works just as you described.
Daniel
Hey @villdaniel,
Awesome! I’m happy to hear the code worked as intended! 😃
Best wishes,
Mihai