Version Description
Download this release
Release Info
Developer | anderly |
Plugin | WooCommerce MailChimp |
Version | 2.0.3 |
Comparing to | |
See all releases |
Code changes from version 2.0.2 to 2.0.3
- includes/class-ss-wc-integration-mailchimp.php +0 -766
- includes/class-ss-wc-mailchimp-handler.php +7 -23
- includes/class-ss-wc-mailchimp-plugin.php +13 -24
- includes/class-ss-wc-settings-mailchimp.php +75 -81
- languages/woocommerce-mailchimp.pot +233 -116
- readme.txt +11 -3
- woocommerce-mailchimp.php +2 -2
includes/class-ss-wc-integration-mailchimp.php
DELETED
@@ -1,766 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly
|
4 |
-
|
5 |
-
/**
|
6 |
-
* MailChimp Integration
|
7 |
-
*
|
8 |
-
* Allows integration with MailChimp
|
9 |
-
*
|
10 |
-
* @class SS_WC_Integration_MailChimp
|
11 |
-
* @extends WC_Integration
|
12 |
-
* @version 1.4.0
|
13 |
-
* @package WooCommerce MailChimp
|
14 |
-
* @author Saint Systems
|
15 |
-
*/
|
16 |
-
class SS_WC_Integration_MailChimp extends WC_Integration {
|
17 |
-
|
18 |
-
/**
|
19 |
-
* Instance of the API class.
|
20 |
-
* @var Object
|
21 |
-
*/
|
22 |
-
private static $api_instance = null;
|
23 |
-
|
24 |
-
private $api_key = '';
|
25 |
-
private $debug = false;
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Init and hook in the integration.
|
29 |
-
*
|
30 |
-
* @access public
|
31 |
-
* @return void
|
32 |
-
*/
|
33 |
-
public function __construct() {
|
34 |
-
|
35 |
-
$this->id = 'mailchimp';
|
36 |
-
$this->method_title = __( 'MailChimp', 'ss_wc_mailchimp' );
|
37 |
-
$this->method_description = __( 'MailChimp is a popular email marketing service.', 'ss_wc_mailchimp' );
|
38 |
-
|
39 |
-
// Load the settings.
|
40 |
-
$this->init_settings();
|
41 |
-
|
42 |
-
if ( is_admin() && ! is_ajax() ) {
|
43 |
-
// Load the settings
|
44 |
-
$this->init_form_fields();
|
45 |
-
}
|
46 |
-
|
47 |
-
// Hooks
|
48 |
-
add_action( 'admin_notices', array( $this, 'checks' ) );
|
49 |
-
|
50 |
-
// Update the settings fields
|
51 |
-
add_action( 'woocommerce_update_options_integration', array( $this, 'process_admin_options') );
|
52 |
-
|
53 |
-
// Update the settings fields
|
54 |
-
add_action( 'woocommerce_update_options_integration', array( $this, 'refresh_settings'), 10 );
|
55 |
-
|
56 |
-
// Refresh the settings
|
57 |
-
add_action( 'woocommerce_update_options_integration_' . $this->id, array( $this, 'refresh_settings'), 10 );
|
58 |
-
|
59 |
-
// We would use the 'woocommerce_new_order' action but first name, last name and email address (order meta) is not yet available,
|
60 |
-
// so instead we use the 'woocommerce_checkout_update_order_meta' action hook which fires after the checkout process on the "thank you" page
|
61 |
-
add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'order_status_changed' ), 1000, 1 );
|
62 |
-
|
63 |
-
// hook into woocommerce order status changed hook to handle the desired subscription event trigger
|
64 |
-
add_action( 'woocommerce_order_status_changed', array( $this, 'order_status_changed' ), 10, 3 );
|
65 |
-
|
66 |
-
// Maybe add an "opt-in" field to the checkout
|
67 |
-
$opt_in_checkbox_display_location = !empty( $this->opt_in_checkbox_display_location() ) ? $this->opt_in_checkbox_display_location() : 'woocommerce_review_order_before_submit';
|
68 |
-
|
69 |
-
// Old opt-in checkbox display locations
|
70 |
-
$old_opt_in_checkbox_display_locations = array(
|
71 |
-
'billing' => 'woocommerce_after_checkout_billing_form',
|
72 |
-
'order' => 'woocommerce_review_order_before_submit',
|
73 |
-
);
|
74 |
-
|
75 |
-
// Map old billing/order checkbox display locations to new format
|
76 |
-
if ( array_key_exists( $opt_in_checkbox_display_location, $old_opt_in_checkbox_display_locations ) ) {
|
77 |
-
$opt_in_checkbox_display_location = $old_opt_in_checkbox_display_locations[ $opt_in_checkbox_display_location ];
|
78 |
-
}
|
79 |
-
|
80 |
-
add_action( $opt_in_checkbox_display_location, array( $this, 'maybe_add_checkout_fields' ) );
|
81 |
-
add_filter( 'default_checkout_ss_wc_mailchimp_opt_in', array( $this, 'checkbox_default_status' ) );
|
82 |
-
|
83 |
-
// Maybe save the "opt-in" field on the checkout
|
84 |
-
add_action( 'woocommerce_checkout_update_order_meta', array( $this, 'maybe_save_checkout_fields' ) );
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* api_key function.
|
89 |
-
* @return string MailChimp API Key
|
90 |
-
*/
|
91 |
-
public function api_key() {
|
92 |
-
return $this->get_option( 'api_key' );
|
93 |
-
}
|
94 |
-
|
95 |
-
/**
|
96 |
-
* is_enabled function.
|
97 |
-
*
|
98 |
-
* @access public
|
99 |
-
* @return boolean
|
100 |
-
*/
|
101 |
-
public function is_enabled() {
|
102 |
-
return 'yes' === $this->get_option( 'enabled' );
|
103 |
-
}
|
104 |
-
|
105 |
-
/**
|
106 |
-
* occurs function
|
107 |
-
* @return string
|
108 |
-
*/
|
109 |
-
public function occurs() {
|
110 |
-
return $this->get_option( 'occurs' );
|
111 |
-
}
|
112 |
-
|
113 |
-
/**
|
114 |
-
* list function.
|
115 |
-
*
|
116 |
-
* @access public
|
117 |
-
* @return string MailChimp list ID
|
118 |
-
*/
|
119 |
-
public function list() {
|
120 |
-
return $this->get_option( 'list' );
|
121 |
-
}
|
122 |
-
|
123 |
-
/**
|
124 |
-
* double_optin function.
|
125 |
-
*
|
126 |
-
* @access public
|
127 |
-
* @return boolean
|
128 |
-
*/
|
129 |
-
public function double_optin() {
|
130 |
-
return 'yes' === $this->get_option( 'double_optin' );
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* display_opt_in function.
|
135 |
-
*
|
136 |
-
* @access public
|
137 |
-
* @return boolean
|
138 |
-
*/
|
139 |
-
public function display_opt_in() {
|
140 |
-
return 'yes' === $this->get_option( 'display_opt_in' );
|
141 |
-
}
|
142 |
-
|
143 |
-
/**
|
144 |
-
* opt_in_label function.
|
145 |
-
*
|
146 |
-
* @access public
|
147 |
-
* @return string
|
148 |
-
*/
|
149 |
-
public function opt_in_label() {
|
150 |
-
return $this->get_option( 'opt_in_label' );
|
151 |
-
}
|
152 |
-
|
153 |
-
/**
|
154 |
-
* opt_in_checkbox_default_status function.
|
155 |
-
*
|
156 |
-
* @access public
|
157 |
-
* @return string
|
158 |
-
*/
|
159 |
-
public function opt_in_checkbox_default_status() {
|
160 |
-
return $this->get_option( 'opt_in_checkbox_default_status' );
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* opt_in_checkbox_display_location function.
|
165 |
-
*
|
166 |
-
* @access public
|
167 |
-
* @return string
|
168 |
-
*/
|
169 |
-
public function opt_in_checkbox_display_location() {
|
170 |
-
return $this->get_option( 'opt_in_checkbox_display_location' );
|
171 |
-
}
|
172 |
-
|
173 |
-
/**
|
174 |
-
* interests function.
|
175 |
-
*
|
176 |
-
* @access public
|
177 |
-
* @return array
|
178 |
-
*/
|
179 |
-
public function interest_groups() {
|
180 |
-
return $this->get_option( 'interest_groups' );
|
181 |
-
}
|
182 |
-
|
183 |
-
/**
|
184 |
-
* has_list function.
|
185 |
-
*
|
186 |
-
* @access public
|
187 |
-
* @return boolean
|
188 |
-
*/
|
189 |
-
public function has_list() {
|
190 |
-
if ( $this->list() ) {
|
191 |
-
return true;
|
192 |
-
}
|
193 |
-
return false;
|
194 |
-
}
|
195 |
-
|
196 |
-
/**
|
197 |
-
* has_api_key function.
|
198 |
-
*
|
199 |
-
* @access public
|
200 |
-
* @return boolean
|
201 |
-
*/
|
202 |
-
public function has_api_key() {
|
203 |
-
return !empty( $this->api_key() );
|
204 |
-
}
|
205 |
-
|
206 |
-
/**
|
207 |
-
* is_valid function.
|
208 |
-
*
|
209 |
-
* @access public
|
210 |
-
* @return boolean
|
211 |
-
*/
|
212 |
-
public function is_valid() {
|
213 |
-
return $this->is_enabled() && $this->has_api_key() && $this->has_list();
|
214 |
-
}
|
215 |
-
|
216 |
-
/**
|
217 |
-
* debug_enabled function.
|
218 |
-
*
|
219 |
-
* @access public
|
220 |
-
* @return boolean
|
221 |
-
*/
|
222 |
-
public function debug_enabled() {
|
223 |
-
return 'yes' === $this->get_option( 'debug' );
|
224 |
-
}
|
225 |
-
|
226 |
-
/*
|
227 |
-
Refreshes the settings form fields
|
228 |
-
*/
|
229 |
-
public function refresh_settings() {
|
230 |
-
$this->init_form_fields();
|
231 |
-
}
|
232 |
-
|
233 |
-
/**
|
234 |
-
* Check if the user has enabled the plugin functionality, but hasn't provided an api key
|
235 |
-
**/
|
236 |
-
function checks() {
|
237 |
-
// Check required fields
|
238 |
-
if ( $this->is_enabled() && ! $this->has_api_key() ) {
|
239 |
-
// Show notice
|
240 |
-
echo $this->get_message( sprintf( '%s <a href="%s">%s</a>.',
|
241 |
-
__( 'WooCommerce MailChimp error: Plugin is enabled but no api key provided. Please enter your api key', 'ss_wc_mailchimp'),
|
242 |
-
WOOCOMMERCE_MAILCHIMP_SETTINGS_URL,
|
243 |
-
__( 'here', 'ss_wc_mailchimp' )
|
244 |
-
)
|
245 |
-
);
|
246 |
-
}
|
247 |
-
}
|
248 |
-
|
249 |
-
/**
|
250 |
-
* order_status_changed function.
|
251 |
-
*
|
252 |
-
* @access public
|
253 |
-
* @return void
|
254 |
-
*/
|
255 |
-
public function order_status_changed( $id, $status = 'new', $new_status = 'pending' ) {
|
256 |
-
if ( $this->is_valid() && $new_status === $this->occurs() ) {
|
257 |
-
// Get WC order
|
258 |
-
$order = $this->wc_get_order( $id );
|
259 |
-
|
260 |
-
// get the ss_wc_mailchimp_opt_in value from the post meta. "order_custom_fields" was removed with WooCommerce 2.1
|
261 |
-
$subscribe_customer = get_post_meta( $id, 'ss_wc_mailchimp_opt_in', true );
|
262 |
-
|
263 |
-
// If the 'ss_wc_mailchimp_opt_in' meta value isn't set
|
264 |
-
// (because 'display_opt_in' wasn't enabled at the time the order was placed)
|
265 |
-
// or the 'ss_wc_mailchimp_opt_in' is yes, subscriber the customer
|
266 |
-
if ( ! $subscribe_customer || empty( $subscribe_customer ) || 'yes' === $subscribe_customer ) {
|
267 |
-
// log
|
268 |
-
$this->log( sprintf( __( __METHOD__ . '(): Subscribing customer (%s) to list %s', 'ss_wc_mailchimp' ), $order->billing_email, $this->list() ) );
|
269 |
-
|
270 |
-
// subscribe
|
271 |
-
$this->subscribe( $order->id, $order->billing_first_name, $order->billing_last_name, $order->billing_email, $this->list() );
|
272 |
-
}
|
273 |
-
}
|
274 |
-
}
|
275 |
-
|
276 |
-
/**
|
277 |
-
* Initialize Settings Form Fields
|
278 |
-
*
|
279 |
-
* @access public
|
280 |
-
* @return void
|
281 |
-
*/
|
282 |
-
function init_form_fields() {
|
283 |
-
// $this->load_settings();
|
284 |
-
|
285 |
-
$form_fields = array();
|
286 |
-
|
287 |
-
$form_fields['api_key'] = array(
|
288 |
-
'title' => __( 'API Key', 'ss_wc_mailchimp' ),
|
289 |
-
'type' => 'text',
|
290 |
-
'description' => sprintf( '<a href="https://admin.mailchimp.com/account/api/" target="_blank">%s</a> %s',
|
291 |
-
__( 'Login to MailChimp', 'ss_wc_mailchimp'),
|
292 |
-
__( 'to look up your api key.', 'ss_wc_mailchimp' )
|
293 |
-
),
|
294 |
-
'default' => ''
|
295 |
-
);
|
296 |
-
if ( !$this->has_api_key() ) {
|
297 |
-
$form_fields['api_key']['description'] = sprintf( '%s <strong>%s</strong> %s.<br/>',
|
298 |
-
__( 'Paste your API key above and click', 'ss_wc_mailchimp' ),
|
299 |
-
__( 'Save changes', 'ss_wc_mailchimp' ),
|
300 |
-
__( 'below', 'ss_wc_mailchimp' )
|
301 |
-
) . $form_fields['api_key']['description'];
|
302 |
-
}
|
303 |
-
|
304 |
-
$mailchimp_lists = $this->get_lists();
|
305 |
-
|
306 |
-
if ( is_admin() && ! is_ajax() ) {
|
307 |
-
|
308 |
-
if ( $this->has_api_key() && $mailchimp_lists !== false ) {
|
309 |
-
|
310 |
-
if ( $this->has_api_key() && $this->has_list() ) {
|
311 |
-
$interest_groups = $this->get_interest_groups();
|
312 |
-
} else {
|
313 |
-
$interest_groups = array();
|
314 |
-
}
|
315 |
-
|
316 |
-
$form_fields['enabled'] = array(
|
317 |
-
'title' => __( 'Enable/Disable', 'ss_wc_mailchimp' ),
|
318 |
-
'label' => __( 'Enable MailChimp Integration', 'ss_wc_mailchimp' ),
|
319 |
-
'type' => 'checkbox',
|
320 |
-
'description' => __( 'Enable/disable the plugin functionality.', 'ss_wc_mailchimp' ),
|
321 |
-
'default' => 'yes',
|
322 |
-
);
|
323 |
-
|
324 |
-
$form_fields['list'] = array(
|
325 |
-
'title' => __( 'Main List', 'ss_wc_mailchimp' ),
|
326 |
-
'type' => 'select',
|
327 |
-
'description' => __( 'All customers will be added to this list.', 'ss_wc_mailchimp' ),
|
328 |
-
'default' => '',
|
329 |
-
'options' => $mailchimp_lists,
|
330 |
-
'class' => 'wc-enhanced-select',
|
331 |
-
'css' => 'min-width: 350px;',
|
332 |
-
'custom_attributes' => array(
|
333 |
-
'onchange' => 'form.submit()',
|
334 |
-
),
|
335 |
-
);
|
336 |
-
if ( array_key_exists( 'no_lists', $mailchimp_lists ) ) {
|
337 |
-
$form_fields['list']['description'] = sprintf( __( 'There are no lists in your MailChimp account. <a href="%s" target="_blank">Click here</a> to create one.', 'ss_wc_mailchimp' ), 'https://admin.mailchimp.com/lists/new-list/' );
|
338 |
-
}
|
339 |
-
|
340 |
-
$form_fields['interest_groups'] = array(
|
341 |
-
'title' => __( 'Interest Groups', 'ss_wc_mailchimp' ),
|
342 |
-
'type' => 'multiselect',
|
343 |
-
'description' => __( 'Optional: Interest groups to assign to subscribers.', 'ss_wc_mailchimp' ),
|
344 |
-
'default' => '',
|
345 |
-
'options' => $interest_groups,
|
346 |
-
'class' => 'wc-enhanced-select',
|
347 |
-
'custom_attributes' => array(
|
348 |
-
'placeholder' => __( 'Select interest groups...', 'ss_wc_mailchimp' ),
|
349 |
-
),
|
350 |
-
'css' => 'min-width: 350px;',
|
351 |
-
);
|
352 |
-
|
353 |
-
if ( is_array( $interest_groups ) && count( $interest_groups ) == 0 ) {
|
354 |
-
// $form_fields['interest_groups']['description'] = __( 'Optional: Interest groups to assign to subscribers.', 'ss_wc_mailchimp' );
|
355 |
-
$form_fields['interest_groups']['custom_attributes']['placeholder'] = __( 'This list has no interest groups.', 'ss_wc_mailchimp' );
|
356 |
-
$form_fields['interest_groups']['custom_attributes']['disabled'] = 'disabled';
|
357 |
-
} elseif ( !$this->has_list() ) {
|
358 |
-
$form_fields['interest_groups']['custom_attributes']['placeholder'] = __( 'Select a list to see interests', 'ss_wc_mailchimp' );
|
359 |
-
$form_fields['interest_groups']['custom_attributes']['disabled'] = 'disabled';
|
360 |
-
}
|
361 |
-
|
362 |
-
$form_fields['occurs'] = array(
|
363 |
-
'title' => __( 'Subscribe Event', 'ss_wc_mailchimp' ),
|
364 |
-
'type' => 'select',
|
365 |
-
'description' => __( 'When should customers be subscribed to lists?', 'ss_wc_mailchimp' ),
|
366 |
-
'default' => 'pending',
|
367 |
-
'options' => array(
|
368 |
-
'pending' => __( 'Order Created', 'ss_wc_mailchimp' ),
|
369 |
-
'processing' => __( 'Order Processing', 'ss_wc_mailchimp' ),
|
370 |
-
'completed' => __( 'Order Completed', 'ss_wc_mailchimp' ),
|
371 |
-
),
|
372 |
-
);
|
373 |
-
|
374 |
-
$form_fields['double_optin'] = array(
|
375 |
-
'title' => __( 'Double Opt-In', 'ss_wc_mailchimp' ),
|
376 |
-
'label' => __( 'Enable Double Opt-In', 'ss_wc_mailchimp' ),
|
377 |
-
'type' => 'checkbox',
|
378 |
-
'description' => __( 'If enabled, customers will receive an email prompting them to confirm their subscription to the list above.', 'ss_wc_mailchimp' ),
|
379 |
-
'default' => 'no'
|
380 |
-
);
|
381 |
-
|
382 |
-
$form_fields['display_opt_in'] = array(
|
383 |
-
'title' => __( 'Display Opt-In Field', 'ss_wc_mailchimp' ),
|
384 |
-
'label' => __( 'Display an Opt-In Field on Checkout', 'ss_wc_mailchimp' ),
|
385 |
-
'type' => 'checkbox',
|
386 |
-
'description' => __( 'If enabled, customers will be presented with a "Opt-in" checkbox during checkout and will only be added to the list above if they opt-in.', 'ss_wc_mailchimp' ),
|
387 |
-
'default' => 'no',
|
388 |
-
);
|
389 |
-
|
390 |
-
$form_fields['opt_in_label'] = array(
|
391 |
-
'title' => __( 'Opt-In Field Label', 'ss_wc_mailchimp' ),
|
392 |
-
'type' => 'text',
|
393 |
-
'description' => __( 'Optional: customize the label displayed next to the opt-in checkbox.', 'ss_wc_mailchimp' ),
|
394 |
-
'default' => __( 'Subscribe to our newsletter', 'ss_wc_mailchimp' ),
|
395 |
-
);
|
396 |
-
|
397 |
-
$form_fields['opt_in_checkbox_default_status'] = array(
|
398 |
-
'title' => __( 'Opt-In Checkbox Default Status', 'ss_wc_mailchimp' ),
|
399 |
-
'type' => 'select',
|
400 |
-
'description' => __( 'The default state of the opt-in checkbox.', 'ss_wc_mailchimp' ),
|
401 |
-
'default' => 'checked',
|
402 |
-
'options' => array(
|
403 |
-
'checked' => __( 'Checked', 'ss_wc_mailchimp' ),
|
404 |
-
'unchecked' => __( 'Unchecked', 'ss_wc_mailchimp' )
|
405 |
-
)
|
406 |
-
);
|
407 |
-
|
408 |
-
$form_fields['opt_in_checkbox_display_location'] = array(
|
409 |
-
'title' => __( 'Opt-In Checkbox Display Location', 'ss_wc_mailchimp' ),
|
410 |
-
'type' => 'select',
|
411 |
-
'description' => __( 'Where to display the opt-in checkbox on the checkout page.', 'ss_wc_mailchimp' ),
|
412 |
-
'default' => 'woocommerce_review_order_before_submit',
|
413 |
-
'options' => array(
|
414 |
-
'woocommerce_checkout_before_customer_details' => __( 'Above customer details', 'ss_wc_mailchimp' ),
|
415 |
-
'woocommerce_checkout_after_customer_details' => __( 'Below customer details', 'ss_wc_mailchimp' ),
|
416 |
-
'woocommerce_review_order_before_submit' => __( 'Order review above submit', 'ss_wc_mailchimp' ),
|
417 |
-
'woocommerce_review_order_after_submit' => __( 'Order review below submit', 'ss_wc_mailchimp' ),
|
418 |
-
'woocommerce_review_order_before_order_total' => __( 'Order review above total', 'ss_wc_mailchimp' ),
|
419 |
-
'woocommerce_checkout_billing' => __( 'Above billing details', 'ss_wc_mailchimp' ),
|
420 |
-
'woocommerce_checkout_shipping' => __( 'Above shipping details', 'ss_wc_mailchimp' ),
|
421 |
-
'woocommerce_after_checkout_billing_form' => __( 'Below Checkout billing form', 'ss_wc_mailchimp' ),
|
422 |
-
)
|
423 |
-
);
|
424 |
-
|
425 |
-
$label = __( 'Enable Logging', 'ss_wc_mailchimp' );
|
426 |
-
|
427 |
-
if ( defined( 'WC_LOG_DIR' ) ) {
|
428 |
-
$debug_log_url = add_query_arg( 'tab', 'logs', add_query_arg( 'page', 'wc-status', admin_url( 'admin.php' ) ) );
|
429 |
-
$debug_log_key = 'woocommerce-mailchimp-' . sanitize_file_name( wp_hash( 'woocommerce-mailchimp' ) ) . '-log';
|
430 |
-
$debug_log_url = add_query_arg( 'log_file', $debug_log_key, $debug_log_url );
|
431 |
-
|
432 |
-
$label .= ' | ' . sprintf( __( '%1$sView Log%2$s', 'ss_wc_mailchimp' ), '<a href="' . esc_url( $debug_log_url ) . '">', '</a>' );
|
433 |
-
}
|
434 |
-
|
435 |
-
$form_fields[ 'debug' ] = array(
|
436 |
-
'title' => __( 'Debug Log', 'ss_wc_mailchimp' ),
|
437 |
-
'label' => $label,
|
438 |
-
'description' => __( 'Enable logging MailChimp API calls. Only enable for troubleshooting purposes.', 'ss_wc_mailchimp' ),
|
439 |
-
'type' => 'checkbox',
|
440 |
-
'default' => 'no'
|
441 |
-
);
|
442 |
-
}
|
443 |
-
|
444 |
-
$this->form_fields = $form_fields;
|
445 |
-
|
446 |
-
$this->wc_enqueue_js("
|
447 |
-
jQuery('#woocommerce_mailchimp_display_opt_in').change(function() {
|
448 |
-
if ( jQuery(this).prop('checked') === true ) {
|
449 |
-
jQuery('#mainform [id^=woocommerce_mailchimp_opt_in]').closest('tr').show('fast');
|
450 |
-
} else {
|
451 |
-
jQuery('#mainform [id^=woocommerce_mailchimp_opt_in]').closest('tr').hide('fast');
|
452 |
-
}
|
453 |
-
|
454 |
-
});
|
455 |
-
|
456 |
-
jQuery('#woocommerce_mailchimp_display_opt_in').change();
|
457 |
-
");
|
458 |
-
}
|
459 |
-
|
460 |
-
} // End init_form_fields()
|
461 |
-
|
462 |
-
/**
|
463 |
-
* WooCommerce 2.1 support for wc_enqueue_js
|
464 |
-
*
|
465 |
-
* @since 1.2.1
|
466 |
-
*
|
467 |
-
* @access private
|
468 |
-
* @param string $code
|
469 |
-
* @return void
|
470 |
-
*/
|
471 |
-
private function wc_enqueue_js( $code ) {
|
472 |
-
if ( function_exists( 'wc_enqueue_js' ) ) {
|
473 |
-
wc_enqueue_js( $code );
|
474 |
-
} else {
|
475 |
-
global $woocommerce;
|
476 |
-
$woocommerce->add_inline_js( $code );
|
477 |
-
}
|
478 |
-
}
|
479 |
-
|
480 |
-
/**
|
481 |
-
* WooCommerce 2.2 support for wc_get_order
|
482 |
-
*
|
483 |
-
* @since 1.2.1
|
484 |
-
*
|
485 |
-
* @access private
|
486 |
-
* @param int $order_id
|
487 |
-
* @return void
|
488 |
-
*/
|
489 |
-
private function wc_get_order( $order_id ) {
|
490 |
-
if ( function_exists( 'wc_get_order' ) ) {
|
491 |
-
return wc_get_order( $order_id );
|
492 |
-
} else {
|
493 |
-
return new WC_Order( $order_id );
|
494 |
-
}
|
495 |
-
}
|
496 |
-
|
497 |
-
/**
|
498 |
-
* Get message
|
499 |
-
* @return string Error
|
500 |
-
*/
|
501 |
-
private function get_message( $message, $type = 'error' ) {
|
502 |
-
ob_start();
|
503 |
-
|
504 |
-
?>
|
505 |
-
<div class="<?php echo $type ?>">
|
506 |
-
<p><?php echo $message ?></p>
|
507 |
-
</div>
|
508 |
-
<?php
|
509 |
-
return ob_get_clean();
|
510 |
-
}
|
511 |
-
|
512 |
-
/**
|
513 |
-
* API Instance Singleton
|
514 |
-
* @return Object
|
515 |
-
*/
|
516 |
-
public function api() {
|
517 |
-
if ( is_null( self::$api_instance ) ) {
|
518 |
-
if ( ! $this->has_api_key() ) {
|
519 |
-
return false;
|
520 |
-
}
|
521 |
-
require_once( 'class-ss-wc-mailchimp-api.php' );
|
522 |
-
self::$api_instance = new SS_WC_MailChimp_API( $this->api_key(), $this->debug_enabled() );
|
523 |
-
}
|
524 |
-
return self::$api_instance;
|
525 |
-
}
|
526 |
-
|
527 |
-
/**
|
528 |
-
* get_lists function.
|
529 |
-
*
|
530 |
-
* @access public
|
531 |
-
* @return void
|
532 |
-
*/
|
533 |
-
public function get_lists() {
|
534 |
-
|
535 |
-
// $mailchimp_lists = get_transient( 'ss_wc_mailchimp_lists' );
|
536 |
-
|
537 |
-
// if ( ! $mailchimp_lists ) {
|
538 |
-
if ( $this->api() ) {
|
539 |
-
$mailchimp_lists = $this->api()->get_lists();
|
540 |
-
} else {
|
541 |
-
return false;
|
542 |
-
}
|
543 |
-
|
544 |
-
if ( $mailchimp_lists === false ) {
|
545 |
-
|
546 |
-
add_action( 'admin_notices', array( $this, 'mailchimp_api_error_msg' ) );
|
547 |
-
add_action( 'network_admin_notices', array( $this, 'mailchimp_api_error_msg' ) );
|
548 |
-
|
549 |
-
return false;
|
550 |
-
|
551 |
-
}
|
552 |
-
|
553 |
-
if ( count( $mailchimp_lists ) === 0 ) {
|
554 |
-
$default = array(
|
555 |
-
'no_lists' => __( 'Oops! No lists in your MailChimp account...', 'ss_wc_mailchimp' ),
|
556 |
-
);
|
557 |
-
add_action( 'admin_notices', array( $this, 'mailchimp_no_lists_found' ) );
|
558 |
-
} else {
|
559 |
-
$default = array(
|
560 |
-
'' => __( 'Select a list...', 'ss_wc_mailchimp' ),
|
561 |
-
);
|
562 |
-
set_transient( 'ss_wc_mailchimp_lists', $mailchimp_lists, 60 * 60 * 1 );
|
563 |
-
}
|
564 |
-
$mailchimp_lists = array_merge( $default, $mailchimp_lists );
|
565 |
-
|
566 |
-
//}
|
567 |
-
|
568 |
-
return $mailchimp_lists;
|
569 |
-
|
570 |
-
}
|
571 |
-
|
572 |
-
/**
|
573 |
-
* get_interest_groups function.
|
574 |
-
*
|
575 |
-
* @access public
|
576 |
-
* @return void
|
577 |
-
*/
|
578 |
-
public function get_interest_groups() {
|
579 |
-
|
580 |
-
if ( $this->api() && $this->has_list() ) {
|
581 |
-
$interest_groups = $this->api()->get_interest_categories_with_interests( $this->list() );
|
582 |
-
} else {
|
583 |
-
return false;
|
584 |
-
}
|
585 |
-
|
586 |
-
if ( $interest_groups === false ) {
|
587 |
-
|
588 |
-
add_action( 'admin_notices', array( $this, 'mailchimp_api_error_msg' ) );
|
589 |
-
add_action( 'network_admin_notices', array( $this, 'mailchimp_api_error_msg' ) );
|
590 |
-
|
591 |
-
return false;
|
592 |
-
|
593 |
-
}
|
594 |
-
|
595 |
-
return $interest_groups;
|
596 |
-
|
597 |
-
}
|
598 |
-
|
599 |
-
/**
|
600 |
-
* Inform the user they don't have any MailChimp lists
|
601 |
-
*/
|
602 |
-
public function mailchimp_no_lists_found() {
|
603 |
-
echo $this->get_message( sprintf( __( 'Oops! There are no lists in your MailChimp account. <a href="%s" target="_blank">Click here</a> to create one.', 'ss_wc_mailchimp' ), 'https://admin.mailchimp.com/lists/new-list/' ) );
|
604 |
-
}
|
605 |
-
|
606 |
-
/**
|
607 |
-
* Display message to user if there is an issue with the MailChimp API call
|
608 |
-
*
|
609 |
-
* @since 1.0
|
610 |
-
* @param void
|
611 |
-
* @return html the message for the user
|
612 |
-
*/
|
613 |
-
public function mailchimp_api_error_msg() {
|
614 |
-
echo $this->get_message(
|
615 |
-
sprintf( __( 'Unable to load lists from MailChimp: (%s) %s. ', 'ss_wc_mailchimp' ), $this->api()->get_error_code(), $this->api()->get_error_message() ) .
|
616 |
-
sprintf( __( 'Please check your %s <a href="%s">settings</a>.', 'ss_wc_mailchimp' ), __( 'Settings', 'ss_wc_mailchimp' ), WOOCOMMERCE_MAILCHIMP_SETTINGS_URL )
|
617 |
-
);
|
618 |
-
} //end function mailchimp_api_error_msg
|
619 |
-
|
620 |
-
/**
|
621 |
-
* subscribe function.
|
622 |
-
*
|
623 |
-
* @access public
|
624 |
-
* @param int $order_id
|
625 |
-
* @param mixed $first_name
|
626 |
-
* @param mixed $last_name
|
627 |
-
* @param mixed $email
|
628 |
-
* @param string $listid (default: 'false')
|
629 |
-
* @return void
|
630 |
-
*/
|
631 |
-
public function subscribe( $order_id, $first_name, $last_name, $email, $list_id = 'false' ) {
|
632 |
-
if ( ! $email ) {
|
633 |
-
return; // Email is required
|
634 |
-
}
|
635 |
-
|
636 |
-
if ( 'false' == $list_id ) {
|
637 |
-
$list_id = $this->list();
|
638 |
-
}
|
639 |
-
|
640 |
-
$merge_tags = array(
|
641 |
-
'FNAME' => $first_name,
|
642 |
-
'LNAME' => $last_name
|
643 |
-
);
|
644 |
-
|
645 |
-
if ( ! empty( $this->interest_groups() ) ) {
|
646 |
-
$interest_groups = array_fill_keys( $this->interest_groups(), true );
|
647 |
-
|
648 |
-
// Allow hooking into variables
|
649 |
-
$interest_groups = apply_filters( 'ss_wc_mailchimp_subscribe_interest_groups', $interest_groups, $order_id, $email );
|
650 |
-
}
|
651 |
-
|
652 |
-
// Allow hooking into variables
|
653 |
-
$merge_tags = apply_filters( 'ss_wc_mailchimp_subscribe_merge_tags', $merge_tags, $order_id, $email );
|
654 |
-
|
655 |
-
// Set subscription options
|
656 |
-
$subscribe_options = array(
|
657 |
-
'list_id' => $list_id,
|
658 |
-
'email' => $email,
|
659 |
-
'merge_tags' => $merge_tags,
|
660 |
-
'interest_groups' => $interest_groups,
|
661 |
-
'email_type' => 'html',
|
662 |
-
'double_optin' => $this->double_optin(),
|
663 |
-
);
|
664 |
-
|
665 |
-
// Allow hooking into subscription options
|
666 |
-
$options = apply_filters( 'ss_wc_mailchimp_subscribe_options', $subscribe_options, $order_id );
|
667 |
-
|
668 |
-
// Extract options into variables
|
669 |
-
extract( $options );
|
670 |
-
|
671 |
-
// Log
|
672 |
-
$this->log( sprintf( __( __METHOD__ . '(): Subscribing customer to MailChimp: %s', 'ss_wc_mailchimp' ), print_r( $options, true ) ) );
|
673 |
-
|
674 |
-
// Call API
|
675 |
-
$api_response = $this->api()->subscribe( $list_id, $email, $email_type, $merge_fields, $interests, $double_optin );
|
676 |
-
|
677 |
-
// Log api response
|
678 |
-
$this->log( sprintf( __( __METHOD__ . '(): MailChimp API response: %s', 'ss_wc_mailchimp' ), $api_response ) );
|
679 |
-
|
680 |
-
if ( $api_response === false ) {
|
681 |
-
// Format error message
|
682 |
-
$error_response = sprintf( __( __METHOD__ . '(): WooCommerce MailChimp subscription failed: %s (%s)', 'ss_wc_mailchimp' ), $this->api()->get_error_message(), $this->api()->get_error_code() );
|
683 |
-
|
684 |
-
// Log
|
685 |
-
$this->log( $error_response );
|
686 |
-
|
687 |
-
// New hook for failing operations
|
688 |
-
do_action( 'ss_wc_mailchimp_subscription_failed', $email, array( 'list_id' => $list_id, 'order_id' => $order_id ) );
|
689 |
-
|
690 |
-
// Email admin
|
691 |
-
wp_mail( get_option( 'admin_email' ), __( 'WooCommerce MailChimp subscription failed', 'ss_wc_mailchimp' ), $error_response );
|
692 |
-
} else {
|
693 |
-
// Hook on success
|
694 |
-
do_action( 'ss_wc_mailchimp_subscription_success', $email, array( 'list_id' => $list_id, 'order_id' => $order_id ) );
|
695 |
-
}
|
696 |
-
}
|
697 |
-
|
698 |
-
/**
|
699 |
-
* Admin Panel Options
|
700 |
-
*/
|
701 |
-
function admin_options() {
|
702 |
-
?>
|
703 |
-
<h3><?php _e( 'MailChimp', 'ss_wc_mailchimp' ); ?></h3>
|
704 |
-
<p><?php _e( 'Enter your MailChimp settings below to control how WooCommerce integrates with your MailChimp lists.', 'ss_wc_mailchimp' ); ?></p>
|
705 |
-
<table class="form-table">
|
706 |
-
<?php $this->generate_settings_html(); ?>
|
707 |
-
</table><!--/.form-table-->
|
708 |
-
<?php
|
709 |
-
}
|
710 |
-
|
711 |
-
/**
|
712 |
-
* Add the opt-in checkbox to the checkout fields (to be displayed on checkout).
|
713 |
-
*
|
714 |
-
* @since 1.1
|
715 |
-
*/
|
716 |
-
function maybe_add_checkout_fields() {
|
717 |
-
if ( $this->is_valid() ) {
|
718 |
-
if ( $this->display_opt_in() ) {
|
719 |
-
do_action( 'ss_wc_mailchimp_before_opt_in_checkbox' );
|
720 |
-
echo apply_filters('ss_wc_mailchimp_opt_in_checkbox', '<p class="form-row woocommerce-mailchimp-opt-in"><label for="ss_wc_mailchimp_opt_in"><input type="checkbox" name="ss_wc_mailchimp_opt_in" id="ss_wc_mailchimp_opt_in" value="yes"' . ($this->opt_in_checkbox_default_status() == 'checked' ? ' checked="checked"' : '') . '/> ' . esc_html( $this->opt_in_label() ) . '</label></p>' . "\n", $this->opt_in_checkbox_default_status(), $this->opt_in_label() );
|
721 |
-
do_action( 'ss_wc_mailchimp_after_opt_in_checkbox' );
|
722 |
-
}
|
723 |
-
}
|
724 |
-
}
|
725 |
-
|
726 |
-
/**
|
727 |
-
* Opt-in checkbox default support for WooCommerce 2.1
|
728 |
-
*
|
729 |
-
* @since 1.2.1
|
730 |
-
*/
|
731 |
-
function checkbox_default_status( $input ) {
|
732 |
-
return $this->opt_in_checkbox_default_status === 'checked' ? 1 : 0;
|
733 |
-
}
|
734 |
-
|
735 |
-
/**
|
736 |
-
* When the checkout form is submitted, save opt-in value.
|
737 |
-
*
|
738 |
-
* @version 1.1
|
739 |
-
*/
|
740 |
-
function maybe_save_checkout_fields( $order_id ) {
|
741 |
-
if ( $this->display_opt_in() ) {
|
742 |
-
$opt_in = isset( $_POST['ss_wc_mailchimp_opt_in'] ) ? 'yes' : 'no';
|
743 |
-
|
744 |
-
update_post_meta( $order_id, 'ss_wc_mailchimp_opt_in', $opt_in );
|
745 |
-
}
|
746 |
-
}
|
747 |
-
|
748 |
-
/**
|
749 |
-
* Helper log function for debugging
|
750 |
-
*
|
751 |
-
* @since 1.2.2
|
752 |
-
*/
|
753 |
-
private function log( $message ) {
|
754 |
-
if ( $this->debug_enabled() ) {
|
755 |
-
$logger = new WC_Logger();
|
756 |
-
|
757 |
-
if ( is_array( $message ) || is_object( $message ) ) {
|
758 |
-
$logger->add( 'woocommerce-mailchimp', print_r( $message, true ) );
|
759 |
-
}
|
760 |
-
else {
|
761 |
-
$logger->add( 'woocommerce-mailchimp', $message );
|
762 |
-
}
|
763 |
-
}
|
764 |
-
}
|
765 |
-
|
766 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/class-ss-wc-mailchimp-handler.php
CHANGED
@@ -48,7 +48,7 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
|
|
48 |
|
49 |
$this->id = 'mailchimp';
|
50 |
$this->namespace = 'ss_wc_' . $this->id;
|
51 |
-
$this->label = __( 'MailChimp',
|
52 |
|
53 |
$this->init();
|
54 |
|
@@ -195,22 +195,6 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
|
|
195 |
return 'yes' === $this->get_option( 'debug' );
|
196 |
}
|
197 |
|
198 |
-
/**
|
199 |
-
* Check if the user has enabled the plugin functionality, but hasn't provided an api key
|
200 |
-
**/
|
201 |
-
function checks() {
|
202 |
-
// Check required fields
|
203 |
-
if ( $this->is_enabled() && ! $this->has_api_key() ) {
|
204 |
-
// Show notice
|
205 |
-
echo $this->get_message( sprintf( '%s <a href="%s">%s</a>.',
|
206 |
-
__( 'WooCommerce MailChimp error: Plugin is enabled but no api key provided. Please enter your api key', $this->namespace ),
|
207 |
-
WOOCOMMERCE_MAILCHIMP_SETTINGS_URL,
|
208 |
-
__( 'here', $this->namespace )
|
209 |
-
)
|
210 |
-
);
|
211 |
-
}
|
212 |
-
}
|
213 |
-
|
214 |
/**
|
215 |
* order_status_changed function.
|
216 |
*
|
@@ -230,7 +214,7 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
|
|
230 |
// or the 'ss_wc_mailchimp_opt_in' is yes, subscriber the customer
|
231 |
if ( ! $subscribe_customer || empty( $subscribe_customer ) || 'yes' === $subscribe_customer ) {
|
232 |
// log
|
233 |
-
$this->log( sprintf( __( __METHOD__ . '(): Subscribing customer (%s) to list %s',
|
234 |
|
235 |
// subscribe
|
236 |
$this->subscribe( $order->id, $order->billing_first_name, $order->billing_last_name, $order->billing_email, $this->list() );
|
@@ -304,7 +288,7 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
|
|
304 |
|
305 |
if ( !$_POST['data']['api_key'] || empty( $_POST['data']['api_key'] ) ) {
|
306 |
|
307 |
-
return $this->toJSON( array( '' => __( 'Enter your api key above to see your lists',
|
308 |
|
309 |
}
|
310 |
|
@@ -487,17 +471,17 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
|
|
487 |
extract( $options );
|
488 |
|
489 |
// Log
|
490 |
-
$this->log( sprintf( __( __METHOD__ . '(): Subscribing customer to MailChimp: %s',
|
491 |
|
492 |
// Call API
|
493 |
$api_response = $this->api()->subscribe( $list_id, $email, $email_type, $merge_tags, $interest_groups, $double_optin );
|
494 |
|
495 |
// Log api response
|
496 |
-
$this->log( sprintf( __( __METHOD__ . '(): MailChimp API response: %s',
|
497 |
|
498 |
if ( $api_response === false ) {
|
499 |
// Format error message
|
500 |
-
$error_response = sprintf( __( __METHOD__ . '(): WooCommerce MailChimp subscription failed: %s (%s)',
|
501 |
|
502 |
// Log
|
503 |
$this->log( $error_response );
|
@@ -506,7 +490,7 @@ if ( ! class_exists( 'SS_WC_MailChimp_Handler' ) ) {
|
|
506 |
do_action( $this->namespace_prefixed( 'subscription_failed' ), $email, array( 'list_id' => $list_id, 'order_id' => $order_id ) );
|
507 |
|
508 |
// Email admin
|
509 |
-
wp_mail( get_option( 'admin_email' ), __( 'WooCommerce MailChimp subscription failed',
|
510 |
} else {
|
511 |
// Hook on success
|
512 |
do_action( $this->namespace_prefixed( 'subscription_success' ), $email, array( 'list_id' => $list_id, 'order_id' => $order_id ) );
|
48 |
|
49 |
$this->id = 'mailchimp';
|
50 |
$this->namespace = 'ss_wc_' . $this->id;
|
51 |
+
$this->label = __( 'MailChimp', 'woocommerce-mailchimp' );
|
52 |
|
53 |
$this->init();
|
54 |
|
195 |
return 'yes' === $this->get_option( 'debug' );
|
196 |
}
|
197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
/**
|
199 |
* order_status_changed function.
|
200 |
*
|
214 |
// or the 'ss_wc_mailchimp_opt_in' is yes, subscriber the customer
|
215 |
if ( ! $subscribe_customer || empty( $subscribe_customer ) || 'yes' === $subscribe_customer ) {
|
216 |
// log
|
217 |
+
$this->log( sprintf( __( __METHOD__ . '(): Subscribing customer (%s) to list %s', 'woocommerce-mailchimp' ), $order->billing_email, $this->list() ) );
|
218 |
|
219 |
// subscribe
|
220 |
$this->subscribe( $order->id, $order->billing_first_name, $order->billing_last_name, $order->billing_email, $this->list() );
|
288 |
|
289 |
if ( !$_POST['data']['api_key'] || empty( $_POST['data']['api_key'] ) ) {
|
290 |
|
291 |
+
return $this->toJSON( array( '' => __( 'Enter your api key above to see your lists', 'woocommerce-mailchimp' ) ) );
|
292 |
|
293 |
}
|
294 |
|
471 |
extract( $options );
|
472 |
|
473 |
// Log
|
474 |
+
$this->log( sprintf( __( __METHOD__ . '(): Subscribing customer to MailChimp: %s', 'woocommerce-mailchimp' ), print_r( $options, true ) ) );
|
475 |
|
476 |
// Call API
|
477 |
$api_response = $this->api()->subscribe( $list_id, $email, $email_type, $merge_tags, $interest_groups, $double_optin );
|
478 |
|
479 |
// Log api response
|
480 |
+
$this->log( sprintf( __( __METHOD__ . '(): MailChimp API response: %s', 'woocommerce-mailchimp' ), print_r( $api_response, true ) ) );
|
481 |
|
482 |
if ( $api_response === false ) {
|
483 |
// Format error message
|
484 |
+
$error_response = sprintf( __( __METHOD__ . '(): WooCommerce MailChimp subscription failed: %s (%s)', 'woocommerce-mailchimp' ), $this->api()->get_error_message(), $this->api()->get_error_code() );
|
485 |
|
486 |
// Log
|
487 |
$this->log( $error_response );
|
490 |
do_action( $this->namespace_prefixed( 'subscription_failed' ), $email, array( 'list_id' => $list_id, 'order_id' => $order_id ) );
|
491 |
|
492 |
// Email admin
|
493 |
+
wp_mail( get_option( 'admin_email' ), __( 'WooCommerce MailChimp subscription failed', 'woocommerce-mailchimp' ), $error_response );
|
494 |
} else {
|
495 |
// Hook on success
|
496 |
do_action( $this->namespace_prefixed( 'subscription_success' ), $email, array( 'list_id' => $list_id, 'order_id' => $order_id ) );
|
includes/class-ss-wc-mailchimp-plugin.php
CHANGED
@@ -7,7 +7,9 @@ final class SS_WC_MailChimp_Plugin {
|
|
7 |
|
8 |
private static $_instance;
|
9 |
|
10 |
-
private static $version = '2.0.
|
|
|
|
|
11 |
|
12 |
public static function version() {
|
13 |
return self::$version;
|
@@ -40,7 +42,7 @@ final class SS_WC_MailChimp_Plugin {
|
|
40 |
|
41 |
$this->id = 'mailchimp';
|
42 |
$this->namespace = 'ss_wc_' . $this->id;
|
43 |
-
$this->label = __( 'MailChimp',
|
44 |
|
45 |
$this->settings_url = admin_url( 'admin.php?page=wc-settings&tab=' . $this->id );
|
46 |
|
@@ -146,10 +148,10 @@ final class SS_WC_MailChimp_Plugin {
|
|
146 |
* - WP_CONTENT_DIR/plugins/woocommerce-mailchimp/languages/woocommerce-mailchimp-LOCALE.mo
|
147 |
*/
|
148 |
public function load_plugin_textdomain() {
|
149 |
-
$locale = apply_filters( 'plugin_locale', get_locale(),
|
150 |
|
151 |
-
load_textdomain(
|
152 |
-
load_plugin_textdomain(
|
153 |
}
|
154 |
|
155 |
/**
|
@@ -159,7 +161,6 @@ final class SS_WC_MailChimp_Plugin {
|
|
159 |
// Add the "Settings" links on the Plugins administration screen
|
160 |
if ( is_admin() ) {
|
161 |
add_filter( 'plugin_action_links_' . plugin_basename( SS_WC_MAILCHIMP_FILE ), array( $this, 'action_links' ) );
|
162 |
-
// add_filter( 'woocommerce_integrations', array( $this, 'add_mailchimp_integration' ) );
|
163 |
add_filter( 'woocommerce_get_settings_pages', array( $this, 'add_mailchimp_settings' ) );
|
164 |
|
165 |
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts') );
|
@@ -177,24 +178,12 @@ final class SS_WC_MailChimp_Plugin {
|
|
177 |
*/
|
178 |
public function action_links( $links ) {
|
179 |
$plugin_links = array(
|
180 |
-
'<a href="' . SS_WC_MAILCHIMP_SETTINGS_URL . '">' . __( 'Settings',
|
181 |
);
|
182 |
|
183 |
return array_merge( $plugin_links, $links );
|
184 |
}
|
185 |
|
186 |
-
/**
|
187 |
-
* Add the Integration to WooCommerce
|
188 |
-
*/
|
189 |
-
public function add_mailchimp_integration( $integrations ) {
|
190 |
-
|
191 |
-
require_once( 'class-ss-wc-integration-mailchimp.php' );
|
192 |
-
|
193 |
-
$integrations[] = 'SS_WC_Integration_MailChimp';
|
194 |
-
|
195 |
-
return $integrations;
|
196 |
-
}
|
197 |
-
|
198 |
/**
|
199 |
* Add the MailChimp settings tab to WooCommerce
|
200 |
*/
|
@@ -220,11 +209,11 @@ final class SS_WC_MailChimp_Plugin {
|
|
220 |
|
221 |
// Localize javascript messages
|
222 |
$translation_array = array(
|
223 |
-
'connecting_to_mailchimp' => __( 'Connecting to MailChimp',
|
224 |
-
'error_loading_lists' => __( 'Error loading lists. Please check your api key.',
|
225 |
-
'error_loading_groups' => __( 'Error loading groups. Please check your MailChimp Interest Groups for the selected list.',
|
226 |
-
'select_groups_placeholder' => __( 'Select one or more groups (optional)',
|
227 |
-
'interest_groups_not_enabled' => __( 'This list does not have interest groups enabled',
|
228 |
);
|
229 |
wp_localize_script( 'woocommerce-mailchimp-admin', 'SS_WC_MailChimp_Messages', $translation_array );
|
230 |
|
7 |
|
8 |
private static $_instance;
|
9 |
|
10 |
+
private static $version = '2.0.3';
|
11 |
+
|
12 |
+
private static $text_domain = 'woocommerce-mailchimp';
|
13 |
|
14 |
public static function version() {
|
15 |
return self::$version;
|
42 |
|
43 |
$this->id = 'mailchimp';
|
44 |
$this->namespace = 'ss_wc_' . $this->id;
|
45 |
+
$this->label = __( 'MailChimp', 'woocommerce-mailchimp' );
|
46 |
|
47 |
$this->settings_url = admin_url( 'admin.php?page=wc-settings&tab=' . $this->id );
|
48 |
|
148 |
* - WP_CONTENT_DIR/plugins/woocommerce-mailchimp/languages/woocommerce-mailchimp-LOCALE.mo
|
149 |
*/
|
150 |
public function load_plugin_textdomain() {
|
151 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), 'woocommerce-mailchimp' );
|
152 |
|
153 |
+
load_textdomain( 'woocommerce-mailchimp', WP_LANG_DIR . '/woocommerce-mailchimp/woocommerce-mailchimp-' . $locale . '.mo' );
|
154 |
+
load_plugin_textdomain( 'woocommerce-mailchimp', false, dirname( plugin_basename( SS_WC_MAILCHIMP_FILE ) ) . '/languages' );
|
155 |
}
|
156 |
|
157 |
/**
|
161 |
// Add the "Settings" links on the Plugins administration screen
|
162 |
if ( is_admin() ) {
|
163 |
add_filter( 'plugin_action_links_' . plugin_basename( SS_WC_MAILCHIMP_FILE ), array( $this, 'action_links' ) );
|
|
|
164 |
add_filter( 'woocommerce_get_settings_pages', array( $this, 'add_mailchimp_settings' ) );
|
165 |
|
166 |
add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts') );
|
178 |
*/
|
179 |
public function action_links( $links ) {
|
180 |
$plugin_links = array(
|
181 |
+
'<a href="' . SS_WC_MAILCHIMP_SETTINGS_URL . '">' . __( 'Settings', 'woocommerce-mailchimp' ) . '</a>',
|
182 |
);
|
183 |
|
184 |
return array_merge( $plugin_links, $links );
|
185 |
}
|
186 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
187 |
/**
|
188 |
* Add the MailChimp settings tab to WooCommerce
|
189 |
*/
|
209 |
|
210 |
// Localize javascript messages
|
211 |
$translation_array = array(
|
212 |
+
'connecting_to_mailchimp' => __( 'Connecting to MailChimp', 'woocommerce-mailchimp' ),
|
213 |
+
'error_loading_lists' => __( 'Error loading lists. Please check your api key.', 'woocommerce-mailchimp' ),
|
214 |
+
'error_loading_groups' => __( 'Error loading groups. Please check your MailChimp Interest Groups for the selected list.', 'woocommerce-mailchimp' ),
|
215 |
+
'select_groups_placeholder' => __( 'Select one or more groups (optional)', 'woocommerce-mailchimp' ),
|
216 |
+
'interest_groups_not_enabled' => __( 'This list does not have interest groups enabled', 'woocommerce-mailchimp' ),
|
217 |
);
|
218 |
wp_localize_script( 'woocommerce-mailchimp-admin', 'SS_WC_MailChimp_Messages', $translation_array );
|
219 |
|
includes/class-ss-wc-settings-mailchimp.php
CHANGED
@@ -49,7 +49,7 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
49 |
|
50 |
$this->id = 'mailchimp';
|
51 |
$this->namespace = 'ss_wc_' . $this->id;
|
52 |
-
$this->label = __( 'MailChimp',
|
53 |
|
54 |
$this->init();
|
55 |
|
@@ -203,11 +203,7 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
203 |
// Check required fields
|
204 |
if ( $this->is_enabled() && ! $this->has_api_key() ) {
|
205 |
// Show notice
|
206 |
-
echo $this->get_message( sprintf( '%s <a href="
|
207 |
-
__( 'WooCommerce MailChimp error: Plugin is enabled but no api key provided. Please enter your api key', $this->namespace ),
|
208 |
-
WOOCOMMERCE_MAILCHIMP_SETTINGS_URL,
|
209 |
-
__( 'here', $this->namespace )
|
210 |
-
)
|
211 |
);
|
212 |
}
|
213 |
}
|
@@ -255,11 +251,11 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
255 |
public function get_sections() {
|
256 |
|
257 |
$sections = array(
|
258 |
-
'' => __( 'General',
|
259 |
-
// 'checkout' => __( 'Checkout',
|
260 |
-
// //'widget' => __( 'Widget',
|
261 |
-
// 'shortcode' => __( 'ShortCode',
|
262 |
-
'troubleshooting' => __( 'Troubleshooting',
|
263 |
);
|
264 |
|
265 |
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
|
@@ -309,20 +305,18 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
309 |
|
310 |
$settings = array(
|
311 |
array(
|
312 |
-
'title' => __( 'MailChimp',
|
313 |
'type' => 'title',
|
314 |
-
'desc' => __( 'Enter your MailChimp settings below to control how WooCommerce integrates with your MailChimp account.',
|
315 |
'id' => 'general_options',
|
316 |
),
|
317 |
);
|
318 |
|
319 |
$settings[] = array(
|
320 |
'id' => $this->namespace_prefixed( 'api_key' ),
|
321 |
-
'title' => __( 'API Key',
|
322 |
'type' => 'text',
|
323 |
-
'desc' => sprintf( '<br/><a href="https://admin.mailchimp.com/account/api/" target="_blank"
|
324 |
-
__( 'Login to MailChimp', $this->namespace ),
|
325 |
-
__( 'to look up your api key.', $this->namespace )
|
326 |
),
|
327 |
'default' => '',
|
328 |
'css' => 'min-width:350px;',
|
@@ -336,9 +330,9 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
336 |
}
|
337 |
// if ( !$this->has_api_key() ) {
|
338 |
// $form_fields['api_key']['description'] = sprintf( '%s <strong>%s</strong> %s.<br/>',
|
339 |
-
// __( 'Paste your API key above and click',
|
340 |
-
// __( 'Save changes',
|
341 |
-
// __( 'below',
|
342 |
// ) . $form_fields['api_key']['description'];
|
343 |
// }
|
344 |
|
@@ -354,18 +348,18 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
354 |
|
355 |
$settings[] = array(
|
356 |
'id' => $this->namespace_prefixed( 'enabled' ),
|
357 |
-
'title' => __( 'Enable/Disable',
|
358 |
-
'label' => __( 'Enable MailChimp Integration',
|
359 |
'type' => 'checkbox',
|
360 |
-
'desc' => __( 'Enable/disable the plugin functionality.',
|
361 |
'default' => 'yes',
|
362 |
);
|
363 |
|
364 |
$settings[] = array(
|
365 |
'id' => $this->namespace_prefixed( 'list' ),
|
366 |
-
'title' => __( 'Main List',
|
367 |
'type' => 'select',
|
368 |
-
'desc' => __( 'All customers will be added to this list.',
|
369 |
'default' => '',
|
370 |
'options' => $mailchimp_lists,
|
371 |
'class' => 'wc-enhanced-select',
|
@@ -376,36 +370,36 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
376 |
'desc_tip' => true,
|
377 |
);
|
378 |
// if ( array_key_exists( 'no_lists', $mailchimp_lists ) ) {
|
379 |
-
// $form_fields['list']['description'] = sprintf( __( 'There are no lists in your MailChimp account. <a href="%s" target="_blank">Click here</a> to create one.',
|
380 |
// }
|
381 |
|
382 |
$settings[] = array(
|
383 |
'id' => $this->namespace_prefixed( 'interest_groups' ),
|
384 |
-
'title' => __( 'Interest Groups',
|
385 |
'type' => 'multiselect',
|
386 |
-
'desc' => __( 'Optional: Interest groups to assign to subscribers.',
|
387 |
'default' => '',
|
388 |
'options' => $interest_groups,
|
389 |
'class' => 'wc-enhanced-select',
|
390 |
'custom_attributes' => array(
|
391 |
-
'placeholder' => __( 'Select interest groups...',
|
392 |
),
|
393 |
'css' => 'min-width: 350px;',
|
394 |
'desc_tip' => true,
|
395 |
);
|
396 |
|
397 |
// if ( is_array( $interest_groups ) && count( $interest_groups ) == 0 ) {
|
398 |
-
// // $form_fields['interest_groups']['description'] = __( 'Optional: Interest groups to assign to subscribers.',
|
399 |
-
// $form_fields['interest_groups']['custom_attributes']['placeholder'] = __( 'This list has no interest groups.',
|
400 |
// $form_fields['interest_groups']['custom_attributes']['disabled'] = 'disabled';
|
401 |
// } elseif ( !$this->has_list() ) {
|
402 |
-
// $form_fields['interest_groups']['custom_attributes']['placeholder'] = __( 'Select a list to see interests',
|
403 |
// $form_fields['interest_groups']['custom_attributes']['disabled'] = 'disabled';
|
404 |
// }
|
405 |
$settings[] = array( 'type' => 'sectionend', 'id' => 'general_options' );
|
406 |
|
407 |
$settings[] = array(
|
408 |
-
'title' => __( 'Checkout Settings',
|
409 |
'type' => 'title',
|
410 |
'desc' => '',
|
411 |
'id' => 'checkout_settings'
|
@@ -413,102 +407,102 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
413 |
|
414 |
$settings[] = array(
|
415 |
'id' => $this->namespace_prefixed( 'occurs' ),
|
416 |
-
'title' => __( 'Subscribe Event',
|
417 |
'type' => 'select',
|
418 |
-
'desc' => __( 'Choose whether to subscribe customers as soon as an order is placed or after the order is processing or completed.',
|
419 |
'class' => 'wc-enhanced-select',
|
420 |
'default' => 'pending',
|
421 |
'options' => array(
|
422 |
-
'pending' => __( 'Order Created',
|
423 |
-
'processing' => __( 'Order Processing',
|
424 |
-
'completed' => __( 'Order Completed',
|
425 |
),
|
426 |
'desc_tip' => true,
|
427 |
);
|
428 |
|
429 |
$settings[] = array(
|
430 |
'id' => $this->namespace_prefixed( 'double_optin' ),
|
431 |
-
'title' => __( 'Double Opt-In',
|
432 |
-
'desc' => __( 'Enable Double Opt-In',
|
433 |
'type' => 'checkbox',
|
434 |
'default' => 'no',
|
435 |
-
'desc_tip' => __( 'If enabled, customers will receive an email prompting them to confirm their subscription to the list above.',
|
436 |
);
|
437 |
|
438 |
// $settings[] = array(
|
439 |
// 'id' => $this->namespace_prefixed( 'display_opt_in' ),
|
440 |
-
// 'title' => __( 'Display Opt-In Field',
|
441 |
-
// 'desc' => __( 'Display an Opt-In Field on Checkout',
|
442 |
// 'type' => 'checkbox',
|
443 |
-
// 'desc_tip' => __( '<p>Choose <strong>Automatically</strong> to subscribe customers silently upon checkout. Caution, this is without the customer\'s consent.</p> <p>Choose <strong>Ask for permission</strong> to show an "Opt-in" checkbox during checkout. Customers will only be subscribed to the list above if they opt-in.' ,
|
444 |
// 'default' => no,
|
445 |
// );
|
446 |
|
447 |
$settings[] = array(
|
448 |
'id' => $this->namespace_prefixed( 'display_opt_in' ),
|
449 |
-
'title' => __( 'Subscribe Customers',
|
450 |
-
'desc' => __( '<p>Choose <strong>Ask for permission</strong> to show an "Opt-in" checkbox during checkout. Customers will only be subscribed to the list above if they opt-in. <p>Choose <strong>Automatically</strong> to subscribe customers silently upon checkout. Caution, this is without the customer\'s consent.</p>',
|
451 |
'type' => 'select',
|
452 |
'css' => 'min-width:300px;',
|
453 |
'class' => 'wc-enhanced-select',
|
454 |
'desc_tip' => true,
|
455 |
'default' => 'yes',
|
456 |
'options' => array(
|
457 |
-
// '0' => __( 'Disabled',
|
458 |
-
'yes' => __( 'Ask for permission',
|
459 |
-
'no' => __( 'Automatically',
|
460 |
)
|
461 |
);
|
462 |
|
463 |
// $settings[] = array(
|
464 |
// 'id' => $this->namespace_prefixed( 'display_opt_in' ),
|
465 |
-
// 'title' => __( 'Display Opt-In Field',
|
466 |
-
// 'label' => __( 'Display an Opt-In Field on Checkout',
|
467 |
// 'type' => 'checkbox',
|
468 |
-
// 'desc' => __( 'If enabled, customers will be presented with a "Opt-in" checkbox during checkout and will only be added to the list above if they opt-in.',
|
469 |
// 'default' => 'no',
|
470 |
// );
|
471 |
|
472 |
$settings[] = array(
|
473 |
'id' => $this->namespace_prefixed( 'opt_in_label' ),
|
474 |
-
'title' => __( 'Opt-In Field Label',
|
475 |
'type' => 'text',
|
476 |
-
'desc' => __( 'Optional: customize the label displayed next to the opt-in checkbox.',
|
477 |
-
'default' => __( 'Subscribe to our newsletter',
|
478 |
'css' => 'min-width:350px;',
|
479 |
'desc_tip' => true,
|
480 |
);
|
481 |
|
482 |
$settings[] = array(
|
483 |
'id' => $this->namespace_prefixed( 'opt_in_checkbox_default_status' ),
|
484 |
-
'title' => __( 'Opt-In Checkbox Default',
|
485 |
'type' => 'select',
|
486 |
-
'desc' => __( 'The default state of the opt-in checkbox.',
|
487 |
'class' => 'wc-enhanced-select',
|
488 |
'default' => 'checked',
|
489 |
'options' => array(
|
490 |
-
'checked' => __( 'Checked',
|
491 |
-
'unchecked' => __( 'Unchecked',
|
492 |
),
|
493 |
'desc_tip' => true,
|
494 |
);
|
495 |
|
496 |
$settings[] = array(
|
497 |
'id' => $this->namespace_prefixed( 'opt_in_checkbox_display_location' ),
|
498 |
-
'title' => __( 'Opt-In Checkbox Location',
|
499 |
'type' => 'select',
|
500 |
-
'desc' => __( 'Where to display the opt-in checkbox on the checkout page.',
|
501 |
'class' => 'wc-enhanced-select',
|
502 |
'default' => 'woocommerce_review_order_before_submit',
|
503 |
'options' => array(
|
504 |
-
'woocommerce_checkout_before_customer_details' => __( 'Above customer details',
|
505 |
-
'woocommerce_checkout_after_customer_details' => __( 'Below customer details',
|
506 |
-
'woocommerce_review_order_before_submit' => __( 'Order review above submit',
|
507 |
-
'woocommerce_review_order_after_submit' => __( 'Order review below submit',
|
508 |
-
'woocommerce_review_order_before_order_total' => __( 'Order review above total',
|
509 |
-
'woocommerce_checkout_billing' => __( 'Above billing details',
|
510 |
-
'woocommerce_checkout_shipping' => __( 'Above shipping details',
|
511 |
-
'woocommerce_after_checkout_billing_form' => __( 'Below Checkout billing form',
|
512 |
),
|
513 |
'desc_tip' => true,
|
514 |
);
|
@@ -521,18 +515,18 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
521 |
|
522 |
} elseif ( 'troubleshooting' === $current_section ) {
|
523 |
|
524 |
-
$label = __( 'Enable Logging',
|
525 |
|
526 |
if ( defined( 'WC_LOG_DIR' ) ) {
|
527 |
$debug_log_url = add_query_arg( 'tab', 'logs', add_query_arg( 'page', 'wc-status', admin_url( 'admin.php' ) ) );
|
528 |
$debug_log_key = 'woocommerce-mailchimp-' . sanitize_file_name( wp_hash( 'woocommerce-mailchimp' ) ) . '-log';
|
529 |
$debug_log_url = add_query_arg( 'log_file', $debug_log_key, $debug_log_url );
|
530 |
|
531 |
-
$label .= ' | ' . sprintf( __( '%1$sView Log%2$s',
|
532 |
}
|
533 |
|
534 |
$settings[] = array(
|
535 |
-
'title' => __( 'Troubleshooting',
|
536 |
'type' => 'title',
|
537 |
'desc' => '',
|
538 |
'id' => 'troubleshooting_settings'
|
@@ -540,18 +534,18 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
540 |
|
541 |
$settings[] = array(
|
542 |
'id' => $this->namespace_prefixed( 'debug' ),
|
543 |
-
'title' => __( 'Debug Log',
|
544 |
'desc' => $label,
|
545 |
'type' => 'checkbox',
|
546 |
'default' => 'no',
|
547 |
-
'desc_tip' => __( 'Enable logging MailChimp API calls. Only enable for troubleshooting purposes.',
|
548 |
);
|
549 |
|
550 |
$settings[] = array(
|
551 |
'id' => 'sysinfo',
|
552 |
-
'title' => __( 'System Info',
|
553 |
'type' => 'sysinfo',
|
554 |
-
'desc' => __( 'Copy the information below and send it to us when reporting an issue with the plugin.<p/>',
|
555 |
'desc_tip' => '',
|
556 |
);
|
557 |
|
@@ -648,12 +642,12 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
648 |
|
649 |
if ( count( $mailchimp_lists ) === 0 ) {
|
650 |
$default = array(
|
651 |
-
'no_lists' => __( 'Oops! No lists in your MailChimp account...',
|
652 |
);
|
653 |
add_action( 'admin_notices', array( $this, 'mailchimp_no_lists_found' ) );
|
654 |
} else {
|
655 |
$default = array(
|
656 |
-
'' => __( 'Select a list...',
|
657 |
);
|
658 |
set_transient( $this->namespace_prefixed( 'lists' ), $mailchimp_lists, 60 * 60 * 1 );
|
659 |
}
|
@@ -696,7 +690,7 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
696 |
* Inform the user they don't have any MailChimp lists
|
697 |
*/
|
698 |
public function mailchimp_no_lists_found() {
|
699 |
-
echo $this->get_message( sprintf( __( 'Oops! There are no lists in your MailChimp account.
|
700 |
}
|
701 |
|
702 |
/**
|
@@ -708,8 +702,8 @@ if ( ! class_exists( 'SS_WC_Settings_MailChimp' ) ) {
|
|
708 |
*/
|
709 |
public function mailchimp_api_error_msg() {
|
710 |
echo $this->get_message(
|
711 |
-
sprintf( __( 'Unable to load lists from MailChimp: (%s) %s. ',
|
712 |
-
sprintf( __( 'Please check your %s <a href="
|
713 |
);
|
714 |
} //end function mailchimp_api_error_msg
|
715 |
|
49 |
|
50 |
$this->id = 'mailchimp';
|
51 |
$this->namespace = 'ss_wc_' . $this->id;
|
52 |
+
$this->label = __( 'MailChimp', 'woocommerce-mailchimp' );
|
53 |
|
54 |
$this->init();
|
55 |
|
203 |
// Check required fields
|
204 |
if ( $this->is_enabled() && ! $this->has_api_key() ) {
|
205 |
// Show notice
|
206 |
+
echo $this->get_message( sprintf( __( 'WooCommerce MailChimp error: Plugin is enabled but no api key provided. Please enter your api key %shere%s.', 'woocommerce-mailchimp' ), '<a href="' . WOOCOMMERCE_MAILCHIMP_SETTINGS_URL . '">', '</a>')
|
|
|
|
|
|
|
|
|
207 |
);
|
208 |
}
|
209 |
}
|
251 |
public function get_sections() {
|
252 |
|
253 |
$sections = array(
|
254 |
+
'' => __( 'General', 'woocommerce-mailchimp' ),
|
255 |
+
// 'checkout' => __( 'Checkout', 'woocommerce-mailchimp' ),
|
256 |
+
// //'widget' => __( 'Widget', 'woocommerce-mailchimp' ),
|
257 |
+
// 'shortcode' => __( 'ShortCode', 'woocommerce-mailchimp' ),
|
258 |
+
'troubleshooting' => __( 'Troubleshooting', 'woocommerce-mailchimp' ),
|
259 |
);
|
260 |
|
261 |
return apply_filters( 'woocommerce_get_sections_' . $this->id, $sections );
|
305 |
|
306 |
$settings = array(
|
307 |
array(
|
308 |
+
'title' => __( 'MailChimp', 'woocommerce-mailchimp' ),
|
309 |
'type' => 'title',
|
310 |
+
'desc' => __( 'Enter your MailChimp settings below to control how WooCommerce integrates with your MailChimp account.', 'woocommerce-mailchimp' ),
|
311 |
'id' => 'general_options',
|
312 |
),
|
313 |
);
|
314 |
|
315 |
$settings[] = array(
|
316 |
'id' => $this->namespace_prefixed( 'api_key' ),
|
317 |
+
'title' => __( 'API Key', 'woocommerce-mailchimp' ),
|
318 |
'type' => 'text',
|
319 |
+
'desc' => sprintf( __( '%sLogin to MailChimp%s to look up your api key.', 'woocommerce-mailchimp' ), '<br/><a href="https://admin.mailchimp.com/account/api/" target="_blank">', '</a>'
|
|
|
|
|
320 |
),
|
321 |
'default' => '',
|
322 |
'css' => 'min-width:350px;',
|
330 |
}
|
331 |
// if ( !$this->has_api_key() ) {
|
332 |
// $form_fields['api_key']['description'] = sprintf( '%s <strong>%s</strong> %s.<br/>',
|
333 |
+
// __( 'Paste your API key above and click', 'woocommerce-mailchimp' ),
|
334 |
+
// __( 'Save changes', 'woocommerce-mailchimp' ),
|
335 |
+
// __( 'below', 'woocommerce-mailchimp' )
|
336 |
// ) . $form_fields['api_key']['description'];
|
337 |
// }
|
338 |
|
348 |
|
349 |
$settings[] = array(
|
350 |
'id' => $this->namespace_prefixed( 'enabled' ),
|
351 |
+
'title' => __( 'Enable/Disable', 'woocommerce-mailchimp' ),
|
352 |
+
'label' => __( 'Enable MailChimp Integration', 'woocommerce-mailchimp' ),
|
353 |
'type' => 'checkbox',
|
354 |
+
'desc' => __( 'Enable/disable the plugin functionality.', 'woocommerce-mailchimp' ),
|
355 |
'default' => 'yes',
|
356 |
);
|
357 |
|
358 |
$settings[] = array(
|
359 |
'id' => $this->namespace_prefixed( 'list' ),
|
360 |
+
'title' => __( 'Main List', 'woocommerce-mailchimp' ),
|
361 |
'type' => 'select',
|
362 |
+
'desc' => __( 'All customers will be added to this list.', 'woocommerce-mailchimp' ),
|
363 |
'default' => '',
|
364 |
'options' => $mailchimp_lists,
|
365 |
'class' => 'wc-enhanced-select',
|
370 |
'desc_tip' => true,
|
371 |
);
|
372 |
// if ( array_key_exists( 'no_lists', $mailchimp_lists ) ) {
|
373 |
+
// $form_fields['list']['description'] = sprintf( __( 'There are no lists in your MailChimp account. <a href="%s" target="_blank">Click here</a> to create one.', 'woocommerce-mailchimp' ), 'https://admin.mailchimp.com/lists/new-list/' );
|
374 |
// }
|
375 |
|
376 |
$settings[] = array(
|
377 |
'id' => $this->namespace_prefixed( 'interest_groups' ),
|
378 |
+
'title' => __( 'Interest Groups', 'woocommerce-mailchimp' ),
|
379 |
'type' => 'multiselect',
|
380 |
+
'desc' => __( 'Optional: Interest groups to assign to subscribers.', 'woocommerce-mailchimp' ),
|
381 |
'default' => '',
|
382 |
'options' => $interest_groups,
|
383 |
'class' => 'wc-enhanced-select',
|
384 |
'custom_attributes' => array(
|
385 |
+
'placeholder' => __( 'Select interest groups...', 'woocommerce-mailchimp' ),
|
386 |
),
|
387 |
'css' => 'min-width: 350px;',
|
388 |
'desc_tip' => true,
|
389 |
);
|
390 |
|
391 |
// if ( is_array( $interest_groups ) && count( $interest_groups ) == 0 ) {
|
392 |
+
// // $form_fields['interest_groups']['description'] = __( 'Optional: Interest groups to assign to subscribers.', 'woocommerce-mailchimp' );
|
393 |
+
// $form_fields['interest_groups']['custom_attributes']['placeholder'] = __( 'This list has no interest groups.', 'woocommerce-mailchimp' );
|
394 |
// $form_fields['interest_groups']['custom_attributes']['disabled'] = 'disabled';
|
395 |
// } elseif ( !$this->has_list() ) {
|
396 |
+
// $form_fields['interest_groups']['custom_attributes']['placeholder'] = __( 'Select a list to see interests', 'woocommerce-mailchimp' );
|
397 |
// $form_fields['interest_groups']['custom_attributes']['disabled'] = 'disabled';
|
398 |
// }
|
399 |
$settings[] = array( 'type' => 'sectionend', 'id' => 'general_options' );
|
400 |
|
401 |
$settings[] = array(
|
402 |
+
'title' => __( 'Checkout Settings', 'woocommerce-mailchimp' ),
|
403 |
'type' => 'title',
|
404 |
'desc' => '',
|
405 |
'id' => 'checkout_settings'
|
407 |
|
408 |
$settings[] = array(
|
409 |
'id' => $this->namespace_prefixed( 'occurs' ),
|
410 |
+
'title' => __( 'Subscribe Event', 'woocommerce-mailchimp' ),
|
411 |
'type' => 'select',
|
412 |
+
'desc' => __( 'Choose whether to subscribe customers as soon as an order is placed or after the order is processing or completed.', 'woocommerce-mailchimp' ),
|
413 |
'class' => 'wc-enhanced-select',
|
414 |
'default' => 'pending',
|
415 |
'options' => array(
|
416 |
+
'pending' => __( 'Order Created', 'woocommerce-mailchimp' ),
|
417 |
+
'processing' => __( 'Order Processing', 'woocommerce-mailchimp' ),
|
418 |
+
'completed' => __( 'Order Completed', 'woocommerce-mailchimp' ),
|
419 |
),
|
420 |
'desc_tip' => true,
|
421 |
);
|
422 |
|
423 |
$settings[] = array(
|
424 |
'id' => $this->namespace_prefixed( 'double_optin' ),
|
425 |
+
'title' => __( 'Double Opt-In', 'woocommerce-mailchimp' ),
|
426 |
+
'desc' => __( 'Enable Double Opt-In', 'woocommerce-mailchimp' ),
|
427 |
'type' => 'checkbox',
|
428 |
'default' => 'no',
|
429 |
+
'desc_tip' => __( 'If enabled, customers will receive an email prompting them to confirm their subscription to the list above.', 'woocommerce-mailchimp' ),
|
430 |
);
|
431 |
|
432 |
// $settings[] = array(
|
433 |
// 'id' => $this->namespace_prefixed( 'display_opt_in' ),
|
434 |
+
// 'title' => __( 'Display Opt-In Field', 'woocommerce-mailchimp' ),
|
435 |
+
// 'desc' => __( 'Display an Opt-In Field on Checkout', 'woocommerce-mailchimp' ),
|
436 |
// 'type' => 'checkbox',
|
437 |
+
// 'desc_tip' => __( '<p>Choose <strong>Automatically</strong> to subscribe customers silently upon checkout. Caution, this is without the customer\'s consent.</p> <p>Choose <strong>Ask for permission</strong> to show an "Opt-in" checkbox during checkout. Customers will only be subscribed to the list above if they opt-in.' , 'woocommerce-mailchimp' ),
|
438 |
// 'default' => no,
|
439 |
// );
|
440 |
|
441 |
$settings[] = array(
|
442 |
'id' => $this->namespace_prefixed( 'display_opt_in' ),
|
443 |
+
'title' => __( 'Subscribe Customers', 'woocommerce-mailchimp' ),
|
444 |
+
'desc' => __( '<p>Choose <strong>Ask for permission</strong> to show an "Opt-in" checkbox during checkout. Customers will only be subscribed to the list above if they opt-in. <p>Choose <strong>Automatically</strong> to subscribe customers silently upon checkout. Caution, this is without the customer\'s consent.</p>', 'woocommerce-mailchimp' ),
|
445 |
'type' => 'select',
|
446 |
'css' => 'min-width:300px;',
|
447 |
'class' => 'wc-enhanced-select',
|
448 |
'desc_tip' => true,
|
449 |
'default' => 'yes',
|
450 |
'options' => array(
|
451 |
+
// '0' => __( 'Disabled', 'woocommerce-mailchimp' ),
|
452 |
+
'yes' => __( 'Ask for permission', 'woocommerce-mailchimp' ),
|
453 |
+
'no' => __( 'Automatically', 'woocommerce-mailchimp' ),
|
454 |
)
|
455 |
);
|
456 |
|
457 |
// $settings[] = array(
|
458 |
// 'id' => $this->namespace_prefixed( 'display_opt_in' ),
|
459 |
+
// 'title' => __( 'Display Opt-In Field', 'woocommerce-mailchimp' ),
|
460 |
+
// 'label' => __( 'Display an Opt-In Field on Checkout', 'woocommerce-mailchimp' ),
|
461 |
// 'type' => 'checkbox',
|
462 |
+
// 'desc' => __( 'If enabled, customers will be presented with a "Opt-in" checkbox during checkout and will only be added to the list above if they opt-in.', 'woocommerce-mailchimp' ),
|
463 |
// 'default' => 'no',
|
464 |
// );
|
465 |
|
466 |
$settings[] = array(
|
467 |
'id' => $this->namespace_prefixed( 'opt_in_label' ),
|
468 |
+
'title' => __( 'Opt-In Field Label', 'woocommerce-mailchimp' ),
|
469 |
'type' => 'text',
|
470 |
+
'desc' => __( 'Optional: customize the label displayed next to the opt-in checkbox.', 'woocommerce-mailchimp' ),
|
471 |
+
'default' => __( 'Subscribe to our newsletter', 'woocommerce-mailchimp' ),
|
472 |
'css' => 'min-width:350px;',
|
473 |
'desc_tip' => true,
|
474 |
);
|
475 |
|
476 |
$settings[] = array(
|
477 |
'id' => $this->namespace_prefixed( 'opt_in_checkbox_default_status' ),
|
478 |
+
'title' => __( 'Opt-In Checkbox Default', 'woocommerce-mailchimp' ),
|
479 |
'type' => 'select',
|
480 |
+
'desc' => __( 'The default state of the opt-in checkbox.', 'woocommerce-mailchimp' ),
|
481 |
'class' => 'wc-enhanced-select',
|
482 |
'default' => 'checked',
|
483 |
'options' => array(
|
484 |
+
'checked' => __( 'Checked', 'woocommerce-mailchimp' ),
|
485 |
+
'unchecked' => __( 'Unchecked', 'woocommerce-mailchimp' )
|
486 |
),
|
487 |
'desc_tip' => true,
|
488 |
);
|
489 |
|
490 |
$settings[] = array(
|
491 |
'id' => $this->namespace_prefixed( 'opt_in_checkbox_display_location' ),
|
492 |
+
'title' => __( 'Opt-In Checkbox Location', 'woocommerce-mailchimp' ),
|
493 |
'type' => 'select',
|
494 |
+
'desc' => __( 'Where to display the opt-in checkbox on the checkout page.', 'woocommerce-mailchimp' ),
|
495 |
'class' => 'wc-enhanced-select',
|
496 |
'default' => 'woocommerce_review_order_before_submit',
|
497 |
'options' => array(
|
498 |
+
'woocommerce_checkout_before_customer_details' => __( 'Above customer details', 'woocommerce-mailchimp' ),
|
499 |
+
'woocommerce_checkout_after_customer_details' => __( 'Below customer details', 'woocommerce-mailchimp' ),
|
500 |
+
'woocommerce_review_order_before_submit' => __( 'Order review above submit', 'woocommerce-mailchimp' ),
|
501 |
+
'woocommerce_review_order_after_submit' => __( 'Order review below submit', 'woocommerce-mailchimp' ),
|
502 |
+
'woocommerce_review_order_before_order_total' => __( 'Order review above total', 'woocommerce-mailchimp' ),
|
503 |
+
'woocommerce_checkout_billing' => __( 'Above billing details', 'woocommerce-mailchimp' ),
|
504 |
+
'woocommerce_checkout_shipping' => __( 'Above shipping details', 'woocommerce-mailchimp' ),
|
505 |
+
'woocommerce_after_checkout_billing_form' => __( 'Below Checkout billing form', 'woocommerce-mailchimp' ),
|
506 |
),
|
507 |
'desc_tip' => true,
|
508 |
);
|
515 |
|
516 |
} elseif ( 'troubleshooting' === $current_section ) {
|
517 |
|
518 |
+
$label = __( 'Enable Logging', 'woocommerce-mailchimp' );
|
519 |
|
520 |
if ( defined( 'WC_LOG_DIR' ) ) {
|
521 |
$debug_log_url = add_query_arg( 'tab', 'logs', add_query_arg( 'page', 'wc-status', admin_url( 'admin.php' ) ) );
|
522 |
$debug_log_key = 'woocommerce-mailchimp-' . sanitize_file_name( wp_hash( 'woocommerce-mailchimp' ) ) . '-log';
|
523 |
$debug_log_url = add_query_arg( 'log_file', $debug_log_key, $debug_log_url );
|
524 |
|
525 |
+
$label .= ' | ' . sprintf( __( '%1$sView Log%2$s', 'woocommerce-mailchimp' ), '<a href="' . esc_url( $debug_log_url ) . '">', '</a>' );
|
526 |
}
|
527 |
|
528 |
$settings[] = array(
|
529 |
+
'title' => __( 'Troubleshooting', 'woocommerce-mailchimp' ),
|
530 |
'type' => 'title',
|
531 |
'desc' => '',
|
532 |
'id' => 'troubleshooting_settings'
|
534 |
|
535 |
$settings[] = array(
|
536 |
'id' => $this->namespace_prefixed( 'debug' ),
|
537 |
+
'title' => __( 'Debug Log', 'woocommerce-mailchimp' ),
|
538 |
'desc' => $label,
|
539 |
'type' => 'checkbox',
|
540 |
'default' => 'no',
|
541 |
+
'desc_tip' => __( 'Enable logging MailChimp API calls. Only enable for troubleshooting purposes.', 'woocommerce-mailchimp' ),
|
542 |
);
|
543 |
|
544 |
$settings[] = array(
|
545 |
'id' => 'sysinfo',
|
546 |
+
'title' => __( 'System Info', 'woocommerce-mailchimp' ),
|
547 |
'type' => 'sysinfo',
|
548 |
+
'desc' => __( 'Copy the information below and send it to us when reporting an issue with the plugin.<p/>', 'woocommerce-mailchimp' ),
|
549 |
'desc_tip' => '',
|
550 |
);
|
551 |
|
642 |
|
643 |
if ( count( $mailchimp_lists ) === 0 ) {
|
644 |
$default = array(
|
645 |
+
'no_lists' => __( 'Oops! No lists in your MailChimp account...', 'woocommerce-mailchimp' ),
|
646 |
);
|
647 |
add_action( 'admin_notices', array( $this, 'mailchimp_no_lists_found' ) );
|
648 |
} else {
|
649 |
$default = array(
|
650 |
+
'' => __( 'Select a list...', 'woocommerce-mailchimp' ),
|
651 |
);
|
652 |
set_transient( $this->namespace_prefixed( 'lists' ), $mailchimp_lists, 60 * 60 * 1 );
|
653 |
}
|
690 |
* Inform the user they don't have any MailChimp lists
|
691 |
*/
|
692 |
public function mailchimp_no_lists_found() {
|
693 |
+
echo $this->get_message( sprintf( __( 'Oops! There are no lists in your MailChimp account. %sClick here%s to create one.', 'woocommerce-mailchimp' ), '<a href="https://admin.mailchimp.com/lists/new-list/" target="_blank">', '</a>' ) );
|
694 |
}
|
695 |
|
696 |
/**
|
702 |
*/
|
703 |
public function mailchimp_api_error_msg() {
|
704 |
echo $this->get_message(
|
705 |
+
sprintf( __( 'Unable to load lists from MailChimp: (%s) %s. ', 'woocommerce-mailchimp' ), $this->api()->get_error_code(), $this->api()->get_error_message() ) .
|
706 |
+
sprintf( __( 'Please check your Settings %ssettings%s.', 'woocommerce-mailchimp' ), '<a href="' . WOOCOMMERCE_MAILCHIMP_SETTINGS_URL .'">', '</a>' )
|
707 |
);
|
708 |
} //end function mailchimp_api_error_msg
|
709 |
|
languages/woocommerce-mailchimp.pot
CHANGED
@@ -1,238 +1,355 @@
|
|
1 |
-
# Copyright (C)
|
2 |
# This file is distributed under the same license as the WooCommerce MailChimp package.
|
|
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"
|
6 |
-
"
|
7 |
-
"POT-Creation-Date:
|
8 |
-
"PO-Revision-Date:
|
9 |
-
"Last-Translator:
|
10 |
-
"Language-Team:
|
11 |
-
"Language: en\n"
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
-
"
|
16 |
-
"X-
|
17 |
-
"X-Poedit-
|
18 |
-
"X-Poedit-
|
19 |
-
"X-Poedit-
|
20 |
-
"
|
21 |
-
|
22 |
-
|
23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
msgid "MailChimp"
|
25 |
msgstr ""
|
26 |
|
27 |
-
#:
|
28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
msgstr ""
|
30 |
|
31 |
-
#:
|
|
|
|
|
|
|
|
|
32 |
#, php-format
|
33 |
-
msgid ""
|
34 |
-
"WooCommerce MailChimp error: Plugin is enabled but no api key provided. Please enter "
|
35 |
-
"your api key <a href=\"%s\">here</a>."
|
36 |
msgstr ""
|
37 |
|
38 |
-
#:
|
39 |
#, php-format
|
40 |
-
msgid "
|
41 |
msgstr ""
|
42 |
|
43 |
-
#:
|
44 |
#, php-format
|
45 |
-
msgid "
|
46 |
msgstr ""
|
47 |
|
48 |
-
#:
|
49 |
-
msgid "
|
50 |
msgstr ""
|
51 |
|
52 |
-
#:
|
53 |
-
msgid "
|
54 |
msgstr ""
|
55 |
|
56 |
-
#:
|
57 |
-
msgid "
|
58 |
msgstr ""
|
59 |
|
60 |
-
#:
|
61 |
-
msgid "
|
62 |
msgstr ""
|
63 |
|
64 |
-
#:
|
65 |
-
msgid "
|
|
|
|
|
66 |
msgstr ""
|
67 |
|
68 |
-
#:
|
69 |
-
msgid "
|
70 |
msgstr ""
|
71 |
|
72 |
-
#:
|
73 |
-
msgid "
|
74 |
msgstr ""
|
75 |
|
76 |
-
#:
|
77 |
-
|
|
|
|
|
|
|
78 |
msgstr ""
|
79 |
|
80 |
-
#:
|
81 |
-
msgid "
|
82 |
msgstr ""
|
83 |
|
84 |
-
#:
|
85 |
-
|
|
|
86 |
msgstr ""
|
87 |
|
88 |
-
#:
|
89 |
msgid ""
|
90 |
-
"
|
91 |
-
"
|
92 |
msgstr ""
|
93 |
|
94 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
95 |
msgid "Main List"
|
96 |
msgstr ""
|
97 |
|
98 |
-
#:
|
99 |
msgid "All customers will be added to this list."
|
100 |
msgstr ""
|
101 |
|
102 |
-
#:
|
103 |
-
msgid "
|
104 |
msgstr ""
|
105 |
|
106 |
-
#:
|
107 |
-
msgid ""
|
108 |
-
|
109 |
-
|
|
|
|
|
110 |
msgstr ""
|
111 |
|
112 |
-
#:
|
113 |
-
msgid "
|
114 |
msgstr ""
|
115 |
|
116 |
-
#:
|
|
|
|
|
|
|
|
|
117 |
msgid ""
|
118 |
-
"
|
119 |
-
"
|
|
|
|
|
|
|
|
|
120 |
msgstr ""
|
121 |
|
122 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
123 |
msgid "Double Opt-In"
|
124 |
msgstr ""
|
125 |
|
126 |
-
#:
|
127 |
msgid "Enable Double Opt-In"
|
128 |
msgstr ""
|
129 |
|
130 |
-
#:
|
131 |
msgid ""
|
132 |
"If enabled, customers will receive an email prompting them to confirm their "
|
133 |
"subscription to the list above."
|
134 |
msgstr ""
|
135 |
|
136 |
-
#:
|
137 |
-
msgid "
|
138 |
msgstr ""
|
139 |
|
140 |
-
#:
|
141 |
-
msgid "
|
|
|
|
|
|
|
|
|
142 |
msgstr ""
|
143 |
|
144 |
-
#:
|
145 |
-
msgid ""
|
146 |
-
"If enabled, customers will be presented with a \"Opt-in\" checkbox during checkout "
|
147 |
-
"and will only be added to the list above if they opt-in."
|
148 |
msgstr ""
|
149 |
|
150 |
-
#:
|
151 |
-
msgid "
|
152 |
msgstr ""
|
153 |
|
154 |
-
#:
|
155 |
-
msgid "
|
156 |
msgstr ""
|
157 |
|
158 |
-
#:
|
159 |
-
msgid "
|
160 |
msgstr ""
|
161 |
|
162 |
-
#:
|
163 |
-
msgid "Opt-In Checkbox Default
|
164 |
msgstr ""
|
165 |
|
166 |
-
#:
|
167 |
msgid "The default state of the opt-in checkbox."
|
168 |
msgstr ""
|
169 |
|
170 |
-
#:
|
171 |
msgid "Checked"
|
172 |
msgstr ""
|
173 |
|
174 |
-
#:
|
175 |
msgid "Unchecked"
|
176 |
msgstr ""
|
177 |
|
178 |
-
#:
|
179 |
-
msgid "Opt-In Checkbox
|
180 |
msgstr ""
|
181 |
|
182 |
-
#:
|
183 |
-
msgid ""
|
184 |
-
"Where to display the opt-in checkbox on the checkout page (under Billing info or "
|
185 |
-
"Order info)."
|
186 |
msgstr ""
|
187 |
|
188 |
-
#:
|
189 |
-
msgid "
|
190 |
msgstr ""
|
191 |
|
192 |
-
#:
|
193 |
-
msgid "
|
194 |
msgstr ""
|
195 |
|
196 |
-
#:
|
197 |
-
|
198 |
-
msgid "Unable to load lists from MailChimp: (%s) %s. "
|
199 |
msgstr ""
|
200 |
|
201 |
-
#:
|
202 |
-
|
203 |
-
msgid "Please check your %s <a href=\"%s\">settings</a>."
|
204 |
msgstr ""
|
205 |
|
206 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
207 |
#, php-format
|
208 |
-
msgid "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
209 |
msgstr ""
|
210 |
|
211 |
-
#:
|
|
|
|
|
|
|
|
|
212 |
#, php-format
|
213 |
-
msgid "
|
|
|
|
|
214 |
msgstr ""
|
215 |
|
216 |
-
#:
|
217 |
#, php-format
|
218 |
-
msgid "
|
219 |
msgstr ""
|
220 |
|
221 |
-
#:
|
222 |
#, php-format
|
223 |
-
msgid "
|
224 |
msgstr ""
|
225 |
|
226 |
-
|
227 |
-
msgid "WooCommerce MailChimp
|
228 |
msgstr ""
|
229 |
|
230 |
-
|
|
|
|
|
|
|
|
|
231 |
msgid ""
|
232 |
-
"
|
233 |
-
"MailChimp lists."
|
234 |
msgstr ""
|
235 |
|
236 |
-
|
237 |
-
msgid "
|
|
|
|
|
|
|
|
|
238 |
msgstr ""
|
1 |
+
# Copyright (C) 2016 Saint Systems
|
2 |
# This file is distributed under the same license as the WooCommerce MailChimp package.
|
3 |
+
#, fuzzy
|
4 |
msgid ""
|
5 |
msgstr ""
|
6 |
+
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
|
7 |
+
"Project-Id-Version: WooCommerce MailChimp 2.0.3\n"
|
8 |
+
"POT-Creation-Date: 2016-09-16 17:27-0500\n"
|
9 |
+
"PO-Revision-Date: 2016-09-16 17:22-0500\n"
|
10 |
+
"Last-Translator: Adam Anderly\n"
|
11 |
+
"Language-Team: \n"
|
|
|
12 |
"MIME-Version: 1.0\n"
|
13 |
"Content-Type: text/plain; charset=UTF-8\n"
|
14 |
"Content-Transfer-Encoding: 8bit\n"
|
15 |
+
"X-Generator: Poedit 1.8.9\n"
|
16 |
+
"X-Poedit-Basepath: ..\n"
|
17 |
+
"X-Poedit-WPHeader: woocommerce-mailchimp.php\n"
|
18 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
19 |
+
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
20 |
+
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;"
|
21 |
+
"_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
22 |
+
"X-Poedit-SearchPath-0: .\n"
|
23 |
+
"X-Poedit-SearchPathExcluded-0: *.js\n"
|
24 |
+
|
25 |
+
#: config/default-settings.php:10
|
26 |
+
#: includes/class-ss-wc-settings-mailchimp.php:471
|
27 |
+
msgid "Subscribe to our newsletter"
|
28 |
+
msgstr ""
|
29 |
+
|
30 |
+
#: includes/class-ss-wc-mailchimp-handler.php:51
|
31 |
+
#: includes/class-ss-wc-mailchimp-plugin.php:45
|
32 |
+
#: includes/class-ss-wc-settings-mailchimp.php:52
|
33 |
+
#: includes/class-ss-wc-settings-mailchimp.php:308
|
34 |
msgid "MailChimp"
|
35 |
msgstr ""
|
36 |
|
37 |
+
#: includes/class-ss-wc-mailchimp-handler.php:217
|
38 |
+
#, php-format
|
39 |
+
msgid "(): Subscribing customer (%s) to list %s"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: includes/class-ss-wc-mailchimp-handler.php:291
|
43 |
+
#: includes/class-ss-wc-mailchimp-handler.php:324
|
44 |
+
msgid "Enter your api key above to see your lists"
|
45 |
msgstr ""
|
46 |
|
47 |
+
#: includes/class-ss-wc-mailchimp-handler.php:330
|
48 |
+
msgid "Please select a list from above."
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
#: includes/class-ss-wc-mailchimp-handler.php:474
|
52 |
#, php-format
|
53 |
+
msgid "(): Subscribing customer to MailChimp: %s"
|
|
|
|
|
54 |
msgstr ""
|
55 |
|
56 |
+
#: includes/class-ss-wc-mailchimp-handler.php:480
|
57 |
#, php-format
|
58 |
+
msgid "(): MailChimp API response: %s"
|
59 |
msgstr ""
|
60 |
|
61 |
+
#: includes/class-ss-wc-mailchimp-handler.php:484
|
62 |
#, php-format
|
63 |
+
msgid "(): WooCommerce MailChimp subscription failed: %s (%s)"
|
64 |
msgstr ""
|
65 |
|
66 |
+
#: includes/class-ss-wc-mailchimp-handler.php:493
|
67 |
+
msgid "WooCommerce MailChimp subscription failed"
|
68 |
msgstr ""
|
69 |
|
70 |
+
#: includes/class-ss-wc-mailchimp-plugin.php:181
|
71 |
+
msgid "Settings"
|
72 |
msgstr ""
|
73 |
|
74 |
+
#: includes/class-ss-wc-mailchimp-plugin.php:212
|
75 |
+
msgid "Connecting to MailChimp"
|
76 |
msgstr ""
|
77 |
|
78 |
+
#: includes/class-ss-wc-mailchimp-plugin.php:213
|
79 |
+
msgid "Error loading lists. Please check your api key."
|
80 |
msgstr ""
|
81 |
|
82 |
+
#: includes/class-ss-wc-mailchimp-plugin.php:214
|
83 |
+
msgid ""
|
84 |
+
"Error loading groups. Please check your MailChimp Interest Groups for the "
|
85 |
+
"selected list."
|
86 |
msgstr ""
|
87 |
|
88 |
+
#: includes/class-ss-wc-mailchimp-plugin.php:215
|
89 |
+
msgid "Select one or more groups (optional)"
|
90 |
msgstr ""
|
91 |
|
92 |
+
#: includes/class-ss-wc-mailchimp-plugin.php:216
|
93 |
+
msgid "This list does not have interest groups enabled"
|
94 |
msgstr ""
|
95 |
|
96 |
+
#: includes/class-ss-wc-settings-mailchimp.php:206
|
97 |
+
#, php-format
|
98 |
+
msgid ""
|
99 |
+
"WooCommerce MailChimp error: Plugin is enabled but no api key provided. "
|
100 |
+
"Please enter your api key %shere%s."
|
101 |
msgstr ""
|
102 |
|
103 |
+
#: includes/class-ss-wc-settings-mailchimp.php:254
|
104 |
+
msgid "General"
|
105 |
msgstr ""
|
106 |
|
107 |
+
#: includes/class-ss-wc-settings-mailchimp.php:258
|
108 |
+
#: includes/class-ss-wc-settings-mailchimp.php:529
|
109 |
+
msgid "Troubleshooting"
|
110 |
msgstr ""
|
111 |
|
112 |
+
#: includes/class-ss-wc-settings-mailchimp.php:310
|
113 |
msgid ""
|
114 |
+
"Enter your MailChimp settings below to control how WooCommerce integrates "
|
115 |
+
"with your MailChimp account."
|
116 |
msgstr ""
|
117 |
|
118 |
+
#: includes/class-ss-wc-settings-mailchimp.php:317
|
119 |
+
msgid "API Key"
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: includes/class-ss-wc-settings-mailchimp.php:319
|
123 |
+
#, php-format
|
124 |
+
msgid "%sLogin to MailChimp%s to look up your api key."
|
125 |
+
msgstr ""
|
126 |
+
|
127 |
+
#: includes/class-ss-wc-settings-mailchimp.php:351
|
128 |
+
msgid "Enable/Disable"
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: includes/class-ss-wc-settings-mailchimp.php:352
|
132 |
+
msgid "Enable MailChimp Integration"
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: includes/class-ss-wc-settings-mailchimp.php:354
|
136 |
+
msgid "Enable/disable the plugin functionality."
|
137 |
+
msgstr ""
|
138 |
+
|
139 |
+
#: includes/class-ss-wc-settings-mailchimp.php:360
|
140 |
msgid "Main List"
|
141 |
msgstr ""
|
142 |
|
143 |
+
#: includes/class-ss-wc-settings-mailchimp.php:362
|
144 |
msgid "All customers will be added to this list."
|
145 |
msgstr ""
|
146 |
|
147 |
+
#: includes/class-ss-wc-settings-mailchimp.php:378
|
148 |
+
msgid "Interest Groups"
|
149 |
msgstr ""
|
150 |
|
151 |
+
#: includes/class-ss-wc-settings-mailchimp.php:380
|
152 |
+
msgid "Optional: Interest groups to assign to subscribers."
|
153 |
+
msgstr ""
|
154 |
+
|
155 |
+
#: includes/class-ss-wc-settings-mailchimp.php:385
|
156 |
+
msgid "Select interest groups..."
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: includes/class-ss-wc-settings-mailchimp.php:402
|
160 |
+
msgid "Checkout Settings"
|
161 |
msgstr ""
|
162 |
|
163 |
+
#: includes/class-ss-wc-settings-mailchimp.php:410
|
164 |
+
msgid "Subscribe Event"
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: includes/class-ss-wc-settings-mailchimp.php:412
|
168 |
msgid ""
|
169 |
+
"Choose whether to subscribe customers as soon as an order is placed or after "
|
170 |
+
"the order is processing or completed."
|
171 |
+
msgstr ""
|
172 |
+
|
173 |
+
#: includes/class-ss-wc-settings-mailchimp.php:416
|
174 |
+
msgid "Order Created"
|
175 |
msgstr ""
|
176 |
|
177 |
+
#: includes/class-ss-wc-settings-mailchimp.php:417
|
178 |
+
msgid "Order Processing"
|
179 |
+
msgstr ""
|
180 |
+
|
181 |
+
#: includes/class-ss-wc-settings-mailchimp.php:418
|
182 |
+
msgid "Order Completed"
|
183 |
+
msgstr ""
|
184 |
+
|
185 |
+
#: includes/class-ss-wc-settings-mailchimp.php:425
|
186 |
msgid "Double Opt-In"
|
187 |
msgstr ""
|
188 |
|
189 |
+
#: includes/class-ss-wc-settings-mailchimp.php:426
|
190 |
msgid "Enable Double Opt-In"
|
191 |
msgstr ""
|
192 |
|
193 |
+
#: includes/class-ss-wc-settings-mailchimp.php:429
|
194 |
msgid ""
|
195 |
"If enabled, customers will receive an email prompting them to confirm their "
|
196 |
"subscription to the list above."
|
197 |
msgstr ""
|
198 |
|
199 |
+
#: includes/class-ss-wc-settings-mailchimp.php:443
|
200 |
+
msgid "Subscribe Customers"
|
201 |
msgstr ""
|
202 |
|
203 |
+
#: includes/class-ss-wc-settings-mailchimp.php:444
|
204 |
+
msgid ""
|
205 |
+
"<p>Choose <strong>Ask for permission</strong> to show an \"Opt-in\" checkbox "
|
206 |
+
"during checkout. Customers will only be subscribed to the list above if they "
|
207 |
+
"opt-in. <p>Choose <strong>Automatically</strong> to subscribe customers "
|
208 |
+
"silently upon checkout. Caution, this is without the customer's consent.</p>"
|
209 |
msgstr ""
|
210 |
|
211 |
+
#: includes/class-ss-wc-settings-mailchimp.php:452
|
212 |
+
msgid "Ask for permission"
|
|
|
|
|
213 |
msgstr ""
|
214 |
|
215 |
+
#: includes/class-ss-wc-settings-mailchimp.php:453
|
216 |
+
msgid "Automatically"
|
217 |
msgstr ""
|
218 |
|
219 |
+
#: includes/class-ss-wc-settings-mailchimp.php:468
|
220 |
+
msgid "Opt-In Field Label"
|
221 |
msgstr ""
|
222 |
|
223 |
+
#: includes/class-ss-wc-settings-mailchimp.php:470
|
224 |
+
msgid "Optional: customize the label displayed next to the opt-in checkbox."
|
225 |
msgstr ""
|
226 |
|
227 |
+
#: includes/class-ss-wc-settings-mailchimp.php:478
|
228 |
+
msgid "Opt-In Checkbox Default"
|
229 |
msgstr ""
|
230 |
|
231 |
+
#: includes/class-ss-wc-settings-mailchimp.php:480
|
232 |
msgid "The default state of the opt-in checkbox."
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: includes/class-ss-wc-settings-mailchimp.php:484
|
236 |
msgid "Checked"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: includes/class-ss-wc-settings-mailchimp.php:485
|
240 |
msgid "Unchecked"
|
241 |
msgstr ""
|
242 |
|
243 |
+
#: includes/class-ss-wc-settings-mailchimp.php:492
|
244 |
+
msgid "Opt-In Checkbox Location"
|
245 |
msgstr ""
|
246 |
|
247 |
+
#: includes/class-ss-wc-settings-mailchimp.php:494
|
248 |
+
msgid "Where to display the opt-in checkbox on the checkout page."
|
|
|
|
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: includes/class-ss-wc-settings-mailchimp.php:498
|
252 |
+
msgid "Above customer details"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: includes/class-ss-wc-settings-mailchimp.php:499
|
256 |
+
msgid "Below customer details"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: includes/class-ss-wc-settings-mailchimp.php:500
|
260 |
+
msgid "Order review above submit"
|
|
|
261 |
msgstr ""
|
262 |
|
263 |
+
#: includes/class-ss-wc-settings-mailchimp.php:501
|
264 |
+
msgid "Order review below submit"
|
|
|
265 |
msgstr ""
|
266 |
|
267 |
+
#: includes/class-ss-wc-settings-mailchimp.php:502
|
268 |
+
msgid "Order review above total"
|
269 |
+
msgstr ""
|
270 |
+
|
271 |
+
#: includes/class-ss-wc-settings-mailchimp.php:503
|
272 |
+
msgid "Above billing details"
|
273 |
+
msgstr ""
|
274 |
+
|
275 |
+
#: includes/class-ss-wc-settings-mailchimp.php:504
|
276 |
+
msgid "Above shipping details"
|
277 |
+
msgstr ""
|
278 |
+
|
279 |
+
#: includes/class-ss-wc-settings-mailchimp.php:505
|
280 |
+
msgid "Below Checkout billing form"
|
281 |
+
msgstr ""
|
282 |
+
|
283 |
+
#: includes/class-ss-wc-settings-mailchimp.php:518
|
284 |
+
msgid "Enable Logging"
|
285 |
+
msgstr ""
|
286 |
+
|
287 |
+
#: includes/class-ss-wc-settings-mailchimp.php:525
|
288 |
#, php-format
|
289 |
+
msgid "%1$sView Log%2$s"
|
290 |
+
msgstr ""
|
291 |
+
|
292 |
+
#: includes/class-ss-wc-settings-mailchimp.php:537
|
293 |
+
msgid "Debug Log"
|
294 |
+
msgstr ""
|
295 |
+
|
296 |
+
#: includes/class-ss-wc-settings-mailchimp.php:541
|
297 |
+
msgid ""
|
298 |
+
"Enable logging MailChimp API calls. Only enable for troubleshooting purposes."
|
299 |
+
msgstr ""
|
300 |
+
|
301 |
+
#: includes/class-ss-wc-settings-mailchimp.php:546
|
302 |
+
msgid "System Info"
|
303 |
+
msgstr ""
|
304 |
+
|
305 |
+
#: includes/class-ss-wc-settings-mailchimp.php:548
|
306 |
+
msgid ""
|
307 |
+
"Copy the information below and send it to us when reporting an issue with "
|
308 |
+
"the plugin.<p/>"
|
309 |
+
msgstr ""
|
310 |
+
|
311 |
+
#: includes/class-ss-wc-settings-mailchimp.php:645
|
312 |
+
msgid "Oops! No lists in your MailChimp account..."
|
313 |
msgstr ""
|
314 |
|
315 |
+
#: includes/class-ss-wc-settings-mailchimp.php:650
|
316 |
+
msgid "Select a list..."
|
317 |
+
msgstr ""
|
318 |
+
|
319 |
+
#: includes/class-ss-wc-settings-mailchimp.php:693
|
320 |
#, php-format
|
321 |
+
msgid ""
|
322 |
+
"Oops! There are no lists in your MailChimp account. %sClick here%s to create "
|
323 |
+
"one."
|
324 |
msgstr ""
|
325 |
|
326 |
+
#: includes/class-ss-wc-settings-mailchimp.php:705
|
327 |
#, php-format
|
328 |
+
msgid "Unable to load lists from MailChimp: (%s) %s. "
|
329 |
msgstr ""
|
330 |
|
331 |
+
#: includes/class-ss-wc-settings-mailchimp.php:706
|
332 |
#, php-format
|
333 |
+
msgid "Please check your Settings %ssettings%s."
|
334 |
msgstr ""
|
335 |
|
336 |
+
#. Plugin Name of the plugin/theme
|
337 |
+
msgid "WooCommerce MailChimp"
|
338 |
msgstr ""
|
339 |
|
340 |
+
#. Plugin URI of the plugin/theme
|
341 |
+
msgid "https://www.saintsystems.com/products/woocommerce-mailchimp/"
|
342 |
+
msgstr ""
|
343 |
+
|
344 |
+
#. Description of the plugin/theme
|
345 |
msgid ""
|
346 |
+
"WooCommerce MailChimp provides simple MailChimp integration for WooCommerce."
|
|
|
347 |
msgstr ""
|
348 |
|
349 |
+
#. Author of the plugin/theme
|
350 |
+
msgid "Saint Systems"
|
351 |
+
msgstr ""
|
352 |
+
|
353 |
+
#. Author URI of the plugin/theme
|
354 |
+
msgid "https://www.saintsystems.com"
|
355 |
msgstr ""
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: saintsystems, anderly
|
|
3 |
Tags: woocommerce, mailchimp
|
4 |
Requires at least: 3.5.1
|
5 |
Tested up to: 4.6.1
|
6 |
-
Stable tag: 2.0.
|
7 |
License: GPLv3
|
8 |
|
9 |
Simple and flexible MailChimp integration for WooCommerce.
|
@@ -42,7 +42,11 @@ Automatically subscribe customers to a designated MailChimp list and, optionally
|
|
42 |
**Included Translations:**
|
43 |
|
44 |
- English (default)
|
45 |
-
-
|
|
|
|
|
|
|
|
|
46 |
|
47 |
Thanks in advance for your help on any translation efforts!
|
48 |
|
@@ -93,7 +97,7 @@ Also, if you enjoy using the software [we'd love it if you could give us a revie
|
|
93 |
|
94 |
== Changelog ==
|
95 |
|
96 |
-
#### 2.0 - 2.0.
|
97 |
|
98 |
**WARNING:** This release contains breaking changes to the plugins action hooks and filters. If you have custom code that hooks into the plugins action hooks and filters, please review the breaking changes below to know how to update your code appropriately.
|
99 |
|
@@ -128,6 +132,10 @@ Also, if you enjoy using the software [we'd love it if you could give us a revie
|
|
128 |
- New action filter `ss_wc_mailchimp_opt_in_checkbox` allows for overriding opt in checkbox rendering
|
129 |
- New action hook `ss_wc_mailchimp_after_opt_in_checkbox` fired after opt in checkbox is rendered.
|
130 |
|
|
|
|
|
|
|
|
|
131 |
#### 1.3.9 - September 13, 2016
|
132 |
|
133 |
**Fixes**
|
3 |
Tags: woocommerce, mailchimp
|
4 |
Requires at least: 3.5.1
|
5 |
Tested up to: 4.6.1
|
6 |
+
Stable tag: 2.0.3
|
7 |
License: GPLv3
|
8 |
|
9 |
Simple and flexible MailChimp integration for WooCommerce.
|
42 |
**Included Translations:**
|
43 |
|
44 |
- English (default)
|
45 |
+
- French.
|
46 |
+
|
47 |
+
**Custom Translations**
|
48 |
+
- Place custom translations in `/wp-content/languages/woocommerce-mailchimp/woocommerce-mailchim_{locale}.[mo|po]`. This ensures they won't get overwritten by plugin updates.
|
49 |
+
- If no custom translations are present, the plugin will load them from `/wp-content/plugins/woocommerce-mailchimp/languages/woocommerce-mailchimp_{locale}.[mo|po]`
|
50 |
|
51 |
Thanks in advance for your help on any translation efforts!
|
52 |
|
97 |
|
98 |
== Changelog ==
|
99 |
|
100 |
+
#### 2.0 - 2.0.3 - September 16, 2016
|
101 |
|
102 |
**WARNING:** This release contains breaking changes to the plugins action hooks and filters. If you have custom code that hooks into the plugins action hooks and filters, please review the breaking changes below to know how to update your code appropriately.
|
103 |
|
132 |
- New action filter `ss_wc_mailchimp_opt_in_checkbox` allows for overriding opt in checkbox rendering
|
133 |
- New action hook `ss_wc_mailchimp_after_opt_in_checkbox` fired after opt in checkbox is rendered.
|
134 |
|
135 |
+
**Fixes**
|
136 |
+
|
137 |
+
- Fixed issues with translations and text domains not loading properly.
|
138 |
+
|
139 |
#### 1.3.9 - September 13, 2016
|
140 |
|
141 |
**Fixes**
|
woocommerce-mailchimp.php
CHANGED
@@ -5,8 +5,8 @@
|
|
5 |
* Description: WooCommerce MailChimp provides simple MailChimp integration for WooCommerce.
|
6 |
* Author: Saint Systems
|
7 |
* Author URI: https://www.saintsystems.com
|
8 |
-
* Version: 2.0.
|
9 |
-
* Text Domain:
|
10 |
* Domain Path: languages
|
11 |
*
|
12 |
* Copyright: � 2016 Saint Systems
|
5 |
* Description: WooCommerce MailChimp provides simple MailChimp integration for WooCommerce.
|
6 |
* Author: Saint Systems
|
7 |
* Author URI: https://www.saintsystems.com
|
8 |
+
* Version: 2.0.3
|
9 |
+
* Text Domain: woocommerce-mailchimp
|
10 |
* Domain Path: languages
|
11 |
*
|
12 |
* Copyright: � 2016 Saint Systems
|