Version Description
- Re add resync button to sync tab, after sync finishes
- Renamed 'merge_vars' to 'merge_fields' as per new Mailchimp naming convention
- fixes issues with cloudflare
- honors woo currency settings
- fix for failing custom coupon type
Download this release
Release Info
Developer | ryanhungate |
Plugin | MailChimp for WooCommerce |
Version | 2.1.17 |
Comparing to | |
See all releases |
Code changes from version 2.1.16 to 2.1.17
- README.txt +7 -1
- admin/class-mailchimp-woocommerce-admin.php +94 -11
- admin/partials/mailchimp-woocommerce-admin-tabs.php +11 -11
- admin/partials/tabs/logs.php +4 -4
- admin/partials/tabs/newsletter_settings.php +24 -24
- admin/partials/tabs/notices.php +6 -6
- admin/partials/tabs/store_info.php +15 -25
- admin/partials/tabs/store_sync.php +18 -10
- bootstrap.php +26 -7
- includes/api/assets/class-mailchimp-cart.php +6 -6
- includes/api/assets/class-mailchimp-customer.php +2 -2
- includes/api/assets/class-mailchimp-order.php +10 -6
- includes/api/assets/class-mailchimp-store.php +14 -8
- includes/api/class-mailchimp-api.php +14 -3
- includes/api/class-mailchimp-woocommerce-transform-coupons.php +2 -0
- includes/api/class-mailchimp-woocommerce-transform-orders-wc3.php +11 -6
- includes/class-mailchimp-woocommerce-activator.php +2 -1
- includes/class-mailchimp-woocommerce-deactivation-survey.php +1 -1
- includes/class-mailchimp-woocommerce-newsletter.php +2 -2
- includes/class-mailchimp-woocommerce-rest-api.php +14 -5
- includes/class-mailchimp-woocommerce-service.php +30 -21
- includes/class-mailchimp-woocommerce.php +11 -6
- includes/processes/class-mailchimp-woocommerce-cart-update.php +1 -1
- includes/processes/class-mailchimp-woocommerce-rest-queue.php +5 -1
- includes/processes/class-mailchimp-woocommerce-single-order.php +17 -5
- includes/processes/class-mailchimp-woocommerce-user-submit.php +19 -19
- languages/mailchimp-woocommerce-pt_BR.mo +0 -0
- languages/mailchimp-woocommerce-pt_BR.po +47 -37
- languages/mailchimp-woocommerce.pot +39 -36
- mailchimp-woocommerce.php +3 -1
README.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: ecommerce,email,workflows,mailchimp
|
|
4 |
Donate link: https://mailchimp.com
|
5 |
Requires at least: 4.3
|
6 |
Tested up to: 5.1
|
7 |
-
Stable tag: 2.1.
|
8 |
Requires PHP: 7.0
|
9 |
WC tested up to: 3.5.4
|
10 |
License: GPLv2 or later
|
@@ -62,6 +62,12 @@ The Mailchimp for WooCommerce supports Wordpress Multi Sites and below are a few
|
|
62 |
- Deleting removes the connection between Mailchimp and WooCommerce, and uninstalls the plugin from your site.
|
63 |
Refer to the Wordpress Codex for more information about [Multisite Network Administration](https://codex.wordpress.org/Multisite_Network_Administration)
|
64 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
65 |
= 2.1.16 =
|
66 |
* support for HTML in opt-in checkbox
|
67 |
* support for language translation
|
4 |
Donate link: https://mailchimp.com
|
5 |
Requires at least: 4.3
|
6 |
Tested up to: 5.1
|
7 |
+
Stable tag: 2.1.17
|
8 |
Requires PHP: 7.0
|
9 |
WC tested up to: 3.5.4
|
10 |
License: GPLv2 or later
|
62 |
- Deleting removes the connection between Mailchimp and WooCommerce, and uninstalls the plugin from your site.
|
63 |
Refer to the Wordpress Codex for more information about [Multisite Network Administration](https://codex.wordpress.org/Multisite_Network_Administration)
|
64 |
== Changelog ==
|
65 |
+
= 2.1.17 =
|
66 |
+
* Re add resync button to sync tab, after sync finishes
|
67 |
+
* Renamed 'merge_vars' to 'merge_fields' as per new Mailchimp naming convention
|
68 |
+
* fixes issues with cloudflare
|
69 |
+
* honors woo currency settings
|
70 |
+
* fix for failing custom coupon type
|
71 |
= 2.1.16 =
|
72 |
* support for HTML in opt-in checkbox
|
73 |
* support for language translation
|
admin/class-mailchimp-woocommerce-admin.php
CHANGED
@@ -75,7 +75,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
75 |
*/
|
76 |
public function add_plugin_admin_menu() {
|
77 |
add_menu_page(
|
78 |
-
__('Mailchimp - WooCommerce Setup', '
|
79 |
'Mailchimp',
|
80 |
'manage_options',
|
81 |
$this->plugin_name,
|
@@ -134,6 +134,8 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
134 |
public function options_update() {
|
135 |
|
136 |
$this->handle_abandoned_cart_table();
|
|
|
|
|
137 |
|
138 |
register_setting($this->plugin_name, $this->plugin_name, array($this, 'validate'));
|
139 |
}
|
@@ -143,6 +145,8 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
143 |
*/
|
144 |
public function update_db_check() {
|
145 |
// grab the current version set in the plugin variables
|
|
|
|
|
146 |
$version = mailchimp_environment_variables()->version;
|
147 |
|
148 |
// grab the saved version or default to 1.0.3 since that's when we first did this.
|
@@ -153,8 +157,66 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
153 |
// resave the site option so this only fires once.
|
154 |
update_site_option('mailchimp_woocommerce_version', $version);
|
155 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
/**
|
159 |
* We need to do a tidy up function on the mailchimp_carts table to
|
160 |
* remove anything older than 30 days.
|
@@ -181,7 +243,8 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
181 |
email VARCHAR (100) NOT NULL,
|
182 |
user_id INT (11) DEFAULT NULL,
|
183 |
cart text NOT NULL,
|
184 |
-
created_at datetime NOT NULL
|
|
|
185 |
) $charset_collate;";
|
186 |
|
187 |
if (($result = $wpdb->query($sql)) > 0) {
|
@@ -198,8 +261,10 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
198 |
|
199 |
$active_tab = isset($input['mailchimp_active_tab']) ? $input['mailchimp_active_tab'] : null;
|
200 |
|
201 |
-
if (empty($active_tab)) {
|
202 |
-
|
|
|
|
|
203 |
}
|
204 |
|
205 |
switch ($active_tab) {
|
@@ -250,6 +315,17 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
250 |
|
251 |
break;
|
252 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
|
254 |
return (isset($data) && is_array($data)) ? array_merge($this->getOptions(), $data) : $this->getOptions();
|
255 |
}
|
@@ -339,6 +415,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
339 |
$this->setData('validation.store_info', true);
|
340 |
|
341 |
$data['active_tab'] = 'campaign_defaults';
|
|
|
342 |
|
343 |
if ($this->hasValidMailChimpList()) {
|
344 |
$this->syncStore(array_merge($this->getOptions(), $data));
|
@@ -364,8 +441,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
364 |
'store_phone' => isset($input['store_phone']) ? $input['store_phone'] : false,
|
365 |
// locale info
|
366 |
'store_locale' => isset($input['store_locale']) ? $input['store_locale'] : false,
|
367 |
-
|
368 |
-
'store_currency_code' => isset($input['store_currency_code']) ? $input['store_currency_code'] : false,
|
369 |
'admin_email' => isset($input['admin_email']) && is_email($input['admin_email']) ? $input['admin_email'] : $this->getOption('admin_email', false),
|
370 |
);
|
371 |
}
|
@@ -566,7 +642,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
566 |
return $this->validateOptions(array(
|
567 |
'store_name', 'store_street', 'store_city', 'store_state',
|
568 |
'store_postal_code', 'store_country', 'store_phone',
|
569 |
-
'store_locale', 'store_timezone',
|
570 |
'store_phone',
|
571 |
), $data);
|
572 |
}
|
@@ -730,6 +806,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
730 |
|
731 |
if (on_sync_tab === 'yes') {
|
732 |
var call_mailchimp_for_stats = function () {
|
|
|
733 |
jQuery.get(endpoint, function(response) {
|
734 |
if (response.success) {
|
735 |
|
@@ -739,6 +816,8 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
739 |
return document.location.reload(true);
|
740 |
}
|
741 |
|
|
|
|
|
742 |
jQuery('#mailchimp_product_count').html(response.products_in_mailchimp.toLocaleString(undefined, {
|
743 |
maximumFractionDigits: 0
|
744 |
}));
|
@@ -749,9 +828,12 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
749 |
|
750 |
jQuery('#mailchimp_last_updated').html(response.date);
|
751 |
|
752 |
-
|
753 |
-
|
754 |
-
|
|
|
|
|
|
|
755 |
}
|
756 |
});
|
757 |
};
|
@@ -861,6 +943,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
861 |
$store->setPrimaryLocale($this->array_get($data, 'store_locale', 'en'));
|
862 |
$store->setTimezone($this->array_get($data, 'store_timezone', 'America\New_York'));
|
863 |
$store->setCurrencyCode($this->array_get($data, 'store_currency_code', 'USD'));
|
|
|
864 |
|
865 |
// set the basics
|
866 |
$store->setName($this->array_get($data, 'store_name'));
|
@@ -955,7 +1038,7 @@ class MailChimp_WooCommerce_Admin extends MailChimp_WooCommerce_Options {
|
|
955 |
$address->setPhone($data['store_phone']);
|
956 |
}
|
957 |
|
958 |
-
$address->setCountryCode(
|
959 |
|
960 |
return $address;
|
961 |
}
|
75 |
*/
|
76 |
public function add_plugin_admin_menu() {
|
77 |
add_menu_page(
|
78 |
+
__('Mailchimp - WooCommerce Setup', 'mc-woocommerce'),
|
79 |
'Mailchimp',
|
80 |
'manage_options',
|
81 |
$this->plugin_name,
|
134 |
public function options_update() {
|
135 |
|
136 |
$this->handle_abandoned_cart_table();
|
137 |
+
|
138 |
+
$this->update_db_check();
|
139 |
|
140 |
register_setting($this->plugin_name, $this->plugin_name, array($this, 'validate'));
|
141 |
}
|
145 |
*/
|
146 |
public function update_db_check() {
|
147 |
// grab the current version set in the plugin variables
|
148 |
+
global $wpdb;
|
149 |
+
|
150 |
$version = mailchimp_environment_variables()->version;
|
151 |
|
152 |
// grab the saved version or default to 1.0.3 since that's when we first did this.
|
157 |
// resave the site option so this only fires once.
|
158 |
update_site_option('mailchimp_woocommerce_version', $version);
|
159 |
}
|
160 |
+
|
161 |
+
if (!get_option( $this->plugin_name.'_cart_table_add_index_update')) {
|
162 |
+
$check_index_sql = "SELECT COUNT(*) FROM INFORMATION_SCHEMA.STATISTICS WHERE table_schema='{$wpdb->dbname}' AND table_name='{$wpdb->prefix}mailchimp_carts' AND index_name='primary' and column_name='email';";
|
163 |
+
$index_exists = $wpdb->get_var($check_index_sql);
|
164 |
+
if ($index_exists == '1') {
|
165 |
+
update_option( $this->plugin_name.'_cart_table_add_index_update', true);
|
166 |
+
}
|
167 |
+
else {
|
168 |
+
$sql = "ALTER TABLE {$wpdb->prefix}mailchimp_carts ADD PRIMARY KEY (email);";
|
169 |
+
// only update the option if the query returned sucessfully
|
170 |
+
if ($wpdb->query($sql)) {
|
171 |
+
update_option( $this->plugin_name.'_cart_table_add_index_update', true);
|
172 |
+
}
|
173 |
+
}
|
174 |
+
}
|
175 |
+
|
176 |
+
if (!get_option( $this->plugin_name.'_woo_currency_update')) {
|
177 |
+
if ($this->mailchimp_update_woo_settings()) {
|
178 |
+
update_option( $this->plugin_name.'_woo_currency_update', true);
|
179 |
+
}
|
180 |
+
}
|
181 |
}
|
182 |
|
183 |
+
/**
|
184 |
+
* Sets the Store Currency code on plugin options
|
185 |
+
*
|
186 |
+
* @param string $code
|
187 |
+
* @return array $options
|
188 |
+
*/
|
189 |
+
private function mailchimp_set_store_currency_code($code = null) {
|
190 |
+
if (!isset($code)) {
|
191 |
+
$code = get_woocommerce_currency();
|
192 |
+
}
|
193 |
+
$options = $this->getOptions();
|
194 |
+
$options['woocommerce_settings_save_general'] = true;
|
195 |
+
$options['store_currency_code'] = $code;
|
196 |
+
update_option($this->plugin_name, $options);
|
197 |
+
return $options;
|
198 |
+
}
|
199 |
+
|
200 |
+
/**
|
201 |
+
* Fired when woocommerce store settings are saved
|
202 |
+
*
|
203 |
+
* @param string $code
|
204 |
+
* @return array $options
|
205 |
+
*/
|
206 |
+
public function mailchimp_update_woo_settings() {
|
207 |
+
$new_currency_code = null;
|
208 |
+
|
209 |
+
if (isset($_POST['woo_multi_currency_params'])) {
|
210 |
+
$new_currency_code = $_POST['currency_default'];
|
211 |
+
}
|
212 |
+
else if (isset($_POST['woocommerce_currency'])) {
|
213 |
+
$new_currency_code = $_POST['woocommerce_currency'];
|
214 |
+
}
|
215 |
+
|
216 |
+
$data = $this->mailchimp_set_store_currency_code($new_currency_code);
|
217 |
+
return $this->syncStore($data);
|
218 |
+
}
|
219 |
+
|
220 |
/**
|
221 |
* We need to do a tidy up function on the mailchimp_carts table to
|
222 |
* remove anything older than 30 days.
|
243 |
email VARCHAR (100) NOT NULL,
|
244 |
user_id INT (11) DEFAULT NULL,
|
245 |
cart text NOT NULL,
|
246 |
+
created_at datetime NOT NULL,
|
247 |
+
PRIMARY KEY (email)
|
248 |
) $charset_collate;";
|
249 |
|
250 |
if (($result = $wpdb->query($sql)) > 0) {
|
261 |
|
262 |
$active_tab = isset($input['mailchimp_active_tab']) ? $input['mailchimp_active_tab'] : null;
|
263 |
|
264 |
+
if (empty($active_tab) && $input['woocommerce_settings_save_general']) {
|
265 |
+
unset($input['woocommerce_settings_save_general']);
|
266 |
+
$data['store_currency_code'] = (string) $input['store_currency_code'];
|
267 |
+
//return $this->getOptions();
|
268 |
}
|
269 |
|
270 |
switch ($active_tab) {
|
315 |
|
316 |
break;
|
317 |
}
|
318 |
+
|
319 |
+
// if no API is provided, check if the one saved on the database is still valid.
|
320 |
+
if (!$input['mailchimp_api_key'] && $this->getOption('mailchimp_api_key')) {
|
321 |
+
// set api key for validation
|
322 |
+
$input['mailchimp_api_key'] = $this->getOption('mailchimp_api_key');
|
323 |
+
$api_key_valid = $this->validatePostApiKey($input);
|
324 |
+
|
325 |
+
// if there's no error, remove the api_ping_error from the db
|
326 |
+
if (!$api_key_valid['api_ping_error'])
|
327 |
+
$data['api_ping_error'] = $api_key_valid['api_ping_error'];
|
328 |
+
}
|
329 |
|
330 |
return (isset($data) && is_array($data)) ? array_merge($this->getOptions(), $data) : $this->getOptions();
|
331 |
}
|
415 |
$this->setData('validation.store_info', true);
|
416 |
|
417 |
$data['active_tab'] = 'campaign_defaults';
|
418 |
+
$data['store_currency_code'] = get_woocommerce_currency();
|
419 |
|
420 |
if ($this->hasValidMailChimpList()) {
|
421 |
$this->syncStore(array_merge($this->getOptions(), $data));
|
441 |
'store_phone' => isset($input['store_phone']) ? $input['store_phone'] : false,
|
442 |
// locale info
|
443 |
'store_locale' => isset($input['store_locale']) ? $input['store_locale'] : false,
|
444 |
+
'store_timezone' => isset($input['store_timezone']) ? $input['store_timezone'] : false,
|
|
|
445 |
'admin_email' => isset($input['admin_email']) && is_email($input['admin_email']) ? $input['admin_email'] : $this->getOption('admin_email', false),
|
446 |
);
|
447 |
}
|
642 |
return $this->validateOptions(array(
|
643 |
'store_name', 'store_street', 'store_city', 'store_state',
|
644 |
'store_postal_code', 'store_country', 'store_phone',
|
645 |
+
'store_locale', 'store_timezone',
|
646 |
'store_phone',
|
647 |
), $data);
|
648 |
}
|
806 |
|
807 |
if (on_sync_tab === 'yes') {
|
808 |
var call_mailchimp_for_stats = function () {
|
809 |
+
jQuery('#mailchimp_last_updated').next('.spinner').css('visibility', 'visible');
|
810 |
jQuery.get(endpoint, function(response) {
|
811 |
if (response.success) {
|
812 |
|
816 |
return document.location.reload(true);
|
817 |
}
|
818 |
|
819 |
+
jQuery('#mailchimp_last_updated').next('.spinner').css('visibility', 'hidden');
|
820 |
+
|
821 |
jQuery('#mailchimp_product_count').html(response.products_in_mailchimp.toLocaleString(undefined, {
|
822 |
maximumFractionDigits: 0
|
823 |
}));
|
828 |
|
829 |
jQuery('#mailchimp_last_updated').html(response.date);
|
830 |
|
831 |
+
// only call status again if sync is running.
|
832 |
+
if (response.has_started && !response.has_finished) {
|
833 |
+
setTimeout(function() {
|
834 |
+
call_mailchimp_for_stats();
|
835 |
+
}, 10000);
|
836 |
+
}
|
837 |
}
|
838 |
});
|
839 |
};
|
943 |
$store->setPrimaryLocale($this->array_get($data, 'store_locale', 'en'));
|
944 |
$store->setTimezone($this->array_get($data, 'store_timezone', 'America\New_York'));
|
945 |
$store->setCurrencyCode($this->array_get($data, 'store_currency_code', 'USD'));
|
946 |
+
$store->setMoneyFormat($store->getCurrencyCode());
|
947 |
|
948 |
// set the basics
|
949 |
$store->setName($this->array_get($data, 'store_name'));
|
1038 |
$address->setPhone($data['store_phone']);
|
1039 |
}
|
1040 |
|
1041 |
+
$address->setCountryCode(WC_Countries::get_base_country());
|
1042 |
|
1043 |
return $address;
|
1044 |
}
|
admin/partials/mailchimp-woocommerce-admin-tabs.php
CHANGED
@@ -83,13 +83,13 @@ if (mailchimp_should_init_rest_queue() && !get_site_transient('http_worker_queue
|
|
83 |
|
84 |
<?php if (!defined('PHP_VERSION_ID') || (PHP_VERSION_ID < 70000)): ?>
|
85 |
<div data-dismissible="notice-php-version" class="error notice notice-error is-dismissible">
|
86 |
-
<p><?php esc_html_e('Mailchimp says: Please upgrade your PHP version to a minimum of 7.0', '
|
87 |
</div>
|
88 |
<?php endif; ?>
|
89 |
|
90 |
<?php if (!empty($has_api_error)): ?>
|
91 |
<div data-dismissible="notice-api-error" class="error notice notice-error is-dismissible">
|
92 |
-
<p><?php esc_html_e("Mailchimp says: API Request Error - ".$has_api_error, '
|
93 |
</div>
|
94 |
<?php endif; ?>
|
95 |
|
@@ -98,22 +98,22 @@ if (mailchimp_should_init_rest_queue() && !get_site_transient('http_worker_queue
|
|
98 |
<!-- Create a header in the default WordPress 'wrap' container -->
|
99 |
<div class="wrap">
|
100 |
<div id="icon-themes" class="icon32"></div>
|
101 |
-
<h2><?= __('Mailchimp for Woocommerce Settings', '
|
102 |
|
103 |
<h2 class="nav-tab-wrapper">
|
104 |
-
<a href="?page=mailchimp-woocommerce&tab=api_key" class="nav-tab <?php echo $active_tab == 'api_key' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Connect', '
|
105 |
<?php if($has_valid_api_key): ?>
|
106 |
-
<a href="?page=mailchimp-woocommerce&tab=store_info" class="nav-tab <?php echo $active_tab == 'store_info' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Store Settings', '
|
107 |
<?php if ($handler->hasValidStoreInfo()) : ?>
|
108 |
<?php if($show_campaign_defaults): ?>
|
109 |
-
<a href="?page=mailchimp-woocommerce&tab=campaign_defaults" class="nav-tab <?php echo $active_tab == 'campaign_defaults' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Audience Defaults', '
|
110 |
<?php endif; ?>
|
111 |
<?php if($handler->hasValidCampaignDefaults()): ?>
|
112 |
-
<a href="?page=mailchimp-woocommerce&tab=newsletter_settings" class="nav-tab <?php echo $active_tab == 'newsletter_settings' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Audience Settings', '
|
113 |
<?php endif; ?>
|
114 |
<?php if($show_sync_tab): ?>
|
115 |
-
<a href="?page=mailchimp-woocommerce&tab=sync" class="nav-tab <?php echo $active_tab == 'sync' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Sync', '
|
116 |
-
<a href="?page=mailchimp-woocommerce&tab=logs" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Logs', '
|
117 |
<?php endif; ?>
|
118 |
<?php endif;?>
|
119 |
<?php endif; ?>
|
@@ -162,10 +162,10 @@ if (mailchimp_should_init_rest_queue() && !get_site_transient('http_worker_queue
|
|
162 |
</form>
|
163 |
|
164 |
<?php if ($active_tab == 'sync'): ?>
|
165 |
-
<h2 style="padding-top: 1em;"><?php esc_html_e('More Information', '
|
166 |
<ul>
|
167 |
<li><?= sprintf(/* translators: %s - WP-CLI URL. */wp_kses( __( 'Have a larger store or having issues syncing? Consider using <a href=%s target=_blank>WP-CLI</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://github.com/mailchimp/mc-woocommerce/issues/158' ) );?></li>
|
168 |
-
<li><?= esc_html__('Order and customer information will not sync if they contain an Amazon or generic email address.', '
|
169 |
<li><?= sprintf(/* translators: %s - Mailchimp Support URL. */wp_kses( __( 'Need help to connect your store? Visit the Mailchimp <a href=%s target=_blank>Knowledge Base</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-woocommerce/' ) );?></li>
|
170 |
<li><?= sprintf(/* translators: %s - Plugin review URL. */wp_kses( __( 'Want to tell us how we\'re doing? <a href=%s target=_blank>Leave a review on Wordpress.org</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://wordpress.org/support/plugin/mailchimp-for-woocommerce/reviews/' ) );?></li>
|
171 |
<li><?= sprintf(/* translators: %s - Mailchimp Privacy Policy URL. */wp_kses( __( 'By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/legal/privacy/' ) );?></li>
|
83 |
|
84 |
<?php if (!defined('PHP_VERSION_ID') || (PHP_VERSION_ID < 70000)): ?>
|
85 |
<div data-dismissible="notice-php-version" class="error notice notice-error is-dismissible">
|
86 |
+
<p><?php esc_html_e('Mailchimp says: Please upgrade your PHP version to a minimum of 7.0', 'mc-woocommerce'); ?></p>
|
87 |
</div>
|
88 |
<?php endif; ?>
|
89 |
|
90 |
<?php if (!empty($has_api_error)): ?>
|
91 |
<div data-dismissible="notice-api-error" class="error notice notice-error is-dismissible">
|
92 |
+
<p><?php esc_html_e("Mailchimp says: API Request Error - ".$has_api_error, 'mc-woocommerce'); ?></p>
|
93 |
</div>
|
94 |
<?php endif; ?>
|
95 |
|
98 |
<!-- Create a header in the default WordPress 'wrap' container -->
|
99 |
<div class="wrap">
|
100 |
<div id="icon-themes" class="icon32"></div>
|
101 |
+
<h2><?= __('Mailchimp for Woocommerce Settings', 'mc-woocommerce');?></h2>
|
102 |
|
103 |
<h2 class="nav-tab-wrapper">
|
104 |
+
<a href="?page=mailchimp-woocommerce&tab=api_key" class="nav-tab <?php echo $active_tab == 'api_key' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Connect', 'mc-woocommerce');?></a>
|
105 |
<?php if($has_valid_api_key): ?>
|
106 |
+
<a href="?page=mailchimp-woocommerce&tab=store_info" class="nav-tab <?php echo $active_tab == 'store_info' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Store Settings', 'mc-woocommerce');?></a>
|
107 |
<?php if ($handler->hasValidStoreInfo()) : ?>
|
108 |
<?php if($show_campaign_defaults): ?>
|
109 |
+
<a href="?page=mailchimp-woocommerce&tab=campaign_defaults" class="nav-tab <?php echo $active_tab == 'campaign_defaults' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Audience Defaults', 'mc-woocommerce');?></a>
|
110 |
<?php endif; ?>
|
111 |
<?php if($handler->hasValidCampaignDefaults()): ?>
|
112 |
+
<a href="?page=mailchimp-woocommerce&tab=newsletter_settings" class="nav-tab <?php echo $active_tab == 'newsletter_settings' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Audience Settings', 'mc-woocommerce');?></a>
|
113 |
<?php endif; ?>
|
114 |
<?php if($show_sync_tab): ?>
|
115 |
+
<a href="?page=mailchimp-woocommerce&tab=sync" class="nav-tab <?php echo $active_tab == 'sync' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Sync', 'mc-woocommerce');?></a>
|
116 |
+
<a href="?page=mailchimp-woocommerce&tab=logs" class="nav-tab <?php echo $active_tab == 'logs' ? 'nav-tab-active' : ''; ?>"><?= esc_html_e('Logs', 'mc-woocommerce');?></a>
|
117 |
<?php endif; ?>
|
118 |
<?php endif;?>
|
119 |
<?php endif; ?>
|
162 |
</form>
|
163 |
|
164 |
<?php if ($active_tab == 'sync'): ?>
|
165 |
+
<h2 style="padding-top: 1em;"><?php esc_html_e('More Information', 'mc-woocommerce'); ?></h2>
|
166 |
<ul>
|
167 |
<li><?= sprintf(/* translators: %s - WP-CLI URL. */wp_kses( __( 'Have a larger store or having issues syncing? Consider using <a href=%s target=_blank>WP-CLI</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://github.com/mailchimp/mc-woocommerce/issues/158' ) );?></li>
|
168 |
+
<li><?= esc_html__('Order and customer information will not sync if they contain an Amazon or generic email address.', 'mc-woocommerce');?></li>
|
169 |
<li><?= sprintf(/* translators: %s - Mailchimp Support URL. */wp_kses( __( 'Need help to connect your store? Visit the Mailchimp <a href=%s target=_blank>Knowledge Base</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/help/connect-or-disconnect-mailchimp-for-woocommerce/' ) );?></li>
|
170 |
<li><?= sprintf(/* translators: %s - Plugin review URL. */wp_kses( __( 'Want to tell us how we\'re doing? <a href=%s target=_blank>Leave a review on Wordpress.org</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://wordpress.org/support/plugin/mailchimp-for-woocommerce/reviews/' ) );?></li>
|
171 |
<li><?= sprintf(/* translators: %s - Mailchimp Privacy Policy URL. */wp_kses( __( 'By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array(), 'target'=> '_blank' ) ) ), esc_url( 'https://mailchimp.com/legal/privacy/' ) );?></li>
|
admin/partials/tabs/logs.php
CHANGED
@@ -32,23 +32,23 @@ if (!empty($requested_log_file) && isset($logs[sanitize_title($requested_log_fil
|
|
32 |
$handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37 ? strlen($viewed_log) - 37 : strlen($viewed_log) - 4) : '';
|
33 |
?>
|
34 |
|
35 |
-
<h2 style="padding-top: 1em;"><?php esc_html_e('Logging Preference', '
|
36 |
<p>
|
37 |
<?php esc_html_e('Advanced troubleshooting can be conducted with the logging capability turned on.
|
38 |
By default, it’s set to “none” and you may toggle to either “standard” or “debug” as needed.
|
39 |
With standard logging, you can see basic information about the data submission to Mailchimp including any errors.
|
40 |
-
“Debug” gives a much deeper insight that is useful to share with support if problems arise.', '
|
41 |
?>
|
42 |
</p>
|
43 |
<fieldset>
|
44 |
<legend class="screen-reader-text">
|
45 |
-
<span><?php esc_html_e('Logging Preference', '
|
46 |
</legend>
|
47 |
<label for="<?php echo $this->plugin_name; ?>-logging">
|
48 |
<select name="<?php echo $this->plugin_name; ?>[mailchimp_logging]" style="width:30%" required>
|
49 |
<?php $logging_preference = mailchimp_environment_variables()->logging; ?>
|
50 |
<?php
|
51 |
-
foreach(array('none' => esc_html__('None', '
|
52 |
echo '<option value="'.esc_attr($log_value).'" '.selected($log_value === $logging_preference, true, false ) . '>' . esc_html($log_label) . '</option>';
|
53 |
}
|
54 |
?>
|
32 |
$handle = !empty($viewed_log) ? substr($viewed_log, 0, strlen($viewed_log) > 37 ? strlen($viewed_log) - 37 : strlen($viewed_log) - 4) : '';
|
33 |
?>
|
34 |
|
35 |
+
<h2 style="padding-top: 1em;"><?php esc_html_e('Logging Preference', 'mc-woocommerce');?></h2>
|
36 |
<p>
|
37 |
<?php esc_html_e('Advanced troubleshooting can be conducted with the logging capability turned on.
|
38 |
By default, it’s set to “none” and you may toggle to either “standard” or “debug” as needed.
|
39 |
With standard logging, you can see basic information about the data submission to Mailchimp including any errors.
|
40 |
+
“Debug” gives a much deeper insight that is useful to share with support if problems arise.', 'mc-woocommerce');
|
41 |
?>
|
42 |
</p>
|
43 |
<fieldset>
|
44 |
<legend class="screen-reader-text">
|
45 |
+
<span><?php esc_html_e('Logging Preference', 'mc-woocommerce');?></span>
|
46 |
</legend>
|
47 |
<label for="<?php echo $this->plugin_name; ?>-logging">
|
48 |
<select name="<?php echo $this->plugin_name; ?>[mailchimp_logging]" style="width:30%" required>
|
49 |
<?php $logging_preference = mailchimp_environment_variables()->logging; ?>
|
50 |
<?php
|
51 |
+
foreach(array('none' => esc_html__('None', 'mc-woocommerce'), 'debug' => esc_html__('Debug', 'mc-woocommerce'), 'standard' => esc_html__('Standard', 'mc-woocommerce')) as $log_value => $log_label) {
|
52 |
echo '<option value="'.esc_attr($log_value).'" '.selected($log_value === $logging_preference, true, false ) . '>' . esc_html($log_label) . '</option>';
|
53 |
}
|
54 |
?>
|
admin/partials/tabs/newsletter_settings.php
CHANGED
@@ -32,22 +32,22 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
|
|
32 |
|
33 |
<input type="hidden" name="mailchimp_active_settings_tab" value="newsletter_settings"/>
|
34 |
|
35 |
-
<h2 style="padding-top: 1em;"><?php esc_html_e('Audience Settings', '
|
36 |
-
<p><?php esc_html_e('Please apply your audience settings. If you don\'t have an audience, you can choose to create one.', '
|
37 |
|
38 |
<fieldset>
|
39 |
<legend class="screen-reader-text">
|
40 |
-
<span><?php esc_html_e('Audience Name', '
|
41 |
</legend>
|
42 |
<label for="<?php echo $this->plugin_name; ?>-mailchimp-list-label">
|
43 |
<select name="<?php echo $this->plugin_name; ?>[mailchimp_list]" style="width:30%" required <?php if($list_is_configured): ?> disabled <?php endif; ?>>
|
44 |
|
45 |
<?php if(!isset($allow_new_list) || $allow_new_list === true): ?>
|
46 |
-
<option value="create_new"><?php esc_html_e('Create New Audience', '
|
47 |
<?php endif ?>
|
48 |
|
49 |
<?php if(isset($allow_new_list) && $allow_new_list === false): ?>
|
50 |
-
<option value="">-- <?php esc_html_e('Select Audience', '
|
51 |
<?php endif; ?>
|
52 |
|
53 |
<?php
|
@@ -65,7 +65,7 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
|
|
65 |
|
66 |
<fieldset>
|
67 |
<legend class="screen-reader-text">
|
68 |
-
<span><?php esc_html_e('Auto Subscribe On Initial Sync', '
|
69 |
</legend>
|
70 |
<label for="<?php echo $this->plugin_name; ?>-mailchimp-auto-subscribe">
|
71 |
<select name="<?php echo $this->plugin_name; ?>[mailchimp_auto_subscribe]" style="width:30%" required <?php if($list_is_configured): ?> disabled <?php endif; ?>>
|
@@ -73,7 +73,7 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
|
|
73 |
<?php
|
74 |
$enable_auto_subscribe = (array_key_exists('mailchimp_auto_subscribe', $options) && !is_null($options['mailchimp_auto_subscribe'])) ? $options['mailchimp_auto_subscribe'] : '1';
|
75 |
|
76 |
-
foreach (array('0' => esc_html__('No', '
|
77 |
echo '<option value="' . esc_attr( $key ) . '" ' . selected($key == $enable_auto_subscribe, true, false ) . '>' . esc_html( $value ) . '</option>';
|
78 |
}
|
79 |
?>
|
@@ -83,46 +83,46 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
|
|
83 |
</label>
|
84 |
</fieldset>
|
85 |
|
86 |
-
<h2 style="padding-top: 1em;"><?php esc_html_e('Opt-in Settings', '
|
87 |
-
<p><?php esc_html_e('Add text to go along with the opt-in checkbox, and choose a default display option. Customers can click a box at checkout to opt in to your newsletter. Write a signup message and choose how you want this checkbox to appear.', '
|
88 |
|
89 |
<fieldset>
|
90 |
<legend class="screen-reader-text">
|
91 |
-
<span><?php esc_html_e('Newsletter Label', '
|
92 |
</legend>
|
93 |
<label for="<?php echo $this->plugin_name; ?>-newsletter-checkbox-label">
|
94 |
-
<textarea style="width: 30%;" rows="3" id="<?php echo $this->plugin_name; ?>-newsletter-checkbox-label" name="<?php echo $this->plugin_name; ?>[newsletter_label]"><?php echo isset($options['newsletter_label']) ? esc_html($options['newsletter_label']) : esc_html__('Subscribe to our newsletter', '
|
95 |
<span><?php esc_html_e('Enter text for the opt-in checkbox', $this->plugin_name); ?></span>
|
96 |
</label>
|
97 |
-
<p class="description"><?= esc_html(__('HTML tags allowed: <a href="" target="" title=""></a> and <br>', '
|
98 |
</fieldset>
|
99 |
|
100 |
-
<h4 style="padding-top: 1em;"><?php esc_html_e('Checkbox Display Options', '
|
101 |
|
102 |
<fieldset>
|
103 |
<legend class="screen-reader-text">
|
104 |
-
<span><?php esc_html_e('Checkbox Display Options', '
|
105 |
</legend>
|
106 |
<?php $checkbox_default_settings = (array_key_exists('mailchimp_checkbox_defaults', $options) && !is_null($options['mailchimp_checkbox_defaults'])) ? $options['mailchimp_checkbox_defaults'] : 'check'; ?>
|
107 |
<label>
|
108 |
-
<input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="check"<?php if($checkbox_default_settings === 'check') echo ' checked="checked" '; ?>><?php esc_html_e('Visible, checked by default', '
|
109 |
</label>
|
110 |
<br/>
|
111 |
<label>
|
112 |
-
<input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="uncheck"<?php if($checkbox_default_settings === 'uncheck') echo ' checked="checked" '; ?>><?php esc_html_e('Visible, unchecked by default', '
|
113 |
</label>
|
114 |
<br/>
|
115 |
<label>
|
116 |
-
<input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="hide"<?php if($checkbox_default_settings === 'hide') echo ' checked="checked" '; ?>><?php esc_html_e('Hidden, unchecked by default', '
|
117 |
</label>
|
118 |
</fieldset>
|
119 |
|
120 |
-
<h4 style="padding-top: 1em;"><?php esc_html_e('Advanced Checkbox Settings', '
|
121 |
<p><?= sprintf(/* translators: %s - Woocommerce Actions documentation URL. */wp_kses( __( 'To change the location of the opt-in checkbox at checkout, input one of the <a href=%s target=_blank>available WooCommerce form actions.</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( 'https://docs.woocommerce.com/wc-apidocs/hook-docs.html' ) ); ?></p>
|
122 |
|
123 |
<fieldset>
|
124 |
<legend class="screen-reader-text">
|
125 |
-
<span><?php esc_html_e('Newsletter Checkbox Action', '
|
126 |
</legend>
|
127 |
<label for="<?php echo $this->plugin_name; ?>-newsletter-checkbox-action">
|
128 |
<input style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-newsletter-checkbox-action" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_action]" value="<?php echo isset($options['mailchimp_checkbox_action']) ? $options['mailchimp_checkbox_action'] : 'woocommerce_after_checkout_billing_form' ?>" />
|
@@ -130,24 +130,24 @@ $list_is_configured = isset($options['mailchimp_list']) && (!empty($options['mai
|
|
130 |
</label>
|
131 |
</fieldset>
|
132 |
|
133 |
-
<h2 style="padding-top: 1em;"><?php esc_html_e('Audience Member Tags', '
|
134 |
<p><?= __( 'Add a comma separated list of tags to add to the user at Mailchimp', 'mailchimp-woocommerce' ); ?></p>
|
135 |
|
136 |
<fieldset>
|
137 |
<legend class="screen-reader-text">
|
138 |
-
<span><?php esc_html_e('Audience Member Tags', '
|
139 |
</legend>
|
140 |
<label for="<?php echo $this->plugin_name; ?>-user-tags">
|
141 |
<input style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-user-tags" name="<?php echo $this->plugin_name; ?>[mailchimp_user_tags]" value="<?php echo isset($options['mailchimp_user_tags']) ? str_replace(',',', ',$options['mailchimp_user_tags']) : '' ?>" />
|
142 |
</label>
|
143 |
</fieldset>
|
144 |
|
145 |
-
<h2 style="padding-top: 1em;"><?php esc_html_e('Product Image Size', '
|
146 |
-
<p><?php esc_html_e('Define the product image size used by abandoned carts, order notifications, and product recommendations.', '
|
147 |
|
148 |
<fieldset>
|
149 |
<legend class="screen-reader-text">
|
150 |
-
<span><?php esc_html_e('Product Image Size', '
|
151 |
</legend>
|
152 |
<label for="<?php echo $this->plugin_name; ?>-mailchimp-product_image_key">
|
153 |
<select name="<?php echo $this->plugin_name; ?>[mailchimp_product_image_key]" style="width:30%">
|
32 |
|
33 |
<input type="hidden" name="mailchimp_active_settings_tab" value="newsletter_settings"/>
|
34 |
|
35 |
+
<h2 style="padding-top: 1em;"><?php esc_html_e('Audience Settings', 'mc-woocommerce');?></h2>
|
36 |
+
<p><?php esc_html_e('Please apply your audience settings. If you don\'t have an audience, you can choose to create one.', 'mc-woocommerce');?></p>
|
37 |
|
38 |
<fieldset>
|
39 |
<legend class="screen-reader-text">
|
40 |
+
<span><?php esc_html_e('Audience Name', 'mc-woocommerce');?></span>
|
41 |
</legend>
|
42 |
<label for="<?php echo $this->plugin_name; ?>-mailchimp-list-label">
|
43 |
<select name="<?php echo $this->plugin_name; ?>[mailchimp_list]" style="width:30%" required <?php if($list_is_configured): ?> disabled <?php endif; ?>>
|
44 |
|
45 |
<?php if(!isset($allow_new_list) || $allow_new_list === true): ?>
|
46 |
+
<option value="create_new"><?php esc_html_e('Create New Audience', 'mc-woocommerce');?></option>
|
47 |
<?php endif ?>
|
48 |
|
49 |
<?php if(isset($allow_new_list) && $allow_new_list === false): ?>
|
50 |
+
<option value="">-- <?php esc_html_e('Select Audience', 'mc-woocommerce');?> --</option>
|
51 |
<?php endif; ?>
|
52 |
|
53 |
<?php
|
65 |
|
66 |
<fieldset>
|
67 |
<legend class="screen-reader-text">
|
68 |
+
<span><?php esc_html_e('Auto Subscribe On Initial Sync', 'mc-woocommerce');?></span>
|
69 |
</legend>
|
70 |
<label for="<?php echo $this->plugin_name; ?>-mailchimp-auto-subscribe">
|
71 |
<select name="<?php echo $this->plugin_name; ?>[mailchimp_auto_subscribe]" style="width:30%" required <?php if($list_is_configured): ?> disabled <?php endif; ?>>
|
73 |
<?php
|
74 |
$enable_auto_subscribe = (array_key_exists('mailchimp_auto_subscribe', $options) && !is_null($options['mailchimp_auto_subscribe'])) ? $options['mailchimp_auto_subscribe'] : '1';
|
75 |
|
76 |
+
foreach (array('0' => esc_html__('No', 'mc-woocommerce'), '1' => esc_html__('Yes', 'mc-woocommerce')) as $key => $value ) {
|
77 |
echo '<option value="' . esc_attr( $key ) . '" ' . selected($key == $enable_auto_subscribe, true, false ) . '>' . esc_html( $value ) . '</option>';
|
78 |
}
|
79 |
?>
|
83 |
</label>
|
84 |
</fieldset>
|
85 |
|
86 |
+
<h2 style="padding-top: 1em;"><?php esc_html_e('Opt-in Settings', 'mc-woocommerce');?></h2>
|
87 |
+
<p><?php esc_html_e('Add text to go along with the opt-in checkbox, and choose a default display option. Customers can click a box at checkout to opt in to your newsletter. Write a signup message and choose how you want this checkbox to appear.', 'mc-woocommerce');?> </p>
|
88 |
|
89 |
<fieldset>
|
90 |
<legend class="screen-reader-text">
|
91 |
+
<span><?php esc_html_e('Newsletter Label', 'mc-woocommerce');?></span>
|
92 |
</legend>
|
93 |
<label for="<?php echo $this->plugin_name; ?>-newsletter-checkbox-label">
|
94 |
+
<textarea style="width: 30%;" rows="3" id="<?php echo $this->plugin_name; ?>-newsletter-checkbox-label" name="<?php echo $this->plugin_name; ?>[newsletter_label]"><?php echo isset($options['newsletter_label']) ? esc_html($options['newsletter_label']) : esc_html__('Subscribe to our newsletter', 'mc-woocommerce'); ?></textarea>
|
95 |
<span><?php esc_html_e('Enter text for the opt-in checkbox', $this->plugin_name); ?></span>
|
96 |
</label>
|
97 |
+
<p class="description"><?= esc_html(__('HTML tags allowed: <a href="" target="" title=""></a> and <br>', 'mc-woocommerce')); ?></p>
|
98 |
</fieldset>
|
99 |
|
100 |
+
<h4 style="padding-top: 1em;"><?php esc_html_e('Checkbox Display Options', 'mc-woocommerce');?></h4>
|
101 |
|
102 |
<fieldset>
|
103 |
<legend class="screen-reader-text">
|
104 |
+
<span><?php esc_html_e('Checkbox Display Options', 'mc-woocommerce');?></span>
|
105 |
</legend>
|
106 |
<?php $checkbox_default_settings = (array_key_exists('mailchimp_checkbox_defaults', $options) && !is_null($options['mailchimp_checkbox_defaults'])) ? $options['mailchimp_checkbox_defaults'] : 'check'; ?>
|
107 |
<label>
|
108 |
+
<input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="check"<?php if($checkbox_default_settings === 'check') echo ' checked="checked" '; ?>><?php esc_html_e('Visible, checked by default', 'mc-woocommerce');?><br>
|
109 |
</label>
|
110 |
<br/>
|
111 |
<label>
|
112 |
+
<input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="uncheck"<?php if($checkbox_default_settings === 'uncheck') echo ' checked="checked" '; ?>><?php esc_html_e('Visible, unchecked by default', 'mc-woocommerce');?><br/>
|
113 |
</label>
|
114 |
<br/>
|
115 |
<label>
|
116 |
+
<input type="radio" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_defaults]" value="hide"<?php if($checkbox_default_settings === 'hide') echo ' checked="checked" '; ?>><?php esc_html_e('Hidden, unchecked by default', 'mc-woocommerce');?><br/>
|
117 |
</label>
|
118 |
</fieldset>
|
119 |
|
120 |
+
<h4 style="padding-top: 1em;"><?php esc_html_e('Advanced Checkbox Settings', 'mc-woocommerce');?></h4>
|
121 |
<p><?= sprintf(/* translators: %s - Woocommerce Actions documentation URL. */wp_kses( __( 'To change the location of the opt-in checkbox at checkout, input one of the <a href=%s target=_blank>available WooCommerce form actions.</a>.', 'mailchimp-woocommerce' ), array( 'a' => array( 'href' => array() ) ) ), esc_url( 'https://docs.woocommerce.com/wc-apidocs/hook-docs.html' ) ); ?></p>
|
122 |
|
123 |
<fieldset>
|
124 |
<legend class="screen-reader-text">
|
125 |
+
<span><?php esc_html_e('Newsletter Checkbox Action', 'mc-woocommerce');?></span>
|
126 |
</legend>
|
127 |
<label for="<?php echo $this->plugin_name; ?>-newsletter-checkbox-action">
|
128 |
<input style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-newsletter-checkbox-action" name="<?php echo $this->plugin_name; ?>[mailchimp_checkbox_action]" value="<?php echo isset($options['mailchimp_checkbox_action']) ? $options['mailchimp_checkbox_action'] : 'woocommerce_after_checkout_billing_form' ?>" />
|
130 |
</label>
|
131 |
</fieldset>
|
132 |
|
133 |
+
<h2 style="padding-top: 1em;"><?php esc_html_e('Audience Member Tags', 'mc-woocommerce');?></h2>
|
134 |
<p><?= __( 'Add a comma separated list of tags to add to the user at Mailchimp', 'mailchimp-woocommerce' ); ?></p>
|
135 |
|
136 |
<fieldset>
|
137 |
<legend class="screen-reader-text">
|
138 |
+
<span><?php esc_html_e('Audience Member Tags', 'mc-woocommerce');?></span>
|
139 |
</legend>
|
140 |
<label for="<?php echo $this->plugin_name; ?>-user-tags">
|
141 |
<input style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-user-tags" name="<?php echo $this->plugin_name; ?>[mailchimp_user_tags]" value="<?php echo isset($options['mailchimp_user_tags']) ? str_replace(',',', ',$options['mailchimp_user_tags']) : '' ?>" />
|
142 |
</label>
|
143 |
</fieldset>
|
144 |
|
145 |
+
<h2 style="padding-top: 1em;"><?php esc_html_e('Product Image Size', 'mc-woocommerce');?></h2>
|
146 |
+
<p><?php esc_html_e('Define the product image size used by abandoned carts, order notifications, and product recommendations.', 'mc-woocommerce');?></p>
|
147 |
|
148 |
<fieldset>
|
149 |
<legend class="screen-reader-text">
|
150 |
+
<span><?php esc_html_e('Product Image Size', 'mc-woocommerce');?></span>
|
151 |
</legend>
|
152 |
<label for="<?php echo $this->plugin_name; ?>-mailchimp-product_image_key">
|
153 |
<select name="<?php echo $this->plugin_name; ?>[mailchimp_product_image_key]" style="width:30%">
|
admin/partials/tabs/notices.php
CHANGED
@@ -3,19 +3,19 @@
|
|
3 |
<?php
|
4 |
switch($_GET['error_notice']) {
|
5 |
case 'missing_api_key':
|
6 |
-
esc_html_e('Mailchimp says: You must enter in a valid API key.', '
|
7 |
break;
|
8 |
case 'missing_campaign_defaults':
|
9 |
-
esc_html_e('Mailchimp says: Sorry you must set up your campaign defaults before you proceed!', '
|
10 |
break;
|
11 |
case 'missing_list':
|
12 |
-
esc_html_e('Mailchimp says: You must select a marketing audience.', '
|
13 |
break;
|
14 |
case 'missing_store':
|
15 |
-
esc_html_e('Mailchimp says: Sorry you must set up your store before you proceed!', '
|
16 |
break;
|
17 |
case 'not_ready_for_sync':
|
18 |
-
esc_html_e('Mailchimp says: You are not fully ready to run the Store Sync, please verify your settings before proceeding.', '
|
19 |
break;
|
20 |
default:
|
21 |
|
@@ -29,7 +29,7 @@
|
|
29 |
<?php
|
30 |
switch($_GET['error_notice']) {
|
31 |
case 're-sync-started':
|
32 |
-
esc_html_e('Mailchimp says: Your re-sync has been started!', '
|
33 |
break;
|
34 |
default:
|
35 |
}
|
3 |
<?php
|
4 |
switch($_GET['error_notice']) {
|
5 |
case 'missing_api_key':
|
6 |
+
esc_html_e('Mailchimp says: You must enter in a valid API key.', 'mc-woocommerce');
|
7 |
break;
|
8 |
case 'missing_campaign_defaults':
|
9 |
+
esc_html_e('Mailchimp says: Sorry you must set up your campaign defaults before you proceed!', 'mc-woocommerce');
|
10 |
break;
|
11 |
case 'missing_list':
|
12 |
+
esc_html_e('Mailchimp says: You must select a marketing audience.', 'mc-woocommerce');
|
13 |
break;
|
14 |
case 'missing_store':
|
15 |
+
esc_html_e('Mailchimp says: Sorry you must set up your store before you proceed!', 'mc-woocommerce');
|
16 |
break;
|
17 |
case 'not_ready_for_sync':
|
18 |
+
esc_html_e('Mailchimp says: You are not fully ready to run the Store Sync, please verify your settings before proceeding.', 'mc-woocommerce');
|
19 |
break;
|
20 |
default:
|
21 |
|
29 |
<?php
|
30 |
switch($_GET['error_notice']) {
|
31 |
case 're-sync-started':
|
32 |
+
esc_html_e('Mailchimp says: Your re-sync has been started!', 'mc-woocommerce');
|
33 |
break;
|
34 |
default:
|
35 |
}
|
admin/partials/tabs/store_info.php
CHANGED
@@ -15,7 +15,7 @@ if (!$handler->hasValidApiKey()) {
|
|
15 |
|
16 |
<fieldset>
|
17 |
<legend class="screen-reader-text">
|
18 |
-
<span><?php esc_html_e('Store Name', '
|
19 |
</legend>
|
20 |
<label for="<?php echo $this->plugin_name; ?>-store-name-label">
|
21 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-name-label" name="<?php echo $this->plugin_name; ?>[store_name]" value="<?php echo isset($options['store_name']) ? $options['store_name'] : get_option('blogname') ?>" />
|
@@ -33,7 +33,7 @@ if (!$handler->hasValidApiKey()) {
|
|
33 |
|
34 |
<fieldset>
|
35 |
<legend class="screen-reader-text">
|
36 |
-
<span><?php esc_html_e('Email', '
|
37 |
</legend>
|
38 |
<label for="<?php echo $this->plugin_name; ?>-admin-email-label">
|
39 |
<input required style="width: 30%;" type="email" id="<?php echo $this->plugin_name; ?>-admin-email-label" name="<?php echo $this->plugin_name; ?>[admin_email]" value="<?php echo isset($options['admin_email']) ? $options['admin_email'] : get_option('admin_email') ?>" />
|
@@ -51,7 +51,7 @@ if (!$handler->hasValidApiKey()) {
|
|
51 |
|
52 |
<fieldset>
|
53 |
<legend class="screen-reader-text">
|
54 |
-
<span><?php esc_html_e('Street Address', '
|
55 |
</legend>
|
56 |
<label for="<?php echo $this->plugin_name; ?>-store-address-label">
|
57 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-address-label" name="<?php echo $this->plugin_name; ?>[store_street]" value="<?php echo isset($options['store_street']) ? $options['store_street'] : '' ?>" />
|
@@ -69,7 +69,7 @@ if (!$handler->hasValidApiKey()) {
|
|
69 |
|
70 |
<fieldset>
|
71 |
<legend class="screen-reader-text">
|
72 |
-
<span><?php esc_html_e('City', '
|
73 |
</legend>
|
74 |
<label for="<?php echo $this->plugin_name; ?>-store-city-label">
|
75 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-city-label" name="<?php echo $this->plugin_name; ?>[store_city]" value="<?php echo isset($options['store_city']) ? $options['store_city'] : '' ?>" />
|
@@ -87,7 +87,7 @@ if (!$handler->hasValidApiKey()) {
|
|
87 |
|
88 |
<fieldset>
|
89 |
<legend class="screen-reader-text">
|
90 |
-
<span><?php esc_html_e('State', '
|
91 |
</legend>
|
92 |
<label for="<?php echo $this->plugin_name; ?>-store-state-label">
|
93 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-state-label" name="<?php echo $this->plugin_name; ?>[store_state]" value="<?php echo isset($options['store_state']) ? $options['store_state'] : '' ?>" />
|
@@ -105,7 +105,7 @@ if (!$handler->hasValidApiKey()) {
|
|
105 |
|
106 |
<fieldset>
|
107 |
<legend class="screen-reader-text">
|
108 |
-
<span><?php esc_html_e('Postal Code', '
|
109 |
</legend>
|
110 |
<label for="<?php echo $this->plugin_name; ?>-store-postal-code-label">
|
111 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-postal-code-label" name="<?php echo $this->plugin_name; ?>[store_postal_code]" value="<?php echo isset($options['store_postal_code']) ? $options['store_postal_code'] : '' ?>" />
|
@@ -123,7 +123,7 @@ if (!$handler->hasValidApiKey()) {
|
|
123 |
|
124 |
<fieldset>
|
125 |
<legend class="screen-reader-text">
|
126 |
-
<span><?php esc_html_e('Country', '
|
127 |
</legend>
|
128 |
<label for="<?php echo $this->plugin_name; ?>-store-country-label">
|
129 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-country-label" name="<?php echo $this->plugin_name; ?>[store_country]" value="<?php echo isset($options['store_country']) ? $options['store_country'] : 'US' ?>" />
|
@@ -141,7 +141,7 @@ if (!$handler->hasValidApiKey()) {
|
|
141 |
|
142 |
<fieldset>
|
143 |
<legend class="screen-reader-text">
|
144 |
-
<span><?php esc_html_e('Phone Number', '
|
145 |
</legend>
|
146 |
<label for="<?php echo $this->plugin_name; ?>-store-phone-label">
|
147 |
<input style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-phone-label" name="<?php echo $this->plugin_name; ?>[store_phone]" value="<?php echo isset($options['store_phone']) ? $options['store_phone'] : '' ?>" />
|
@@ -163,7 +163,7 @@ if (!$handler->hasValidApiKey()) {
|
|
163 |
|
164 |
<fieldset>
|
165 |
<legend class="screen-reader-text">
|
166 |
-
<span><?php esc_html_e('Locale', '
|
167 |
</legend>
|
168 |
<label for="<?php echo $this->plugin_name; ?>-store-locale-label">
|
169 |
<select name="<?php echo $this->plugin_name; ?>[store_locale]" style="width:30%" required>
|
@@ -180,29 +180,19 @@ if (!$handler->hasValidApiKey()) {
|
|
180 |
|
181 |
<fieldset>
|
182 |
<legend class="screen-reader-text">
|
183 |
-
<span><?php esc_html_e('Currency Code', '
|
184 |
</legend>
|
|
|
|
|
185 |
<label for="<?php echo $this->plugin_name; ?>-store-currency-code-label">
|
186 |
-
<
|
187 |
-
|
188 |
-
<?php
|
189 |
-
$all_currencies = MailChimp_WooCommerce_CurrencyCodes::lists();
|
190 |
-
$selected_currency_code = isset($options['store_currency_code']) && !empty($options['store_currency_code']) ? $options['store_currency_code'] : 'USD';
|
191 |
-
if (! in_array($selected_currency_code, array_keys($all_currencies))) {
|
192 |
-
echo '<option value="" selected>' . $selected_currency_code . ' ['.esc_html__('deprecated', 'mailchimp-woocommerce').']</option>';
|
193 |
-
}
|
194 |
-
foreach ($all_currencies as $key => $value ) {
|
195 |
-
echo '<option value="' . esc_attr( $key ) . '" ' . selected($key === $selected_currency_code, true, false ) . '>' . $key .' | '. $value . '</option>';
|
196 |
-
}
|
197 |
-
?>
|
198 |
-
</select>
|
199 |
-
<span><?php esc_html_e('Currency', $this->plugin_name); ?></span>
|
200 |
</label>
|
201 |
</fieldset>
|
202 |
|
203 |
<fieldset>
|
204 |
<legend class="screen-reader-text">
|
205 |
-
<span><?php esc_html_e('Timezone', '
|
206 |
</legend>
|
207 |
<label for="<?php echo $this->plugin_name; ?>-store-timezone-label">
|
208 |
<select name="<?php echo $this->plugin_name; ?>[store_timezone]" style="width:30%" required>
|
15 |
|
16 |
<fieldset>
|
17 |
<legend class="screen-reader-text">
|
18 |
+
<span><?php esc_html_e('Store Name', 'mc-woocommerce');?></span>
|
19 |
</legend>
|
20 |
<label for="<?php echo $this->plugin_name; ?>-store-name-label">
|
21 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-name-label" name="<?php echo $this->plugin_name; ?>[store_name]" value="<?php echo isset($options['store_name']) ? $options['store_name'] : get_option('blogname') ?>" />
|
33 |
|
34 |
<fieldset>
|
35 |
<legend class="screen-reader-text">
|
36 |
+
<span><?php esc_html_e('Email', 'mc-woocommerce');?></span>
|
37 |
</legend>
|
38 |
<label for="<?php echo $this->plugin_name; ?>-admin-email-label">
|
39 |
<input required style="width: 30%;" type="email" id="<?php echo $this->plugin_name; ?>-admin-email-label" name="<?php echo $this->plugin_name; ?>[admin_email]" value="<?php echo isset($options['admin_email']) ? $options['admin_email'] : get_option('admin_email') ?>" />
|
51 |
|
52 |
<fieldset>
|
53 |
<legend class="screen-reader-text">
|
54 |
+
<span><?php esc_html_e('Street Address', 'mc-woocommerce');?></span>
|
55 |
</legend>
|
56 |
<label for="<?php echo $this->plugin_name; ?>-store-address-label">
|
57 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-address-label" name="<?php echo $this->plugin_name; ?>[store_street]" value="<?php echo isset($options['store_street']) ? $options['store_street'] : '' ?>" />
|
69 |
|
70 |
<fieldset>
|
71 |
<legend class="screen-reader-text">
|
72 |
+
<span><?php esc_html_e('City', 'mc-woocommerce');?></span>
|
73 |
</legend>
|
74 |
<label for="<?php echo $this->plugin_name; ?>-store-city-label">
|
75 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-city-label" name="<?php echo $this->plugin_name; ?>[store_city]" value="<?php echo isset($options['store_city']) ? $options['store_city'] : '' ?>" />
|
87 |
|
88 |
<fieldset>
|
89 |
<legend class="screen-reader-text">
|
90 |
+
<span><?php esc_html_e('State', 'mc-woocommerce');?></span>
|
91 |
</legend>
|
92 |
<label for="<?php echo $this->plugin_name; ?>-store-state-label">
|
93 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-state-label" name="<?php echo $this->plugin_name; ?>[store_state]" value="<?php echo isset($options['store_state']) ? $options['store_state'] : '' ?>" />
|
105 |
|
106 |
<fieldset>
|
107 |
<legend class="screen-reader-text">
|
108 |
+
<span><?php esc_html_e('Postal Code', 'mc-woocommerce');?></span>
|
109 |
</legend>
|
110 |
<label for="<?php echo $this->plugin_name; ?>-store-postal-code-label">
|
111 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-postal-code-label" name="<?php echo $this->plugin_name; ?>[store_postal_code]" value="<?php echo isset($options['store_postal_code']) ? $options['store_postal_code'] : '' ?>" />
|
123 |
|
124 |
<fieldset>
|
125 |
<legend class="screen-reader-text">
|
126 |
+
<span><?php esc_html_e('Country', 'mc-woocommerce');?></span>
|
127 |
</legend>
|
128 |
<label for="<?php echo $this->plugin_name; ?>-store-country-label">
|
129 |
<input required style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-country-label" name="<?php echo $this->plugin_name; ?>[store_country]" value="<?php echo isset($options['store_country']) ? $options['store_country'] : 'US' ?>" />
|
141 |
|
142 |
<fieldset>
|
143 |
<legend class="screen-reader-text">
|
144 |
+
<span><?php esc_html_e('Phone Number', 'mc-woocommerce');?></span>
|
145 |
</legend>
|
146 |
<label for="<?php echo $this->plugin_name; ?>-store-phone-label">
|
147 |
<input style="width: 30%;" type="text" id="<?php echo $this->plugin_name; ?>-store-phone-label" name="<?php echo $this->plugin_name; ?>[store_phone]" value="<?php echo isset($options['store_phone']) ? $options['store_phone'] : '' ?>" />
|
163 |
|
164 |
<fieldset>
|
165 |
<legend class="screen-reader-text">
|
166 |
+
<span><?php esc_html_e('Locale', 'mc-woocommerce');?></span>
|
167 |
</legend>
|
168 |
<label for="<?php echo $this->plugin_name; ?>-store-locale-label">
|
169 |
<select name="<?php echo $this->plugin_name; ?>[store_locale]" style="width:30%" required>
|
180 |
|
181 |
<fieldset>
|
182 |
<legend class="screen-reader-text">
|
183 |
+
<span><?php esc_html_e('Currency Code', 'mc-woocommerce');?></span>
|
184 |
</legend>
|
185 |
+
<?php $all_currencies = MailChimp_WooCommerce_CurrencyCodes::lists();?>
|
186 |
+
|
187 |
<label for="<?php echo $this->plugin_name; ?>-store-currency-code-label">
|
188 |
+
<input style="width: 30%;" type="text" value="<?php echo isset($options['store_currency_code']) ? $options['store_currency_code'] . ' | ' . $all_currencies[$options['store_currency_code']]: '' ?>" disabled/>
|
189 |
+
<span><?php esc_html_e('Currency', $this->plugin_name); ?> (<span class="description"><?php esc_html_e('Retrieved from Woocommerce Settings', $this->plugin_name); ?></span>)</span>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
190 |
</label>
|
191 |
</fieldset>
|
192 |
|
193 |
<fieldset>
|
194 |
<legend class="screen-reader-text">
|
195 |
+
<span><?php esc_html_e('Timezone', 'mc-woocommerce');?></span>
|
196 |
</legend>
|
197 |
<label for="<?php echo $this->plugin_name; ?>-store-timezone-label">
|
198 |
<select name="<?php echo $this->plugin_name; ?>[store_timezone]" style="width:30%" required>
|
admin/partials/tabs/store_sync.php
CHANGED
@@ -51,25 +51,33 @@ if (($mailchimp_api = mailchimp_get_api()) && ($store = $mailchimp_api->getStore
|
|
51 |
|
52 |
<input type="hidden" name="mailchimp_active_settings_tab" value="store_sync"/>
|
53 |
|
54 |
-
<h2 style="padding-top: 1em;"><?php esc_html_e('Sync Information', '
|
55 |
|
56 |
<?php if ($sync_started_at && !$sync_completed_at): ?>
|
57 |
-
<p><strong><?php esc_html_e('Initial Sync:', '
|
58 |
<?php endif; ?>
|
59 |
|
60 |
<?php if ($last_updated_time): ?>
|
61 |
-
<p
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
62 |
<?php endif; ?>
|
63 |
|
64 |
-
<p><strong><?php esc_html_e('Account Connected:', '
|
65 |
-
<p><strong><?php esc_html_e('Audience Connected:', '
|
66 |
-
<p><strong><?php esc_html_e('Products Synced:', '
|
67 |
-
<p><strong><?php esc_html_e('Orders Synced:', '
|
68 |
|
69 |
<?php if($mailchimp_api && (!$store_syncing || isset($_GET['resync']) && $_GET['resync'] === '1')): ?>
|
70 |
-
<h2 style="padding-top: 1em;"><?php esc_html_e('Advanced', '
|
71 |
<p id="resync_data_help_text">
|
72 |
-
<?php esc_html_e('You can resync your audience at any time without losing any of your e-commerce data.', '
|
73 |
</p>
|
74 |
-
<?php submit_button(__('Resync', '
|
75 |
<?php endif; ?>
|
51 |
|
52 |
<input type="hidden" name="mailchimp_active_settings_tab" value="store_sync"/>
|
53 |
|
54 |
+
<h2 style="padding-top: 1em;"><?php esc_html_e('Sync Information', 'mc-woocommerce');?></h2>
|
55 |
|
56 |
<?php if ($sync_started_at && !$sync_completed_at): ?>
|
57 |
+
<p><strong><?php esc_html_e('Initial Sync:', 'mc-woocommerce');?></strong> <i><?php esc_html_e('In Progress', 'mc-woocommerce');?></i></p>
|
58 |
<?php endif; ?>
|
59 |
|
60 |
<?php if ($last_updated_time): ?>
|
61 |
+
<p>
|
62 |
+
<strong>
|
63 |
+
<?php esc_html_e('Last Updated:', 'mc-woocommerce');?>
|
64 |
+
</strong>
|
65 |
+
<i id="mailchimp_last_updated">
|
66 |
+
<?php echo date_i18n( __('D, M j, Y g:i A', 'mc-woocommerce'), $last_updated_time->getTimestamp())?>
|
67 |
+
</i>
|
68 |
+
<span class="spinner" style="float:none; background-size: 16px 16px; width: 16px; height: 16px; margin: 0px 10px"></span>
|
69 |
+
</p>
|
70 |
<?php endif; ?>
|
71 |
|
72 |
+
<p><strong><?php esc_html_e('Account Connected:', 'mc-woocommerce');?></strong> <span id="mailchimp_account_connected"><?php echo $account_name; ?></span></p>
|
73 |
+
<p><strong><?php esc_html_e('Audience Connected:', 'mc-woocommerce');?></strong> <span id="mailchimp_list_name"><?php echo $mailchimp_list_name; ?></span></p>
|
74 |
+
<p><strong><?php esc_html_e('Products Synced:', 'mc-woocommerce');?></strong> <span id="mailchimp_product_count"><?php echo $mailchimp_total_products; ?></span></p>
|
75 |
+
<p><strong><?php esc_html_e('Orders Synced:', 'mc-woocommerce');?></strong> <span id="mailchimp_order_count"><?php echo $mailchimp_total_orders; ?></span></p>
|
76 |
|
77 |
<?php if($mailchimp_api && (!$store_syncing || isset($_GET['resync']) && $_GET['resync'] === '1')): ?>
|
78 |
+
<h2 style="padding-top: 1em;"><?php esc_html_e('Advanced', 'mc-woocommerce');?></h2>
|
79 |
<p id="resync_data_help_text">
|
80 |
+
<?php esc_html_e('You can resync your audience at any time without losing any of your e-commerce data.', 'mc-woocommerce');?>
|
81 |
</p>
|
82 |
+
<?php submit_button(__('Resync', 'mc-woocommerce'), 'primary','submit', TRUE); ?>
|
83 |
<?php endif; ?>
|
bootstrap.php
CHANGED
@@ -70,7 +70,6 @@ spl_autoload_register(function($class) {
|
|
70 |
|
71 |
'WP_Job' => 'includes/vendor/queue/classes/wp-job.php',
|
72 |
'WP_Queue' => 'includes/vendor/queue/classes/wp-queue.php',
|
73 |
-
'WP_Http_Worker' => 'includes/vendor/queue/classes/worker/wp-http-worker.php',
|
74 |
'WP_Worker' => 'includes/vendor/queue/classes/worker/wp-worker.php',
|
75 |
'Queue_Command' => 'includes/vendor/queue/classes/cli/queue-command.php',
|
76 |
);
|
@@ -92,8 +91,8 @@ function mailchimp_environment_variables() {
|
|
92 |
|
93 |
return (object) array(
|
94 |
'repo' => 'master',
|
95 |
-
'environment' => '
|
96 |
-
'version' => '2.1.
|
97 |
'php_version' => phpversion(),
|
98 |
'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
|
99 |
'wc_version' => function_exists('WC') ? WC()->version : null,
|
@@ -170,7 +169,18 @@ if (!function_exists( 'wp_queue')) {
|
|
170 |
* @param bool $force_now
|
171 |
*/
|
172 |
function mailchimp_handle_or_queue(WP_Job $job, $delay = 0, $force_now = false)
|
173 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
174 |
wp_queue($job, $delay);
|
175 |
|
176 |
// force now is used during the sync.
|
@@ -302,10 +312,13 @@ function mailchimp_get_user_tags_to_update() {
|
|
302 |
}
|
303 |
|
304 |
$tags = explode(',', $tags);
|
305 |
-
|
306 |
foreach ($tags as $tag) {
|
307 |
$formatted_tags[] = array("name" => $tag, "status" => 'active');
|
308 |
}
|
|
|
|
|
|
|
309 |
|
310 |
return $formatted_tags;
|
311 |
}
|
@@ -910,6 +923,10 @@ function mailchimp_woocommerce_check_if_http_worker_fails() {
|
|
910 |
$message = __('The REST API seems to be disabled on this wordpress site. Please enable to sync data.', 'mailchimp-woocommerce');
|
911 |
mailchimp_set_data('test.can.remote_post', false);
|
912 |
mailchimp_set_data('test.can.remote_post.error', $message);
|
|
|
|
|
|
|
|
|
913 |
return $message;
|
914 |
}
|
915 |
}
|
@@ -1231,15 +1248,17 @@ function mailchimp_rest_response($data, $status = 200) {
|
|
1231 |
*/
|
1232 |
function mailchimp_has_started_syncing() {
|
1233 |
$sync_started_at = get_option('mailchimp-woocommerce-sync.started_at');
|
1234 |
-
|
|
|
1235 |
}
|
1236 |
|
1237 |
/**
|
1238 |
* @return bool
|
1239 |
*/
|
1240 |
function mailchimp_is_done_syncing() {
|
|
|
1241 |
$sync_completed_at = get_option('mailchimp-woocommerce-sync.completed_at');
|
1242 |
-
return
|
1243 |
}
|
1244 |
|
1245 |
function run_mailchimp_woocommerce() {
|
70 |
|
71 |
'WP_Job' => 'includes/vendor/queue/classes/wp-job.php',
|
72 |
'WP_Queue' => 'includes/vendor/queue/classes/wp-queue.php',
|
|
|
73 |
'WP_Worker' => 'includes/vendor/queue/classes/worker/wp-worker.php',
|
74 |
'Queue_Command' => 'includes/vendor/queue/classes/cli/queue-command.php',
|
75 |
);
|
91 |
|
92 |
return (object) array(
|
93 |
'repo' => 'master',
|
94 |
+
'environment' => 'staging', // staging or production
|
95 |
+
'version' => '2.1.17',
|
96 |
'php_version' => phpversion(),
|
97 |
'wp_version' => (empty($wp_version) ? 'Unknown' : $wp_version),
|
98 |
'wc_version' => function_exists('WC') ? WC()->version : null,
|
169 |
* @param bool $force_now
|
170 |
*/
|
171 |
function mailchimp_handle_or_queue(WP_Job $job, $delay = 0, $force_now = false)
|
172 |
+
{
|
173 |
+
if ($job instanceof \MailChimp_WooCommerce_Single_Order && isset($job->order_id)) {
|
174 |
+
// if this is a order process already queued - just skip this
|
175 |
+
if (get_site_transient("mailchimp_order_being_processed_{$job->order_id}") == true) {
|
176 |
+
mailchimp_debug('order_sync.abort', "transient true for order {$job->order_id}. Skipping queue item addition.");
|
177 |
+
return;
|
178 |
+
}
|
179 |
+
// tell the system the order is already queued for processing in this saving process - and we don't need to process it again.
|
180 |
+
set_site_transient( "mailchimp_order_being_processed_{$job->order_id}", true, 30);
|
181 |
+
mailchimp_debug('order_sync.transient', "transient set for order {$job->order_id}");
|
182 |
+
}
|
183 |
+
|
184 |
wp_queue($job, $delay);
|
185 |
|
186 |
// force now is used during the sync.
|
312 |
}
|
313 |
|
314 |
$tags = explode(',', $tags);
|
315 |
+
|
316 |
foreach ($tags as $tag) {
|
317 |
$formatted_tags[] = array("name" => $tag, "status" => 'active');
|
318 |
}
|
319 |
+
|
320 |
+
// apply filter to user custom tags addition/removal
|
321 |
+
$formatted_tags = apply_filters('mailchimp_user_tags', $formatted_tags);
|
322 |
|
323 |
return $formatted_tags;
|
324 |
}
|
923 |
$message = __('The REST API seems to be disabled on this wordpress site. Please enable to sync data.', 'mailchimp-woocommerce');
|
924 |
mailchimp_set_data('test.can.remote_post', false);
|
925 |
mailchimp_set_data('test.can.remote_post.error', $message);
|
926 |
+
mailchimp_error('test.rest_api', '', array(
|
927 |
+
'status' => $r->get_status(),
|
928 |
+
'body' => $r->get_data(),
|
929 |
+
));
|
930 |
return $message;
|
931 |
}
|
932 |
}
|
1248 |
*/
|
1249 |
function mailchimp_has_started_syncing() {
|
1250 |
$sync_started_at = get_option('mailchimp-woocommerce-sync.started_at');
|
1251 |
+
$sync_completed_at = get_option('mailchimp-woocommerce-sync.completed_at');
|
1252 |
+
return ($sync_completed_at < $sync_started_at);
|
1253 |
}
|
1254 |
|
1255 |
/**
|
1256 |
* @return bool
|
1257 |
*/
|
1258 |
function mailchimp_is_done_syncing() {
|
1259 |
+
$sync_started_at = get_option('mailchimp-woocommerce-sync.started_at');
|
1260 |
$sync_completed_at = get_option('mailchimp-woocommerce-sync.completed_at');
|
1261 |
+
return ($sync_completed_at >= $sync_started_at);
|
1262 |
}
|
1263 |
|
1264 |
function run_mailchimp_woocommerce() {
|
includes/api/assets/class-mailchimp-cart.php
CHANGED
@@ -93,8 +93,9 @@ class MailChimp_WooCommerce_Cart
|
|
93 |
{
|
94 |
$api = MailChimp_WooCommerce_MailChimpApi::getInstance();
|
95 |
$cid = trim($id);
|
96 |
-
$campaign = $api->getCampaign($cid)
|
97 |
-
|
|
|
98 |
return $this;
|
99 |
}
|
100 |
|
@@ -133,9 +134,9 @@ class MailChimp_WooCommerce_Cart
|
|
133 |
* @param $code
|
134 |
* @return $this
|
135 |
*/
|
136 |
-
public function setCurrencyCode(
|
137 |
{
|
138 |
-
$this->currency_code =
|
139 |
|
140 |
return $this;
|
141 |
}
|
@@ -146,8 +147,7 @@ class MailChimp_WooCommerce_Cart
|
|
146 |
public function getCurrencyCode()
|
147 |
{
|
148 |
if (empty($this->currency_code)) {
|
149 |
-
$
|
150 |
-
$this->currency_code = isset($options['store_currency_code']) ? $options['store_currency_code'] : 'USD';
|
151 |
}
|
152 |
|
153 |
return $this->currency_code;
|
93 |
{
|
94 |
$api = MailChimp_WooCommerce_MailChimpApi::getInstance();
|
95 |
$cid = trim($id);
|
96 |
+
if (($campaign = $api->getCampaign($cid, false))) {
|
97 |
+
$this->campaign_id = $campaign['id'];
|
98 |
+
}
|
99 |
return $this;
|
100 |
}
|
101 |
|
134 |
* @param $code
|
135 |
* @return $this
|
136 |
*/
|
137 |
+
public function setCurrencyCode()
|
138 |
{
|
139 |
+
$this->currency_code = get_woocommerce_currency();
|
140 |
|
141 |
return $this;
|
142 |
}
|
147 |
public function getCurrencyCode()
|
148 |
{
|
149 |
if (empty($this->currency_code)) {
|
150 |
+
$this->currency_code = get_woocommerce_currency();
|
|
|
151 |
}
|
152 |
|
153 |
return $this->currency_code;
|
includes/api/assets/class-mailchimp-customer.php
CHANGED
@@ -260,7 +260,7 @@ class MailChimp_WooCommerce_Customer
|
|
260 |
/**
|
261 |
* @return array
|
262 |
*/
|
263 |
-
public function
|
264 |
{
|
265 |
return array(
|
266 |
'FNAME' => trim($this->getFirstName()),
|
@@ -283,7 +283,7 @@ class MailChimp_WooCommerce_Customer
|
|
283 |
'first_name' => (string) $this->getFirstName(),
|
284 |
'last_name' => (string) $this->getLastName(),
|
285 |
'orders_count' => (int) $this->getOrdersCount(),
|
286 |
-
'total_spent' => floatval(number_format($this->getTotalSpent(), 2)),
|
287 |
'address' => (empty($address) ? null : $address),
|
288 |
));
|
289 |
}
|
260 |
/**
|
261 |
* @return array
|
262 |
*/
|
263 |
+
public function getMergeFields()
|
264 |
{
|
265 |
return array(
|
266 |
'FNAME' => trim($this->getFirstName()),
|
283 |
'first_name' => (string) $this->getFirstName(),
|
284 |
'last_name' => (string) $this->getLastName(),
|
285 |
'orders_count' => (int) $this->getOrdersCount(),
|
286 |
+
'total_spent' => floatval(number_format($this->getTotalSpent(), 2, '.', '')),
|
287 |
'address' => (empty($address) ? null : $address),
|
288 |
));
|
289 |
}
|
includes/api/assets/class-mailchimp-order.php
CHANGED
@@ -212,8 +212,9 @@ class MailChimp_WooCommerce_Order
|
|
212 |
{
|
213 |
$api = MailChimp_WooCommerce_MailChimpApi::getInstance();
|
214 |
$cid = trim($id);
|
215 |
-
$campaign = $api->getCampaign($cid)
|
216 |
-
|
|
|
217 |
return $this;
|
218 |
}
|
219 |
|
@@ -267,10 +268,10 @@ class MailChimp_WooCommerce_Order
|
|
267 |
* @param null $currency_code
|
268 |
* @return MailChimp_WooCommerce_Order
|
269 |
*/
|
270 |
-
public function setCurrencyCode(
|
271 |
{
|
272 |
-
$
|
273 |
-
|
274 |
return $this;
|
275 |
}
|
276 |
|
@@ -508,11 +509,14 @@ class MailChimp_WooCommerce_Order
|
|
508 |
*/
|
509 |
public function toArray()
|
510 |
{
|
|
|
|
|
511 |
return mailchimp_array_remove_empty(array(
|
512 |
'id' => (string) $this->getId(),
|
513 |
'landing_site' => (string) $this->getLandingSite(),
|
514 |
'customer' => $this->getCustomer()->toArray(),
|
515 |
-
'campaign_id' => (string) $this->getCampaignId(),
|
|
|
516 |
'financial_status' => (string) $this->getFinancialStatus(),
|
517 |
'fulfillment_status' => (string) $this->getFulfillmentStatus(),
|
518 |
'currency_code' => (string) $this->getCurrencyCode(),
|
212 |
{
|
213 |
$api = MailChimp_WooCommerce_MailChimpApi::getInstance();
|
214 |
$cid = trim($id);
|
215 |
+
if (($campaign = $api->getCampaign($cid, false))) {
|
216 |
+
$this->campaign_id = $campaign['id'];
|
217 |
+
}
|
218 |
return $this;
|
219 |
}
|
220 |
|
268 |
* @param null $currency_code
|
269 |
* @return MailChimp_WooCommerce_Order
|
270 |
*/
|
271 |
+
public function setCurrencyCode()
|
272 |
{
|
273 |
+
$woo = new WC_Order($this->id);
|
274 |
+
$this->currency_code = $woo->get_currency();
|
275 |
return $this;
|
276 |
}
|
277 |
|
509 |
*/
|
510 |
public function toArray()
|
511 |
{
|
512 |
+
$campaign_id = (string) $this->getCampaignId();
|
513 |
+
|
514 |
return mailchimp_array_remove_empty(array(
|
515 |
'id' => (string) $this->getId(),
|
516 |
'landing_site' => (string) $this->getLandingSite(),
|
517 |
'customer' => $this->getCustomer()->toArray(),
|
518 |
+
//'campaign_id' => (string) $this->getCampaignId(),
|
519 |
+
'outreach' => $campaign_id ? ['id' => $campaign_id] : null,
|
520 |
'financial_status' => (string) $this->getFinancialStatus(),
|
521 |
'fulfillment_status' => (string) $this->getFulfillmentStatus(),
|
522 |
'currency_code' => (string) $this->getCurrencyCode(),
|
includes/api/assets/class-mailchimp-store.php
CHANGED
@@ -169,13 +169,15 @@ class MailChimp_WooCommerce_Store
|
|
169 |
* @param null $currency_code
|
170 |
* @return MailChimp_WooCommerce_Store;
|
171 |
*/
|
172 |
-
public function setCurrencyCode($
|
173 |
-
{
|
174 |
-
$
|
175 |
-
|
|
|
|
|
176 |
return $this;
|
177 |
}
|
178 |
-
|
179 |
/**
|
180 |
* @return null
|
181 |
*/
|
@@ -188,9 +190,13 @@ class MailChimp_WooCommerce_Store
|
|
188 |
* @param null $money_format
|
189 |
* @return MailChimp_WooCommerce_Store;
|
190 |
*/
|
191 |
-
public function setMoneyFormat($
|
192 |
-
{
|
193 |
-
$
|
|
|
|
|
|
|
|
|
194 |
|
195 |
return $this;
|
196 |
}
|
169 |
* @param null $currency_code
|
170 |
* @return MailChimp_WooCommerce_Store;
|
171 |
*/
|
172 |
+
public function setCurrencyCode($code)
|
173 |
+
{
|
174 |
+
if(!isset($code)){
|
175 |
+
$code = get_woocommerce_currency();
|
176 |
+
}
|
177 |
+
$this->currency_code = $code;
|
178 |
return $this;
|
179 |
}
|
180 |
+
|
181 |
/**
|
182 |
* @return null
|
183 |
*/
|
190 |
* @param null $money_format
|
191 |
* @return MailChimp_WooCommerce_Store;
|
192 |
*/
|
193 |
+
public function setMoneyFormat($code)
|
194 |
+
{
|
195 |
+
if(!isset($code)){
|
196 |
+
$code = get_woocommerce_currency();
|
197 |
+
}
|
198 |
+
|
199 |
+
$this->money_format = html_entity_decode(get_woocommerce_currency_symbol($code));
|
200 |
|
201 |
return $this;
|
202 |
}
|
includes/api/class-mailchimp-api.php
CHANGED
@@ -13,7 +13,7 @@ class MailChimp_WooCommerce_MailChimpApi
|
|
13 |
protected static $instance = null;
|
14 |
|
15 |
/**
|
16 |
-
* @return null
|
17 |
*/
|
18 |
public static function getInstance()
|
19 |
{
|
@@ -528,20 +528,31 @@ class MailChimp_WooCommerce_MailChimpApi
|
|
528 |
|
529 |
/**
|
530 |
* @param $campaign_id
|
531 |
-
* @
|
|
|
|
|
532 |
*/
|
533 |
-
public function getCampaign($campaign_id)
|
534 |
{
|
|
|
|
|
|
|
|
|
535 |
if (get_site_transient('mailchimp-woocommerce-no-campaign-id-'.$campaign_id)) {
|
536 |
return false;
|
537 |
}
|
538 |
try {
|
539 |
$data = $this->get("campaigns/$campaign_id");
|
540 |
delete_site_transient('mailchimp-woocommerce-no-campaign-id-'.$campaign_id);
|
|
|
541 |
return $data;
|
542 |
} catch (\Exception $e) {
|
543 |
mailchimp_log('campaign_get.error', 'No campaign with provided ID: '. $campaign_id. ' :: '. $e->getMessage(). ' :: in '.$e->getFile().' :: on '.$e->getLine());
|
544 |
set_site_transient('mailchimp-woocommerce-no-campaign-id-'.$campaign_id, true, 60 * 30);
|
|
|
|
|
|
|
|
|
545 |
throw $e;
|
546 |
}
|
547 |
}
|
13 |
protected static $instance = null;
|
14 |
|
15 |
/**
|
16 |
+
* @return null|MailChimp_WooCommerce_MailChimpApi
|
17 |
*/
|
18 |
public static function getInstance()
|
19 |
{
|
528 |
|
529 |
/**
|
530 |
* @param $campaign_id
|
531 |
+
* @param bool $throw_if_invalid
|
532 |
+
* @return array|bool|mixed|object|null
|
533 |
+
* @throws Exception
|
534 |
*/
|
535 |
+
public function getCampaign($campaign_id, $throw_if_invalid = true)
|
536 |
{
|
537 |
+
// if we found the campaign ID already and it's been stored in the cache, return it from the cache instead.
|
538 |
+
if (($data = get_site_transient('mailchimp-woocommerce-has-campaign-id-'.$campaign_id))) {
|
539 |
+
return $data;
|
540 |
+
}
|
541 |
if (get_site_transient('mailchimp-woocommerce-no-campaign-id-'.$campaign_id)) {
|
542 |
return false;
|
543 |
}
|
544 |
try {
|
545 |
$data = $this->get("campaigns/$campaign_id");
|
546 |
delete_site_transient('mailchimp-woocommerce-no-campaign-id-'.$campaign_id);
|
547 |
+
set_site_transient('mailchimp-woocommerce-has-campaign-id-'.$campaign_id, $data, 60 * 30);
|
548 |
return $data;
|
549 |
} catch (\Exception $e) {
|
550 |
mailchimp_log('campaign_get.error', 'No campaign with provided ID: '. $campaign_id. ' :: '. $e->getMessage(). ' :: in '.$e->getFile().' :: on '.$e->getLine());
|
551 |
set_site_transient('mailchimp-woocommerce-no-campaign-id-'.$campaign_id, true, 60 * 30);
|
552 |
+
|
553 |
+
if (!$throw_if_invalid) {
|
554 |
+
return false;
|
555 |
+
}
|
556 |
throw $e;
|
557 |
}
|
558 |
}
|
includes/api/class-mailchimp-woocommerce-transform-coupons.php
CHANGED
@@ -65,6 +65,8 @@ class MailChimp_WooCommerce_Transform_Coupons
|
|
65 |
|
66 |
switch ($resource->get_discount_type()) {
|
67 |
case 'fixed_product':
|
|
|
|
|
68 |
$rule->setTypeFixed();
|
69 |
$rule->setTargetTypePerItem();
|
70 |
break;
|
65 |
|
66 |
switch ($resource->get_discount_type()) {
|
67 |
case 'fixed_product':
|
68 |
+
// Support to Woocommerce Free Gift Coupon Plugin
|
69 |
+
case 'free_gift':
|
70 |
$rule->setTypeFixed();
|
71 |
$rule->setTargetTypePerItem();
|
72 |
break;
|
includes/api/class-mailchimp-woocommerce-transform-orders-wc3.php
CHANGED
@@ -62,6 +62,8 @@ class MailChimp_WooCommerce_Transform_Orders
|
|
62 |
|
63 |
$order = new MailChimp_WooCommerce_Order();
|
64 |
|
|
|
|
|
65 |
$email = $woo->get_billing_email();
|
66 |
|
67 |
// just skip these altogether because we can't submit any amazon orders anyway.
|
@@ -84,7 +86,7 @@ class MailChimp_WooCommerce_Transform_Orders
|
|
84 |
|
85 |
$order->setProcessedAt($woo->get_date_created()->setTimezone(new \DateTimeZone('UTC')));
|
86 |
|
87 |
-
$order->setCurrencyCode(
|
88 |
|
89 |
// grab the current statuses - this will end up being custom at some point.
|
90 |
$statuses = $this->getOrderStatuses();
|
@@ -122,6 +124,13 @@ class MailChimp_WooCommerce_Transform_Orders
|
|
122 |
$order->setOrderURL($woo->get_view_order_url());
|
123 |
}
|
124 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
// if we have any tax
|
126 |
$order->setTaxTotal($woo->get_total_tax());
|
127 |
|
@@ -134,7 +143,7 @@ class MailChimp_WooCommerce_Transform_Orders
|
|
134 |
$order->setDiscountTotal($woo->get_total_discount());
|
135 |
|
136 |
// set the customer
|
137 |
-
$order->setCustomer($
|
138 |
|
139 |
// apply the addresses to the order
|
140 |
$order->setShippingAddress($this->transformShippingAddress($woo));
|
@@ -177,10 +186,6 @@ class MailChimp_WooCommerce_Transform_Orders
|
|
177 |
$order->addItem($item);
|
178 |
}
|
179 |
|
180 |
-
//if (($refund = $woo->get_total_refunded()) && $refund > 0){
|
181 |
-
// this is where we would be altering the submission to tell us about the refund.
|
182 |
-
//}
|
183 |
-
|
184 |
return $order;
|
185 |
}
|
186 |
|
62 |
|
63 |
$order = new MailChimp_WooCommerce_Order();
|
64 |
|
65 |
+
$customer = $this->buildCustomerFromOrder($woo);
|
66 |
+
|
67 |
$email = $woo->get_billing_email();
|
68 |
|
69 |
// just skip these altogether because we can't submit any amazon orders anyway.
|
86 |
|
87 |
$order->setProcessedAt($woo->get_date_created()->setTimezone(new \DateTimeZone('UTC')));
|
88 |
|
89 |
+
$order->setCurrencyCode();
|
90 |
|
91 |
// grab the current statuses - this will end up being custom at some point.
|
92 |
$statuses = $this->getOrderStatuses();
|
124 |
$order->setOrderURL($woo->get_view_order_url());
|
125 |
}
|
126 |
|
127 |
+
// set the total if refund
|
128 |
+
if (($refund = $woo->get_total_refunded()) && $refund > 0){
|
129 |
+
// If there's a refund, apply to order total.
|
130 |
+
$order_spent = $order_total - $refund;
|
131 |
+
$order->setOrderTotal($order_spent);
|
132 |
+
}
|
133 |
+
|
134 |
// if we have any tax
|
135 |
$order->setTaxTotal($woo->get_total_tax());
|
136 |
|
143 |
$order->setDiscountTotal($woo->get_total_discount());
|
144 |
|
145 |
// set the customer
|
146 |
+
$order->setCustomer($customer);
|
147 |
|
148 |
// apply the addresses to the order
|
149 |
$order->setShippingAddress($this->transformShippingAddress($woo));
|
186 |
$order->addItem($item);
|
187 |
}
|
188 |
|
|
|
|
|
|
|
|
|
189 |
return $order;
|
190 |
}
|
191 |
|
includes/class-mailchimp-woocommerce-activator.php
CHANGED
@@ -89,7 +89,8 @@ class MailChimp_WooCommerce_Activator {
|
|
89 |
email VARCHAR (100) NOT NULL,
|
90 |
user_id INT (11) DEFAULT NULL,
|
91 |
cart text NOT NULL,
|
92 |
-
created_at datetime NOT NULL
|
|
|
93 |
) $charset_collate;";
|
94 |
|
95 |
dbDelta( $sql );
|
89 |
email VARCHAR (100) NOT NULL,
|
90 |
user_id INT (11) DEFAULT NULL,
|
91 |
cart text NOT NULL,
|
92 |
+
created_at datetime NOT NULL,
|
93 |
+
PRIMARY KEY (email)
|
94 |
) $charset_collate;";
|
95 |
|
96 |
dbDelta( $sql );
|
includes/class-mailchimp-woocommerce-deactivation-survey.php
CHANGED
@@ -376,7 +376,7 @@ if ( ! class_exists( 'Mailchimp_Woocommerce_Deactivation_Survey', false ) ) {
|
|
376 |
printf(
|
377 |
/* translators: %s - plugin name. */
|
378 |
esc_html__( 'If you have a moment, please share why you are deactivating %s:', 'mailchimp-woocommerce' ),
|
379 |
-
esc_html__( 'Mailchimp for Woocommerce', '
|
380 |
);
|
381 |
?>
|
382 |
</span>
|
376 |
printf(
|
377 |
/* translators: %s - plugin name. */
|
378 |
esc_html__( 'If you have a moment, please share why you are deactivating %s:', 'mailchimp-woocommerce' ),
|
379 |
+
esc_html__( 'Mailchimp for Woocommerce', 'mc-woocommerce')
|
380 |
);
|
381 |
?>
|
382 |
</span>
|
includes/class-mailchimp-woocommerce-newsletter.php
CHANGED
@@ -40,7 +40,7 @@ class MailChimp_Newsletter extends MailChimp_WooCommerce_Options
|
|
40 |
}
|
41 |
|
42 |
// allow the user to specify the text in the newsletter label.
|
43 |
-
$label = $this->getOption('newsletter_label', __('Subscribe to our newsletter', '
|
44 |
|
45 |
// if the user chose 'check' or nothing at all, we default to true.
|
46 |
$default_checked = $default_setting === 'check';
|
@@ -62,7 +62,7 @@ class MailChimp_Newsletter extends MailChimp_WooCommerce_Options
|
|
62 |
// echo out the checkbox.
|
63 |
$checkbox = '<p class="form-row form-row-wide mailchimp-newsletter">';
|
64 |
$checkbox .= '<input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="mailchimp_woocommerce_newsletter" type="checkbox" name="mailchimp_woocommerce_newsletter" value="1"'.($status ? ' checked="checked"' : '').'> ';
|
65 |
-
$checkbox .= '<label for="mailchimp_woocommerce_newsletter" class="woocommerce-form__label woocommerce-form__label-for-checkbox inline"><span>' .
|
66 |
$checkbox .= '</p>';
|
67 |
$checkbox .= '<div class="clear"></div>';
|
68 |
|
40 |
}
|
41 |
|
42 |
// allow the user to specify the text in the newsletter label.
|
43 |
+
$label = $this->getOption('newsletter_label', __('Subscribe to our newsletter', 'mc-woocommerce'));
|
44 |
|
45 |
// if the user chose 'check' or nothing at all, we default to true.
|
46 |
$default_checked = $default_setting === 'check';
|
62 |
// echo out the checkbox.
|
63 |
$checkbox = '<p class="form-row form-row-wide mailchimp-newsletter">';
|
64 |
$checkbox .= '<input class="woocommerce-form__input woocommerce-form__input-checkbox input-checkbox" id="mailchimp_woocommerce_newsletter" type="checkbox" name="mailchimp_woocommerce_newsletter" value="1"'.($status ? ' checked="checked"' : '').'> ';
|
65 |
+
$checkbox .= '<label for="mailchimp_woocommerce_newsletter" class="woocommerce-form__label woocommerce-form__label-for-checkbox inline"><span>' . $label . '</span></label>';
|
66 |
$checkbox .= '</p>';
|
67 |
$checkbox .= '<div class="clear"></div>';
|
68 |
|
includes/class-mailchimp-woocommerce-rest-api.php
CHANGED
@@ -22,12 +22,21 @@ class MailChimp_WooCommerce_Rest_Api
|
|
22 |
*/
|
23 |
public static function test()
|
24 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
return mailchimp_woocommerce_rest_api_get(
|
26 |
static::url('ping'),
|
27 |
array(
|
28 |
-
'timeout' =>
|
29 |
'blocking' => true,
|
30 |
-
'sslverify' => apply_filters('https_local_ssl_verify', false)
|
31 |
),
|
32 |
mailchimp_get_http_local_json_header()
|
33 |
);
|
@@ -42,6 +51,8 @@ class MailChimp_WooCommerce_Rest_Api
|
|
42 |
*/
|
43 |
public static function work($force = false)
|
44 |
{
|
|
|
|
|
45 |
$path = $force ? 'queue/work/force' : 'queue/work';
|
46 |
// this is the new rest API version
|
47 |
return mailchimp_woocommerce_rest_api_get(
|
@@ -49,7 +60,6 @@ class MailChimp_WooCommerce_Rest_Api
|
|
49 |
array(
|
50 |
'timeout' => 0.01,
|
51 |
'blocking' => false,
|
52 |
-
'sslverify' => apply_filters('https_local_ssl_verify', false),
|
53 |
),
|
54 |
mailchimp_get_http_local_json_header()
|
55 |
);
|
@@ -225,7 +235,6 @@ class MailChimp_WooCommerce_Rest_Api
|
|
225 |
$result = wp_remote_post(esc_url_raw($route), array(
|
226 |
'timeout' => 12,
|
227 |
'blocking' => true,
|
228 |
-
'sslverify' => apply_filters('https_local_ssl_verify', false),
|
229 |
'method' => 'POST',
|
230 |
'data_format' => 'body',
|
231 |
'headers' => array('Content-Type' => 'application/json; charset=utf-8'),
|
@@ -270,7 +279,7 @@ class MailChimp_WooCommerce_Rest_Api
|
|
270 |
'products_in_mailchimp' => $mailchimp_total_products,
|
271 |
'orders_in_store' => $order_count,
|
272 |
'orders_in_mailchimp' => $mailchimp_total_orders,
|
273 |
-
'date' => date_i18n( __('D, M j, Y g:i A', '
|
274 |
'has_started' => mailchimp_has_started_syncing(),
|
275 |
'has_finished' => mailchimp_is_done_syncing(),
|
276 |
));
|
22 |
*/
|
23 |
public static function test()
|
24 |
{
|
25 |
+
add_filter( 'https_local_ssl_verify', '__return_false', 1 );
|
26 |
+
|
27 |
+
// allow people to change this value just in case, but default to a sensible 10 second timeout.
|
28 |
+
$timeout = apply_filters('mailchimp_woocommerce_test_rest_api_timeout', 10);
|
29 |
+
|
30 |
+
// just in case someone didn't return a valid timeout value, go back to the default
|
31 |
+
if (!is_numeric($timeout)) {
|
32 |
+
$timeout = 10;
|
33 |
+
}
|
34 |
+
|
35 |
return mailchimp_woocommerce_rest_api_get(
|
36 |
static::url('ping'),
|
37 |
array(
|
38 |
+
'timeout' => $timeout,
|
39 |
'blocking' => true,
|
|
|
40 |
),
|
41 |
mailchimp_get_http_local_json_header()
|
42 |
);
|
51 |
*/
|
52 |
public static function work($force = false)
|
53 |
{
|
54 |
+
add_filter( 'https_local_ssl_verify', '__return_false', 1 );
|
55 |
+
|
56 |
$path = $force ? 'queue/work/force' : 'queue/work';
|
57 |
// this is the new rest API version
|
58 |
return mailchimp_woocommerce_rest_api_get(
|
60 |
array(
|
61 |
'timeout' => 0.01,
|
62 |
'blocking' => false,
|
|
|
63 |
),
|
64 |
mailchimp_get_http_local_json_header()
|
65 |
);
|
235 |
$result = wp_remote_post(esc_url_raw($route), array(
|
236 |
'timeout' => 12,
|
237 |
'blocking' => true,
|
|
|
238 |
'method' => 'POST',
|
239 |
'data_format' => 'body',
|
240 |
'headers' => array('Content-Type' => 'application/json; charset=utf-8'),
|
279 |
'products_in_mailchimp' => $mailchimp_total_products,
|
280 |
'orders_in_store' => $order_count,
|
281 |
'orders_in_mailchimp' => $mailchimp_total_orders,
|
282 |
+
'date' => date_i18n( __('D, M j, Y g:i A', 'mc-woocommerce'), $date->getTimestamp()),
|
283 |
'has_started' => mailchimp_has_started_syncing(),
|
284 |
'has_finished' => mailchimp_is_done_syncing(),
|
285 |
));
|
includes/class-mailchimp-woocommerce-service.php
CHANGED
@@ -85,9 +85,6 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
|
|
85 |
{
|
86 |
if (!mailchimp_is_configured()) return;
|
87 |
|
88 |
-
// tell the system the order was brand new - and we don't need to process the order update hook.
|
89 |
-
set_site_transient( "mailchimp_order_created_{$order_id}", true, 20);
|
90 |
-
|
91 |
// see if we have a session id and a campaign id, also only do this when this user is not the admin.
|
92 |
$campaign_id = $this->getCampaignTrackingID();
|
93 |
|
@@ -100,40 +97,47 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
|
|
100 |
// remove this record from the db.
|
101 |
$this->clearCartData();
|
102 |
|
103 |
-
|
104 |
-
|
105 |
-
|
|
|
106 |
}
|
107 |
|
108 |
/**
|
109 |
* @param $order_id
|
110 |
* @param bool $is_admin
|
111 |
*/
|
112 |
-
public function handleOrderStatusChanged($order_id, $
|
113 |
{
|
114 |
if (!mailchimp_is_configured()) return;
|
115 |
|
116 |
-
|
117 |
-
if (get_site_transient("mailchimp_order_created_{$order_id}") === true) {
|
118 |
-
return;
|
119 |
-
}
|
120 |
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
|
|
126 |
}
|
127 |
|
128 |
/**
|
129 |
* @param $order_id
|
|
|
130 |
*/
|
131 |
-
public function
|
132 |
{
|
133 |
if (!mailchimp_is_configured()) return;
|
134 |
|
135 |
-
|
136 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
137 |
}
|
138 |
|
139 |
/**
|
@@ -265,7 +269,7 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
|
|
265 |
if ('product' == $post->post_type) {
|
266 |
mailchimp_handle_or_queue(new MailChimp_WooCommerce_Single_Product($post_id), 5);
|
267 |
} elseif ('shop_order' == $post->post_type) {
|
268 |
-
$this->
|
269 |
}
|
270 |
}
|
271 |
}
|
@@ -478,9 +482,14 @@ class MailChimp_Service extends MailChimp_WooCommerce_Options
|
|
478 |
*/
|
479 |
public function setCampaignTrackingID($id, $cookie_duration)
|
480 |
{
|
|
|
|
|
|
|
|
|
481 |
$cid = trim($id);
|
482 |
|
483 |
-
if
|
|
|
484 |
$cid = null;
|
485 |
}
|
486 |
|
85 |
{
|
86 |
if (!mailchimp_is_configured()) return;
|
87 |
|
|
|
|
|
|
|
88 |
// see if we have a session id and a campaign id, also only do this when this user is not the admin.
|
89 |
$campaign_id = $this->getCampaignTrackingID();
|
90 |
|
97 |
// remove this record from the db.
|
98 |
$this->clearCartData();
|
99 |
|
100 |
+
return array (
|
101 |
+
'campaign_id' => $campaign_id,
|
102 |
+
'landing_site' => $landing_site
|
103 |
+
);
|
104 |
}
|
105 |
|
106 |
/**
|
107 |
* @param $order_id
|
108 |
* @param bool $is_admin
|
109 |
*/
|
110 |
+
public function handleOrderStatusChanged($order_id, $old_status, $new_status)
|
111 |
{
|
112 |
if (!mailchimp_is_configured()) return;
|
113 |
|
114 |
+
$newOrder = false;
|
|
|
|
|
|
|
115 |
|
116 |
+
if ("pending" == $old_status && "processing" == $new_status) {
|
117 |
+
$tracking = $this->onNewOrder($order_id);
|
118 |
+
$newOrder = true;
|
119 |
+
}
|
120 |
+
|
121 |
+
$this->onOrderSave($order_id, $tracking, $newOrder);
|
122 |
}
|
123 |
|
124 |
/**
|
125 |
* @param $order_id
|
126 |
+
* @param $tracking
|
127 |
*/
|
128 |
+
public function onOrderSave($order_id, $tracking = null, $newOrder = null)
|
129 |
{
|
130 |
if (!mailchimp_is_configured()) return;
|
131 |
|
132 |
+
// queue up the single order to be processed.
|
133 |
+
$campaign_id = isset($tracking) && isset($tracking['campaign_id']) ? $tracking['campaign_id'] : null;
|
134 |
+
$landing_site = isset($tracking) && isset($tracking['landing_site']) ? $tracking['landing_site'] : null;
|
135 |
+
|
136 |
+
$handler = new MailChimp_WooCommerce_Single_Order($order_id, null, $campaign_id, $landing_site);
|
137 |
+
$handler->is_update = $newOrder ? !$newOrder : null;
|
138 |
+
$handler->is_admin_save = is_admin();
|
139 |
+
|
140 |
+
mailchimp_handle_or_queue($handler, 90);
|
141 |
}
|
142 |
|
143 |
/**
|
269 |
if ('product' == $post->post_type) {
|
270 |
mailchimp_handle_or_queue(new MailChimp_WooCommerce_Single_Product($post_id), 5);
|
271 |
} elseif ('shop_order' == $post->post_type) {
|
272 |
+
$this->onOrderSave($post_id);
|
273 |
}
|
274 |
}
|
275 |
}
|
482 |
*/
|
483 |
public function setCampaignTrackingID($id, $cookie_duration)
|
484 |
{
|
485 |
+
if (!mailchimp_is_configured()) {
|
486 |
+
return $this;
|
487 |
+
}
|
488 |
+
|
489 |
$cid = trim($id);
|
490 |
|
491 |
+
// don't throw the error if it's not found.
|
492 |
+
if (!$this->api()->getCampaign($cid, false)) {
|
493 |
$cid = null;
|
494 |
}
|
495 |
|
includes/class-mailchimp-woocommerce.php
CHANGED
@@ -245,6 +245,14 @@ class MailChimp_WooCommerce
|
|
245 |
$this->loader->add_action('plugins_loaded', $plugin_admin, 'update_db_check');
|
246 |
$this->loader->add_action('admin_init', $plugin_admin, 'setup_survey_form');
|
247 |
$this->loader->add_action('admin_footer', $plugin_admin, 'inject_sync_ajax_call');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
248 |
}
|
249 |
|
250 |
/**
|
@@ -311,13 +319,10 @@ class MailChimp_WooCommerce
|
|
311 |
$this->loader->add_action( 'init', $service, 'handleCampaignTracking' );
|
312 |
|
313 |
// order hooks
|
314 |
-
$this->loader->add_action('
|
315 |
-
$this->loader->add_action('woocommerce_api_create_order', $service, 'onNewOrder', 10);
|
316 |
-
$this->loader->add_action('woocommerce_ppe_do_payaction', $service, 'onNewPayPalOrder', 10, 1);
|
317 |
-
$this->loader->add_action('woocommerce_order_status_changed', $service, 'handleOrderStatusChanged', 10);
|
318 |
|
319 |
-
//
|
320 |
-
$this->loader->add_action('woocommerce_order_partially_refunded', $service, 'onPartiallyRefunded',
|
321 |
|
322 |
// cart hooks
|
323 |
//$this->loader->add_action('woocommerce_cart_updated', $service, 'handleCartUpdated');
|
245 |
$this->loader->add_action('plugins_loaded', $plugin_admin, 'update_db_check');
|
246 |
$this->loader->add_action('admin_init', $plugin_admin, 'setup_survey_form');
|
247 |
$this->loader->add_action('admin_footer', $plugin_admin, 'inject_sync_ajax_call');
|
248 |
+
|
249 |
+
// update MC store information when woocommerce general settings are saved
|
250 |
+
$this->loader->add_action('woocommerce_settings_save_general', $plugin_admin, 'mailchimp_update_woo_settings');
|
251 |
+
|
252 |
+
// update MC store information if "WooCommerce Multi-Currency Extension" settings are saved
|
253 |
+
if ( class_exists( 'WOOMULTI_CURRENCY_F' ) ) {
|
254 |
+
$this->loader->add_action('villatheme_support_woo-multi-currency', $plugin_admin, 'mailchimp_update_woo_settings');
|
255 |
+
}
|
256 |
}
|
257 |
|
258 |
/**
|
319 |
$this->loader->add_action( 'init', $service, 'handleCampaignTracking' );
|
320 |
|
321 |
// order hooks
|
322 |
+
$this->loader->add_action('woocommerce_order_status_changed', $service, 'handleOrderStatusChanged', 11, 3);
|
|
|
|
|
|
|
323 |
|
324 |
+
// refunds
|
325 |
+
$this->loader->add_action('woocommerce_order_partially_refunded', $service, 'onPartiallyRefunded', 20, 1);
|
326 |
|
327 |
// cart hooks
|
328 |
//$this->loader->add_action('woocommerce_cart_updated', $service, 'handleCartUpdated');
|
includes/processes/class-mailchimp-woocommerce-cart-update.php
CHANGED
@@ -123,7 +123,7 @@ class MailChimp_WooCommerce_Cart_Update extends WP_Job
|
|
123 |
}
|
124 |
|
125 |
$cart->setCheckoutUrl($checkout_url);
|
126 |
-
$cart->setCurrencyCode(
|
127 |
|
128 |
$cart->setCustomer($customer);
|
129 |
|
123 |
}
|
124 |
|
125 |
$cart->setCheckoutUrl($checkout_url);
|
126 |
+
$cart->setCurrencyCode();
|
127 |
|
128 |
$cart->setCustomer($customer);
|
129 |
|
includes/processes/class-mailchimp-woocommerce-rest-queue.php
CHANGED
@@ -165,6 +165,10 @@ class MailChimp_WooCommerce_Rest_Queue
|
|
165 |
}
|
166 |
|
167 |
return (int) preg_replace_callback('/(\-?\d+)(.?)/', function ($m) {
|
|
|
|
|
|
|
|
|
168 |
return $m[1] * pow(1024, strpos('BKMG', $m[2]));
|
169 |
}, strtoupper($memory_limit));
|
170 |
}
|
@@ -236,11 +240,11 @@ class MailChimp_WooCommerce_Rest_Queue
|
|
236 |
*/
|
237 |
protected function again()
|
238 |
{
|
|
|
239 |
$url = esc_url_raw(rest_url('mailchimp-for-woocommerce/v1/queue/work'));
|
240 |
$params = array(
|
241 |
'timeout' => 0.01,
|
242 |
'blocking' => false,
|
243 |
-
'sslverify' => apply_filters('https_local_ssl_verify', false),
|
244 |
);
|
245 |
mailchimp_woocommerce_rest_api_get($url, $params, mailchimp_get_http_local_json_header());
|
246 |
}
|
165 |
}
|
166 |
|
167 |
return (int) preg_replace_callback('/(\-?\d+)(.?)/', function ($m) {
|
168 |
+
if (!isset($m[2]) || $m[2] == '') {
|
169 |
+
$m[1] = '128';
|
170 |
+
$m[2] = 'M';
|
171 |
+
}
|
172 |
return $m[1] * pow(1024, strpos('BKMG', $m[2]));
|
173 |
}, strtoupper($memory_limit));
|
174 |
}
|
240 |
*/
|
241 |
protected function again()
|
242 |
{
|
243 |
+
add_filter( 'https_local_ssl_verify', '__return_false', 1 );
|
244 |
$url = esc_url_raw(rest_url('mailchimp-for-woocommerce/v1/queue/work'));
|
245 |
$params = array(
|
246 |
'timeout' => 0.01,
|
247 |
'blocking' => false,
|
|
|
248 |
);
|
249 |
mailchimp_woocommerce_rest_api_get($url, $params, mailchimp_get_http_local_json_header());
|
250 |
}
|
includes/processes/class-mailchimp-woocommerce-single-order.php
CHANGED
@@ -103,6 +103,18 @@ class MailChimp_WooCommerce_Single_Order extends WP_Job
|
|
103 |
// will be the same as the customer id. an md5'd hash of a lowercased email.
|
104 |
$this->cart_session_id = $order->getCustomer()->getId();
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
// delete the AC cart record.
|
107 |
$deleted_abandoned_cart = !empty($this->cart_session_id) && $api->deleteCartByID($store_id, $this->cart_session_id);
|
108 |
|
@@ -188,23 +200,23 @@ class MailChimp_WooCommerce_Single_Order extends WP_Job
|
|
188 |
if ($order->getCustomer()->requiresDoubleOptIn() && $order->getCustomer()->getOriginalSubscriberStatus()) {
|
189 |
try {
|
190 |
$list_id = mailchimp_get_list_id();
|
191 |
-
$
|
192 |
$email = $order->getCustomer()->getEmailAddress();
|
193 |
|
194 |
try {
|
195 |
$member = $api->member($list_id, $email);
|
196 |
if ($member['status'] === 'transactional') {
|
197 |
|
198 |
-
$api->update($list_id, $email, 'pending', $
|
199 |
mailchimp_tell_system_about_user_submit($email, mailchimp_get_subscriber_status_options('pending'), 60);
|
200 |
-
mailchimp_log('double_opt_in', "Updated {$email} Using Double Opt In - previous status was '{$member['status']}'", $
|
201 |
}
|
202 |
} catch (\Exception $e) {
|
203 |
// if the error code is 404 - need to subscribe them becausce it means they were not on the list.
|
204 |
if ($e->getCode() == 404) {
|
205 |
-
$api->subscribe($list_id, $email, false, $
|
206 |
mailchimp_tell_system_about_user_submit($email, mailchimp_get_subscriber_status_options(false), 60);
|
207 |
-
mailchimp_log('double_opt_in', "Subscribed {$email} Using Double Opt In", $
|
208 |
} else {
|
209 |
mailchimp_error('double_opt_in.update', $e->getMessage());
|
210 |
}
|
103 |
// will be the same as the customer id. an md5'd hash of a lowercased email.
|
104 |
$this->cart_session_id = $order->getCustomer()->getId();
|
105 |
|
106 |
+
// see if we have a campaign ID already from the order transformer / cookie.
|
107 |
+
$campaign_id = $order->getCampaignId();
|
108 |
+
|
109 |
+
// if the campaign ID is empty, and we have a cart session id
|
110 |
+
if (empty($campaign_id) && !empty($this->cart_session_id)) {
|
111 |
+
// pull the cart info from Mailchimp
|
112 |
+
if (($abandoned_cart_record = $api->getCart($store_id, $this->cart_session_id))) {
|
113 |
+
// set the campaign ID
|
114 |
+
$order->setCampaignId($this->campaign_id = $abandoned_cart_record->getCampaignID());
|
115 |
+
}
|
116 |
+
}
|
117 |
+
|
118 |
// delete the AC cart record.
|
119 |
$deleted_abandoned_cart = !empty($this->cart_session_id) && $api->deleteCartByID($store_id, $this->cart_session_id);
|
120 |
|
200 |
if ($order->getCustomer()->requiresDoubleOptIn() && $order->getCustomer()->getOriginalSubscriberStatus()) {
|
201 |
try {
|
202 |
$list_id = mailchimp_get_list_id();
|
203 |
+
$merge_fields = $order->getCustomer()->getMergeFields();
|
204 |
$email = $order->getCustomer()->getEmailAddress();
|
205 |
|
206 |
try {
|
207 |
$member = $api->member($list_id, $email);
|
208 |
if ($member['status'] === 'transactional') {
|
209 |
|
210 |
+
$api->update($list_id, $email, 'pending', $merge_fields);
|
211 |
mailchimp_tell_system_about_user_submit($email, mailchimp_get_subscriber_status_options('pending'), 60);
|
212 |
+
mailchimp_log('double_opt_in', "Updated {$email} Using Double Opt In - previous status was '{$member['status']}'", $merge_fields);
|
213 |
}
|
214 |
} catch (\Exception $e) {
|
215 |
// if the error code is 404 - need to subscribe them becausce it means they were not on the list.
|
216 |
if ($e->getCode() == 404) {
|
217 |
+
$api->subscribe($list_id, $email, false, $merge_fields);
|
218 |
mailchimp_tell_system_about_user_submit($email, mailchimp_get_subscriber_status_options(false), 60);
|
219 |
+
mailchimp_log('double_opt_in', "Subscribed {$email} Using Double Opt In", $merge_fields);
|
220 |
} else {
|
221 |
mailchimp_error('double_opt_in.update', $e->getMessage());
|
222 |
}
|
includes/processes/class-mailchimp-woocommerce-user-submit.php
CHANGED
@@ -124,21 +124,21 @@ class MailChimp_WooCommerce_User_Submit extends WP_Job
|
|
124 |
|
125 |
$api = new MailChimp_WooCommerce_MailChimpApi($api_key);
|
126 |
|
127 |
-
$
|
128 |
|
129 |
$fn = trim($user->first_name);
|
130 |
$ln = trim($user->last_name);
|
131 |
|
132 |
-
if (!empty($fn)) $
|
133 |
-
if (!empty($ln)) $
|
134 |
|
135 |
-
// allow users to hook into the merge
|
136 |
-
$
|
137 |
|
138 |
// for whatever reason if this isn't an array we need to skip it.
|
139 |
-
if (!is_array($
|
140 |
-
mailchimp_error("custom.
|
141 |
-
$
|
142 |
}
|
143 |
|
144 |
// pull the transient key for this job.
|
@@ -163,18 +163,18 @@ class MailChimp_WooCommerce_User_Submit extends WP_Job
|
|
163 |
// delete the old
|
164 |
$api->deleteMember($list_id, $this->updated_data['user_email']);
|
165 |
// subscribe the new
|
166 |
-
$api->subscribe($list_id, $email, $status_meta['created'], $
|
167 |
mailchimp_tell_system_about_user_submit($email, $status_meta, 60);
|
168 |
|
169 |
if ($status_meta['created']) {
|
170 |
mailchimp_log('member.sync', 'Subscriber Swap '.$this->updated_data['user_email'].' to '.$email, array(
|
171 |
'status' => $status_meta['created'],
|
172 |
-
'
|
173 |
));
|
174 |
} else {
|
175 |
mailchimp_log('member.sync', 'Subscriber Swap '.$this->updated_data['user_email'].' to '.$email.' Pending Double OptIn', array(
|
176 |
'status' => $status_meta['created'],
|
177 |
-
'
|
178 |
));
|
179 |
}
|
180 |
static::$handling_for = null;
|
@@ -184,7 +184,7 @@ class MailChimp_WooCommerce_User_Submit extends WP_Job
|
|
184 |
|
185 |
// if the member is unsubscribed or pending, we really can't do anything here.
|
186 |
if (isset($member_data['status']) && in_array($member_data['status'], array('unsubscribed', 'pending'))) {
|
187 |
-
mailchimp_log('member.sync', "Skipped Member Sync For {$email} because the current status is {$member_data['status']}", $
|
188 |
static::$handling_for = null;
|
189 |
return false;
|
190 |
}
|
@@ -192,12 +192,12 @@ class MailChimp_WooCommerce_User_Submit extends WP_Job
|
|
192 |
// if the status is not === 'transactional' we can update them to subscribed or pending now.
|
193 |
if (isset($member_data['status']) && $member_data['status'] === 'transactional' || $member_data['status'] === 'cleaned') {
|
194 |
// ok let's update this member
|
195 |
-
$api->update($list_id, $email, $status_meta['updated'], $
|
196 |
mailchimp_tell_system_about_user_submit($email, $status_meta, 60);
|
197 |
mailchimp_log('member.sync', "Updated Member {$email}", array(
|
198 |
'previous_status' => $member_data['status'],
|
199 |
'status' => $status_meta['updated'],
|
200 |
-
'
|
201 |
));
|
202 |
static::$handling_for = null;
|
203 |
return true;
|
@@ -205,10 +205,10 @@ class MailChimp_WooCommerce_User_Submit extends WP_Job
|
|
205 |
|
206 |
if (isset($member_data['status'])) {
|
207 |
// ok let's update this member
|
208 |
-
$api->update($list_id, $email, $member_data['status'], $
|
209 |
mailchimp_tell_system_about_user_submit($email, $status_meta, 60);
|
210 |
-
mailchimp_log('member.sync', "Updated Member {$email} ( merge
|
211 |
-
'
|
212 |
));
|
213 |
static::$handling_for = null;
|
214 |
return true;
|
@@ -224,10 +224,10 @@ class MailChimp_WooCommerce_User_Submit extends WP_Job
|
|
224 |
if ($e->getCode() == 404) {
|
225 |
|
226 |
try {
|
227 |
-
$api->subscribe($list_id, $user->user_email, $status_meta['created'], $
|
228 |
mailchimp_tell_system_about_user_submit($email, $status_meta, 60);
|
229 |
if ($status_meta['created']) {
|
230 |
-
mailchimp_log('member.sync', "Subscribed Member {$user->user_email}", array('status_if_new' => $status_meta['created'], '
|
231 |
} else {
|
232 |
mailchimp_log('member.sync', "{$user->user_email} is Pending Double OptIn");
|
233 |
}
|
124 |
|
125 |
$api = new MailChimp_WooCommerce_MailChimpApi($api_key);
|
126 |
|
127 |
+
$merge_fields_system = array();
|
128 |
|
129 |
$fn = trim($user->first_name);
|
130 |
$ln = trim($user->last_name);
|
131 |
|
132 |
+
if (!empty($fn)) $merge_fields_system['FNAME'] = $fn;
|
133 |
+
if (!empty($ln)) $merge_fields_system['LNAME'] = $ln;
|
134 |
|
135 |
+
// allow users to hook into the merge field submission
|
136 |
+
$merge_fields = apply_filters('mailchimp_sync_user_mergetags', $merge_fields_system, $user);
|
137 |
|
138 |
// for whatever reason if this isn't an array we need to skip it.
|
139 |
+
if (!is_array($merge_fields)) {
|
140 |
+
mailchimp_error("custom.merge_fields", "The filter for mailchimp_sync_user_mergetags needs to return an array, using the default setup instead.");
|
141 |
+
$merge_fields = $merge_fields_system;
|
142 |
}
|
143 |
|
144 |
// pull the transient key for this job.
|
163 |
// delete the old
|
164 |
$api->deleteMember($list_id, $this->updated_data['user_email']);
|
165 |
// subscribe the new
|
166 |
+
$api->subscribe($list_id, $email, $status_meta['created'], $merge_fields);
|
167 |
mailchimp_tell_system_about_user_submit($email, $status_meta, 60);
|
168 |
|
169 |
if ($status_meta['created']) {
|
170 |
mailchimp_log('member.sync', 'Subscriber Swap '.$this->updated_data['user_email'].' to '.$email, array(
|
171 |
'status' => $status_meta['created'],
|
172 |
+
'merge_fields' => $merge_fields
|
173 |
));
|
174 |
} else {
|
175 |
mailchimp_log('member.sync', 'Subscriber Swap '.$this->updated_data['user_email'].' to '.$email.' Pending Double OptIn', array(
|
176 |
'status' => $status_meta['created'],
|
177 |
+
'merge_fields' => $merge_fields
|
178 |
));
|
179 |
}
|
180 |
static::$handling_for = null;
|
184 |
|
185 |
// if the member is unsubscribed or pending, we really can't do anything here.
|
186 |
if (isset($member_data['status']) && in_array($member_data['status'], array('unsubscribed', 'pending'))) {
|
187 |
+
mailchimp_log('member.sync', "Skipped Member Sync For {$email} because the current status is {$member_data['status']}", $merge_fields);
|
188 |
static::$handling_for = null;
|
189 |
return false;
|
190 |
}
|
192 |
// if the status is not === 'transactional' we can update them to subscribed or pending now.
|
193 |
if (isset($member_data['status']) && $member_data['status'] === 'transactional' || $member_data['status'] === 'cleaned') {
|
194 |
// ok let's update this member
|
195 |
+
$api->update($list_id, $email, $status_meta['updated'], $merge_fields);
|
196 |
mailchimp_tell_system_about_user_submit($email, $status_meta, 60);
|
197 |
mailchimp_log('member.sync', "Updated Member {$email}", array(
|
198 |
'previous_status' => $member_data['status'],
|
199 |
'status' => $status_meta['updated'],
|
200 |
+
'merge_fields' => $merge_fields
|
201 |
));
|
202 |
static::$handling_for = null;
|
203 |
return true;
|
205 |
|
206 |
if (isset($member_data['status'])) {
|
207 |
// ok let's update this member
|
208 |
+
$api->update($list_id, $email, $member_data['status'], $merge_fields);
|
209 |
mailchimp_tell_system_about_user_submit($email, $status_meta, 60);
|
210 |
+
mailchimp_log('member.sync', "Updated Member {$email} ( merge fields only )", array(
|
211 |
+
'merge_fields' => $merge_fields
|
212 |
));
|
213 |
static::$handling_for = null;
|
214 |
return true;
|
224 |
if ($e->getCode() == 404) {
|
225 |
|
226 |
try {
|
227 |
+
$api->subscribe($list_id, $user->user_email, $status_meta['created'], $merge_fields);
|
228 |
mailchimp_tell_system_about_user_submit($email, $status_meta, 60);
|
229 |
if ($status_meta['created']) {
|
230 |
+
mailchimp_log('member.sync', "Subscribed Member {$user->user_email}", array('status_if_new' => $status_meta['created'], 'merge_fields' => $merge_fields));
|
231 |
} else {
|
232 |
mailchimp_log('member.sync', "{$user->user_email} is Pending Double OptIn");
|
233 |
}
|
languages/mailchimp-woocommerce-pt_BR.mo
CHANGED
Binary file
|
languages/mailchimp-woocommerce-pt_BR.po
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: \n"
|
4 |
-
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mc-woocommerce
|
5 |
-
"
|
6 |
-
"
|
7 |
-
"PO-Revision-Date: 2019-05-02 21:07+0200\n"
|
8 |
"Last-Translator: \n"
|
9 |
"Language-Team: \n"
|
10 |
"Language: pt_BR\n"
|
@@ -19,6 +18,10 @@ msgstr ""
|
|
19 |
msgid "Mailchimp for WooCommerce"
|
20 |
msgstr "Mailchimp para Woocommerce"
|
21 |
|
|
|
|
|
|
|
|
|
22 |
#. Description of the plugin
|
23 |
msgid ""
|
24 |
"Connects WooCommerce to Mailchimp to sync your store data, send targeted "
|
@@ -31,6 +34,10 @@ msgstr ""
|
|
31 |
msgid "Mailchimp"
|
32 |
msgstr "Mailchimp"
|
33 |
|
|
|
|
|
|
|
|
|
34 |
#: includes/class-mailchimp-woocommerce-deactivation-survey.php:179
|
35 |
msgid "Please select an option"
|
36 |
msgstr "Por favor selecione uma opção"
|
@@ -137,13 +144,13 @@ msgid "User ID"
|
|
137 |
msgstr "ID do Usuário"
|
138 |
|
139 |
#: includes/class-mailchimp-woocommerce-newsletter.php:43
|
140 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
141 |
#: admin/partials/tabs/newsletter_settings.php:94
|
142 |
msgid "Subscribe to our newsletter"
|
143 |
msgstr "Inscreva-se em nossa newsletter"
|
144 |
|
145 |
-
#: includes/class-mailchimp-woocommerce-rest-api.php:
|
146 |
-
#: admin/partials/tabs/store_sync.php:
|
147 |
msgid "D, M j, Y g:i A"
|
148 |
msgstr "l, d\\/m\\/Y H:i"
|
149 |
|
@@ -155,7 +162,7 @@ msgstr "Mailchimp para Woocommerce"
|
|
155 |
msgid "Settings"
|
156 |
msgstr "Configurações"
|
157 |
|
158 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
159 |
msgid ""
|
160 |
"As part of the Mailchimp Terms of Use, we require a contact email and a "
|
161 |
"physical mailing address."
|
@@ -163,7 +170,7 @@ msgstr ""
|
|
163 |
"Como parte dos Termos de Uso do Mailchimp, são mandatórios um email de "
|
164 |
"contato e um endereço físico de correspondência."
|
165 |
|
166 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
167 |
msgid ""
|
168 |
"As part of the Mailchimp Terms of Use, we require a valid phone number for "
|
169 |
"your store."
|
@@ -171,31 +178,31 @@ msgstr ""
|
|
171 |
"Como parte dos Termos de Uso do Mailchimp, é mandatório um número de "
|
172 |
"telefone válido para sua Loja."
|
173 |
|
174 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
175 |
msgid "Mailchimp for WooCommerce requires a Store Name to connect your store."
|
176 |
msgstr ""
|
177 |
"Mailchimp para Woocommerce requer um Nome de Loja para conectar sua Loja."
|
178 |
|
179 |
#. translators: %s - plugin name.
|
180 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
181 |
#: admin/partials/tabs/campaign_defaults.php:95
|
182 |
msgid "You were subscribed to the newsletter from %s"
|
183 |
msgstr "Você foi inscrito na newsletter de %s"
|
184 |
|
185 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
186 |
msgid "You must supply your Mailchimp API key to pull the audiences."
|
187 |
msgstr ""
|
188 |
"É necessário fornecer a sua Mailchimp API Key para recuperar as audiências."
|
189 |
|
190 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
191 |
msgid "Starting the sync process..."
|
192 |
msgstr "Iniciando a Sincronização…"
|
193 |
|
194 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
195 |
msgid "Please hang tight while we work our mojo."
|
196 |
msgstr "Por favor aguarde."
|
197 |
|
198 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
199 |
msgid ""
|
200 |
"Sometimes the sync can take a while, especially on sites with lots of orders "
|
201 |
"and/or products."
|
@@ -483,31 +490,31 @@ msgstr "Sincronização inicial:"
|
|
483 |
msgid "In Progress"
|
484 |
msgstr "Em progresso"
|
485 |
|
486 |
-
#: admin/partials/tabs/store_sync.php:
|
487 |
msgid "Last Updated:"
|
488 |
msgstr "Última atualização:"
|
489 |
|
490 |
-
#: admin/partials/tabs/store_sync.php:
|
491 |
msgid "Account Connected:"
|
492 |
msgstr "Conta conectada:"
|
493 |
|
494 |
-
#: admin/partials/tabs/store_sync.php:
|
495 |
msgid "Audience Connected:"
|
496 |
msgstr "Audiência conectada:"
|
497 |
|
498 |
-
#: admin/partials/tabs/store_sync.php:
|
499 |
msgid "Products Synced:"
|
500 |
msgstr "Produtos sincronizados:"
|
501 |
|
502 |
-
#: admin/partials/tabs/store_sync.php:
|
503 |
msgid "Orders Synced:"
|
504 |
msgstr "Pedidos sincronizados:"
|
505 |
|
506 |
-
#: admin/partials/tabs/store_sync.php:
|
507 |
msgid "Advanced"
|
508 |
msgstr "Avançado"
|
509 |
|
510 |
-
#: admin/partials/tabs/store_sync.php:
|
511 |
msgid ""
|
512 |
"You can resync your audience at any time without losing any of your e-"
|
513 |
"commerce data."
|
@@ -515,7 +522,7 @@ msgstr ""
|
|
515 |
"Você pode ressincronizar sua Audiência a qualquer momento, sem perder nenhum "
|
516 |
"de seus dados."
|
517 |
|
518 |
-
#: admin/partials/tabs/store_sync.php:
|
519 |
msgid "Resync"
|
520 |
msgstr "Ressincronizar"
|
521 |
|
@@ -620,20 +627,16 @@ msgstr "Língua"
|
|
620 |
msgid "Currency Code"
|
621 |
msgstr "Código da Moeda"
|
622 |
|
623 |
-
#: admin/partials/tabs/store_info.php:
|
624 |
-
msgid "Currency is currently deprecated. Please select one from the list above"
|
625 |
-
msgstr "Moeda obsoleta. Selecione uma da lista acima"
|
626 |
-
|
627 |
-
#: admin/partials/tabs/store_info.php:192
|
628 |
-
msgid "deprecated"
|
629 |
-
msgstr "obsoleta"
|
630 |
-
|
631 |
-
#: admin/partials/tabs/store_info.php:199
|
632 |
msgid "Currency"
|
633 |
msgstr "Moeda"
|
634 |
|
635 |
-
#: admin/partials/tabs/store_info.php:
|
636 |
-
|
|
|
|
|
|
|
|
|
637 |
msgid "Timezone"
|
638 |
msgstr "Fuso Horário"
|
639 |
|
@@ -711,7 +714,7 @@ msgstr ""
|
|
711 |
"clientes de acordo com sua <a href=%s target=_blank>Política de Privacidade</"
|
712 |
"a>."
|
713 |
|
714 |
-
#: bootstrap.php:
|
715 |
msgid ""
|
716 |
"The MailChimp For WooCommerce plugin requires the <a href=\"http://wordpress."
|
717 |
"org/extend/plugins/woocommerce/\">WooCommerce</a> plugin to be active!"
|
@@ -719,11 +722,11 @@ msgstr ""
|
|
719 |
"O plugin Mailchimp para Woocommerce requer que o plugin <a href=“http://"
|
720 |
"wordpress.org/extend/plugins/woocommerce/“>WooCommerce</a> esteja ativo!"
|
721 |
|
722 |
-
#: bootstrap.php:
|
723 |
msgid "function \"wp_remote_post\" does not exist"
|
724 |
msgstr "a funcão “wp_remote_post” não existe"
|
725 |
|
726 |
-
#: bootstrap.php:
|
727 |
msgid ""
|
728 |
"The REST API seems to be disabled on this wordpress site. Please enable to "
|
729 |
"sync data."
|
@@ -731,6 +734,13 @@ msgstr ""
|
|
731 |
"A REST API aparenta ester desabilitada nest site WordPress. For favor, "
|
732 |
"habilite para sincronizar dados."
|
733 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
734 |
#~ msgid "User Tags"
|
735 |
#~ msgstr "Etiquetas de Usuário"
|
736 |
|
1 |
msgid ""
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: \n"
|
4 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mc-woocommerce\n"
|
5 |
+
"POT-Creation-Date: 2019-05-21T12:55:04+00:00\n"
|
6 |
+
"PO-Revision-Date: 2019-05-21 14:56+0200\n"
|
|
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: \n"
|
9 |
"Language: pt_BR\n"
|
18 |
msgid "Mailchimp for WooCommerce"
|
19 |
msgstr "Mailchimp para Woocommerce"
|
20 |
|
21 |
+
#. Plugin URI of the plugin
|
22 |
+
msgid "https://mailchimp.com/connect-your-store/"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
#. Description of the plugin
|
26 |
msgid ""
|
27 |
"Connects WooCommerce to Mailchimp to sync your store data, send targeted "
|
34 |
msgid "Mailchimp"
|
35 |
msgstr "Mailchimp"
|
36 |
|
37 |
+
#. Author URI of the plugin
|
38 |
+
msgid "https://mailchimp.com"
|
39 |
+
msgstr ""
|
40 |
+
|
41 |
#: includes/class-mailchimp-woocommerce-deactivation-survey.php:179
|
42 |
msgid "Please select an option"
|
43 |
msgstr "Por favor selecione uma opção"
|
144 |
msgstr "ID do Usuário"
|
145 |
|
146 |
#: includes/class-mailchimp-woocommerce-newsletter.php:43
|
147 |
+
#: admin/class-mailchimp-woocommerce-admin.php:564
|
148 |
#: admin/partials/tabs/newsletter_settings.php:94
|
149 |
msgid "Subscribe to our newsletter"
|
150 |
msgstr "Inscreva-se em nossa newsletter"
|
151 |
|
152 |
+
#: includes/class-mailchimp-woocommerce-rest-api.php:274
|
153 |
+
#: admin/partials/tabs/store_sync.php:66
|
154 |
msgid "D, M j, Y g:i A"
|
155 |
msgstr "l, d\\/m\\/Y H:i"
|
156 |
|
162 |
msgid "Settings"
|
163 |
msgstr "Configurações"
|
164 |
|
165 |
+
#: admin/class-mailchimp-woocommerce-admin.php:484
|
166 |
msgid ""
|
167 |
"As part of the Mailchimp Terms of Use, we require a contact email and a "
|
168 |
"physical mailing address."
|
170 |
"Como parte dos Termos de Uso do Mailchimp, são mandatórios um email de "
|
171 |
"contato e um endereço físico de correspondência."
|
172 |
|
173 |
+
#: admin/class-mailchimp-woocommerce-admin.php:492
|
174 |
msgid ""
|
175 |
"As part of the Mailchimp Terms of Use, we require a valid phone number for "
|
176 |
"your store."
|
178 |
"Como parte dos Termos de Uso do Mailchimp, é mandatório um número de "
|
179 |
"telefone válido para sua Loja."
|
180 |
|
181 |
+
#: admin/class-mailchimp-woocommerce-admin.php:500
|
182 |
msgid "Mailchimp for WooCommerce requires a Store Name to connect your store."
|
183 |
msgstr ""
|
184 |
"Mailchimp para Woocommerce requer um Nome de Loja para conectar sua Loja."
|
185 |
|
186 |
#. translators: %s - plugin name.
|
187 |
+
#: admin/class-mailchimp-woocommerce-admin.php:518
|
188 |
#: admin/partials/tabs/campaign_defaults.php:95
|
189 |
msgid "You were subscribed to the newsletter from %s"
|
190 |
msgstr "Você foi inscrito na newsletter de %s"
|
191 |
|
192 |
+
#: admin/class-mailchimp-woocommerce-admin.php:673
|
193 |
msgid "You must supply your Mailchimp API key to pull the audiences."
|
194 |
msgstr ""
|
195 |
"É necessário fornecer a sua Mailchimp API Key para recuperar as audiências."
|
196 |
|
197 |
+
#: admin/class-mailchimp-woocommerce-admin.php:1067
|
198 |
msgid "Starting the sync process..."
|
199 |
msgstr "Iniciando a Sincronização…"
|
200 |
|
201 |
+
#: admin/class-mailchimp-woocommerce-admin.php:1069
|
202 |
msgid "Please hang tight while we work our mojo."
|
203 |
msgstr "Por favor aguarde."
|
204 |
|
205 |
+
#: admin/class-mailchimp-woocommerce-admin.php:1071
|
206 |
msgid ""
|
207 |
"Sometimes the sync can take a while, especially on sites with lots of orders "
|
208 |
"and/or products."
|
490 |
msgid "In Progress"
|
491 |
msgstr "Em progresso"
|
492 |
|
493 |
+
#: admin/partials/tabs/store_sync.php:63
|
494 |
msgid "Last Updated:"
|
495 |
msgstr "Última atualização:"
|
496 |
|
497 |
+
#: admin/partials/tabs/store_sync.php:72
|
498 |
msgid "Account Connected:"
|
499 |
msgstr "Conta conectada:"
|
500 |
|
501 |
+
#: admin/partials/tabs/store_sync.php:73
|
502 |
msgid "Audience Connected:"
|
503 |
msgstr "Audiência conectada:"
|
504 |
|
505 |
+
#: admin/partials/tabs/store_sync.php:74
|
506 |
msgid "Products Synced:"
|
507 |
msgstr "Produtos sincronizados:"
|
508 |
|
509 |
+
#: admin/partials/tabs/store_sync.php:75
|
510 |
msgid "Orders Synced:"
|
511 |
msgstr "Pedidos sincronizados:"
|
512 |
|
513 |
+
#: admin/partials/tabs/store_sync.php:78
|
514 |
msgid "Advanced"
|
515 |
msgstr "Avançado"
|
516 |
|
517 |
+
#: admin/partials/tabs/store_sync.php:80
|
518 |
msgid ""
|
519 |
"You can resync your audience at any time without losing any of your e-"
|
520 |
"commerce data."
|
522 |
"Você pode ressincronizar sua Audiência a qualquer momento, sem perder nenhum "
|
523 |
"de seus dados."
|
524 |
|
525 |
+
#: admin/partials/tabs/store_sync.php:82
|
526 |
msgid "Resync"
|
527 |
msgstr "Ressincronizar"
|
528 |
|
627 |
msgid "Currency Code"
|
628 |
msgstr "Código da Moeda"
|
629 |
|
630 |
+
#: admin/partials/tabs/store_info.php:189
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
631 |
msgid "Currency"
|
632 |
msgstr "Moeda"
|
633 |
|
634 |
+
#: admin/partials/tabs/store_info.php:189
|
635 |
+
msgid "Retrieved from Woocommerce Settings"
|
636 |
+
msgstr "Configuração do Woocommerce"
|
637 |
+
|
638 |
+
#: admin/partials/tabs/store_info.php:195
|
639 |
+
#: admin/partials/tabs/store_info.php:206
|
640 |
msgid "Timezone"
|
641 |
msgstr "Fuso Horário"
|
642 |
|
714 |
"clientes de acordo com sua <a href=%s target=_blank>Política de Privacidade</"
|
715 |
"a>."
|
716 |
|
717 |
+
#: bootstrap.php:510
|
718 |
msgid ""
|
719 |
"The MailChimp For WooCommerce plugin requires the <a href=\"http://wordpress."
|
720 |
"org/extend/plugins/woocommerce/\">WooCommerce</a> plugin to be active!"
|
722 |
"O plugin Mailchimp para Woocommerce requer que o plugin <a href=“http://"
|
723 |
"wordpress.org/extend/plugins/woocommerce/“>WooCommerce</a> esteja ativo!"
|
724 |
|
725 |
+
#: bootstrap.php:907
|
726 |
msgid "function \"wp_remote_post\" does not exist"
|
727 |
msgstr "a funcão “wp_remote_post” não existe"
|
728 |
|
729 |
+
#: bootstrap.php:921
|
730 |
msgid ""
|
731 |
"The REST API seems to be disabled on this wordpress site. Please enable to "
|
732 |
"sync data."
|
734 |
"A REST API aparenta ester desabilitada nest site WordPress. For favor, "
|
735 |
"habilite para sincronizar dados."
|
736 |
|
737 |
+
#~ msgid ""
|
738 |
+
#~ "Currency is currently deprecated. Please select one from the list above"
|
739 |
+
#~ msgstr "Moeda obsoleta. Selecione uma da lista acima"
|
740 |
+
|
741 |
+
#~ msgid "deprecated"
|
742 |
+
#~ msgstr "obsoleta"
|
743 |
+
|
744 |
#~ msgid "User Tags"
|
745 |
#~ msgstr "Etiquetas de Usuário"
|
746 |
|
languages/mailchimp-woocommerce.pot
CHANGED
@@ -2,22 +2,25 @@
|
|
2 |
# This file is distributed under the same license as the Mailchimp for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: Mailchimp for WooCommerce 2.1.
|
6 |
-
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mc-woocommerce
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
-
"POT-Creation-Date: 2019-
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.1.0\n"
|
15 |
-
"Description: desc\n"
|
16 |
|
17 |
#. Plugin Name of the plugin
|
18 |
msgid "Mailchimp for WooCommerce"
|
19 |
msgstr ""
|
20 |
|
|
|
|
|
|
|
|
|
21 |
#. Description of the plugin
|
22 |
msgid "Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff."
|
23 |
msgstr ""
|
@@ -26,6 +29,10 @@ msgstr ""
|
|
26 |
msgid "Mailchimp"
|
27 |
msgstr ""
|
28 |
|
|
|
|
|
|
|
|
|
29 |
#: includes/class-mailchimp-woocommerce-deactivation-survey.php:179
|
30 |
msgid "Please select an option"
|
31 |
msgstr ""
|
@@ -122,13 +129,13 @@ msgid "User ID"
|
|
122 |
msgstr ""
|
123 |
|
124 |
#: includes/class-mailchimp-woocommerce-newsletter.php:43
|
125 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
126 |
#: admin/partials/tabs/newsletter_settings.php:94
|
127 |
msgid "Subscribe to our newsletter"
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: includes/class-mailchimp-woocommerce-rest-api.php:
|
131 |
-
#: admin/partials/tabs/store_sync.php:
|
132 |
msgid "D, M j, Y g:i A"
|
133 |
msgstr ""
|
134 |
|
@@ -140,37 +147,37 @@ msgstr ""
|
|
140 |
msgid "Settings"
|
141 |
msgstr ""
|
142 |
|
143 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
144 |
msgid "As part of the Mailchimp Terms of Use, we require a contact email and a physical mailing address."
|
145 |
msgstr ""
|
146 |
|
147 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
148 |
msgid "As part of the Mailchimp Terms of Use, we require a valid phone number for your store."
|
149 |
msgstr ""
|
150 |
|
151 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
152 |
msgid "Mailchimp for WooCommerce requires a Store Name to connect your store."
|
153 |
msgstr ""
|
154 |
|
155 |
#. translators: %s - plugin name.
|
156 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
157 |
#: admin/partials/tabs/campaign_defaults.php:95
|
158 |
msgid "You were subscribed to the newsletter from %s"
|
159 |
msgstr ""
|
160 |
|
161 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
162 |
msgid "You must supply your Mailchimp API key to pull the audiences."
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
166 |
msgid "Starting the sync process..."
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
170 |
msgid "Please hang tight while we work our mojo."
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: admin/class-mailchimp-woocommerce-admin.php:
|
174 |
msgid "Sometimes the sync can take a while, especially on sites with lots of orders and/or products."
|
175 |
msgstr ""
|
176 |
|
@@ -412,35 +419,35 @@ msgstr ""
|
|
412 |
msgid "In Progress"
|
413 |
msgstr ""
|
414 |
|
415 |
-
#: admin/partials/tabs/store_sync.php:
|
416 |
msgid "Last Updated:"
|
417 |
msgstr ""
|
418 |
|
419 |
-
#: admin/partials/tabs/store_sync.php:
|
420 |
msgid "Account Connected:"
|
421 |
msgstr ""
|
422 |
|
423 |
-
#: admin/partials/tabs/store_sync.php:
|
424 |
msgid "Audience Connected:"
|
425 |
msgstr ""
|
426 |
|
427 |
-
#: admin/partials/tabs/store_sync.php:
|
428 |
msgid "Products Synced:"
|
429 |
msgstr ""
|
430 |
|
431 |
-
#: admin/partials/tabs/store_sync.php:
|
432 |
msgid "Orders Synced:"
|
433 |
msgstr ""
|
434 |
|
435 |
-
#: admin/partials/tabs/store_sync.php:
|
436 |
msgid "Advanced"
|
437 |
msgstr ""
|
438 |
|
439 |
-
#: admin/partials/tabs/store_sync.php:
|
440 |
msgid "You can resync your audience at any time without losing any of your e-commerce data."
|
441 |
msgstr ""
|
442 |
|
443 |
-
#: admin/partials/tabs/store_sync.php:
|
444 |
msgid "Resync"
|
445 |
msgstr ""
|
446 |
|
@@ -540,20 +547,16 @@ msgstr ""
|
|
540 |
msgid "Currency Code"
|
541 |
msgstr ""
|
542 |
|
543 |
-
#: admin/partials/tabs/store_info.php:
|
544 |
-
msgid "Currency
|
545 |
-
msgstr ""
|
546 |
-
|
547 |
-
#: admin/partials/tabs/store_info.php:192
|
548 |
-
msgid "deprecated"
|
549 |
msgstr ""
|
550 |
|
551 |
-
#: admin/partials/tabs/store_info.php:
|
552 |
-
msgid "
|
553 |
msgstr ""
|
554 |
|
555 |
-
#: admin/partials/tabs/store_info.php:
|
556 |
-
#: admin/partials/tabs/store_info.php:
|
557 |
msgid "Timezone"
|
558 |
msgstr ""
|
559 |
|
@@ -610,14 +613,14 @@ msgstr ""
|
|
610 |
msgid "By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>."
|
611 |
msgstr ""
|
612 |
|
613 |
-
#: bootstrap.php:
|
614 |
msgid "The MailChimp For WooCommerce plugin requires the <a href=\"http://wordpress.org/extend/plugins/woocommerce/\">WooCommerce</a> plugin to be active!"
|
615 |
msgstr ""
|
616 |
|
617 |
-
#: bootstrap.php:
|
618 |
msgid "function \"wp_remote_post\" does not exist"
|
619 |
msgstr ""
|
620 |
|
621 |
-
#: bootstrap.php:
|
622 |
msgid "The REST API seems to be disabled on this wordpress site. Please enable to sync data."
|
623 |
msgstr ""
|
2 |
# This file is distributed under the same license as the Mailchimp for WooCommerce plugin.
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: Mailchimp for WooCommerce 2.1.17\n"
|
6 |
+
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/mc-woocommerce\n"
|
7 |
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
8 |
"Language-Team: LANGUAGE <LL@li.org>\n"
|
9 |
"MIME-Version: 1.0\n"
|
10 |
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"POT-Creation-Date: 2019-06-03T04:04:33+00:00\n"
|
13 |
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
14 |
"X-Generator: WP-CLI 2.1.0\n"
|
|
|
15 |
|
16 |
#. Plugin Name of the plugin
|
17 |
msgid "Mailchimp for WooCommerce"
|
18 |
msgstr ""
|
19 |
|
20 |
+
#. Plugin URI of the plugin
|
21 |
+
msgid "https://mailchimp.com/connect-your-store/"
|
22 |
+
msgstr ""
|
23 |
+
|
24 |
#. Description of the plugin
|
25 |
msgid "Connects WooCommerce to Mailchimp to sync your store data, send targeted campaigns to your customers, and sell more stuff."
|
26 |
msgstr ""
|
29 |
msgid "Mailchimp"
|
30 |
msgstr ""
|
31 |
|
32 |
+
#. Author URI of the plugin
|
33 |
+
msgid "https://mailchimp.com"
|
34 |
+
msgstr ""
|
35 |
+
|
36 |
#: includes/class-mailchimp-woocommerce-deactivation-survey.php:179
|
37 |
msgid "Please select an option"
|
38 |
msgstr ""
|
129 |
msgstr ""
|
130 |
|
131 |
#: includes/class-mailchimp-woocommerce-newsletter.php:43
|
132 |
+
#: admin/class-mailchimp-woocommerce-admin.php:583
|
133 |
#: admin/partials/tabs/newsletter_settings.php:94
|
134 |
msgid "Subscribe to our newsletter"
|
135 |
msgstr ""
|
136 |
|
137 |
+
#: includes/class-mailchimp-woocommerce-rest-api.php:282
|
138 |
+
#: admin/partials/tabs/store_sync.php:66
|
139 |
msgid "D, M j, Y g:i A"
|
140 |
msgstr ""
|
141 |
|
147 |
msgid "Settings"
|
148 |
msgstr ""
|
149 |
|
150 |
+
#: admin/class-mailchimp-woocommerce-admin.php:503
|
151 |
msgid "As part of the Mailchimp Terms of Use, we require a contact email and a physical mailing address."
|
152 |
msgstr ""
|
153 |
|
154 |
+
#: admin/class-mailchimp-woocommerce-admin.php:511
|
155 |
msgid "As part of the Mailchimp Terms of Use, we require a valid phone number for your store."
|
156 |
msgstr ""
|
157 |
|
158 |
+
#: admin/class-mailchimp-woocommerce-admin.php:519
|
159 |
msgid "Mailchimp for WooCommerce requires a Store Name to connect your store."
|
160 |
msgstr ""
|
161 |
|
162 |
#. translators: %s - plugin name.
|
163 |
+
#: admin/class-mailchimp-woocommerce-admin.php:537
|
164 |
#: admin/partials/tabs/campaign_defaults.php:95
|
165 |
msgid "You were subscribed to the newsletter from %s"
|
166 |
msgstr ""
|
167 |
|
168 |
+
#: admin/class-mailchimp-woocommerce-admin.php:692
|
169 |
msgid "You must supply your Mailchimp API key to pull the audiences."
|
170 |
msgstr ""
|
171 |
|
172 |
+
#: admin/class-mailchimp-woocommerce-admin.php:1086
|
173 |
msgid "Starting the sync process..."
|
174 |
msgstr ""
|
175 |
|
176 |
+
#: admin/class-mailchimp-woocommerce-admin.php:1088
|
177 |
msgid "Please hang tight while we work our mojo."
|
178 |
msgstr ""
|
179 |
|
180 |
+
#: admin/class-mailchimp-woocommerce-admin.php:1090
|
181 |
msgid "Sometimes the sync can take a while, especially on sites with lots of orders and/or products."
|
182 |
msgstr ""
|
183 |
|
419 |
msgid "In Progress"
|
420 |
msgstr ""
|
421 |
|
422 |
+
#: admin/partials/tabs/store_sync.php:63
|
423 |
msgid "Last Updated:"
|
424 |
msgstr ""
|
425 |
|
426 |
+
#: admin/partials/tabs/store_sync.php:72
|
427 |
msgid "Account Connected:"
|
428 |
msgstr ""
|
429 |
|
430 |
+
#: admin/partials/tabs/store_sync.php:73
|
431 |
msgid "Audience Connected:"
|
432 |
msgstr ""
|
433 |
|
434 |
+
#: admin/partials/tabs/store_sync.php:74
|
435 |
msgid "Products Synced:"
|
436 |
msgstr ""
|
437 |
|
438 |
+
#: admin/partials/tabs/store_sync.php:75
|
439 |
msgid "Orders Synced:"
|
440 |
msgstr ""
|
441 |
|
442 |
+
#: admin/partials/tabs/store_sync.php:78
|
443 |
msgid "Advanced"
|
444 |
msgstr ""
|
445 |
|
446 |
+
#: admin/partials/tabs/store_sync.php:80
|
447 |
msgid "You can resync your audience at any time without losing any of your e-commerce data."
|
448 |
msgstr ""
|
449 |
|
450 |
+
#: admin/partials/tabs/store_sync.php:82
|
451 |
msgid "Resync"
|
452 |
msgstr ""
|
453 |
|
547 |
msgid "Currency Code"
|
548 |
msgstr ""
|
549 |
|
550 |
+
#: admin/partials/tabs/store_info.php:189
|
551 |
+
msgid "Currency"
|
|
|
|
|
|
|
|
|
552 |
msgstr ""
|
553 |
|
554 |
+
#: admin/partials/tabs/store_info.php:189
|
555 |
+
msgid "Retrieved from Woocommerce Settings"
|
556 |
msgstr ""
|
557 |
|
558 |
+
#: admin/partials/tabs/store_info.php:195
|
559 |
+
#: admin/partials/tabs/store_info.php:206
|
560 |
msgid "Timezone"
|
561 |
msgstr ""
|
562 |
|
613 |
msgid "By using this plugin, Mailchimp will process customer information in accordance with their <a href=%s target=_blank>Privacy Policy</a>."
|
614 |
msgstr ""
|
615 |
|
616 |
+
#: bootstrap.php:512
|
617 |
msgid "The MailChimp For WooCommerce plugin requires the <a href=\"http://wordpress.org/extend/plugins/woocommerce/\">WooCommerce</a> plugin to be active!"
|
618 |
msgstr ""
|
619 |
|
620 |
+
#: bootstrap.php:909
|
621 |
msgid "function \"wp_remote_post\" does not exist"
|
622 |
msgstr ""
|
623 |
|
624 |
+
#: bootstrap.php:923
|
625 |
msgid "The REST API seems to be disabled on this wordpress site. Please enable to sync data."
|
626 |
msgstr ""
|
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.1.
|
20 |
* Author: Mailchimp
|
21 |
* Author URI: https://mailchimp.com
|
22 |
* License: GPL-2.0+
|
@@ -25,6 +25,8 @@
|
|
25 |
* Domain Path: /languages
|
26 |
* Requires at least: 4.4
|
27 |
* Tested up to: 5.1
|
|
|
|
|
28 |
*/
|
29 |
|
30 |
// If this file is called directly, abort.
|
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.1.17
|
20 |
* Author: Mailchimp
|
21 |
* Author URI: https://mailchimp.com
|
22 |
* License: GPL-2.0+
|
25 |
* Domain Path: /languages
|
26 |
* Requires at least: 4.4
|
27 |
* Tested up to: 5.1
|
28 |
+
* WC requires at least: 3.5
|
29 |
+
* WC tested up to: 3.6.4
|
30 |
*/
|
31 |
|
32 |
// If this file is called directly, abort.
|