Access transaction data in 'wpsc_purchase_log_admin_notification_address' hook
-
Hi,
I need to set up a way that chooses which admin email the transaction notification should be sent to.
Basically, I have a “department” checkout form field (https://media.mosaika.fr/fF5f) and based on the value of this department field, I choose to send the admin order notification to [email protected] or [email protected] email.
I found precious hooks (thanks for that !) in the notification class, but i CAN’T access any precious data due to the fact that properties are private or protected.
function msk_conditional_email_on_purchase($email, $transaction) { //write_log($transaction); //$form_data = new WPSC_Checkout_Form_Data( $transaction->purchase_log['id']); $purchase_log = $transaction->get_purchase_log(); write_log('---------------------------------------'); write_log($transaction); write_log($purchase_log); write_log('---------------------------------------'); } add_filter('wpsc_purchase_log_admin_notification_address', 'msk_conditional_email_on_purchase', 10, 2);
What’s the easiest way to get the transaction ID so I can finally access checkout form data ? I’m stuck with a lot of
Cannot access private property WPSC_Purchase_Log
fatal errors :/I’d really appreciate your help.
Thanks a lot !
- The topic ‘Access transaction data in 'wpsc_purchase_log_admin_notification_address' hook’ is closed to new replies.