WooCommerce Cart Abandonment Recovery - Version 1.2.12

Version Description

Download this release

Release Info

Developer cartflowswp
Plugin Icon 128x128 WooCommerce Cart Abandonment Recovery
Version 1.2.12
Comparing to
See all releases

Code changes from version 1.2.11 to 1.2.12

admin/assets/js/admin-email-templates.js CHANGED
@@ -1,303 +1,468 @@
1
- (function ($) {
2
-
3
- CartAbandonmentSettings = {
4
-
5
- init: function () {
6
-
7
- $("#wcf_ca_custom_filter_from").datepicker({
8
- dateFormat: 'yy-mm-dd',
9
- maxDate: '0',
10
- onClose: function( selectedDate ) {
11
- jQuery( "#wcf_ca_custom_filter_to" ).datepicker( "option", "minDate", selectedDate );
12
- }
13
- }).attr('readonly','readonly').css('background', 'white');
14
-
15
- $("#wcf_ca_custom_filter_to").datepicker({
16
- dateFormat: 'yy-mm-dd',
17
- maxDate: '0',
18
- onClose: function( selectedDate ) {
19
- jQuery( "#wcf_ca_custom_filter_from" ).datepicker( "option", "maxDate", selectedDate );
20
- }
21
- }).attr('readonly','readonly').css('background', 'white');
22
-
23
- $("#wcf_ca_custom_filter").on('click',function () {
24
- var from = $("#wcf_ca_custom_filter_from").val().trim();
25
- var to = $("#wcf_ca_custom_filter_to").val().trim();
26
- var url = window.location.search;
27
- url = url + "&from_date=" + from + "&to_date=" + to + "&filter=custom";
28
- window.location.href = url;
29
-
30
- });
31
-
32
- $("#wcf_search_id_submit").on('click', function () {
33
- var search = $("#wcf_search_id_search_input").val().trim();
34
- window.location.href = window.location.search + "&search_term=" + search;
35
- } );
36
-
37
- // Hide initially.
38
- $("#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry, #wcf_ca_zapier_cart_abandoned_webhook, #wcf_ca_coupon_code_status, #wcf_ca_gdpr_message").closest('tr').hide();
39
-
40
-
41
- if( $("#wcf_ca_gdpr_status:checked").length ) {
42
- $("#wcf_ca_gdpr_message").closest('tr').show();
43
- }
44
-
45
- if ($("#wcf_ca_zapier_tracking_status:checked").length) {
46
- $("#wcf_ca_zapier_cart_abandoned_webhook, #wcf_ca_coupon_code_status").closest('tr').show();
47
- }
48
-
49
- if ( $("#wcf_ca_coupon_code_status:checked").length && $("#wcf_ca_zapier_tracking_status:checked").length ) {
50
- $("#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry").closest('tr').show();
51
- }
52
-
53
- $("#wcf_ca_coupon_code_status").on( 'click',
54
- function () {
55
- if (!$("#wcf_ca_coupon_code_status:checked").length) {
56
- $("#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry").closest('tr').fadeOut();
57
- } else {
58
- $("#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry").closest('tr').fadeIn();
59
- }
60
- }
61
- );
62
-
63
- $("#wcf_ca_gdpr_status").on( 'click',
64
- function () {
65
- if (!$("#wcf_ca_gdpr_status:checked").length) {
66
- $("#wcf_ca_gdpr_message").closest('tr').fadeOut();
67
- } else {
68
- $("#wcf_ca_gdpr_message").closest('tr').fadeIn();
69
- }
70
- }
71
- );
72
-
73
- $("#wcf_ca_zapier_tracking_status").on('click',
74
- function () {
75
- if (!$("#wcf_ca_zapier_tracking_status:checked").length) {
76
- $("#wcf_ca_zapier_cart_abandoned_webhook, #wcf_ca_coupon_code_status").closest('tr').fadeOut();
77
- } else {
78
- $("#wcf_ca_zapier_cart_abandoned_webhook, #wcf_ca_coupon_code_status").closest('tr').fadeIn();
79
- }
80
-
81
- if ($("#wcf_ca_coupon_code_status:checked").length && $("#wcf_ca_zapier_tracking_status:checked").length) {
82
- $("#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry").closest('tr').fadeIn();
83
- } else {
84
- $("#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry").closest('tr').fadeOut();
85
- }
86
- }
87
- );
88
-
89
- }
90
- }
91
-
92
-
93
- EmailTemplatesAdmin = {
94
-
95
-
96
- init: function () {
97
-
98
- $(document).on('click', '#wcf_preview_email', EmailTemplatesAdmin.send_test_email);
99
- $(document).on('click', '.wcf-ca-switch.wcf-toggle-template-status', EmailTemplatesAdmin.toggle_activate_template);
100
- $(document).on('click', '#wcf_ca_delete_coupons', EmailTemplatesAdmin.delete_coupons);
101
- $(document).on('click', '#wcf_ca_export_orders', EmailTemplatesAdmin.export_orders);
102
- $(document).on('click', '.wcar-switch-grid', EmailTemplatesAdmin.toggle_activate_template_on_grid);
103
- var coupon_child_fields = "#wcf_email_discount_type, #wcf_email_discount_amount, #wcf_email_coupon_expiry_date, #wcf_free_shipping_coupon, #wcf_auto_coupon_apply, #wcf_individual_use_only";
104
- $(coupon_child_fields).closest('tr').toggle($("#wcf_override_global_coupon").is(":checked"));
105
- $(document).on('click', '#wcf_override_global_coupon', function () {
106
- $(coupon_child_fields).closest('tr').fadeToggle($("#wcf_override_global_coupon").is(":checked"));
107
- });
108
- },
109
-
110
- send_test_email: function () {
111
-
112
- var email_body = '';
113
- if (jQuery("#wp-wcf_email_body-wrap").hasClass("tmce-active")) {
114
- email_body = tinyMCE.get('wcf_email_body').getContent();
115
- } else {
116
- email_body = jQuery('#wcf_email_body').val();
117
- }
118
-
119
- var email_subject = $('#wcf_email_subject').val();
120
- var email_send_to = $('#wcf_send_test_email').val();
121
- var wp_nonce = $("#_wpnonce").val();
122
-
123
- $(this).next('div.error').remove();
124
-
125
- if (!$.trim(email_body)) {
126
- $(this).after('<div class="error-message wcf-ca-error-msg"> Email body is required! </div>');
127
- } else if (!$.trim(email_subject)) {
128
- $(this).after('<div class="error-message wcf-ca-error-msg"> Email subject is required! </div>');
129
- } else if (!$.trim(email_send_to)) {
130
- $(this).after('<div class="error-message wcf-ca-error-msg"> You must add your email id! </div>');
131
- }
132
- else {
133
-
134
- var data = {
135
- email_subject: email_subject,
136
- email_body: email_body,
137
- email_send_to: email_send_to,
138
- action: 'wcf_ca_preview_email_send',
139
- security: wp_nonce,
140
- };
141
- $("#wcf_preview_email").css('cursor', 'wait').attr("disabled", true);
142
-
143
- // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
144
- $.post(
145
- ajaxurl, data, function (response) {
146
- $("#mail_response_msg").empty().fadeIn();;
147
-
148
- if (response.success) {
149
- var htmlString = "<strong> Email has been sent successfully! </strong>";
150
- $("#mail_response_msg").css('color','green').html(htmlString).delay(3000).fadeOut();
151
-
152
- } else {
153
- var htmlString = "<strong> Email sending failed! Please check your SMTP settings! </a></strong>"
154
- $("#mail_response_msg").css('color','red').html(htmlString).delay(3000).fadeOut();;
155
- }
156
- $("#wcf_preview_email").css('cursor', '').attr("disabled", false);
157
-
158
- }
159
- );
160
- }
161
-
162
- $(".wcf-ca-error-msg").delay(2000).fadeOut();
163
- },
164
-
165
- delete_coupons: function () {
166
- if (confirm(wcf_ca_localized_vars._confirm_msg)) {
167
- var data = {
168
- action: 'wcf_ca_delete_garbage_coupons',
169
- security: wcf_ca_localized_vars._delete_coupon_nonce
170
- };
171
- $('.wcf-ca-spinner').show();
172
-
173
- $('.wcf-ca-spinner').addClass("is-active");
174
- $("#wcf_ca_delete_coupons").css('cursor', 'wait').attr("disabled", true);
175
- $.post(
176
- ajaxurl, data, function (response) {
177
- $(".wcf-ca-response-msg").empty().fadeIn();;
178
- if (response.success) {
179
- $('.wcf-ca-spinner').hide();
180
- $(".wcf-ca-response-msg").css('color','green').html(response.data).delay(5000).fadeOut();
181
- }
182
-
183
- $("#wcf_ca_delete_coupons").css('cursor', '').attr("disabled", false);
184
- }
185
- );
186
- }
187
- },
188
- export_orders: function () {
189
- if( confirm( wcf_ca_localized_vars._confirm_msg_export ) ) {
190
- window.location.href = window.location.search + "&export_data=true";
191
- }
192
- },
193
- toggle_activate_template_on_grid: function () {
194
- var $switch, state, new_state;
195
- $switch = $(this);
196
- state = $switch.attr('wcf-ca-template-switch');
197
- var css = (state === 'on') ? 'green' : 'red';
198
-
199
- $.post(
200
- ajaxurl, {
201
- action: 'activate_email_templates',
202
- id: $(this).attr('id'),
203
- state: state,
204
- security: wcf_ca_details.email_toggle_button_nonce
205
- }, function (response) {
206
-
207
- $("#wcf_activate_email_template").val(new_state == 'on' ? 1 : 0);
208
-
209
- $(".wcar_tmpl_response_msg").remove();
210
-
211
- $("<span class='wcar_tmpl_response_msg'> " + response.data + " </span>").insertAfter($switch).delay(2000).fadeOut().css('color', css);
212
-
213
- }
214
- );
215
- },
216
-
217
-
218
- toggle_activate_template: function () {
219
- var $switch, state, new_state;
220
- $switch = $(this);
221
- state = $switch.attr('wcf-ca-template-switch');
222
- new_state = state === 'on' ? 'off' : 'on';
223
- $("#wcf_activate_email_template").val(new_state == 'on' ? 1 : 0);
224
- $switch.attr('wcf-ca-template-switch', new_state);
225
- }
226
- }
227
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
228
  ZapierSettings = {
229
- init: function () {
230
-
231
- $(document).on( "click", "#wcf_ca_trigger_web_hook_abandoned_btn",
232
- { 'order_status': 'abandoned' },
233
- ZapierSettings.zapier_trigger_sample);
234
- },
235
- zapier_trigger_sample: function( event ) {
236
-
237
- var zapier_webhook_url = $("#wcf_ca_zapier_cart_"+ event.data.order_status +"_webhook").val().trim();
238
-
 
 
 
 
 
239
  if ( ! zapier_webhook_url.length ) {
240
- $("#wcf_ca_"+ event.data.order_status +"_btn_message").text("Webhook URL is required.").fadeIn().css('color', '#dc3232').delay(2000).fadeOut();
 
 
 
 
 
241
  return;
242
  }
243
 
244
- $("#wcf_ca_"+ event.data.order_status +"_btn_message").text("Triggering...").fadeIn();
245
-
 
 
246
  var now = new Date();
247
- var datetime = now.getFullYear()+'/'+(now.getMonth()+1)+'/'+now.getDate();
248
- datetime += ' '+now.getHours()+':'+now.getMinutes()+':'+now.getSeconds();
249
- if ($.trim(zapier_webhook_url) !== "") {
 
 
 
 
 
 
 
 
 
 
 
250
  var sample_data = {
251
- "first_name": wcf_ca_details.name,
252
- "last_name": wcf_ca_details.surname,
253
- "email": wcf_ca_details.email,
254
- "order_status": event.data.order_status,
255
- "checkout_url": window.location.origin + "/checkout/?wcf_ac_token=something",
256
- "coupon_code": "abcgefgh",
257
- "product_names": "Product1, Product2 & Product3",
258
- "cart_total": wcf_ca_details.woo_currency_symbol + "20",
259
- "product_table": '<table align= left; cellpadding="10" cellspacing="0" style="float: none; border: 1px solid #e5e5e5;"> <tr align="center"> <th style="color: #636363; border: 1px solid #e5e5e5;">Item</th> <th style="color: #636363; border: 1px solid #e5e5e5;">Name</th> <th style="color: #636363; border: 1px solid #e5e5e5;">Quantity</th> <th style="color: #636363; border: 1px solid #e5e5e5;">Price</th> <th style="color: #636363; border: 1px solid #e5e5e5;">Line Subtotal</th> </tr> <tr style=color: #636363; border: 1px solid #e5e5e5; align="center"> <td style="color: #636363; border: 1px solid #e5e5e5;"><img class="demo_img" style="height: 42px; width: 42px;" src="http://localhost/wp-local/wp-content/uploads/2019/11/wGdyS_Zgz1A.jpg"></td> <td style="color: #636363; border: 1px solid #e5e5e5;">Product1</td> <td style="color: #636363; border: 1px solid #e5e5e5;"> 1 </td> <td style="color: #636363; border: 1px solid #e5e5e5;">&pound;85.00</td> <td style="color: #636363; border: 1px solid #e5e5e5;" >&pound;85.00</td> </tr> </table>'
 
 
 
260
  };
261
- $.ajax({
262
  url: zapier_webhook_url,
263
  type: 'POST',
264
  data: sample_data,
265
- success: function(data) {
266
- if (data.status == "success") {
267
- $("#wcf_ca_"+ event.data.order_status +"_btn_message").text("Trigger Success!").css('color', '#46b450');
 
 
 
 
 
 
268
  } else {
269
- $("#wcf_ca_"+ event.data.order_status +"_btn_message").text("Trigger Failed!").css('color', '#dc3232');
 
 
 
 
 
 
270
  }
271
- $("#wcf_ca_"+ event.data.order_status +"_btn_message").fadeIn().delay(2000).fadeOut();
 
 
 
 
 
 
 
272
  },
273
- error: function() {
274
- $("#wcf_ca_"+ event.data.order_status +"_btn_message").text("Trigger Failed!").css('color', '#dc3232');
275
- }
276
- });
 
 
 
 
 
 
277
  } else {
278
- $("wcf_ca"+ event.data.order_status +"_btn_message").text("Please verify webhook URL.").fadeIn().delay(2000).fadeOut();;
 
 
 
 
279
  }
280
  },
281
- }
282
-
283
- ToolTipHover = {
284
- init: function () {
285
-
286
- $(".wcf-ca-report-table-row .wcf-ca-icon-row").on('hover',function(){
287
- $(this).find('.wcf-ca-tooltip-text').toggleClass("display_tool_tip");
288
- });
289
- },
290
- }
291
-
292
-
293
- $(function () {
294
- EmailTemplatesAdmin.init();
295
- CartAbandonmentSettings.init();
296
- ZapierSettings.init();
297
- ToolTipHover.init();
298
- }
299
-
300
- );
301
-
302
-
303
- })(jQuery);
1
+ ( function ( $ ) {
2
+ CartAbandonmentSettings = {
3
+ init: function () {
4
+ $( '#wcf_ca_custom_filter_from' )
5
+ .datepicker( {
6
+ dateFormat: 'yy-mm-dd',
7
+ maxDate: '0',
8
+ onClose: function ( selectedDate ) {
9
+ jQuery( '#wcf_ca_custom_filter_to' ).datepicker(
10
+ 'option',
11
+ 'minDate',
12
+ selectedDate
13
+ );
14
+ },
15
+ } )
16
+ .attr( 'readonly', 'readonly' )
17
+ .css( 'background', 'white' );
18
+
19
+ $( '#wcf_ca_custom_filter_to' )
20
+ .datepicker( {
21
+ dateFormat: 'yy-mm-dd',
22
+ maxDate: '0',
23
+ onClose: function ( selectedDate ) {
24
+ jQuery( '#wcf_ca_custom_filter_from' ).datepicker(
25
+ 'option',
26
+ 'maxDate',
27
+ selectedDate
28
+ );
29
+ },
30
+ } )
31
+ .attr( 'readonly', 'readonly' )
32
+ .css( 'background', 'white' );
33
+
34
+ $( '#wcf_ca_custom_filter' ).on( 'click', function () {
35
+ var from = $( '#wcf_ca_custom_filter_from' ).val().trim();
36
+ var to = $( '#wcf_ca_custom_filter_to' ).val().trim();
37
+ var url = window.location.search;
38
+ url =
39
+ url +
40
+ '&from_date=' +
41
+ from +
42
+ '&to_date=' +
43
+ to +
44
+ '&filter=custom';
45
+ window.location.href = url;
46
+ } );
47
+
48
+ $( '#wcf_search_id_submit' ).on( 'click', function () {
49
+ var search = $( '#wcf_search_id_search_input' ).val().trim();
50
+ window.location.href =
51
+ window.location.search + '&search_term=' + search;
52
+ } );
53
+
54
+ // Hide initially.
55
+ $(
56
+ '#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry, #wcf_ca_zapier_cart_abandoned_webhook, #wcf_ca_coupon_code_status, #wcf_ca_gdpr_message'
57
+ )
58
+ .closest( 'tr' )
59
+ .hide();
60
+
61
+ if ( $( '#wcf_ca_gdpr_status:checked' ).length ) {
62
+ $( '#wcf_ca_gdpr_message' ).closest( 'tr' ).show();
63
+ }
64
+
65
+ if ( $( '#wcf_ca_zapier_tracking_status:checked' ).length ) {
66
+ $(
67
+ '#wcf_ca_zapier_cart_abandoned_webhook, #wcf_ca_coupon_code_status'
68
+ )
69
+ .closest( 'tr' )
70
+ .show();
71
+ }
72
+
73
+ if (
74
+ $( '#wcf_ca_coupon_code_status:checked' ).length &&
75
+ $( '#wcf_ca_zapier_tracking_status:checked' ).length
76
+ ) {
77
+ $(
78
+ '#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry'
79
+ )
80
+ .closest( 'tr' )
81
+ .show();
82
+ }
83
+
84
+ $( '#wcf_ca_coupon_code_status' ).on( 'click', function () {
85
+ if ( ! $( '#wcf_ca_coupon_code_status:checked' ).length ) {
86
+ $(
87
+ '#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry'
88
+ )
89
+ .closest( 'tr' )
90
+ .fadeOut();
91
+ } else {
92
+ $(
93
+ '#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry'
94
+ )
95
+ .closest( 'tr' )
96
+ .fadeIn();
97
+ }
98
+ } );
99
+
100
+ $( '#wcf_ca_gdpr_status' ).on( 'click', function () {
101
+ if ( ! $( '#wcf_ca_gdpr_status:checked' ).length ) {
102
+ $( '#wcf_ca_gdpr_message' ).closest( 'tr' ).fadeOut();
103
+ } else {
104
+ $( '#wcf_ca_gdpr_message' ).closest( 'tr' ).fadeIn();
105
+ }
106
+ } );
107
+
108
+ $( '#wcf_ca_zapier_tracking_status' ).on( 'click', function () {
109
+ if ( ! $( '#wcf_ca_zapier_tracking_status:checked' ).length ) {
110
+ $(
111
+ '#wcf_ca_zapier_cart_abandoned_webhook, #wcf_ca_coupon_code_status'
112
+ )
113
+ .closest( 'tr' )
114
+ .fadeOut();
115
+ } else {
116
+ $(
117
+ '#wcf_ca_zapier_cart_abandoned_webhook, #wcf_ca_coupon_code_status'
118
+ )
119
+ .closest( 'tr' )
120
+ .fadeIn();
121
+ }
122
+
123
+ if (
124
+ $( '#wcf_ca_coupon_code_status:checked' ).length &&
125
+ $( '#wcf_ca_zapier_tracking_status:checked' ).length
126
+ ) {
127
+ $(
128
+ '#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry'
129
+ )
130
+ .closest( 'tr' )
131
+ .fadeIn();
132
+ } else {
133
+ $(
134
+ '#wcf_ca_discount_type, #wcf_ca_coupon_amount, #wcf_ca_coupon_expiry'
135
+ )
136
+ .closest( 'tr' )
137
+ .fadeOut();
138
+ }
139
+ } );
140
+ },
141
+ };
142
+
143
+ EmailTemplatesAdmin = {
144
+ init: function () {
145
+ $( document ).on(
146
+ 'click',
147
+ '#wcf_preview_email',
148
+ EmailTemplatesAdmin.send_test_email
149
+ );
150
+ $( document ).on(
151
+ 'click',
152
+ '.wcf-ca-switch.wcf-toggle-template-status',
153
+ EmailTemplatesAdmin.toggle_activate_template
154
+ );
155
+ $( document ).on(
156
+ 'click',
157
+ '#wcf_ca_delete_coupons',
158
+ EmailTemplatesAdmin.delete_coupons
159
+ );
160
+ $( document ).on(
161
+ 'click',
162
+ '#wcf_ca_export_orders',
163
+ EmailTemplatesAdmin.export_orders
164
+ );
165
+ $( document ).on(
166
+ 'click',
167
+ '.wcar-switch-grid',
168
+ EmailTemplatesAdmin.toggle_activate_template_on_grid
169
+ );
170
+ var coupon_child_fields =
171
+ '#wcf_email_discount_type, #wcf_email_discount_amount, #wcf_email_coupon_expiry_date, #wcf_free_shipping_coupon, #wcf_auto_coupon_apply, #wcf_individual_use_only';
172
+ $( coupon_child_fields )
173
+ .closest( 'tr' )
174
+ .toggle( $( '#wcf_override_global_coupon' ).is( ':checked' ) );
175
+ $( document ).on(
176
+ 'click',
177
+ '#wcf_override_global_coupon',
178
+ function () {
179
+ $( coupon_child_fields )
180
+ .closest( 'tr' )
181
+ .fadeToggle(
182
+ $( '#wcf_override_global_coupon' ).is( ':checked' )
183
+ );
184
+ }
185
+ );
186
+ },
187
+
188
+ send_test_email: function () {
189
+ var email_body = '';
190
+ if (
191
+ jQuery( '#wp-wcf_email_body-wrap' ).hasClass( 'tmce-active' )
192
+ ) {
193
+ email_body = tinyMCE.get( 'wcf_email_body' ).getContent();
194
+ } else {
195
+ email_body = jQuery( '#wcf_email_body' ).val();
196
+ }
197
+
198
+ var email_subject = $( '#wcf_email_subject' ).val();
199
+ var email_send_to = $( '#wcf_send_test_email' ).val();
200
+ var wp_nonce = $( '#_wpnonce' ).val();
201
+
202
+ $( this ).next( 'div.error' ).remove();
203
+
204
+ if ( ! $.trim( email_body ) ) {
205
+ $( this ).after(
206
+ '<div class="error-message wcf-ca-error-msg"> Email body is required! </div>'
207
+ );
208
+ } else if ( ! $.trim( email_subject ) ) {
209
+ $( this ).after(
210
+ '<div class="error-message wcf-ca-error-msg"> Email subject is required! </div>'
211
+ );
212
+ } else if ( ! $.trim( email_send_to ) ) {
213
+ $( this ).after(
214
+ '<div class="error-message wcf-ca-error-msg"> You must add your email id! </div>'
215
+ );
216
+ } else {
217
+ var data = {
218
+ email_subject: email_subject,
219
+ email_body: email_body,
220
+ email_send_to: email_send_to,
221
+ action: 'wcf_ca_preview_email_send',
222
+ security: wp_nonce,
223
+ };
224
+ $( '#wcf_preview_email' )
225
+ .css( 'cursor', 'wait' )
226
+ .attr( 'disabled', true );
227
+
228
+ // since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
229
+ $.post( ajaxurl, data, function ( response ) {
230
+ $( '#mail_response_msg' ).empty().fadeIn();
231
+
232
+ if ( response.success ) {
233
+ var htmlString =
234
+ '<strong> Email has been sent successfully! </strong>';
235
+ $( '#mail_response_msg' )
236
+ .css( 'color', 'green' )
237
+ .html( htmlString )
238
+ .delay( 3000 )
239
+ .fadeOut();
240
+ } else {
241
+ var htmlString =
242
+ '<strong> Email sending failed! Please check your SMTP settings! </a></strong>';
243
+ $( '#mail_response_msg' )
244
+ .css( 'color', 'red' )
245
+ .html( htmlString )
246
+ .delay( 3000 )
247
+ .fadeOut();
248
+ }
249
+ $( '#wcf_preview_email' )
250
+ .css( 'cursor', '' )
251
+ .attr( 'disabled', false );
252
+ } );
253
+ }
254
+
255
+ $( '.wcf-ca-error-msg' ).delay( 2000 ).fadeOut();
256
+ },
257
+
258
+ delete_coupons: function () {
259
+ if ( confirm( wcf_ca_localized_vars._confirm_msg ) ) {
260
+ var data = {
261
+ action: 'wcf_ca_delete_garbage_coupons',
262
+ security: wcf_ca_localized_vars._delete_coupon_nonce,
263
+ };
264
+ $( '.wcf-ca-spinner' ).show();
265
+
266
+ $( '.wcf-ca-spinner' ).addClass( 'is-active' );
267
+ $( '#wcf_ca_delete_coupons' )
268
+ .css( 'cursor', 'wait' )
269
+ .attr( 'disabled', true );
270
+ $.post( ajaxurl, data, function ( response ) {
271
+ $( '.wcf-ca-response-msg' ).empty().fadeIn();
272
+ if ( response.success ) {
273
+ $( '.wcf-ca-spinner' ).hide();
274
+ $( '.wcf-ca-response-msg' )
275
+ .css( 'color', 'green' )
276
+ .html( response.data )
277
+ .delay( 5000 )
278
+ .fadeOut();
279
+ }
280
+
281
+ $( '#wcf_ca_delete_coupons' )
282
+ .css( 'cursor', '' )
283
+ .attr( 'disabled', false );
284
+ } );
285
+ }
286
+ },
287
+ export_orders: function () {
288
+ if ( confirm( wcf_ca_localized_vars._confirm_msg_export ) ) {
289
+ window.location.href =
290
+ window.location.search + '&export_data=true';
291
+ }
292
+ },
293
+ toggle_activate_template_on_grid: function () {
294
+ var $switch, state, new_state;
295
+ $switch = $( this );
296
+ state = $switch.attr( 'wcf-ca-template-switch' );
297
+ var css = state === 'on' ? 'green' : 'red';
298
+
299
+ $.post(
300
+ ajaxurl,
301
+ {
302
+ action: 'activate_email_templates',
303
+ id: $( this ).attr( 'id' ),
304
+ state: state,
305
+ security: wcf_ca_details.email_toggle_button_nonce,
306
+ },
307
+ function ( response ) {
308
+ $( '#wcf_activate_email_template' ).val(
309
+ new_state == 'on' ? 1 : 0
310
+ );
311
+
312
+ $( '.wcar_tmpl_response_msg' ).remove();
313
+
314
+ $(
315
+ "<span class='wcar_tmpl_response_msg'> " +
316
+ response.data +
317
+ ' </span>'
318
+ )
319
+ .insertAfter( $switch )
320
+ .delay( 2000 )
321
+ .fadeOut()
322
+ .css( 'color', css );
323
+ }
324
+ );
325
+ },
326
+
327
+ toggle_activate_template: function () {
328
+ var $switch, state, new_state;
329
+ $switch = $( this );
330
+ state = $switch.attr( 'wcf-ca-template-switch' );
331
+ new_state = state === 'on' ? 'off' : 'on';
332
+ $( '#wcf_activate_email_template' ).val(
333
+ new_state == 'on' ? 1 : 0
334
+ );
335
+ $switch.attr( 'wcf-ca-template-switch', new_state );
336
+ },
337
+ };
338
+
339
  ZapierSettings = {
340
+ init: function () {
341
+ $( document ).on(
342
+ 'click',
343
+ '#wcf_ca_trigger_web_hook_abandoned_btn',
344
+ { order_status: 'abandoned' },
345
+ ZapierSettings.zapier_trigger_sample
346
+ );
347
+ },
348
+ zapier_trigger_sample: function ( event ) {
349
+ var zapier_webhook_url = $(
350
+ '#wcf_ca_zapier_cart_' + event.data.order_status + '_webhook'
351
+ )
352
+ .val()
353
+ .trim();
354
+
355
  if ( ! zapier_webhook_url.length ) {
356
+ $( '#wcf_ca_' + event.data.order_status + '_btn_message' )
357
+ .text( 'Webhook URL is required.' )
358
+ .fadeIn()
359
+ .css( 'color', '#dc3232' )
360
+ .delay( 2000 )
361
+ .fadeOut();
362
  return;
363
  }
364
 
365
+ $( '#wcf_ca_' + event.data.order_status + '_btn_message' )
366
+ .text( 'Triggering...' )
367
+ .fadeIn();
368
+
369
  var now = new Date();
370
+ var datetime =
371
+ now.getFullYear() +
372
+ '/' +
373
+ ( now.getMonth() + 1 ) +
374
+ '/' +
375
+ now.getDate();
376
+ datetime +=
377
+ ' ' +
378
+ now.getHours() +
379
+ ':' +
380
+ now.getMinutes() +
381
+ ':' +
382
+ now.getSeconds();
383
+ if ( $.trim( zapier_webhook_url ) !== '' ) {
384
  var sample_data = {
385
+ first_name: wcf_ca_details.name,
386
+ last_name: wcf_ca_details.surname,
387
+ email: wcf_ca_details.email,
388
+ order_status: event.data.order_status,
389
+ checkout_url:
390
+ window.location.origin +
391
+ '/checkout/?wcf_ac_token=something',
392
+ coupon_code: 'abcgefgh',
393
+ product_names: 'Product1, Product2 & Product3',
394
+ cart_total: wcf_ca_details.woo_currency_symbol + '20',
395
+ product_table:
396
+ '<table align= left; cellpadding="10" cellspacing="0" style="float: none; border: 1px solid #e5e5e5;"> <tr align="center"> <th style="color: #636363; border: 1px solid #e5e5e5;">Item</th> <th style="color: #636363; border: 1px solid #e5e5e5;">Name</th> <th style="color: #636363; border: 1px solid #e5e5e5;">Quantity</th> <th style="color: #636363; border: 1px solid #e5e5e5;">Price</th> <th style="color: #636363; border: 1px solid #e5e5e5;">Line Subtotal</th> </tr> <tr style=color: #636363; border: 1px solid #e5e5e5; align="center"> <td style="color: #636363; border: 1px solid #e5e5e5;"><img class="demo_img" style="height: 42px; width: 42px;" src="http://localhost/wp-local/wp-content/uploads/2019/11/wGdyS_Zgz1A.jpg"></td> <td style="color: #636363; border: 1px solid #e5e5e5;">Product1</td> <td style="color: #636363; border: 1px solid #e5e5e5;"> 1 </td> <td style="color: #636363; border: 1px solid #e5e5e5;">&pound;85.00</td> <td style="color: #636363; border: 1px solid #e5e5e5;" >&pound;85.00</td> </tr> </table>',
397
  };
398
+ $.ajax( {
399
  url: zapier_webhook_url,
400
  type: 'POST',
401
  data: sample_data,
402
+ success: function ( data ) {
403
+ if ( data.status == 'success' ) {
404
+ $(
405
+ '#wcf_ca_' +
406
+ event.data.order_status +
407
+ '_btn_message'
408
+ )
409
+ .text( 'Trigger Success!' )
410
+ .css( 'color', '#46b450' );
411
  } else {
412
+ $(
413
+ '#wcf_ca_' +
414
+ event.data.order_status +
415
+ '_btn_message'
416
+ )
417
+ .text( 'Trigger Failed!' )
418
+ .css( 'color', '#dc3232' );
419
  }
420
+ $(
421
+ '#wcf_ca_' +
422
+ event.data.order_status +
423
+ '_btn_message'
424
+ )
425
+ .fadeIn()
426
+ .delay( 2000 )
427
+ .fadeOut();
428
  },
429
+ error: function () {
430
+ $(
431
+ '#wcf_ca_' +
432
+ event.data.order_status +
433
+ '_btn_message'
434
+ )
435
+ .text( 'Trigger Failed!' )
436
+ .css( 'color', '#dc3232' );
437
+ },
438
+ } );
439
  } else {
440
+ $( 'wcf_ca' + event.data.order_status + '_btn_message' )
441
+ .text( 'Please verify webhook URL.' )
442
+ .fadeIn()
443
+ .delay( 2000 )
444
+ .fadeOut();
445
  }
446
  },
447
+ };
448
+
449
+ ToolTipHover = {
450
+ init: function () {
451
+ $( '.wcf-ca-report-table-row .wcf-ca-icon-row' ).on(
452
+ 'hover',
453
+ function () {
454
+ $( this )
455
+ .find( '.wcf-ca-tooltip-text' )
456
+ .toggleClass( 'display_tool_tip' );
457
+ }
458
+ );
459
+ },
460
+ };
461
+
462
+ $( function () {
463
+ EmailTemplatesAdmin.init();
464
+ CartAbandonmentSettings.init();
465
+ ZapierSettings.init();
466
+ ToolTipHover.init();
467
+ } );
468
+ } )( jQuery );
 
