MailChimp for WooCommerce - Version 2.4.7

Version Description

Download this release

Release Info

Developer ryanhungate
Plugin Icon wp plugin MailChimp for WooCommerce
Version 2.4.7
Comparing to
See all releases

Code changes from version 2.4.6 to 2.4.7

CHANGELOG.txt CHANGED
@@ -1,4 +1,7 @@
1
  == Changelog ==
 
 
 
2
  = 2.4.6 =
3
  * fix for errors on installs with RTL Site Languages
4
  * adds GDPR fields for GDPR enabled audiences
1
  == Changelog ==
2
+ = 2.4.7 =
3
+ * fix cart items with no price on product
4
+ * fix admin note issue on login
5
  = 2.4.6 =
6
  * fix for errors on installs with RTL Site Languages
7
  * adds GDPR fields for GDPR enabled audiences
README.txt CHANGED
@@ -4,7 +4,7 @@ Tags: ecommerce,email,workflows,mailchimp
4
  Donate link: https://mailchimp.com
5
  Requires at least: 4.9
6
  Tested up to: 5.5
7
- Stable tag: 2.4.6
8
  Requires PHP: 7.0
9
  WC requires at least: 3.5
10
  WC tested up to: 4.5
@@ -77,12 +77,9 @@ At this time, the synchronization of product categories from WooCommerce to Mail
77
  If you are unable to sync or connect with Mailchimp, you can open a ticket on our [Github plugin page](https://github.com/mailchimp/mc-woocommerce/issues). Please provide the version of the plugin and PHP you're using, any fatal errors in the WooCommerce logs (WooCommerce -> Status -> Logs) you're seeing, along with relevant information to the problem you're experiencing.
78
 
79
  == Changelog ==
80
- = 2.4.6 =
81
- * fix for errors on installs with RTL Site Languages
82
- * adds GDPR fields for GDPR enabled audiences
83
- * locale settings from WooCommerce or WP are now auto-selected
84
- * support for notices in the wc-admin inbox
85
- * moves Mailchimp plugin link to bottom of Woocommerce sub navigation
86
 
87
  [Historical Changelog](https://raw.githubusercontent.com/mailchimp/mc-woocommerce/master/CHANGELOG.txt)
88
 
4
  Donate link: https://mailchimp.com
5
  Requires at least: 4.9
6
  Tested up to: 5.5
7
+ Stable tag: 2.4.7
8
  Requires PHP: 7.0
9
  WC requires at least: 3.5
10
  WC tested up to: 4.5
77
  If you are unable to sync or connect with Mailchimp, you can open a ticket on our [Github plugin page](https://github.com/mailchimp/mc-woocommerce/issues). Please provide the version of the plugin and PHP you're using, any fatal errors in the WooCommerce logs (WooCommerce -> Status -> Logs) you're seeing, along with relevant information to the problem you're experiencing.
78
 
79
  == Changelog ==
80
+ = 2.4.7 =
81
+ * fix cart items with no price on product
82
+ * fix admin note issue on login
 
 
 
83
 
84
  [Historical Changelog](https://raw.githubusercontent.com/mailchimp/mc-woocommerce/master/CHANGELOG.txt)
85
 
admin/class-mailchimp-woocommerce-admin.php CHANGED
@@ -265,7 +265,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
265
  /* translators: Placeholders %1$s - opening strong HTML tag, %2$s - closing strong HTML tag, %3$s - opening link HTML tag, %4$s - closing link HTML tag */
266
  esc_html__(
267
  '%1$sMailchimp for Woocommerce%2$s is not yet connected to a Mailchimp account. To complete the connection, %3$svisit the plugin settings page%4$s.',
268
- 'facebook-for-woocommerce'
269
  ),
270
  '<strong>',
271
  '</strong>',
@@ -309,12 +309,10 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
309
  'activated_formatted' => $activated_time_formatted,
310
  ) );
311
  $note->set_type( \Automattic\WooCommerce\Admin\Notes\WC_Admin_Note::E_WC_ADMIN_NOTE_WARNING );
312
- $note->set_layout('plain');
313
- $note->set_image('');
314
  $note->set_name( 'mailchimp-for-woocommerce-incomplete-install' );
315
  $note->set_source( 'mailchimp-for-woocommerce' );
316
- $note->set_layout('plain');
317
- $note->set_image('');
318
  $note->add_action(
319
  'settings',
320
  __( 'Open Settings', 'mailchimp-for-woocommerce' ),
265
  /* translators: Placeholders %1$s - opening strong HTML tag, %2$s - closing strong HTML tag, %3$s - opening link HTML tag, %4$s - closing link HTML tag */
266
  esc_html__(
267
  '%1$sMailchimp for Woocommerce%2$s is not yet connected to a Mailchimp account. To complete the connection, %3$svisit the plugin settings page%4$s.',
268
+ 'mailchimp-for-woocommerce'
269
  ),
270
  '<strong>',
271
  '</strong>',
309
  'activated_formatted' => $activated_time_formatted,
310
  ) );
311
  $note->set_type( \Automattic\WooCommerce\Admin\Notes\WC_Admin_Note::E_WC_ADMIN_NOTE_WARNING );
 
 
312
  $note->set_name( 'mailchimp-for-woocommerce-incomplete-install' );
313
  $note->set_source( 'mailchimp-for-woocommerce' );
314
+ if (method_exists($note, 'set_layout')) $note->set_layout('plain');
315
+ if (method_exists($note, 'set_image')) $note->set_image('');
316
  $note->add_action(
317
  'settings',
318
  __( 'Open Settings', 'mailchimp-for-woocommerce' ),
bootstrap.php CHANGED
@@ -87,7 +87,7 @@ function mailchimp_environment_variables() {
87
  return (object) array(
88
  'repo' => 'master',
89
  'environment' => 'production', // staging or production
90
- 'version' => '2.4.6',
91
  'php_version' => phpversion(),
92
  'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
93
  'wc_version' => function_exists('WC') ? WC()->version : null,
87
  return (object) array(
88
  'repo' => 'master',
89
  'environment' => 'production', // staging or production
90
+ 'version' => '2.4.7',
91
  'php_version' => phpversion(),
92
  'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
93
  'wc_version' => function_exists('WC') ? WC()->version : null,
includes/api/class-mailchimp-api.php CHANGED
@@ -1608,11 +1608,9 @@ class MailChimp_WooCommerce_MailChimpApi
1608
  return $GDPRfields;
1609
  }
1610
 
1611
-
1612
- /**
1613
- * @param string $list_id
1614
- * @param int $minutes
1615
- * @return false|mixed
1616
  */
1617
  public function getGDPRFields($list_id)
1618
  {
1608
  return $GDPRfields;
1609
  }
1610
 
1611
+ /**
1612
+ * @param
1613
+ * @return
 
 
1614
  */
1615
  public function getGDPRFields($list_id)
1616
  {
includes/processes/class-mailchimp-woocommerce-cart-update.php CHANGED
@@ -216,15 +216,27 @@ class MailChimp_WooCommerce_Cart_Update extends Mailchimp_Woocommerce_Job
216
  $variant_id = isset($item['variation_id']) && $item['variation_id'] > 0 ? $item['variation_id'] : null;
217
  $product_id = $item['product_id'];
218
 
219
- // if the cart contains a variant id with no parent id, we need to use this instead of the main product id.
220
- if ($variant_id) {
221
- $product = wc_get_product($variant_id);
222
- $product_id = $product->get_parent_id();
223
- } else {
224
- $product = wc_get_product($product_id);
 
 
 
 
 
 
 
 
 
 
 
 
 
225
  }
226
 
227
- $price = $product ? $product->get_price() : 0;
228
  $line = new MailChimp_WooCommerce_LineItem();
229
  $line->setId($hash);
230
  $line->setProductId($product_id);
216
  $variant_id = isset($item['variation_id']) && $item['variation_id'] > 0 ? $item['variation_id'] : null;
217
  $product_id = $item['product_id'];
218
 
219
+ // if the line item has a total, and a quantity we can determine the proper price
220
+ // that was in the cart at that time.
221
+ if (isset($item['line_total']) && !empty($item['line_total'])) {
222
+ if ($item['line_total'] > 0 && $item['quantity'] > 0) {
223
+ $price = $item['line_total'] / $item['quantity'];
224
+ }
225
+ }
226
+
227
+ // this is a fallback from now on.
228
+ if (!isset($price) || empty($price)) {
229
+ // if the cart contains a variant id with no parent id,
230
+ // we need to use this instead of the main product id.
231
+ if ($variant_id) {
232
+ $product = wc_get_product($variant_id);
233
+ $product_id = $product->get_parent_id();
234
+ } else {
235
+ $product = wc_get_product($product_id);
236
+ }
237
+ $price = $product ? $product->get_price() : 0;
238
  }
239
 
 
240
  $line = new MailChimp_WooCommerce_LineItem();
241
  $line->setId($hash);
242
  $line->setProductId($product_id);
mailchimp-woocommerce.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Mailchimp for WooCommerce
17
  * Plugin URI: https://mailchimp.com/connect-your-store/
18
  * Description: Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff.
19
- * Version: 2.4.6
20
  * Author: Mailchimp
21
  * Author URI: https://mailchimp.com
22
  * License: GPL-2.0+
16
  * Plugin Name: Mailchimp for WooCommerce
17
  * Plugin URI: https://mailchimp.com/connect-your-store/
18
  * Description: Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff.
19
+ * Version: 2.4.7
20
  * Author: Mailchimp
21
  * Author URI: https://mailchimp.com
22
  * License: GPL-2.0+