Created
March 9, 2018 15:06
-
-
Save woogists/133824c30938218ea23c58ae9d61870f to your computer and use it in GitHub Desktop.
[WooCommerce Drip] This filter allows you to customize the subscriber custom fields sent to Drip. This is an example of sending the first and last names instead of a general full name:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'wcdrip_custom_fields', 'drip_add_first_last_fields', 10, 5 ); | |
function drip_add_first_last_fields( $filters, $email, $lifetime_value, $products, $order ) { | |
unset( $filters['name'] ); | |
$filters['first_name'] = $order->billing_first_name; | |
$filters['last_name'] = $order->billing_last_name; | |
return $filters; | |
} |
Hi, Im using the filter wcdrip_custom_fields in order to send custom values to drip. But one thing that I noticed is that this only works if a returning customer has purchased a product from my site. But if the customer purchases something for the very first time the custom info is not sent to drip.
Any help?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If I'm looking to grab an additional field that is a checkbox, how would I do that to pass along into Drip as a custom field?
I'm testing this along with the
first_name
and it's not storing the first_name either, so either this no longer works or I'm not doing something correctly.Any thoughts/help would be appreciated, thank you in advance!