admin/assets/js/admin-mce.js CHANGED
@@ -1,108 +1,99 @@
1
- (function ($) {
2
- $(document).ready(
3
- function () {
4
- tinymce.PluginManager.add(
5
- 'cartflows_ac', function (editor, url) {
6
-
7
- editor.addButton(
8
- 'cartflows_ac', {
9
- type: 'menubutton',
10
- text: 'WCAR Fields',
11
- icon: false,
12
- menu: [
13
- {
14
- text: wcf_ca_details.admin_firstname,
15
- value: '{{admin.firstname}}',
16
- onclick: function () {
17
- editor.insertContent(this.value());
18
- }
19
- },
20
- {
21
- text: wcf_ca_details.admin_company,
22
- value: '{{admin.company}}',
23
- onclick: function () {
24
- editor.insertContent(this.value());
25
- }
26
- },
27
- {
28
- text: wcf_ca_details.abandoned_product_details_table,
29
- value: '{{cart.product.table}}',
30
- onclick: function () {
31
- editor.insertContent(this.value());
32
- }
33
- },
34
- {
35
- text: wcf_ca_details.abandoned_product_names,
36
- value: '{{cart.product.names}}',
37
- onclick: function () {
38
- editor.insertContent(this.value());
39
- }
40
- },
41
- {
42
- text: wcf_ca_details.cart_checkout_url,
43
- value: '{{cart.checkout_url}}',
44
- onclick: function () {
45
- editor.insertContent(this.value());
46
- }
47
- },
48
- {
49
- text: wcf_ca_details.coupon_code,
50
- value: '{{cart.coupon_code}}',
51
- onclick: function () {
52
- editor.insertContent(this.value());
53
- }
54
- },
55
- {
56
- text: wcf_ca_details.customer_firstname,
57
- value: '{{customer.firstname}}',
58
- onclick: function () {
59
- editor.insertContent(this.value());
60
- }
61
- },
62
- {
63
- text: wcf_ca_details.customer_lastname,
64
- value: '{{customer.lastname}}',
65
- onclick: function () {
66
- editor.insertContent(this.value());
67
- }
68
- },
69
- {
70
- text: wcf_ca_details.customer_full_name,
71
- value: '{{customer.fullname}}',
72
- onclick: function () {
73
- editor.insertContent(this.value());
74
- }
75
- },
76
- {
77
- text: wcf_ca_details.cart_abandonment_date,
78
- value: '{{cart.abandoned_date}}',
79
- onclick: function () {
80
- editor.insertContent(this.value());
81
- }
82
- },
83
- {
84
- text: wcf_ca_details.site_url,
85
- value: '{{site.url}}',
86
- onclick: function () {
87
- editor.insertContent(this.value());
88
- }
89
- },
90
- {
91
- text: wcf_ca_details.unsubscribe_link,
92
- value: '{{cart.unsubscribe}}',
93
- onclick: function () {
94
- editor.insertContent(this.value());
95
- }
96
- },
97
- ].sort(function(a,b){
98
- return a.text.localeCompare(b.text);
99
- })
100
- }
101
- );
102
- }
103
- );
104
- }
105
- );
106
-
107
- })(jQuery);
108
-
1
+ ( function ( $ ) {
2
+ $( document ).ready( function () {
3
+ tinymce.PluginManager.add( 'cartflows_ac', function ( editor, url ) {
4
+ editor.addButton( 'cartflows_ac', {
5
+ type: 'menubutton',
6
+ text: 'WCAR Fields',
7
+ icon: false,
8
+ menu: [
9
+ {
10
+ text: wcf_ca_details.admin_firstname,
11
+ value: '{{admin.firstname}}',
12
+ onclick: function () {
13
+ editor.insertContent( this.value() );
14
+ },
15
+ },
16
+ {
17
+ text: wcf_ca_details.admin_company,
18
+ value: '{{admin.company}}',
19
+ onclick: function () {
20
+ editor.insertContent( this.value() );
21
+ },
22
+ },
23
+ {
24
+ text: wcf_ca_details.abandoned_product_details_table,
25
+ value: '{{cart.product.table}}',
26
+ onclick: function () {
27
+ editor.insertContent( this.value() );
28
+ },
29
+ },
30
+ {
31
+ text: wcf_ca_details.abandoned_product_names,
32
+ value: '{{cart.product.names}}',
33
+ onclick: function () {
34
+ editor.insertContent( this.value() );
35
+ },
36
+ },
37
+ {
38
+ text: wcf_ca_details.cart_checkout_url,
39
+ value: '{{cart.checkout_url}}',
40
+ onclick: function () {
41
+ editor.insertContent( this.value() );
42
+ },
43
+ },
44
+ {
45
+ text: wcf_ca_details.coupon_code,
46
+ value: '{{cart.coupon_code}}',
47
+ onclick: function () {
48
+ editor.insertContent( this.value() );
49
+ },
50
+ },
51
+ {
52
+ text: wcf_ca_details.customer_firstname,
53
+ value: '{{customer.firstname}}',
54
+ onclick: function () {
55
+ editor.insertContent( this.value() );
56
+ },
57
+ },
58
+ {
59
+ text: wcf_ca_details.customer_lastname,
60
+ value: '{{customer.lastname}}',
61
+ onclick: function () {
62
+ editor.insertContent( this.value() );
63
+ },
64
+ },
65
+ {
66
+ text: wcf_ca_details.customer_full_name,
67
+ value: '{{customer.fullname}}',
68
+ onclick: function () {
69
+ editor.insertContent( this.value() );
70
+ },
71
+ },
72
+ {
73
+ text: wcf_ca_details.cart_abandonment_date,
74
+ value: '{{cart.abandoned_date}}',
75
+ onclick: function () {
76
+ editor.insertContent( this.value() );
77
+ },
78
+ },
79
+ {
80
+ text: wcf_ca_details.site_url,
81
+ value: '{{site.url}}',
82
+ onclick: function () {
83
+ editor.insertContent( this.value() );
84
+ },
85
+ },
86
+ {
87
+ text: wcf_ca_details.unsubscribe_link,
88
+ value: '{{cart.unsubscribe}}',
89
+ onclick: function () {
90
+ editor.insertContent( this.value() );
91
+ },
92
+ },
93
+ ].sort( function ( a, b ) {
94
+ return a.text.localeCompare( b.text );
95
+ } ),
96
+ } );
97
+ } );
98
+ } );
99
+ } )( jQuery );
 
 
 
 
 
 
 
 
 
