wpf_ecommerce_order_args

#Overview

This filter is run by the Enhanced Ecommerce addon before the order data is passed to the CRM for processing. It can be used to override the order details that are synced to the CRM.

To use the code examples below, add them to your active theme’s functions.php file.

#Parameters

  • $order_args: An array of order data:
    • order_label: The label, for example “WooCommerce Order #123”
    • order_number: The order umber, for example 123
    • order_edit_link: The link to edit the order in the admin
    • payment_method: The payment method
    • products: An array of products and their prices
    • line_items: An array of line items (discounts, shipping, etc) and their amounts
    • total: The order total
    • currency: The order currency
    • currency_symbol: The order currency symbol
    • order_date: The order date
    • provider: The plugin source, for example woocommerce or easy-digital-downloads
    • status: The order status
    • user_id: The user ID who placed the order, 0 for guest
    • user_email: The customer email address
  • $order_id: The ecommerce order ID

#Examples

#Override order label

This example overrides the order label that’s synced to the CRM.

function alt_emails_for_attendees( $order_args, $order_id ) {

	$order_args['order_label'] = 'Custom Label, Order #' . $order_args['order_number'];

	return $order_args;

}

add_filter( 'wpf_ecommerce_order_args', 'override_order_label', 10, 2 );

Was this helpful?