Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanhungate committed Feb 3, 2017
2 parents a9bb53c + 30458b5 commit 0c8294c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ You’ll need to do a few things to connect your WooCommerce store to MailChimp.
For more information on settings and configuration, please visit our Knowledge Base: [http://kb.mailchimp.com/integrations/e-commerce/connect-or-disconnect-mailchimp-for-woocommerce](http://kb.mailchimp.com/integrations/e-commerce/connect-or-disconnect-mailchimp-for-woocommerce)

== Changelog ==
= 1.0.9 =
* billing and shipping address support for orders

= 1.0.8 =
* add landing_site, financial status and discount information for orders
* fix to support php 5.3
Expand Down
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
** 1.0.9 **
* billing and shipping address support for orders

** 1.0.8 **
* add landing_site, financial status and discount information for orders
* fix to support php 5.3
Expand Down
18 changes: 15 additions & 3 deletions includes/api/class-mailchimp-woocommerce-transform-orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,11 @@ public function buildCustomerFromOrder(WC_Order $order)
$address->setPostalCode($order->billing_postcode);
$address->setCountry($order->billing_country);
$address->setPhone($order->billing_phone);
$address->setName('billing');

// if we have billing names set it here
if (!empty($order->billing_first_name) && !empty($order->billing_last_name)) {
$address->setName($order->billing_first_name.' '.$order->billing_last_name);
}

$customer->setAddress($address);

Expand Down Expand Up @@ -362,7 +366,11 @@ public function getOrderAddresses(WC_Order $order)
$billing->setPostalCode($order->billing_postcode);
$billing->setCountry($order->billing_country);
$billing->setPhone($order->billing_phone);
$billing->setName('billing');

// if we have billing names go ahead and apply them
if (!empty($order->billing_first_name) && !empty($order->billing_last_name)) {
$billing->setName($order->billing_first_name.' '.$order->billing_last_name);
}

$shipping = new MailChimp_WooCommerce_Address();
$shipping->setAddress1($order->shipping_address_1);
Expand All @@ -374,7 +382,11 @@ public function getOrderAddresses(WC_Order $order)
if (isset($order->shipping_phone)) {
$shipping->setPhone($order->shipping_phone);
}
$shipping->setName('shipping');

// if we have shipping names go ahead and apply them
if (!empty($order->shipping_first_name) && !empty($order->shipping_last_name)) {
$shipping->setName($order->shipping_first_name.' '.$order->shipping_last_name);
}

return (object) array('billing' => $billing, 'shipping' => $shipping);
}
Expand Down
4 changes: 2 additions & 2 deletions mailchimp-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Plugin Name: MailChimp for WooCommerce
* Plugin URI: https://mailchimp.com/connect-your-store/
* Description: MailChimp - WooCommerce plugin
* Version: 1.0.8
* Version: 1.0.9
* Author: MailChimp
* Author URI: https://mailchimp.com
* License: GPL-2.0+
Expand All @@ -39,7 +39,7 @@ function mailchimp_environment_variables() {
return (object) array(
'repo' => 'master',
'environment' => 'production',
'version' => '1.0.8',
'version' => '1.0.9',
'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
);
}
Expand Down

0 comments on commit 0c8294c

Please sign in to comment.