assets/images/hoodie.jpg DELETED
Binary file
assets/images/image-placeholder.png ADDED
Binary file
assets/images/polo.jpg DELETED
Binary file
changelog.txt CHANGED
@@ -1,3 +1,9 @@
 
 
 
 
 
 
1
  Version 1.2.11 - Monday, 08th March 2021
2
  - Improvement: WordPress 5.7 compatibility.
3
  - Improvement: Removed jQuery3 deprecated function notices.
1
+ Version 1.2.12 - Thursday, 29th April 2021
2
+ - Improvement: Added the placeholder image for the product image.
3
+ - Fix: PHP error while notifying recovery to admin.
4
+ - Fix: Products Custom attributes not showing in product column.
5
+ - Fix: Orders list was not sorting.
6
+
7
  Version 1.2.11 - Monday, 08th March 2021
8
  - Improvement: WordPress 5.7 compatibility.
9
  - Improvement: Removed jQuery3 deprecated function notices.
classes/class-cartflows-ca-loader.php CHANGED
@@ -82,7 +82,8 @@ if ( ! class_exists( 'CARTFLOWS_CA_Loader' ) ) {
82
  define( 'CARTFLOWS_CA_BASE', plugin_basename( CARTFLOWS_CA_FILE ) );
83
  define( 'CARTFLOWS_CA_DIR', plugin_dir_path( CARTFLOWS_CA_FILE ) );
84
  define( 'CARTFLOWS_CA_URL', plugins_url( '/', CARTFLOWS_CA_FILE ) );
85
- define( 'CARTFLOWS_CA_VER', '1.2.11' );
 
86
  define( 'CARTFLOWS_CA_SLUG', 'cartflows_ca' );
87
 
88
  define( 'CARTFLOWS_CA_CART_ABANDONMENT_TABLE', 'cartflows_ca_cart_abandonment' );
82
  define( 'CARTFLOWS_CA_BASE', plugin_basename( CARTFLOWS_CA_FILE ) );
83
  define( 'CARTFLOWS_CA_DIR', plugin_dir_path( CARTFLOWS_CA_FILE ) );
84
  define( 'CARTFLOWS_CA_URL', plugins_url( '/', CARTFLOWS_CA_FILE ) );
85
+ define( 'CARTFLOWS_CA_VER', '1.2.12' );
86
+
87
  define( 'CARTFLOWS_CA_SLUG', 'cartflows_ca' );
88
 
89
  define( 'CARTFLOWS_CA_CART_ABANDONMENT_TABLE', 'cartflows_ca_cart_abandonment' );
languages/woo-cart-abandonment-recovery.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the WooCommerce Cart Abandonment Recovery package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce Cart Abandonment Recovery 1.2.11\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woo-cart-abandonment-recovery\n"
8
- "POT-Creation-Date: 2021-03-05 05:29:49+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
@@ -25,18 +25,18 @@ msgstr ""
25
  "X-Textdomain-Support: yes\n"
26
  "X-Generator: grunt-wp-i18n 1.0.3\n"
27
 
28
- #: classes/class-cartflows-ca-loader.php:142
29
  #. translators: %s: html tags
30
  msgid ""
31
  "The %1$sWooCommerce Cart Abandonment Recovery%2$s plugin requires "
32
  "%1$sWooCommerce%2$s plugin installed & activated."
33
  msgstr ""
34
 
35
- #: classes/class-cartflows-ca-loader.php:151
36
  msgid "Activate WooCommerce"
37
  msgstr ""
38
 
39
- #: classes/class-cartflows-ca-loader.php:159
40
  msgid "Install WooCommerce"
41
  msgstr ""
42
 
@@ -259,158 +259,158 @@ msgstr ""
259
 
260
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:90
261
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:142
262
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1799
263
  msgid "Unsubscribe"
264
  msgstr ""
265
 
266
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:238
267
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1943
268
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1995
269
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:176
270
  msgid "Name"
271
  msgstr ""
272
 
273
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:239
274
  msgid "Email"
275
  msgstr ""
276
 
277
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:240
278
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2017
279
  msgid "Cart Total"
280
  msgstr ""
281
 
282
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:241
283
  msgid "Order Status"
284
  msgstr ""
285
 
286
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:242
287
  msgid "Time"
288
  msgstr ""
289
 
290
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:210
291
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1042
292
  msgid "This order was abandoned & subsequently recovered."
293
  msgstr ""
294
 
295
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:235
296
  msgid "Mail has been sent successfully!"
297
  msgstr ""
298
 
299
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:237
300
  msgid "Mail sending failed!"
301
  msgstr ""
302
 
303
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:276
304
  msgid "Every Fifteen Minutes"
305
  msgstr ""
306
 
307
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:350
308
  msgid "You have successfully unsubscribed from our email list."
309
  msgstr ""
310
 
311
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:350
312
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:167
313
  msgid "Unsubscribed"
314
  msgstr ""
315
 
316
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:501
317
  msgid ""
318
  "This checkout page is generated by WooCommerce Cart Abandonment Recovery "
319
  "plugin from test mail."
320
  msgstr ""
321
 
322
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:543
323
  msgid "No Thanks"
324
  msgstr ""
325
 
326
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:544
327
  msgid "You won't receive further emails from us, thank you!"
328
  msgstr ""
329
 
330
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1200
331
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1201
 
332
  msgid "Cart Abandonment"
333
  msgstr ""
334
 
335
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1226
336
  msgid "Items deleted: %d"
337
  msgstr ""
338
 
339
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1243
340
  msgid "User(s) unsubscribed successfully!"
341
  msgstr ""
342
 
343
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1304
344
  msgid ""
345
  "Do you really want to delete the used and expired coupons created by Cart "
346
  "Abandonment Plugin?"
347
  msgstr ""
348
 
349
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1305
350
  msgid "Do you really want to export orders?"
351
  msgstr ""
352
 
353
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1309
354
  msgid "No such order is found."
355
  msgstr ""
356
 
357
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1328
358
  msgid "View Report"
359
  msgstr ""
360
 
361
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1466
362
  msgid "Report"
363
  msgstr ""
364
 
365
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1482
366
  msgid "Follow-Up Emails"
367
  msgstr ""
368
 
369
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1498
370
  msgid "Settings"
371
  msgstr ""
372
 
373
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1760
374
  msgid "there"
375
  msgstr ""
376
 
377
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1935
378
  msgid "Cart Total ( Cart Total + Shipping + Tax )"
379
  msgstr ""
380
 
381
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1942
382
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1994
383
  msgid "Item"
384
  msgstr ""
385
 
386
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1944
387
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1996
388
  msgid "Quantity"
389
  msgstr ""
390
 
391
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1945
392
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1997
393
  msgid "Price"
394
  msgstr ""
395
 
396
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1946
397
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1998
398
  msgid "Line Subtotal"
399
  msgstr ""
400
 
401
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2004
402
  msgid "Discount"
403
  msgstr ""
404
 
405
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2008
406
  msgid "Other"
407
  msgstr ""
408
 
409
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2013
410
  msgid "Shipping"
411
  msgstr ""
412
 
413
- #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2165
414
  #. translators: %1$s: Coupons Deleted, %2$s: Deleted coupons count'.
415
  msgid "%1$s: %2$d"
416
  msgstr ""
@@ -423,20 +423,20 @@ msgstr ""
423
  msgid "Clone"
424
  msgstr ""
425
 
426
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:187
427
  msgid "Template Name"
428
  msgstr ""
429
 
430
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:188
431
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:86
432
  msgid "Email Subject"
433
  msgstr ""
434
 
435
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:189
436
  msgid "Trigger After"
437
  msgstr ""
438
 
439
- #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:190
440
  msgid "Activate Template"
441
  msgstr ""
442
 
2
  # This file is distributed under the same license as the WooCommerce Cart Abandonment Recovery package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce Cart Abandonment Recovery 1.2.12\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://wordpress.org/support/plugin/woo-cart-abandonment-recovery\n"
8
+ "POT-Creation-Date: 2021-04-28 12:40:14+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
25
  "X-Textdomain-Support: yes\n"
26
  "X-Generator: grunt-wp-i18n 1.0.3\n"
27
 
28
+ #: classes/class-cartflows-ca-loader.php:143
29
  #. translators: %s: html tags
30
  msgid ""
31
  "The %1$sWooCommerce Cart Abandonment Recovery%2$s plugin requires "
32
  "%1$sWooCommerce%2$s plugin installed & activated."
33
  msgstr ""
34
 
35
+ #: classes/class-cartflows-ca-loader.php:152
36
  msgid "Activate WooCommerce"
37
  msgstr ""
38
 
39
+ #: classes/class-cartflows-ca-loader.php:160
40
  msgid "Install WooCommerce"
41
  msgstr ""
42
 
259
 
260
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:90
261
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:142
262
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1800
263
  msgid "Unsubscribe"
264
  msgstr ""
265
 
266
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:236
267
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1951
268
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2010
269
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:176
270
  msgid "Name"
271
  msgstr ""
272
 
273
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:237
274
  msgid "Email"
275
  msgstr ""
276
 
277
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:238
278
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2032
279
  msgid "Cart Total"
280
  msgstr ""
281
 
282
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:239
283
  msgid "Order Status"
284
  msgstr ""
285
 
286
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php:240
287
  msgid "Time"
288
  msgstr ""
289
 
290
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:211
291
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1043
292
  msgid "This order was abandoned & subsequently recovered."
293
  msgstr ""
294
 
295
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:236
296
  msgid "Mail has been sent successfully!"
297
  msgstr ""
298
 
299
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:238
300
  msgid "Mail sending failed!"
301
  msgstr ""
302
 
303
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:277
304
  msgid "Every Fifteen Minutes"
305
  msgstr ""
306
 
307
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:351
308
  msgid "You have successfully unsubscribed from our email list."
309
  msgstr ""
310
 
311
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:351
312
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:167
313
  msgid "Unsubscribed"
314
  msgstr ""
315
 
316
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:502
317
  msgid ""
318
  "This checkout page is generated by WooCommerce Cart Abandonment Recovery "
319
  "plugin from test mail."
320
  msgstr ""
321
 
322
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:544
323
  msgid "No Thanks"
324
  msgstr ""
325
 
326
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:545
327
  msgid "You won't receive further emails from us, thank you!"
328
  msgstr ""
329
 
 
330
  #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1201
331
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1202
332
  msgid "Cart Abandonment"
333
  msgstr ""
334
 
335
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1227
336
  msgid "Items deleted: %d"
337
  msgstr ""
338
 
339
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1244
340
  msgid "User(s) unsubscribed successfully!"
341
  msgstr ""
342
 
343
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1305
344
  msgid ""
345
  "Do you really want to delete the used and expired coupons created by Cart "
346
  "Abandonment Plugin?"
347
  msgstr ""
348
 
349
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1306
350
  msgid "Do you really want to export orders?"
351
  msgstr ""
352
 
353
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1310
354
  msgid "No such order is found."
355
  msgstr ""
356
 
357
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1329
358
  msgid "View Report"
359
  msgstr ""
360
 
361
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1467
362
  msgid "Report"
363
  msgstr ""
364
 
365
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1483
366
  msgid "Follow-Up Emails"
367
  msgstr ""
368
 
369
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1499
370
  msgid "Settings"
371
  msgstr ""
372
 
373
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1761
374
  msgid "there"
375
  msgstr ""
376
 
377
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1943
378
  msgid "Cart Total ( Cart Total + Shipping + Tax )"
379
  msgstr ""
380
 
381
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1950
382
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2009
383
  msgid "Item"
384
  msgstr ""
385
 
386
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1952
387
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2011
388
  msgid "Quantity"
389
  msgstr ""
390
 
391
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1953
392
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2012
393
  msgid "Price"
394
  msgstr ""
395
 
396
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:1954
397
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2013
398
  msgid "Line Subtotal"
399
  msgstr ""
400
 
401
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2019
402
  msgid "Discount"
403
  msgstr ""
404
 
405
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2023
406
  msgid "Other"
407
  msgstr ""
408
 
409
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2028
410
  msgid "Shipping"
411
  msgstr ""
412
 
413
+ #: modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php:2180
414
  #. translators: %1$s: Coupons Deleted, %2$s: Deleted coupons count'.
415
  msgid "%1$s: %2$d"
416
  msgstr ""
423
  msgid "Clone"
424
  msgstr ""
425
 
426
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:189
427
  msgid "Template Name"
428
  msgstr ""
429
 
430
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:190
431
  #: modules/cart-abandonment/includes/admin/cartflows-ca-single-report-details.php:86
432
  msgid "Email Subject"
433
  msgstr ""
434
 
435
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:191
436
  msgid "Trigger After"
437
  msgstr ""
438
 
439
+ #: modules/cart-abandonment/class-cartflows-ca-email-templates-table.php:192
440
  msgid "Activate Template"
441
  msgstr ""
442
 
modules/cart-abandonment/assets/js/cart-abandonment-tracking.js CHANGED
@@ -1,167 +1,197 @@
1
- (function ($) {
2
-
3
- var timer;
4
- var wcf_cart_abandonment = {
5
-
6
- init: function () {
7
-
8
- if ( CartFlowsProCAVars._show_gdpr_message && ! $("#wcf_cf_gdpr_message_block").length ) {
9
- $("#billing_email").after("<span id='wcf_cf_gdpr_message_block'> <span style='font-size: xx-small'> "+ CartFlowsProCAVars._gdpr_message +" <a style='cursor: pointer' id='wcf_ca_gdpr_no_thanks'> "+ CartFlowsProCAVars._gdpr_nothanks_msg +" </a></span></span>");
10
- }
11
-
12
- $(document).on(
13
- 'keyup keypress change',
14
- '#billing_email, #billing_phone, input.input-text, textarea.input-text, select',
15
- this._getCheckoutData
16
- );
17
-
18
- $("#wcf_ca_gdpr_no_thanks").on( 'click', function () {
19
- wcf_cart_abandonment._set_cookie();
20
- } );
21
-
22
- $( document.body ).on( 'updated_checkout', function(){
23
- wcf_cart_abandonment._getCheckoutData();
24
- });
25
-
26
- $( function(e) {
27
- setTimeout(function() {
28
- wcf_cart_abandonment._getCheckoutData();
29
- }, 800);
30
- });
31
- },
32
-
33
- _set_cookie: function() {
34
-
35
-
36
- var data = {
37
- 'wcf_ca_skip_track_data': true,
38
- 'action': 'cartflows_skip_cart_tracking_gdpr',
39
- 'security': CartFlowsProCAVars._gdpr_nonce,
40
- };
41
-
42
- jQuery.post(
43
- CartFlowsProCAVars.ajaxurl,data,
44
- function (response) {
45
-
46
- if(response.success) {
47
- $("#wcf_cf_gdpr_message_block").empty().append("<span style='font-size: xx-small'>" + CartFlowsProCAVars._gdpr_after_no_thanks_msg + "</span>").delay(5000).fadeOut();
48
- }
49
-
50
- }
51
- );
52
-
53
- },
54
-
55
- _validate_email: function (value) {
56
- var valid = true;
57
- if (value.indexOf('@') == -1) {
58
- valid = false;
59
- } else {
60
- var parts = value.split('@');
61
- var domain = parts[1];
62
- if (domain.indexOf('.') == -1) {
63
- valid = false;
64
- } else {
65
- var domainParts = domain.split('.');
66
- var ext = domainParts[1];
67
- if (ext.length > 14 || ext.length < 2) {
68
- valid = false;
69
- }
70
- }
71
- }
72
- return valid;
73
- },
74
-
75
- _getCheckoutData: function () {
76
-
77
- var wcf_phone = jQuery("#billing_phone").val();
78
- var wcf_email = jQuery("#billing_email").val();
79
-
80
- if( typeof wcf_email === 'undefined' ){
81
- return ;
82
- }
83
-
84
- var atposition = wcf_email.indexOf("@");
85
- var dotposition = wcf_email.lastIndexOf(".");
86
-
87
-
88
- if (typeof wcf_phone === 'undefined' || wcf_phone === null) { //If phone number field does not exist on the Checkout form
89
- wcf_phone = '';
90
- }
91
-
92
- clearTimeout(timer);
93
-
94
- if (!(atposition < 1 || dotposition < atposition + 2 || dotposition + 2 >= wcf_email.length) || wcf_phone.length >= 1) { //Checking if the email field is valid or phone number is longer than 1 digit
95
- //If Email or Phone valid
96
- var wcf_name = jQuery("#billing_first_name").val();
97
- var wcf_surname = jQuery("#billing_last_name").val();
98
- var wcf_phone = jQuery("#billing_phone").val();
99
- var wcf_country = jQuery("#billing_country").val();
100
- var wcf_city = jQuery("#billing_city").val();
101
-
102
- //Other fields used for "Remember user input" function
103
- var wcf_billing_company = jQuery("#billing_company").val();
104
- var wcf_billing_address_1 = jQuery("#billing_address_1").val();
105
- var wcf_billing_address_2 = jQuery("#billing_address_2").val();
106
- var wcf_billing_state = jQuery("#billing_state").val();
107
- var wcf_billing_postcode = jQuery("#billing_postcode").val();
108
- var wcf_shipping_first_name = jQuery("#shipping_first_name").val();
109
- var wcf_shipping_last_name = jQuery("#shipping_last_name").val();
110
- var wcf_shipping_company = jQuery("#shipping_company").val();
111
- var wcf_shipping_country = jQuery("#shipping_country").val();
112
- var wcf_shipping_address_1 = jQuery("#shipping_address_1").val();
113
- var wcf_shipping_address_2 = jQuery("#shipping_address_2").val();
114
- var wcf_shipping_city = jQuery("#shipping_city").val();
115
- var wcf_shipping_state = jQuery("#shipping_state").val();
116
- var wcf_shipping_postcode = jQuery("#shipping_postcode").val();
117
- var wcf_order_comments = jQuery("#order_comments").val();
118
-
119
- var data = {
120
- action: "cartflows_save_cart_abandonment_data",
121
- wcf_email: wcf_email,
122
- wcf_name: wcf_name,
123
- wcf_surname: wcf_surname,
124
- wcf_phone: wcf_phone,
125
- wcf_country: wcf_country,
126
- wcf_city: wcf_city,
127
- wcf_billing_company: wcf_billing_company,
128
- wcf_billing_address_1: wcf_billing_address_1,
129
- wcf_billing_address_2: wcf_billing_address_2,
130
- wcf_billing_state: wcf_billing_state,
131
- wcf_billing_postcode: wcf_billing_postcode,
132
- wcf_shipping_first_name: wcf_shipping_first_name,
133
- wcf_shipping_last_name: wcf_shipping_last_name,
134
- wcf_shipping_company: wcf_shipping_company,
135
- wcf_shipping_country: wcf_shipping_country,
136
- wcf_shipping_address_1: wcf_shipping_address_1,
137
- wcf_shipping_address_2: wcf_shipping_address_2,
138
- wcf_shipping_city: wcf_shipping_city,
139
- wcf_shipping_state: wcf_shipping_state,
140
- wcf_shipping_postcode: wcf_shipping_postcode,
141
- wcf_order_comments: wcf_order_comments,
142
- security: CartFlowsProCAVars._nonce,
143
- wcf_post_id: CartFlowsProCAVars._post_id,
144
- }
145
-
146
- timer = setTimeout(
147
- function () {
148
- if (wcf_cart_abandonment._validate_email(data.wcf_email)) {
149
- jQuery.post(
150
- CartFlowsProCAVars.ajaxurl, data, //Ajaxurl coming from localized script and contains the link to wp-admin/admin-ajax.php file that handles AJAX requests on Wordpress
151
- function (response) {
152
- // success response
153
- }
154
- );
155
- }
156
- }, 500
157
- );
158
- } else {
159
- //console.log("Not a valid e-mail or phone address");
160
- }
161
- }
162
-
163
- }
164
-
165
- wcf_cart_abandonment.init();
166
-
167
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function ( $ ) {
2
+ var timer;
3
+ var wcf_cart_abandonment = {
4
+ init: function () {
5
+ if (
6
+ CartFlowsProCAVars._show_gdpr_message &&
7
+ ! $( '#wcf_cf_gdpr_message_block' ).length
8
+ ) {
9
+ $( '#billing_email' ).after(
10
+ "<span id='wcf_cf_gdpr_message_block'> <span style='font-size: xx-small'> " +
11
+ CartFlowsProCAVars._gdpr_message +
12
+ " <a style='cursor: pointer' id='wcf_ca_gdpr_no_thanks'> " +
13
+ CartFlowsProCAVars._gdpr_nothanks_msg +
14
+ ' </a></span></span>'
15
+ );
16
+ }
17
+
18
+ $( document ).on(
19
+ 'keyup keypress change',
20
+ '#billing_email, #billing_phone, input.input-text, textarea.input-text, select',
21
+ this._getCheckoutData
22
+ );
23
+
24
+ $( '#wcf_ca_gdpr_no_thanks' ).on( 'click', function () {
25
+ wcf_cart_abandonment._set_cookie();
26
+ } );
27
+
28
+ $( document.body ).on( 'updated_checkout', function () {
29
+ wcf_cart_abandonment._getCheckoutData();
30
+ } );
31
+
32
+ $( function ( e ) {
33
+ setTimeout( function () {
34
+ wcf_cart_abandonment._getCheckoutData();
35
+ }, 800 );
36
+ } );
37
+ },
38
+
39
+ _set_cookie: function () {
40
+ var data = {
41
+ wcf_ca_skip_track_data: true,
42
+ action: 'cartflows_skip_cart_tracking_gdpr',
43
+ security: CartFlowsProCAVars._gdpr_nonce,
44
+ };
45
+
46
+ jQuery.post(
47
+ CartFlowsProCAVars.ajaxurl,
48
+ data,
49
+ function ( response ) {
50
+ if ( response.success ) {
51
+ $( '#wcf_cf_gdpr_message_block' )
52
+ .empty()
53
+ .append(
54
+ "<span style='font-size: xx-small'>" +
55
+ CartFlowsProCAVars._gdpr_after_no_thanks_msg +
56
+ '</span>'
57
+ )
58
+ .delay( 5000 )
59
+ .fadeOut();
60
+ }
61
+ }
62
+ );
63
+ },
64
+
65
+ _validate_email: function ( value ) {
66
+ var valid = true;
67
+ if ( value.indexOf( '@' ) == -1 ) {
68
+ valid = false;
69
+ } else {
70
+ var parts = value.split( '@' );
71
+ var domain = parts[ 1 ];
72
+ if ( domain.indexOf( '.' ) == -1 ) {
73
+ valid = false;
74
+ } else {
75
+ var domainParts = domain.split( '.' );
76
+ var ext = domainParts[ 1 ];
77
+ if ( ext.length > 14 || ext.length < 2 ) {
78
+ valid = false;
79
+ }
80
+ }
81
+ }
82
+ return valid;
83
+ },
84
+
85
+ _getCheckoutData: function () {
86
+ var wcf_phone = jQuery( '#billing_phone' ).val();
87
+ var wcf_email = jQuery( '#billing_email' ).val();
88
+
89
+ if ( typeof wcf_email === 'undefined' ) {
90
+ return;
91
+ }
92
+
93
+ var atposition = wcf_email.indexOf( '@' );
94
+ var dotposition = wcf_email.lastIndexOf( '.' );
95
+
96
+ if ( typeof wcf_phone === 'undefined' || wcf_phone === null ) {
97
+ //If phone number field does not exist on the Checkout form
98
+ wcf_phone = '';
99
+ }
100
+
101
+ clearTimeout( timer );
102
+
103
+ if (
104
+ ! (
105
+ atposition < 1 ||
106
+ dotposition < atposition + 2 ||
107
+ dotposition + 2 >= wcf_email.length
108
+ ) ||
109
+ wcf_phone.length >= 1
110
+ ) {
111
+ //Checking if the email field is valid or phone number is longer than 1 digit
112
+ //If Email or Phone valid
113
+ var wcf_name = jQuery( '#billing_first_name' ).val();
114
+ var wcf_surname = jQuery( '#billing_last_name' ).val();
115
+ var wcf_phone = jQuery( '#billing_phone' ).val();
116
+ var wcf_country = jQuery( '#billing_country' ).val();
117
+ var wcf_city = jQuery( '#billing_city' ).val();
118
+
119
+ //Other fields used for "Remember user input" function
120
+ var wcf_billing_company = jQuery( '#billing_company' ).val();
121
+ var wcf_billing_address_1 = jQuery(
122
+ '#billing_address_1'
123
+ ).val();
124
+ var wcf_billing_address_2 = jQuery(
125
+ '#billing_address_2'
126
+ ).val();
127
+ var wcf_billing_state = jQuery( '#billing_state' ).val();
128
+ var wcf_billing_postcode = jQuery( '#billing_postcode' ).val();
129
+ var wcf_shipping_first_name = jQuery(
130
+ '#shipping_first_name'
131
+ ).val();
132
+ var wcf_shipping_last_name = jQuery(
133
+ '#shipping_last_name'
134
+ ).val();
135
+ var wcf_shipping_company = jQuery( '#shipping_company' ).val();
136
+ var wcf_shipping_country = jQuery( '#shipping_country' ).val();
137
+ var wcf_shipping_address_1 = jQuery(
138
+ '#shipping_address_1'
139
+ ).val();
140
+ var wcf_shipping_address_2 = jQuery(
141
+ '#shipping_address_2'
142
+ ).val();
143
+ var wcf_shipping_city = jQuery( '#shipping_city' ).val();
144
+ var wcf_shipping_state = jQuery( '#shipping_state' ).val();
145
+ var wcf_shipping_postcode = jQuery(
146
+ '#shipping_postcode'
147
+ ).val();
148
+ var wcf_order_comments = jQuery( '#order_comments' ).val();
149
+
150
+ var data = {
151
+ action: 'cartflows_save_cart_abandonment_data',
152
+ wcf_email: wcf_email,
153
+ wcf_name: wcf_name,
154
+ wcf_surname: wcf_surname,
155
+ wcf_phone: wcf_phone,
156
+ wcf_country: wcf_country,
157
+ wcf_city: wcf_city,
158
+ wcf_billing_company: wcf_billing_company,
159
+ wcf_billing_address_1: wcf_billing_address_1,
160
+ wcf_billing_address_2: wcf_billing_address_2,
161
+ wcf_billing_state: wcf_billing_state,
162
+ wcf_billing_postcode: wcf_billing_postcode,
163
+ wcf_shipping_first_name: wcf_shipping_first_name,
164
+ wcf_shipping_last_name: wcf_shipping_last_name,
165
+ wcf_shipping_company: wcf_shipping_company,
166
+ wcf_shipping_country: wcf_shipping_country,
167
+ wcf_shipping_address_1: wcf_shipping_address_1,
168
+ wcf_shipping_address_2: wcf_shipping_address_2,
169
+ wcf_shipping_city: wcf_shipping_city,
170
+ wcf_shipping_state: wcf_shipping_state,
171
+ wcf_shipping_postcode: wcf_shipping_postcode,
172
+ wcf_order_comments: wcf_order_comments,
173
+ security: CartFlowsProCAVars._nonce,
174
+ wcf_post_id: CartFlowsProCAVars._post_id,
175
+ };
176
+
177
+ timer = setTimeout( function () {
178
+ if (
179
+ wcf_cart_abandonment._validate_email( data.wcf_email )
180
+ ) {
181
+ jQuery.post(
182
+ CartFlowsProCAVars.ajaxurl,
183
+ data, //Ajaxurl coming from localized script and contains the link to wp-admin/admin-ajax.php file that handles AJAX requests on Wordpress
184
+ function ( response ) {
185
+ // success response
186
+ }
187
+ );
188
+ }
189
+ }, 500 );
190
+ } else {
191
+ //console.log("Not a valid e-mail or phone address");
192
+ }
193
+ },
194
+ };
195
+
196
+ wcf_cart_abandonment.init();
197
+ } )( jQuery );
modules/cart-abandonment/class-cartflows-ca-cart-abandonment-table.php CHANGED
@@ -180,18 +180,18 @@ class Cartflows_Ca_Cart_Abandonment_Table extends WP_List_Table {
180
  $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_STRING );
181
  $search_term = filter_input( INPUT_GET, 'search_term', FILTER_SANITIZE_STRING );
182
 
 
 
183
  $paged = $paged ? max( 0, $paged - 1 ) : 0;
184
  $orderby = ( $orderby && in_array( $orderby, array_keys( $this->get_sortable_columns() ), true ) ) ? $orderby : 'id';
185
  $order = ( $order && in_array( $order, array( 'asc', 'desc' ), true ) ) ? $order : 'desc';
186
 
187
  $this->items = $wpdb->get_results(
188
- $wpdb->prepare( "SELECT * FROM {$cart_abandonment_table_name} WHERE `order_status` = %s AND DATE(`time`) >= %s AND DATE(`time`) <= %s AND `email` LIKE '%%%s%%' ORDER BY %s %s LIMIT %d OFFSET %d", //phpcs:ignore
189
  $cart_type,
190
  $from_date,
191
  $to_date,
192
  $wpdb->esc_like( $search_term ),
193
- $orderby,
194
- $order,
195
  $per_page,
196
  $paged * $per_page
197
  ),
@@ -213,13 +213,11 @@ class Cartflows_Ca_Cart_Abandonment_Table extends WP_List_Table {
213
  if ( $export_data ) {
214
 
215
  $this->items = $wpdb->get_results(
216
- $wpdb->prepare( "SELECT * FROM {$cart_abandonment_table_name} WHERE `order_status` = %s AND DATE(`time`) >= %s AND DATE(`time`) <= %s AND `email` LIKE '%%%s%%' ORDER BY %s %s", //phpcs:ignore
217
  $cart_type,
218
  $from_date,
219
  $to_date,
220
- $wpdb->esc_like( $search_term ),
221
- $orderby,
222
- $order
223
  ),
224
  ARRAY_A
225
  );
180
  $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_STRING );
181
  $search_term = filter_input( INPUT_GET, 'search_term', FILTER_SANITIZE_STRING );
182
 
183
+ $orderby = strtolower( str_replace( ' ', '_', $orderby ) );
184
+
185
  $paged = $paged ? max( 0, $paged - 1 ) : 0;
186
  $orderby = ( $orderby && in_array( $orderby, array_keys( $this->get_sortable_columns() ), true ) ) ? $orderby : 'id';
187
  $order = ( $order && in_array( $order, array( 'asc', 'desc' ), true ) ) ? $order : 'desc';
188
 
189
  $this->items = $wpdb->get_results(
190
+ $wpdb->prepare( "SELECT * FROM {$cart_abandonment_table_name} WHERE `order_status` = %s AND DATE(`time`) >= %s AND DATE(`time`) <= %s AND `email` LIKE '%%%s%%' ORDER BY {$orderby} {$order} LIMIT %d OFFSET %d", //phpcs:ignore
191
  $cart_type,
192
  $from_date,
193
  $to_date,
194
  $wpdb->esc_like( $search_term ),
 
 
195
  $per_page,
196
  $paged * $per_page
197
  ),
213
  if ( $export_data ) {
214
 
215
  $this->items = $wpdb->get_results(
216
+ $wpdb->prepare( "SELECT * FROM {$cart_abandonment_table_name} WHERE `order_status` = %s AND DATE(`time`) >= %s AND DATE(`time`) <= %s AND `email` LIKE '%%%s%%' ORDER BY {$orderby} {$order}", //phpcs:ignore
217
  $cart_type,
218
  $from_date,
219
  $to_date,
220
+ $wpdb->esc_like( $search_term )
 
 
221
  ),
222
  ARRAY_A
223
  );
modules/cart-abandonment/class-cartflows-ca-cart-abandonment.php CHANGED
@@ -133,11 +133,12 @@ class Cartflows_Ca_Cart_Abandonment {
133
  wc_get_template(
134
  'emails/admin-new-order.php',
135
  array(
136
- 'order' => $order,
137
- 'email_heading' => $email_heading,
138
- 'sent_to_admin' => false,
139
- 'plain_text' => false,
140
- 'email' => true,
 
141
  )
142
  );
143
 
@@ -1916,9 +1917,16 @@ class Cartflows_Ca_Cart_Abandonment {
1916
  $id = 0 !== $cart_item['variation_id'] ? $cart_item['variation_id'] : $cart_item['product_id'];
1917
  $image_url = get_the_post_thumbnail_url( $id );
1918
  $image_url = ! empty( $image_url ) ? $image_url : get_the_post_thumbnail_url( $cart_item['product_id'] );
1919
- $tr = $tr . '<tr style=' . $style . ' align="center">
 
 
 
 
 
 
 
1920
  <td style="' . $style . '"><img class="demo_img" style="' . $product_image_style . '" src="' . esc_url( $image_url ) . '"></td>
1921
- <td style="' . $style . '">' . get_the_title( $id ) . '</td>
1922
  <td style="' . $style . '"> ' . $cart_item['quantity'] . ' </td>
1923
  <td style="' . $style . '">' . $currency_symbol . number_format_i18n( $cart_item['line_total'], 2 ) . '</td>
1924
  <td style="' . $style . '" >' . $currency_symbol . number_format_i18n( $cart_item['line_total'], 2 ) . '</td>
@@ -1978,9 +1986,16 @@ class Cartflows_Ca_Cart_Abandonment {
1978
  $tax = number_format_i18n( $tax + $cart_item['line_tax'], 2 );
1979
  $image_url = get_the_post_thumbnail_url( $id );
1980
  $image_url = ! empty( $image_url ) ? $image_url : get_the_post_thumbnail_url( $cart_item['product_id'] );
1981
- $tr = $tr . '<tr align="center">
 
 
 
 
 
 
 
1982
  <td ><img class="demo_img" width="42" height="42" src=" ' . esc_url( $image_url ) . ' "/></td>
1983
- <td >' . get_the_title( $id ) . '</td>
1984
  <td > ' . $cart_item['quantity'] . ' </td>
1985
  <td >' . $currency_symbol . number_format_i18n( $cart_item['line_total'], 2 ) . '</td>
1986
  <td >' . $currency_symbol . number_format_i18n( $cart_item['line_total'], 2 ) . '</td>
133
  wc_get_template(
134
  'emails/admin-new-order.php',
135
  array(
136
+ 'order' => $order,
137
+ 'email_heading' => $email_heading,
138
+ 'sent_to_admin' => false,
139
+ 'plain_text' => false,
140
+ 'email' => true,
141
+ 'additional_content' => '',
142
  )
143
  );
144
 
1917
  $id = 0 !== $cart_item['variation_id'] ? $cart_item['variation_id'] : $cart_item['product_id'];
1918
  $image_url = get_the_post_thumbnail_url( $id );
1919
  $image_url = ! empty( $image_url ) ? $image_url : get_the_post_thumbnail_url( $cart_item['product_id'] );
1920
+
1921
+ $product = wc_get_product( $id );
1922
+ $product_name = $product ? $product->get_formatted_name() : '';
1923
+
1924
+ if ( empty( $image_url ) ) {
1925
+ $image_url = CARTFLOWS_CA_URL . '/assets/images/image-placeholder.png';
1926
+ }
1927
+ $tr = $tr . '<tr style=' . $style . ' align="center">
1928
  <td style="' . $style . '"><img class="demo_img" style="' . $product_image_style . '" src="' . esc_url( $image_url ) . '"></td>
1929
+ <td style="' . $style . '">' . $product_name . '</td>
1930
  <td style="' . $style . '"> ' . $cart_item['quantity'] . ' </td>
1931
  <td style="' . $style . '">' . $currency_symbol . number_format_i18n( $cart_item['line_total'], 2 ) . '</td>
1932
  <td style="' . $style . '" >' . $currency_symbol . number_format_i18n( $cart_item['line_total'], 2 ) . '</td>
1986
  $tax = number_format_i18n( $tax + $cart_item['line_tax'], 2 );
1987
  $image_url = get_the_post_thumbnail_url( $id );
1988
  $image_url = ! empty( $image_url ) ? $image_url : get_the_post_thumbnail_url( $cart_item['product_id'] );
1989
+
1990
+ $product = wc_get_product( $id );
1991
+ $product_name = $product ? $product->get_formatted_name() : '';
1992
+
1993
+ if ( empty( $image_url ) ) {
1994
+ $image_url = CARTFLOWS_CA_URL . '/assets/images/image-placeholder.png';
1995
+ }
1996
+ $tr = $tr . '<tr align="center">
1997
  <td ><img class="demo_img" width="42" height="42" src=" ' . esc_url( $image_url ) . ' "/></td>
1998
+ <td >' . $product_name . '</td>
1999
  <td > ' . $cart_item['quantity'] . ' </td>
2000
  <td >' . $currency_symbol . number_format_i18n( $cart_item['line_total'], 2 ) . '</td>
2001
  <td >' . $currency_symbol . number_format_i18n( $cart_item['line_total'], 2 ) . '</td>
modules/cart-abandonment/class-cartflows-ca-email-templates-table.php CHANGED
@@ -158,6 +158,8 @@ class Cartflows_Ca_Email_Templates_Table extends WP_List_Table {
158
  $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_STRING );
159
  $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_STRING );
160
 
 
 
161
  $paged = $paged ? max( 0, $paged - 1 ) : 0;
162
  $orderby = ( $orderby && in_array( $orderby, array_keys( $this->get_sortable_columns() ), true ) ) ? $orderby : 'id';
163
  $order = ( $order && in_array( $order, array( 'asc', 'desc' ), true ) ) ? $order : 'desc';
@@ -171,7 +173,7 @@ class Cartflows_Ca_Email_Templates_Table extends WP_List_Table {
171
  )
172
  );
173
  $this->items = $wpdb->get_results(
174
- $wpdb->prepare( "SELECT * FROM {$cart_abandonment_template_table_name} ORDER BY $orderby $order LIMIT %d OFFSET %d", $per_page, $paged * $per_page ), // phpcs:ignore
175
  ARRAY_A
176
  );
177
  }
158
  $orderby = filter_input( INPUT_GET, 'orderby', FILTER_SANITIZE_STRING );
159
  $order = filter_input( INPUT_GET, 'order', FILTER_SANITIZE_STRING );
160
 
161
+ $orderby = strtolower( str_replace( ' ', '_', $orderby ) );
162
+
163
  $paged = $paged ? max( 0, $paged - 1 ) : 0;
164
  $orderby = ( $orderby && in_array( $orderby, array_keys( $this->get_sortable_columns() ), true ) ) ? $orderby : 'id';
165
  $order = ( $order && in_array( $order, array( 'asc', 'desc' ), true ) ) ? $order : 'desc';
173
  )
174
  );
175
  $this->items = $wpdb->get_results(
176
+ $wpdb->prepare( "SELECT * FROM {$cart_abandonment_template_table_name} ORDER BY {$orderby} {$order} LIMIT %d OFFSET %d", $per_page, $paged * $per_page ), // phpcs:ignore
177
  ARRAY_A
178
  );
179
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: sujaypawar, wpcrafter
3
  Tags: woocommerce, cart abandonment, cart recovery
4
  Requires at least: 5.4
5
- Tested up to: 5.7
6
- Stable tag: 1.2.11
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -128,6 +128,12 @@ Here are few thoughts behind making it available for free:
128
 
129
  == Changelog ==
130
 
 
 
 
 
 
 
131
  = Version 1.2.11 - Monday, 08th March 2021 =
132
  * Improvement: WordPress 5.7 compatibility.
133
  * Improvement: Removed jQuery3 deprecated function notices.
2
  Contributors: sujaypawar, wpcrafter
3
  Tags: woocommerce, cart abandonment, cart recovery
4
  Requires at least: 5.4
5
+ Tested up to: 5.7.1
6
+ Stable tag: 1.2.12
7
  Requires PHP: 5.6
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
128
 
129
  == Changelog ==
130
 
131
+ = Version 1.2.12 - Thursday, 29th April 2021 =
132
+ * Improvement: Added the placeholder image for the product image.
133
+ * Fix: PHP error while notifying recovery to admin.
134
+ * Fix: Products Custom attributes not showing in product column.
135
+ * Fix: Orders list was not sorting.
136
+
137
  = Version 1.2.11 - Monday, 08th March 2021 =
138
  * Improvement: WordPress 5.7 compatibility.
139
  * Improvement: Removed jQuery3 deprecated function notices.
woo-cart-abandonment-recovery.php CHANGED
@@ -3,12 +3,12 @@
3
  * Plugin Name: WooCommerce Cart Abandonment Recovery
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Recover your lost revenue. Capture email address of users on the checkout page and send follow up emails if they don't complete the purchase.
6
- * Version: 1.2.11
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: woo-cart-abandonment-recovery
10
  * WC requires at least: 3.0
11
- * WC tested up to: 5.0.0
12
  *
13
  * @package Woocommerce-Cart-Abandonment-Recovery
14
  */
3
  * Plugin Name: WooCommerce Cart Abandonment Recovery
4
  * Plugin URI: https://cartflows.com/
5
  * Description: Recover your lost revenue. Capture email address of users on the checkout page and send follow up emails if they don't complete the purchase.
6
+ * Version: 1.2.12
7
  * Author: CartFlows Inc
8
  * Author URI: https://cartflows.com/
9
  * Text Domain: woo-cart-abandonment-recovery
10
  * WC requires at least: 3.0
11
+ * WC tested up to: 5.2.2
12
  *
13
  * @package Woocommerce-Cart-Abandonment-Recovery
14
  */