Your cart is currently empty!
Add affiliates column to woocommerce
—
by
Do you happen to have php code on how to add an Affiliates column to WooCommerce orders? I’d like to be able to see which affiliate is associated with each order by adding a column that shows the affiliate’s “organization” – a custom field from the registration form – in a new column on the WooCommerce orders page. If I can’t use “organization”, I’d be happy with displaying the Affiliate’s ID. Thanks!
Posted in Affiliates Pro
Comments
One response to “Add affiliates column to woocommerce”
Hi Eric,
Thanks for using our plugin.
I’m afraid I don’t have something equivalent but this implementation consists of two parts.
The first part has to do with the columns in the orders list and new columns can be added with the following hooks:
add_filter( ‘manage_edit-shop_order_columns’, ‘custom_shop_order_column’, 10 ); which is responsible for adding new columns and
add_action( ‘manage_shop_order_posts_custom_column’ , ‘custom_orders_list_column_content’, 10, 2 ); which is responsible for adding data to the new columns.
As for the second part you need to get the referrals and based on the order id involved in each referral you should get the affiliate and the rest of the data you need.
Kind regards,
George