Skip to content

Commit

Permalink
feat: add user name to woocommerce data events (#3473)
Browse files Browse the repository at this point in the history
* feat: add user name to woocommerce data events

* fix: use correct object
  • Loading branch information
leogermani committed Oct 25, 2024
1 parent 0f1cc08 commit 2b57d27
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/data-events/class-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ public static function get_order_data( $order_id, $process_donations_only = fals
'product_id' => $product_id,
'client_id' => $order->get_meta( NEWSPACK_CLIENT_ID_COOKIE_NAME ),
],
'user_first_name' => $order->get_billing_first_name(),
'user_last_name' => $order->get_billing_last_name(),
];
}

Expand All @@ -85,6 +87,8 @@ public static function get_recurring_donation_data( $subscription ) {
'currency' => $subscription->get_currency(),
'recurrence' => empty( $recurrence ) ? 'once' : $recurrence,
'platform' => \Newspack\Donations::get_platform_slug(),
'user_first_name' => $subscription->get_billing_first_name(),
'user_last_name' => $subscription->get_billing_last_name(),
];
}
}

0 comments on commit 2b57d27

Please sign in to comment.