From 12c934682b27a99ec5cdb1fc11a5a329837074f8 Mon Sep 17 00:00:00 2001 From: Liam McArthur Date: Wed, 5 Apr 2017 16:25:51 +0100 Subject: [PATCH] Update class-woocommerce.php Updated magic methods so that order data isn't being accessed directly. This prevents notices in WooCommerce 3.0. --- integrations/woocommerce/class-woocommerce.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/integrations/woocommerce/class-woocommerce.php b/integrations/woocommerce/class-woocommerce.php index c0fae1cd..9c3d0450 100644 --- a/integrations/woocommerce/class-woocommerce.php +++ b/integrations/woocommerce/class-woocommerce.php @@ -87,10 +87,10 @@ public function subscribe_from_woocommerce_checkout( $order_id ) { $order = wc_get_order( $order_id ); $data = array( - 'EMAIL' => $order->billing_email, - 'NAME' => "{$order->billing_first_name} {$order->billing_last_name}", - 'FNAME' => $order->billing_first_name, - 'LNAME' => $order->billing_last_name, + 'EMAIL' => $order->get_billing_email(), + 'NAME' => "{$order->get_billing_first_name()} {$order->get_billing_last_name()}", + 'FNAME' => $order->get_billing_first_name(), + 'LNAME' => $order->get_billing_last_name(), ); // TODO: add billing address fields, maybe by finding MailChimp field of type "address"? @@ -114,4 +114,4 @@ public function get_object_link( $object_id ) { return sprintf( '%s', get_edit_post_link( $object_id ), sprintf( __( 'Order #%d', 'mailchimp-for-wp' ), $object_id ) ); } -} \ No newline at end of file +}