wpf_woocommerce_payment_complete

wpf_woocommerce_payment_complete

#Overview
This action is triggered whenever WP Fusion has completed processing a WooCommerce order
#Parameters

$order_id: (int) The order ID
$contact_id: (string) The contact ID that was created or updated at checkout

#Examples
#Send a custom field to your CRM
The example below will update a custom field in the CRM (with key order_total) with the order total after an order has been placed.
function my_woo_payment_complete( $order_id, $contact_id ) {

$order = wc_get_order( $order_id );

$update_data = array( 'order_total' => $order->get_total() );

wp_fusion()->crm->update_contact( $contact_id, $update_data, false );

}

add_action( 'wpf_woocommerce_payment_complete', 'my_woo_payment_complete', 10, 2 );

#Was this helpful?

Let us know if you liked the post. That』s the only way we can improve.

Yes

No

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注