Version Description
Download this release
Release Info
Developer | ashokrane |
Plugin | Abandoned Cart Lite for WooCommerce |
Version | 3.4 |
Comparing to | |
See all releases |
Code changes from version 2.6 to 3.4
- css/view.abadoned.orders.style.css → assets/css/view.abandoned.orders.style.css +43 -43
- {images → assets/images}/abandoned_cart_small.png +0 -0
- {images → assets/images}/ac_editor_icon.png +0 -0
- {images → assets/images}/ac_tab_icon.png +0 -0
- {images → assets/images}/check.jpg +0 -0
- {images → assets/images}/copy.png +0 -0
- {images → assets/images}/delete.png +0 -0
- {images → assets/images}/edit.png +0 -0
- {images → assets/images}/handbag.jpg +0 -0
- {images → assets/images}/shoes.jpg +0 -0
- {images → assets/images}/spectre.jpg +0 -0
- {js → assets/js}/abandoncart_plugin_button.js +65 -58
- {js → assets/js}/jquery.tipTip.minified.js +20 -20
- class-abandoned-orders-table.php +0 -438
- class-product-report-table.php +0 -301
- class-recover-orders-table.php +0 -404
- class-templates-table.php +0 -295
- cron/send_email.php +0 -447
- cron/wcal_send_email.php +491 -0
- {languages → i18n/languages}/woocommerce-ac-de_DE.mo +0 -0
- {languages → i18n/languages}/woocommerce-ac-de_DE.po +283 -283
- {languages → i18n/languages}/woocommerce-ac-he_IL.mo +0 -0
- {languages → i18n/languages}/woocommerce-ac-he_IL.po +281 -281
- {languages → i18n/languages}/woocommerce-ac-sk_SK.mo +0 -0
- {languages → i18n/languages}/woocommerce-ac-sk_SK.po +283 -283
- {languages → i18n/languages}/woocommerce-ac.mo +0 -0
- i18n/languages/woocommerce-ac.po +500 -0
- i18n/languages/woocommerce-ac.pot +505 -0
- includes/classes/class-wcal-abandoned-orders-table.php +392 -0
- includes/classes/class-wcal-aes-counter.php +171 -0
- includes/classes/class-wcal-aes.php +190 -0
- includes/classes/class-wcal-product-report-table.php +258 -0
- includes/classes/class-wcal-recover-orders-table.php +371 -0
- includes/classes/class-wcal-templates-table.php +260 -0
- actions.php → includes/wcal_actions.php +45 -45
- includes/wcal_class-guest.php +235 -0
- default-settings.php → includes/wcal_default-settings.php +54 -56
- languages/messages.pot +0 -268
- languages/woocommerce-ac.po +0 -269
- pagination.class.php +0 -204
- readme.txt +248 -195
- screenshot-1.png +0 -0
- screenshot-2.png +0 -0
- screenshot-3.png +0 -0
- screenshot-4.png +0 -0
- screenshot-5.png +0 -0
- views/wacp-email-template-preview.php +0 -52
- views/wacp-wc-email-template-preview.php +0 -47
- views/wcal-email-template-preview.php +50 -0
- views/wcal-wc-email-template-preview.php +45 -0
- woo-includes/class-wc-dependencies.php +0 -29
- woo-includes/woo-functions.php +0 -97
- woocommerce-ac.php +2887 -2713
- woocommerce_guest_ac.class.php +0 -208
css/view.abadoned.orders.style.css → assets/css/view.abandoned.orders.style.css
RENAMED
@@ -1,44 +1,44 @@
|
|
1 |
-
/* Decrease the width of the Id column */
|
2 |
-
table.wp-list-table .column-id {
|
3 |
-
width:5%;
|
4 |
-
}
|
5 |
-
/* Decrease the width of the cutomer name column
|
6 |
-
table.wp-list-table .column-customer {
|
7 |
-
width:12%;
|
8 |
-
}*/
|
9 |
-
/* Decrease the width of the email column*/
|
10 |
-
table.wp-list-table .column-email {
|
11 |
-
width:15%;
|
12 |
-
}
|
13 |
-
|
14 |
-
/* Decrease the width of the abandoned order date column */
|
15 |
-
table.wp-list-table .column-date {
|
16 |
-
width:20%;
|
17 |
-
}
|
18 |
-
|
19 |
-
/* Decrease the width of the abandoned order total column */
|
20 |
-
table.wp-list-table .column-order_total {
|
21 |
-
width:20%;
|
22 |
-
}
|
23 |
-
|
24 |
-
/* This is for the new cart and checkout button in tinymce */
|
25 |
-
#woocommerce_ac_email_body_abandoncart_email_variables_css{
|
26 |
-
|
27 |
-
width : 60px !important;
|
28 |
-
}
|
29 |
-
|
30 |
-
span.mce_abandoncart_email_variables_css {
|
31 |
-
|
32 |
-
width : 60px !important;
|
33 |
-
}
|
34 |
-
|
35 |
-
/* Decrease the width of the sr column in templates tab */
|
36 |
-
table.wp-list-table .column-sr {
|
37 |
-
width:4% !important;
|
38 |
-
}
|
39 |
-
|
40 |
-
i.mce-i-abandoncart_email_variables {
|
41 |
-
background-image: url(../images/ac_editor_icon.png) ;
|
42 |
-
width: 30px;
|
43 |
-
height: 30px;
|
44 |
}
|
1 |
+
/* Decrease the width of the Id column */
|
2 |
+
table.wp-list-table .column-id {
|
3 |
+
width:5%;
|
4 |
+
}
|
5 |
+
/* Decrease the width of the cutomer name column
|
6 |
+
table.wp-list-table .column-customer {
|
7 |
+
width:12%;
|
8 |
+
}*/
|
9 |
+
/* Decrease the width of the email column*/
|
10 |
+
table.wp-list-table .column-email {
|
11 |
+
width:15%;
|
12 |
+
}
|
13 |
+
|
14 |
+
/* Decrease the width of the abandoned order date column */
|
15 |
+
table.wp-list-table .column-date {
|
16 |
+
width:20%;
|
17 |
+
}
|
18 |
+
|
19 |
+
/* Decrease the width of the abandoned order total column */
|
20 |
+
table.wp-list-table .column-order_total {
|
21 |
+
width:20%;
|
22 |
+
}
|
23 |
+
|
24 |
+
/* This is for the new cart and checkout button in tinymce */
|
25 |
+
#woocommerce_ac_email_body_abandoncart_email_variables_css{
|
26 |
+
|
27 |
+
width : 60px !important;
|
28 |
+
}
|
29 |
+
|
30 |
+
span.mce_abandoncart_email_variables_css {
|
31 |
+
|
32 |
+
width : 60px !important;
|
33 |
+
}
|
34 |
+
|
35 |
+
/* Decrease the width of the sr column in templates tab */
|
36 |
+
table.wp-list-table .column-sr {
|
37 |
+
width:4% !important;
|
38 |
+
}
|
39 |
+
|
40 |
+
i.mce-i-abandoncart_email_variables {
|
41 |
+
background-image: url(../images/ac_editor_icon.png) ;
|
42 |
+
width: 30px;
|
43 |
+
height: 30px;
|
44 |
}
|
{images → assets/images}/abandoned_cart_small.png
RENAMED
File without changes
|
{images → assets/images}/ac_editor_icon.png
RENAMED
File without changes
|
{images → assets/images}/ac_tab_icon.png
RENAMED
File without changes
|
{images → assets/images}/check.jpg
RENAMED
File without changes
|
{images → assets/images}/copy.png
RENAMED
File without changes
|
{images → assets/images}/delete.png
RENAMED
File without changes
|
{images → assets/images}/edit.png
RENAMED
File without changes
|
{images → assets/images}/handbag.jpg
RENAMED
File without changes
|
{images → assets/images}/shoes.jpg
RENAMED
File without changes
|
{images → assets/images}/spectre.jpg
RENAMED
File without changes
|
{js → assets/js}/abandoncart_plugin_button.js
RENAMED
@@ -1,59 +1,66 @@
|
|
1 |
-
(function() {
|
2 |
-
|
3 |
-
tinymce.PluginManager.add('abandoncart', function(editor, url) {
|
4 |
-
|
5 |
-
|
6 |
-
editor.addButton('abandoncart', {
|
7 |
-
type: 'menubutton',
|
8 |
-
text: false,
|
9 |
-
icon: "abandoncart_email_variables",
|
10 |
-
menu: [
|
11 |
-
{
|
12 |
-
text: 'Customer First Name',
|
13 |
-
value: '{{customer.firstname}}',
|
14 |
-
onclick: function() {
|
15 |
-
editor.insertContent(this.value());
|
16 |
-
}
|
17 |
-
},
|
18 |
-
{
|
19 |
-
text: 'Customer Last Name',
|
20 |
-
value: '{{customer.lastname}}',
|
21 |
-
onclick: function() {
|
22 |
-
editor.insertContent(this.value());
|
23 |
-
}
|
24 |
-
},
|
25 |
-
{
|
26 |
-
text: 'Customer Full Name',
|
27 |
-
value: '{{customer.fullname}}',
|
28 |
-
onclick: function() {
|
29 |
-
editor.insertContent(this.value());
|
30 |
-
}
|
31 |
-
},
|
32 |
-
{
|
33 |
-
text: 'Product Information/Cart Content',
|
34 |
-
value: '{{products.cart}}',
|
35 |
-
onclick: function() {
|
36 |
-
editor.insertContent(this.value());
|
37 |
-
}
|
38 |
-
},
|
39 |
-
{
|
40 |
-
text: 'Cart Link',
|
41 |
-
value: '{{cart.link}}',
|
42 |
-
onclick: function() {
|
43 |
-
editor.insertContent(this.value());
|
44 |
-
}
|
45 |
-
},
|
46 |
-
{
|
47 |
-
text: 'Date when Cart was abandoned',
|
48 |
-
value: '{{cart.abandoned_date}}',
|
49 |
-
onclick: function() {
|
50 |
-
editor.insertContent(this.value());
|
51 |
-
}
|
52 |
-
}
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
})();
|
1 |
+
(function() {
|
2 |
+
|
3 |
+
tinymce.PluginManager.add('abandoncart', function(editor, url) {
|
4 |
+
|
5 |
+
|
6 |
+
editor.addButton('abandoncart', {
|
7 |
+
type: 'menubutton',
|
8 |
+
text: false,
|
9 |
+
icon: "abandoncart_email_variables",
|
10 |
+
menu: [
|
11 |
+
{
|
12 |
+
text: 'Customer First Name',
|
13 |
+
value: '{{customer.firstname}}',
|
14 |
+
onclick: function() {
|
15 |
+
editor.insertContent(this.value());
|
16 |
+
}
|
17 |
+
},
|
18 |
+
{
|
19 |
+
text: 'Customer Last Name',
|
20 |
+
value: '{{customer.lastname}}',
|
21 |
+
onclick: function() {
|
22 |
+
editor.insertContent(this.value());
|
23 |
+
}
|
24 |
+
},
|
25 |
+
{
|
26 |
+
text: 'Customer Full Name',
|
27 |
+
value: '{{customer.fullname}}',
|
28 |
+
onclick: function() {
|
29 |
+
editor.insertContent(this.value());
|
30 |
+
}
|
31 |
+
},
|
32 |
+
{
|
33 |
+
text: 'Product Information/Cart Content',
|
34 |
+
value: '{{products.cart}}',
|
35 |
+
onclick: function() {
|
36 |
+
editor.insertContent(this.value());
|
37 |
+
}
|
38 |
+
},
|
39 |
+
{
|
40 |
+
text: 'Cart Link',
|
41 |
+
value: '{{cart.link}}',
|
42 |
+
onclick: function() {
|
43 |
+
editor.insertContent(this.value());
|
44 |
+
}
|
45 |
+
},
|
46 |
+
{
|
47 |
+
text: 'Date when Cart was abandoned',
|
48 |
+
value: '{{cart.abandoned_date}}',
|
49 |
+
onclick: function() {
|
50 |
+
editor.insertContent(this.value());
|
51 |
+
}
|
52 |
+
},
|
53 |
+
{
|
54 |
+
text: 'Unsubscribe Link',
|
55 |
+
value: '{{cart.unsubscribe}}',
|
56 |
+
onclick: function() {
|
57 |
+
editor.insertContent(this.value());
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
]
|
62 |
+
});
|
63 |
+
|
64 |
+
});
|
65 |
+
|
66 |
})();
|
{js → assets/js}/jquery.tipTip.minified.js
RENAMED
@@ -1,21 +1,21 @@
|
|
1 |
-
/*
|
2 |
-
* TipTip
|
3 |
-
* Copyright 2010 Drew Wilson
|
4 |
-
* www.drewwilson.com
|
5 |
-
* code.drewwilson.com/entry/tiptip-jquery-plugin
|
6 |
-
*
|
7 |
-
* Version 1.3 - Updated: Mar. 23, 2010
|
8 |
-
*
|
9 |
-
* This Plug-In will create a custom tooltip to replace the default
|
10 |
-
* browser tooltip. It is extremely lightweight and very smart in
|
11 |
-
* that it detects the edges of the browser window and will make sure
|
12 |
-
* the tooltip stays within the current window size. As a result the
|
13 |
-
* tooltip will adjust itself to be displayed above, below, to the left
|
14 |
-
* or to the right depending on what is necessary to stay within the
|
15 |
-
* browser window. It is completely customizable as well via CSS.
|
16 |
-
*
|
17 |
-
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
|
18 |
-
* http://www.opensource.org/licenses/mit-license.php
|
19 |
-
* http://www.gnu.org/licenses/gpl.html
|
20 |
-
*/
|
21 |
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
|
1 |
+
/*
|
2 |
+
* TipTip
|
3 |
+
* Copyright 2010 Drew Wilson
|
4 |
+
* www.drewwilson.com
|
5 |
+
* code.drewwilson.com/entry/tiptip-jquery-plugin
|
6 |
+
*
|
7 |
+
* Version 1.3 - Updated: Mar. 23, 2010
|
8 |
+
*
|
9 |
+
* This Plug-In will create a custom tooltip to replace the default
|
10 |
+
* browser tooltip. It is extremely lightweight and very smart in
|
11 |
+
* that it detects the edges of the browser window and will make sure
|
12 |
+
* the tooltip stays within the current window size. As a result the
|
13 |
+
* tooltip will adjust itself to be displayed above, below, to the left
|
14 |
+
* or to the right depending on what is necessary to stay within the
|
15 |
+
* browser window. It is completely customizable as well via CSS.
|
16 |
+
*
|
17 |
+
* This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
|
18 |
+
* http://www.opensource.org/licenses/mit-license.php
|
19 |
+
* http://www.gnu.org/licenses/gpl.html
|
20 |
+
*/
|
21 |
(function($){$.fn.tipTip=function(options){var defaults={activation:"hover",keepAlive:false,maxWidth:"200px",edgeOffset:3,defaultPosition:"bottom",delay:400,fadeIn:200,fadeOut:200,attribute:"title",content:false,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')))}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow")}return this.each(function(){var org_elem=$(this);if(opts.content){var org_title=opts.content}else{var org_title=org_elem.attr(opts.attribute)}if(org_title!=""){if(!opts.content){org_elem.removeAttr(opts.attribute)}var timeout=false;if(opts.activation=="hover"){org_elem.hover(function(){active_tiptip()},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}else if(opts.activation=="focus"){org_elem.focus(function(){active_tiptip()}).blur(function(){deactive_tiptip()})}else if(opts.activation=="click"){org_elem.click(function(){active_tiptip();return false}).hover(function(){},function(){if(!opts.keepAlive){deactive_tiptip()}});if(opts.keepAlive){tiptip_holder.hover(function(){},function(){deactive_tiptip()})}}function active_tiptip(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(opts.defaultPosition=="bottom"){t_class="_bottom"}else if(opts.defaultPosition=="top"){t_class="_top"}else if(opts.defaultPosition=="left"){t_class="_left"}else if(opts.defaultPosition=="right"){t_class="_right"}var right_compare=(w_compare+left)<parseInt($(window).scrollLeft());var left_compare=(tip_w+left)>parseInt($(window).width());if((right_compare&&w_compare<0)||(t_class=="_right"&&!left_compare)||(t_class=="_left"&&left<(tip_w+opts.edgeOffset+5))){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare)}else if((left_compare&&w_compare<0)||(t_class=="_left"&&!right_compare)){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare)}var top_compare=(top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop());var bottom_compare=((top+org_height)-(opts.edgeOffset+tip_h+8))<0;if(top_compare||(t_class=="_bottom"&&top_compare)||(t_class=="_top"&&!bottom_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_top"}else{t_class=t_class+"_top"}arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset))}else if(bottom_compare|(t_class=="_top"&&bottom_compare)||(t_class=="_bottom"&&!top_compare)){if(t_class=="_top"||t_class=="_bottom"){t_class="_bottom"}else{t_class=t_class+"_bottom"}arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset)}if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5}if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5}tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout)}timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn)},opts.delay)}function deactive_tiptip(){opts.exit.call(this);if(timeout){clearTimeout(timeout)}tiptip_holder.fadeOut(opts.fadeOut)}}})}})(jQuery);
|
class-abandoned-orders-table.php
DELETED
@@ -1,438 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Load WP_List_Table if not loaded
|
4 |
-
if ( ! class_exists( 'WP_List_Table' ) ) {
|
5 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
6 |
-
}
|
7 |
-
|
8 |
-
class WACP_Abandoned_Orders_Table extends WP_List_Table {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Number of results to show per page
|
12 |
-
*
|
13 |
-
* @var string
|
14 |
-
* @since 2.5.2
|
15 |
-
*/
|
16 |
-
public $per_page = 30;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* URL of this page
|
20 |
-
*
|
21 |
-
* @var string
|
22 |
-
* @since 2.5.2
|
23 |
-
*/
|
24 |
-
public $base_url;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Total number of bookings
|
28 |
-
*
|
29 |
-
* @var int
|
30 |
-
* @since 2.5.2
|
31 |
-
*/
|
32 |
-
public $total_count;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Get things started
|
36 |
-
*
|
37 |
-
* @see WP_List_Table::__construct()
|
38 |
-
*/
|
39 |
-
public function __construct() {
|
40 |
-
|
41 |
-
global $status, $page;
|
42 |
-
|
43 |
-
// Set parent defaults
|
44 |
-
parent::__construct( array(
|
45 |
-
'singular' => __( 'abandoned_order_id', 'woocommerce-ac' ), //singular name of the listed records
|
46 |
-
'plural' => __( 'abandoned_order_ids', 'woocommerce-ac' ), //plural name of the listed records
|
47 |
-
'ajax' => false // Does this table support ajax?
|
48 |
-
) );
|
49 |
-
$this->wcap_get_abadoned_orders_count_lite();
|
50 |
-
$this->process_bulk_action();
|
51 |
-
$this->base_url = admin_url( 'admin.php?page=woocommerce_ac_page' );
|
52 |
-
}
|
53 |
-
|
54 |
-
public function wcap_abadoned_order_prepare_items() {
|
55 |
-
|
56 |
-
$columns = $this->get_columns();
|
57 |
-
$hidden = array(); // No hidden columns
|
58 |
-
$sortable = $this->get_sortable_columns();
|
59 |
-
$data = $this->wacp_abandoned_cart_lite_data();
|
60 |
-
|
61 |
-
$this->_column_headers = array( $columns, $hidden, $sortable);
|
62 |
-
$total_items = $this->total_count;
|
63 |
-
|
64 |
-
if ( count($data) > 0 ){
|
65 |
-
$this->items = $data;
|
66 |
-
}else{
|
67 |
-
$this->items = '';
|
68 |
-
}
|
69 |
-
$this->set_pagination_args( array(
|
70 |
-
'total_items' => $total_items, // WE have to calculate the total number of items
|
71 |
-
'per_page' => $this->per_page, // WE have to determine how many items to show on a page
|
72 |
-
'total_pages' => ceil( $total_items / $this->per_page ) // WE have to calculate the total number of pages
|
73 |
-
)
|
74 |
-
);
|
75 |
-
}
|
76 |
-
|
77 |
-
public function get_columns() {
|
78 |
-
|
79 |
-
|
80 |
-
$columns = array();
|
81 |
-
$columns = array(
|
82 |
-
'cb' => '<input type="checkbox" />',
|
83 |
-
'id' => __( 'Id', 'woocommerce-ac' ),
|
84 |
-
'email' => __( 'Email Address', 'woocommerce-ac' ),
|
85 |
-
'customer' => __( 'Customer', 'woocommerce-ac' ),
|
86 |
-
'order_total' => __( 'Order Total', 'woocommerce-ac' ),
|
87 |
-
'date' => __( 'Abandoned Date', 'woocommerce-ac' ),
|
88 |
-
'status' => __( 'Status of Cart', 'woocommerce-ac' )
|
89 |
-
);
|
90 |
-
|
91 |
-
return apply_filters( 'wcap_abandoned_orders_columns', $columns );
|
92 |
-
}
|
93 |
-
|
94 |
-
/***
|
95 |
-
* It is used to add the check box for the items
|
96 |
-
*/
|
97 |
-
function column_cb( $item ){
|
98 |
-
|
99 |
-
$abadoned_order_id = '';
|
100 |
-
if( isset($item->id) && "" != $item->id ){
|
101 |
-
$abadoned_order_id = $item->id;
|
102 |
-
}
|
103 |
-
return sprintf(
|
104 |
-
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
105 |
-
'abandoned_order_id',
|
106 |
-
$abadoned_order_id
|
107 |
-
);
|
108 |
-
}
|
109 |
-
|
110 |
-
public function get_sortable_columns() {
|
111 |
-
$columns = array(
|
112 |
-
'date' => array( 'date', false ),
|
113 |
-
'status' => array( 'status',false),
|
114 |
-
);
|
115 |
-
return apply_filters( 'wcap_abandoned_orders_sortable_columns', $columns );
|
116 |
-
}
|
117 |
-
|
118 |
-
/**
|
119 |
-
* Render the Email Column
|
120 |
-
*
|
121 |
-
* @access public
|
122 |
-
* @since 2.4.8
|
123 |
-
* @param array $abadoned_row_info Contains all the data of the abandoned order tabs row
|
124 |
-
* @return string Data shown in the Email column
|
125 |
-
*
|
126 |
-
* This function used for individual delete of row, It is for hover effect delete.
|
127 |
-
*/
|
128 |
-
public function column_email( $abadoned_row_info ) {
|
129 |
-
|
130 |
-
$row_actions = array();
|
131 |
-
$value = '';
|
132 |
-
$abadoned_order_id = 0;
|
133 |
-
if( isset($abadoned_row_info->email) ){
|
134 |
-
|
135 |
-
$abadoned_order_id = $abadoned_row_info->id ;
|
136 |
-
$row_actions['delete'] = '<a href="' . wp_nonce_url( add_query_arg( array( 'action' => 'wcap_delete', 'abandoned_order_id' => $abadoned_row_info->id ), $this->base_url ), 'abandoned_order_nonce') . '">' . __( 'Delete', 'woocommerce-ac' ) . '</a>';
|
137 |
-
|
138 |
-
$email = $abadoned_row_info->email;
|
139 |
-
|
140 |
-
$value = $email . $this->row_actions( $row_actions );
|
141 |
-
|
142 |
-
}
|
143 |
-
|
144 |
-
return apply_filters( 'wcap_abandoned_orders_single_column', $value, $abadoned_order_id, 'email' );
|
145 |
-
}
|
146 |
-
|
147 |
-
/***
|
148 |
-
* This function used to get the abadoned orders count
|
149 |
-
*/
|
150 |
-
public function wcap_get_abadoned_orders_count_lite() {
|
151 |
-
|
152 |
-
global $wpdb;
|
153 |
-
$results = array();
|
154 |
-
|
155 |
-
$blank_cart_info = '{"cart":[]}';
|
156 |
-
$blank_cart_info_guest = '[]';
|
157 |
-
|
158 |
-
// non-multisite - regular table name
|
159 |
-
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email
|
160 |
-
FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
|
161 |
-
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
162 |
-
WHERE recovered_cart = '0'
|
163 |
-
AND wpac.abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND wpac.abandoned_cart_info NOT LIKE '$blank_cart_info_guest' ORDER BY wpac.abandoned_cart_time DESC";
|
164 |
-
|
165 |
-
$results = $wpdb->get_results($query);
|
166 |
-
|
167 |
-
$abadoned_orders = count($results);
|
168 |
-
$this->total_count = $abadoned_orders;
|
169 |
-
}
|
170 |
-
public function wacp_abandoned_cart_lite_data() {
|
171 |
-
global $wpdb;
|
172 |
-
|
173 |
-
$return_bookings = array();
|
174 |
-
$per_page = $this->per_page;
|
175 |
-
$results = array();
|
176 |
-
|
177 |
-
$blank_cart_info = '{"cart":[]}';
|
178 |
-
$blank_cart_info_guest = '[]';
|
179 |
-
|
180 |
-
// non-multisite - regular table name
|
181 |
-
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email
|
182 |
-
FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
|
183 |
-
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
184 |
-
WHERE recovered_cart = '0'
|
185 |
-
AND wpac.abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND wpac.abandoned_cart_info NOT LIKE '$blank_cart_info_guest' ORDER BY wpac.abandoned_cart_time DESC";
|
186 |
-
|
187 |
-
$results = $wpdb->get_results($query);
|
188 |
-
|
189 |
-
$i = 0;
|
190 |
-
|
191 |
-
foreach ( $results as $key => $value ) {
|
192 |
-
|
193 |
-
$return_abadoned_orders[$i] = new stdClass();
|
194 |
-
|
195 |
-
if ( $value->user_type == "GUEST" ) {
|
196 |
-
$query_guest = "SELECT * from `" . $wpdb->prefix . "ac_guest_abandoned_cart_history_lite` WHERE id = %d";
|
197 |
-
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $value->user_id ) );
|
198 |
-
}
|
199 |
-
$abandoned_order_id = $value->id;
|
200 |
-
$user_id = $value->user_id;
|
201 |
-
$user_login = $value->user_login;
|
202 |
-
|
203 |
-
if ( $value->user_type == "GUEST" ) {
|
204 |
-
|
205 |
-
if ( isset( $results_guest[0]->email_id ) ) $user_email = $results_guest[0]->email_id;
|
206 |
-
|
207 |
-
if ( isset( $results_guest[0]->billing_first_name ) ) $user_first_name = $results_guest[0]->billing_first_name;
|
208 |
-
else $user_first_name = "";
|
209 |
-
|
210 |
-
if ( isset( $results_guest[0]->billing_last_name ) ) $user_last_name = $results_guest[0]->billing_last_name;
|
211 |
-
else $user_last_name = "";
|
212 |
-
|
213 |
-
} else {
|
214 |
-
|
215 |
-
$user_email_temp = get_user_meta($value->user_id, 'billing_email');
|
216 |
-
if ( isset( $user_email_temp[0] ) ) {
|
217 |
-
$user_email = $user_email_temp[0];
|
218 |
-
}else {
|
219 |
-
$user_email = "";
|
220 |
-
}
|
221 |
-
|
222 |
-
$user_first_name_temp = get_user_meta($value->user_id, 'first_name');
|
223 |
-
if ( isset( $user_first_name_temp[0] ) ) {
|
224 |
-
$user_first_name = $user_first_name_temp[0];
|
225 |
-
}else {
|
226 |
-
$user_first_name = "";
|
227 |
-
}
|
228 |
-
|
229 |
-
$user_last_name_temp = get_user_meta($value->user_id, 'last_name');
|
230 |
-
if ( isset( $user_last_name_temp[0] ) ) {
|
231 |
-
$user_last_name = $user_last_name_temp[0];
|
232 |
-
}else {
|
233 |
-
$user_last_name = "";
|
234 |
-
}
|
235 |
-
}
|
236 |
-
|
237 |
-
$cart_info = json_decode( $value->abandoned_cart_info );
|
238 |
-
$order_date = "";
|
239 |
-
$cart_update_time = $value->abandoned_cart_time;
|
240 |
-
|
241 |
-
if ( $cart_update_time != "" && $cart_update_time != 0 ) {
|
242 |
-
$order_date = date( 'd M, Y h:i A', $cart_update_time );
|
243 |
-
}
|
244 |
-
|
245 |
-
$ac_cutoff_time = get_option( 'ac_lite_cart_abandoned_time' );
|
246 |
-
$cut_off_time = $ac_cutoff_time * 60;
|
247 |
-
$current_time = current_time( 'timestamp' );
|
248 |
-
$compare_time = $current_time - $cart_update_time;
|
249 |
-
$cart_details = array();
|
250 |
-
if( isset( $cart_info->cart ) ){
|
251 |
-
$cart_details = $cart_info->cart;
|
252 |
-
}
|
253 |
-
$line_total = 0;
|
254 |
-
|
255 |
-
if ( count( $cart_details ) > 0 ) {
|
256 |
-
|
257 |
-
foreach ( $cart_details as $k => $v ) {
|
258 |
-
|
259 |
-
if( $v->line_subtotal_tax != 0 && $v->line_subtotal_tax > 0 ) {
|
260 |
-
$line_total = $line_total + $v->line_total + $v->line_subtotal_tax;
|
261 |
-
} else {
|
262 |
-
$line_total = $line_total + $v->line_total;
|
263 |
-
}
|
264 |
-
}
|
265 |
-
}
|
266 |
-
$line_total = round( $line_total, 2 );
|
267 |
-
$quantity_total = 0;
|
268 |
-
|
269 |
-
if ( count( $cart_details ) > 0) {
|
270 |
-
|
271 |
-
foreach ( $cart_details as $k => $v ) {
|
272 |
-
$quantity_total = $quantity_total + $v->quantity;
|
273 |
-
}
|
274 |
-
}
|
275 |
-
|
276 |
-
if ( 1 == $quantity_total ) {
|
277 |
-
$item_disp = __("item", "woocommerce-ac");
|
278 |
-
} else {
|
279 |
-
$item_disp = __("items", "woocommerce-ac");
|
280 |
-
}
|
281 |
-
|
282 |
-
if( $value->cart_ignored == 0 && $value->recovered_cart == 0 ) {
|
283 |
-
$ac_status = __("Abandoned", "woocommerce-ac");
|
284 |
-
} elseif( $value->cart_ignored == 1 && $value->recovered_cart == 0 ) {
|
285 |
-
$ac_status = __("Abandoned but new","woocommerce-ac")."</br>". __("cart created after this", "woocommerce-ac");
|
286 |
-
} else {
|
287 |
-
$ac_status = "";
|
288 |
-
}
|
289 |
-
|
290 |
-
if ( $compare_time > $cut_off_time && $ac_status != "" ) {
|
291 |
-
|
292 |
-
if( $quantity_total > 0 ) {
|
293 |
-
|
294 |
-
$abandoned_order_id = $abandoned_order_id;
|
295 |
-
$customer_information = $user_first_name . " ".$user_last_name;
|
296 |
-
$return_abadoned_orders[ $i ]->id = $abandoned_order_id;
|
297 |
-
$return_abadoned_orders[ $i ]->email = $user_email;
|
298 |
-
$return_abadoned_orders[ $i ]->customer = $customer_information;
|
299 |
-
$return_abadoned_orders[ $i ]->order_total = get_woocommerce_currency_symbol() . "" . $line_total;
|
300 |
-
$return_abadoned_orders[ $i ]->date = $order_date;
|
301 |
-
$return_abadoned_orders[ $i ]->status = $ac_status;
|
302 |
-
|
303 |
-
}
|
304 |
-
$i++;
|
305 |
-
}
|
306 |
-
|
307 |
-
}
|
308 |
-
|
309 |
-
// sort for order date
|
310 |
-
if (isset($_GET['orderby']) && $_GET['orderby'] == 'date') {
|
311 |
-
if (isset($_GET['order']) && $_GET['order'] == 'asc') {
|
312 |
-
usort( $return_abadoned_orders, array( __CLASS__ ,"wcap_class_order_date_asc") );
|
313 |
-
}
|
314 |
-
else {
|
315 |
-
usort( $return_abadoned_orders, array( __CLASS__ ,"wcap_class_order_date_dsc") );
|
316 |
-
}
|
317 |
-
}
|
318 |
-
|
319 |
-
// sort for customer name
|
320 |
-
else if ( isset( $_GET['orderby']) && $_GET['orderby'] == 'status' ) {
|
321 |
-
if ( isset( $_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
322 |
-
usort( $return_abadoned_orders, array( __CLASS__ ,"wcap_class_status_asc" ) );
|
323 |
-
}
|
324 |
-
else {
|
325 |
-
usort( $return_abadoned_orders, array( __CLASS__ ,"wcap_class_status_dsc" ) );
|
326 |
-
}
|
327 |
-
}
|
328 |
-
|
329 |
-
if (isset($_GET['paged']) && $_GET['paged'] > 1) {
|
330 |
-
$page_number = $_GET['paged'] - 1;
|
331 |
-
$k = $per_page * $page_number;
|
332 |
-
}
|
333 |
-
else {
|
334 |
-
$k = 0;
|
335 |
-
}
|
336 |
-
$return_abadoned_orders_display = array();
|
337 |
-
for ($j = $k;$j < ($k+$per_page);$j++) {
|
338 |
-
if (isset($return_abadoned_orders[$j])) {
|
339 |
-
$return_abadoned_orders_display[$j] = $return_abadoned_orders[$j];
|
340 |
-
}
|
341 |
-
else {
|
342 |
-
break;
|
343 |
-
}
|
344 |
-
}
|
345 |
-
return apply_filters( 'wcap_abandoned_orders_table_data', $return_abadoned_orders_display );
|
346 |
-
}
|
347 |
-
function wcap_class_order_date_asc($value1,$value2) {
|
348 |
-
|
349 |
-
$date_two = $date_one = '';
|
350 |
-
$value_one = $value1->date;
|
351 |
-
$value_two = $value2->date;
|
352 |
-
|
353 |
-
$date_formatted_one = date_create_from_format( 'd M, Y h:i A', $value_one );
|
354 |
-
if ( isset( $date_formatted_one ) && $date_formatted_one != '' ) {
|
355 |
-
$date_one = date_format( $date_formatted_one, 'Y-m-d' );
|
356 |
-
}
|
357 |
-
|
358 |
-
$date_formatted_two = date_create_from_format( 'd M, Y h:i A', $value_two );
|
359 |
-
if ( isset( $date_formatted_two ) && $date_formatted_two != '' ) {
|
360 |
-
$date_two = date_format( $date_formatted_two, 'Y-m-d' );
|
361 |
-
}
|
362 |
-
return strtotime($date_one) - strtotime($date_two);
|
363 |
-
}
|
364 |
-
function wcap_class_order_date_dsc($value1,$value2) {
|
365 |
-
|
366 |
-
$date_two = $date_one = '';
|
367 |
-
$value_one = $value1->date;
|
368 |
-
$value_two = $value2->date;
|
369 |
-
|
370 |
-
$date_formatted_one = date_create_from_format( 'd M, Y h:i A', $value_one );
|
371 |
-
if ( isset( $date_formatted_one ) && $date_formatted_one != '' ) {
|
372 |
-
$date_one = date_format( $date_formatted_one, 'Y-m-d' );
|
373 |
-
}
|
374 |
-
|
375 |
-
$date_formatted_two = date_create_from_format( 'd M, Y h:i A', $value_two );
|
376 |
-
if ( isset( $date_formatted_two ) && $date_formatted_two != '' ) {
|
377 |
-
$date_two = date_format( $date_formatted_two, 'Y-m-d' );
|
378 |
-
}
|
379 |
-
|
380 |
-
return strtotime($date_two) - strtotime($date_one);
|
381 |
-
}
|
382 |
-
|
383 |
-
function wcap_class_status_asc($value1,$value2) {
|
384 |
-
return strcasecmp($value1->status,$value2->status );
|
385 |
-
}
|
386 |
-
|
387 |
-
function wcap_class_status_dsc ($value1,$value2) {
|
388 |
-
return strcasecmp($value2->status,$value1->status );
|
389 |
-
}
|
390 |
-
|
391 |
-
public function column_default( $wcap_abadoned_orders, $column_name ) {
|
392 |
-
$value = '';
|
393 |
-
switch ( $column_name ) {
|
394 |
-
case 'id' :
|
395 |
-
if(isset($wcap_abadoned_orders->id)){
|
396 |
-
$value = '<strong><a href="admin.php?page=woocommerce_ac_page&action=orderdetails&id='.$wcap_abadoned_orders->id.' ">'.$wcap_abadoned_orders->id.'</a> </strong>';
|
397 |
-
}
|
398 |
-
break;
|
399 |
-
case 'customer' :
|
400 |
-
if(isset($wcap_abadoned_orders->customer)){
|
401 |
-
$value = $wcap_abadoned_orders->customer;
|
402 |
-
}
|
403 |
-
break;
|
404 |
-
|
405 |
-
case 'order_total' :
|
406 |
-
if(isset($wcap_abadoned_orders->order_total)){
|
407 |
-
$value = $wcap_abadoned_orders->order_total;
|
408 |
-
}
|
409 |
-
break;
|
410 |
-
|
411 |
-
case 'date' :
|
412 |
-
if(isset($wcap_abadoned_orders->date)){
|
413 |
-
$value = $wcap_abadoned_orders->date;
|
414 |
-
}
|
415 |
-
break;
|
416 |
-
|
417 |
-
case 'status' :
|
418 |
-
if(isset($wcap_abadoned_orders->status)){
|
419 |
-
$value = $wcap_abadoned_orders->status;
|
420 |
-
}
|
421 |
-
break;
|
422 |
-
|
423 |
-
default:
|
424 |
-
|
425 |
-
$value = isset( $booking->$column_name ) ? $booking->$column_name : '';
|
426 |
-
break;
|
427 |
-
}
|
428 |
-
|
429 |
-
return apply_filters( 'wcap_abandoned_orders_column_default', $value, $wcap_abadoned_orders, $column_name );
|
430 |
-
}
|
431 |
-
|
432 |
-
public function get_bulk_actions() {
|
433 |
-
return array(
|
434 |
-
'wcap_delete' => __( 'Delete', 'woocommerce-ac' )
|
435 |
-
);
|
436 |
-
}
|
437 |
-
}
|
438 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class-product-report-table.php
DELETED
@@ -1,301 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if( session_id() === '' ){
|
4 |
-
//session has not started
|
5 |
-
session_start();
|
6 |
-
}
|
7 |
-
|
8 |
-
|
9 |
-
// Load WP_List_Table if not loaded
|
10 |
-
if ( ! class_exists( 'WP_List_Table' ) ) {
|
11 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
12 |
-
}
|
13 |
-
|
14 |
-
class WACP_Product_Report_Table extends WP_List_Table {
|
15 |
-
|
16 |
-
/**
|
17 |
-
* Number of results to show per page
|
18 |
-
*
|
19 |
-
* @var string
|
20 |
-
* @since 2.5.3
|
21 |
-
*/
|
22 |
-
public $per_page = 30;
|
23 |
-
|
24 |
-
/**
|
25 |
-
* URL of this page
|
26 |
-
*
|
27 |
-
* @var string
|
28 |
-
* @since 2.5.3
|
29 |
-
*/
|
30 |
-
public $base_url;
|
31 |
-
|
32 |
-
/**
|
33 |
-
* Total number of recovred orders
|
34 |
-
*
|
35 |
-
* @var int
|
36 |
-
* @since 2.5.3
|
37 |
-
*/
|
38 |
-
public $total_count;
|
39 |
-
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Total number of recovred orders
|
43 |
-
*
|
44 |
-
* @var int
|
45 |
-
* @since 2.5.3
|
46 |
-
*/
|
47 |
-
public $open_emails;
|
48 |
-
|
49 |
-
/**
|
50 |
-
* Total amount of abadoned orders
|
51 |
-
*
|
52 |
-
* @var int
|
53 |
-
* @since 2.5.3
|
54 |
-
*/
|
55 |
-
public $link_click_count;
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Total number recovred orders
|
59 |
-
*
|
60 |
-
* @var int
|
61 |
-
* @since 2.5.3
|
62 |
-
*/
|
63 |
-
public $start_date_db;
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Total number recovred orders total
|
67 |
-
*
|
68 |
-
* @var int
|
69 |
-
* @since 2.5.3
|
70 |
-
*/
|
71 |
-
public $end_date_db;
|
72 |
-
|
73 |
-
public $duration;
|
74 |
-
|
75 |
-
/**
|
76 |
-
* Get things started
|
77 |
-
*
|
78 |
-
* @see WP_List_Table::__construct()
|
79 |
-
*/
|
80 |
-
public function __construct() {
|
81 |
-
|
82 |
-
global $status, $page;
|
83 |
-
|
84 |
-
// Set parent defaults
|
85 |
-
parent::__construct( array(
|
86 |
-
'singular' => __( 'product_id', 'woocommerce-ac' ), //singular name of the listed records
|
87 |
-
'plural' => __( 'product_ids', 'woocommerce-ac' ), //plural name of the listed records
|
88 |
-
'ajax' => false // Does this table support ajax?
|
89 |
-
) );
|
90 |
-
|
91 |
-
$this->base_url = admin_url( 'admin.php?page=woocommerce_ac_page&action=stats' );
|
92 |
-
}
|
93 |
-
|
94 |
-
public function wcap_product_report_prepare_items_lite() {
|
95 |
-
|
96 |
-
$columns = $this->get_columns();
|
97 |
-
$hidden = array(); // No hidden columns
|
98 |
-
|
99 |
-
//$sortable = $this->product_report_sortable_columns();
|
100 |
-
|
101 |
-
$data = $this->wacp_product_report_lite_data ();
|
102 |
-
|
103 |
-
$total_items = $this->total_count;
|
104 |
-
$this->items = $data;
|
105 |
-
|
106 |
-
//$this->_column_headers = array( $columns, $hidden, $sortable);
|
107 |
-
$this->_column_headers = array( $columns, $hidden);
|
108 |
-
$this->set_pagination_args( array(
|
109 |
-
'total_items' => $total_items, // WE have to calculate the total number of items
|
110 |
-
'per_page' => $this->per_page, // WE have to determine how many items to show on a page
|
111 |
-
'total_pages' => ceil( $total_items / $this->per_page ) // WE have to calculate the total number of pages
|
112 |
-
)
|
113 |
-
);
|
114 |
-
|
115 |
-
}
|
116 |
-
|
117 |
-
public function get_columns() {
|
118 |
-
|
119 |
-
$columns = array(
|
120 |
-
|
121 |
-
'product_name' => __( 'Product Name', 'woocommerce-ac' ),
|
122 |
-
'abandoned_number' => __( 'Number of Times Abandoned', 'woocommerce-ac' ),
|
123 |
-
'recover_number' => __( 'Number of Times Recovered', 'woocommerce-ac' )
|
124 |
-
|
125 |
-
);
|
126 |
-
|
127 |
-
return apply_filters( 'wcap_product_report_columns', $columns );
|
128 |
-
}
|
129 |
-
|
130 |
-
// public function product_report_sortable_columns() {
|
131 |
-
// $columns = array(
|
132 |
-
// 'abandoned_number' => array( 'abandoned_number', false ),
|
133 |
-
// 'recover_number' => array( 'recover_number',false),
|
134 |
-
// );
|
135 |
-
// return apply_filters( 'wcap_product_report_columns', $columns );
|
136 |
-
// }
|
137 |
-
/**
|
138 |
-
* Render the user name Column
|
139 |
-
*
|
140 |
-
* @access public
|
141 |
-
* @since 2.5.3
|
142 |
-
* @param array $abadoned_row_info Contains all the data of the template row
|
143 |
-
* @return string Data shown in the Email column
|
144 |
-
*
|
145 |
-
* This function used for individual delete of row, It is for hover effect delete.
|
146 |
-
*/
|
147 |
-
public function wacp_product_report_lite_data () {
|
148 |
-
global $wpdb;
|
149 |
-
|
150 |
-
$wcap_class = new woocommerce_abandon_cart ();
|
151 |
-
$i = 1;
|
152 |
-
|
153 |
-
$order = "desc";
|
154 |
-
$query = "SELECT abandoned_cart_time, abandoned_cart_info, recovered_cart FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` ORDER BY recovered_cart DESC";
|
155 |
-
$recover_query = $wpdb->get_results( $query );
|
156 |
-
$rec_carts_array = array ( );
|
157 |
-
$recover_product_array = array( );
|
158 |
-
|
159 |
-
foreach ( $recover_query as $recovered_cart_key => $recovered_cart_value ) {
|
160 |
-
$recovered_cart_info = json_decode( $recovered_cart_value->abandoned_cart_info );
|
161 |
-
$recovered_cart_dat = json_decode( $recovered_cart_value->recovered_cart);
|
162 |
-
$order_date = "";
|
163 |
-
$cart_update_time = $recovered_cart_value->abandoned_cart_time;
|
164 |
-
$quantity_total = 0;
|
165 |
-
$cart_details = array();
|
166 |
-
if( isset( $recovered_cart_info->cart ) ){
|
167 |
-
$cart_details = $recovered_cart_info->cart;
|
168 |
-
}
|
169 |
-
if ( count( $cart_details ) > 0) {
|
170 |
-
|
171 |
-
foreach ( $cart_details as $k => $v ) {
|
172 |
-
|
173 |
-
$quantity_total = $quantity_total + $v->quantity;
|
174 |
-
}
|
175 |
-
}
|
176 |
-
|
177 |
-
if ( $cart_update_time != "" && $cart_update_time != 0 ) {
|
178 |
-
$order_date = date( 'd M, Y h:i A', $cart_update_time );
|
179 |
-
}
|
180 |
-
$ac_cutoff_time = get_option( 'ac_lite_cart_abandoned_time' );
|
181 |
-
$cut_off_time = $ac_cutoff_time * 60 ;
|
182 |
-
$current_time = current_time( 'timestamp' );
|
183 |
-
$compare_time = $current_time - $cart_update_time;
|
184 |
-
if ( is_array( $recovered_cart_info ) || is_object( $recovered_cart_info ) ) {
|
185 |
-
foreach ( $recovered_cart_info as $rec_cart_key => $rec_cart_value ) {
|
186 |
-
foreach ( $rec_cart_value as $rec_product_id_key => $rec_product_id_value ) {
|
187 |
-
$product_id = $rec_product_id_value->product_id;
|
188 |
-
if ( $compare_time > $cut_off_time ) {
|
189 |
-
$rec_carts_array [] = $product_id;
|
190 |
-
}
|
191 |
-
if($recovered_cart_dat != 0) {
|
192 |
-
$recover_product_array[] = $product_id;
|
193 |
-
|
194 |
-
|
195 |
-
}
|
196 |
-
}
|
197 |
-
}
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
$count = array_count_values( $rec_carts_array );
|
202 |
-
$count1 = $count;
|
203 |
-
$count_new = $wcap_class->bubble_sort_function ( $count1 ,$order );
|
204 |
-
$recover_cart = "0";
|
205 |
-
$count_css = 0;
|
206 |
-
$chunck_array = array_chunk( $count_new,10, true ); // keep True for retaing the Array Index number which is product ids in our case.
|
207 |
-
|
208 |
-
$chunck_array_value = array();
|
209 |
-
|
210 |
-
foreach ( $chunck_array as $chunck_array_key => $chunck_array_value ) {
|
211 |
-
|
212 |
-
foreach ( $chunck_array_value as $k => $v){
|
213 |
-
|
214 |
-
$return_product_report[$i] = new stdClass();
|
215 |
-
|
216 |
-
$prod_name = get_post( $k );
|
217 |
-
$product_name = $prod_name->post_title;
|
218 |
-
$abandoned_count = $v;
|
219 |
-
$recover = array_count_values( $recover_product_array );
|
220 |
-
foreach ( $recover as $ke => $ve ) {
|
221 |
-
if( array_key_exists ( $ke, $count ) ) {
|
222 |
-
|
223 |
-
if ( $ke == $k ) {
|
224 |
-
$recover_cart = $ve;
|
225 |
-
}
|
226 |
-
}
|
227 |
-
if( ! array_key_exists ( $k, $recover ) ) {
|
228 |
-
$recover_cart = "0";
|
229 |
-
}
|
230 |
-
}
|
231 |
-
|
232 |
-
$return_product_report[ $i ]->product_name = $product_name ;
|
233 |
-
$return_product_report[ $i ]->abandoned_number = $abandoned_count;
|
234 |
-
$return_product_report[ $i ]->recover_number = $recover_cart;
|
235 |
-
$return_product_report[ $i ]->product_id = $k;
|
236 |
-
$i++;
|
237 |
-
|
238 |
-
}
|
239 |
-
}
|
240 |
-
|
241 |
-
$this->total_count = count ( $chunck_array_value ) > 0 ? count ( $chunck_array_value ) : 0 ;
|
242 |
-
|
243 |
-
|
244 |
-
$per_page = $this->per_page;
|
245 |
-
|
246 |
-
if ( isset( $_GET['paged'] ) && $_GET['paged'] > 1 ) {
|
247 |
-
$page_number = $_GET['paged'] - 1;
|
248 |
-
$k = $per_page * $page_number;
|
249 |
-
}else {
|
250 |
-
$k = 1;
|
251 |
-
}
|
252 |
-
|
253 |
-
$return_product_report_display = array();
|
254 |
-
|
255 |
-
|
256 |
-
for ( $j = $k; $j < ( $k + $per_page ); $j++ ) {
|
257 |
-
|
258 |
-
if ( isset( $return_product_report[ $j ] ) ) {
|
259 |
-
$return_product_report_display[ $j ] = $return_product_report[ $j ];
|
260 |
-
}else {
|
261 |
-
break;
|
262 |
-
}
|
263 |
-
}
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
return apply_filters( 'wcap_product_report_table_data', $return_product_report_display );
|
268 |
-
}
|
269 |
-
|
270 |
-
public function column_default( $wcap_sent_emails, $column_name ) {
|
271 |
-
$value = '';
|
272 |
-
switch ( $column_name ) {
|
273 |
-
|
274 |
-
case 'product_name' :
|
275 |
-
if(isset($wcap_sent_emails->product_name)){
|
276 |
-
|
277 |
-
$value = "<a href= post.php?post=$wcap_sent_emails->product_id&action=edit title = product name > $wcap_sent_emails->product_name </a>";
|
278 |
-
}
|
279 |
-
break;
|
280 |
-
|
281 |
-
case 'abandoned_number' :
|
282 |
-
if(isset($wcap_sent_emails->abandoned_number)){
|
283 |
-
$value = $wcap_sent_emails->abandoned_number;
|
284 |
-
}
|
285 |
-
break;
|
286 |
-
|
287 |
-
case 'recover_number' :
|
288 |
-
if(isset($wcap_sent_emails->recover_number)){
|
289 |
-
$value = $wcap_sent_emails->recover_number;
|
290 |
-
}
|
291 |
-
break;
|
292 |
-
default:
|
293 |
-
|
294 |
-
$value = isset( $wcap_sent_emails->$column_name ) ? $wcap_sent_emails->$column_name : '';
|
295 |
-
break;
|
296 |
-
}
|
297 |
-
|
298 |
-
return apply_filters( 'wcap_product_report_column_default', $value, $wcap_sent_emails, $column_name );
|
299 |
-
}
|
300 |
-
}
|
301 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class-recover-orders-table.php
DELETED
@@ -1,404 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Load WP_List_Table if not loaded
|
4 |
-
if ( ! class_exists( 'WP_List_Table' ) ) {
|
5 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
6 |
-
}
|
7 |
-
|
8 |
-
class WACP_Recover_Orders_Table extends WP_List_Table {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Number of results to show per page
|
12 |
-
*
|
13 |
-
* @var string
|
14 |
-
* @since 2.5.2
|
15 |
-
*/
|
16 |
-
public $per_page = 30;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* URL of this page
|
20 |
-
*
|
21 |
-
* @var string
|
22 |
-
* @since 2.5.2
|
23 |
-
*/
|
24 |
-
public $base_url;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Total number of recovred orders
|
28 |
-
*
|
29 |
-
* @var int
|
30 |
-
* @since 2.5.2
|
31 |
-
*/
|
32 |
-
public $total_count;
|
33 |
-
|
34 |
-
|
35 |
-
/**
|
36 |
-
* Total number of recovred orders
|
37 |
-
*
|
38 |
-
* @var int
|
39 |
-
* @since 2.5.2
|
40 |
-
*/
|
41 |
-
public $total_abandoned_cart_count;
|
42 |
-
|
43 |
-
/**
|
44 |
-
* Total amount of abadoned orders
|
45 |
-
*
|
46 |
-
* @var int
|
47 |
-
* @since 2.5.2
|
48 |
-
*/
|
49 |
-
public $total_order_amount;
|
50 |
-
|
51 |
-
/**
|
52 |
-
* Total number recovred orders
|
53 |
-
*
|
54 |
-
* @var int
|
55 |
-
* @since 2.5.2
|
56 |
-
*/
|
57 |
-
public $recovered_item;
|
58 |
-
|
59 |
-
/**
|
60 |
-
* Total number recovred orders total
|
61 |
-
*
|
62 |
-
* @var int
|
63 |
-
* @since 2.5.2
|
64 |
-
*/
|
65 |
-
public $total_recover_amount;
|
66 |
-
|
67 |
-
|
68 |
-
/**
|
69 |
-
* Get things started
|
70 |
-
*
|
71 |
-
* @see WP_List_Table::__construct()
|
72 |
-
*/
|
73 |
-
public function __construct() {
|
74 |
-
|
75 |
-
global $status, $page;
|
76 |
-
|
77 |
-
// Set parent defaults
|
78 |
-
parent::__construct( array(
|
79 |
-
'singular' => __( 'rec_abandoned_id', 'woocommerce-ac' ), //singular name of the listed records
|
80 |
-
'plural' => __( 'rec_abandoned_ids', 'woocommerce-ac' ), //plural name of the listed records
|
81 |
-
'ajax' => false // Does this table support ajax?
|
82 |
-
) );
|
83 |
-
$this->wcap_get_recovered_orders_count_lite();
|
84 |
-
|
85 |
-
$this->base_url = admin_url( 'admin.php?page=woocommerce_ac_page&action=stats' );
|
86 |
-
}
|
87 |
-
|
88 |
-
public function wcap_recovered_orders_prepare_items_lite() {
|
89 |
-
|
90 |
-
$columns = $this->get_columns();
|
91 |
-
$hidden = array(); // No hidden columns
|
92 |
-
$sortable = $this->recovered_orders_get_sortable_columns();
|
93 |
-
$data = $this->wacp_recovered_orders_data_lite();
|
94 |
-
|
95 |
-
$total_items = $this->total_count;
|
96 |
-
$total_abandoned_cart_count = $this->total_abandoned_cart_count;
|
97 |
-
$total_order_amount = $this->total_order_amount;
|
98 |
-
$total_recover_amount = $this->total_recover_amount;
|
99 |
-
$recovered_item = $this->recovered_item;
|
100 |
-
$this->items = $data;
|
101 |
-
|
102 |
-
$this->_column_headers = array( $columns, $hidden, $sortable);
|
103 |
-
|
104 |
-
$this->set_pagination_args( array(
|
105 |
-
'total_items' => $total_items, // WE have to calculate the total number of items
|
106 |
-
'per_page' => $this->per_page, // WE have to determine how many items to show on a page
|
107 |
-
'total_pages' => ceil( $total_items / $this->per_page ) // WE have to calculate the total number of pages
|
108 |
-
)
|
109 |
-
);
|
110 |
-
}
|
111 |
-
|
112 |
-
public function get_columns() {
|
113 |
-
|
114 |
-
$columns = array(
|
115 |
-
|
116 |
-
'user_name' => __( 'User Name', 'woocommerce-ac' ),
|
117 |
-
'user_email_id' => __( 'User Email Address', 'woocommerce-ac' ),
|
118 |
-
'created_on' => __( 'Cart Abandoned Date', 'woocommerce-ac' ),
|
119 |
-
'recovered_date' => __( 'Cart Recovered Date' , 'woocommerce-ac'),
|
120 |
-
'order_total' => __( 'Order Total', 'woocommerce-ac' )
|
121 |
-
|
122 |
-
);
|
123 |
-
|
124 |
-
return apply_filters( 'wcap_recovered_orders_columns', $columns );
|
125 |
-
}
|
126 |
-
|
127 |
-
public function recovered_orders_get_sortable_columns() {
|
128 |
-
$columns = array(
|
129 |
-
'created_on' => array( 'created_on', false ),
|
130 |
-
'recovered_date' => array( 'recovered_date',false)
|
131 |
-
);
|
132 |
-
return apply_filters( 'wcap_templates_sortable_columns', $columns );
|
133 |
-
}
|
134 |
-
|
135 |
-
/**
|
136 |
-
* Render the user name Column
|
137 |
-
*
|
138 |
-
* @access public
|
139 |
-
* @since 2.5.2
|
140 |
-
* @param array $abadoned_row_info Contains all the data of the template row
|
141 |
-
* @return string Data shown in the Email column
|
142 |
-
*
|
143 |
-
* This function used for individual delete of row, It is for hover effect delete.
|
144 |
-
*/
|
145 |
-
public function column_user_name( $recovered_orders_row_info ) {
|
146 |
-
|
147 |
-
$row_actions = array();
|
148 |
-
$value = '';
|
149 |
-
$recovered_id = 0;
|
150 |
-
|
151 |
-
if( isset($recovered_orders_row_info->user_name ) ){
|
152 |
-
$recovered_id = $recovered_orders_row_info->recovered_id ;
|
153 |
-
$row_actions['view_details'] = "<a target=_blank href = post.php?post=$recovered_id&action=edit>". __( 'View Details', 'woocommerce-ac' )."</a>";
|
154 |
-
$user_name = $recovered_orders_row_info->user_name;
|
155 |
-
$value = $user_name . $this->row_actions( $row_actions );
|
156 |
-
}
|
157 |
-
|
158 |
-
return apply_filters( 'wcap_recovered_orders_single_column', $value, $recovered_id, 'email' );
|
159 |
-
}
|
160 |
-
|
161 |
-
/***
|
162 |
-
* This function used to get the abadoned orders count
|
163 |
-
*/
|
164 |
-
public function wcap_get_recovered_orders_count_lite() {
|
165 |
-
|
166 |
-
global $wpdb;
|
167 |
-
|
168 |
-
if ( isset( $_POST['start_date'] ) ) $start_date_range = $_POST['start_date'];
|
169 |
-
else $start_date_range = "";
|
170 |
-
|
171 |
-
if ( isset( $_POST['end_date'] ) ) $end_date_range = $_POST['end_date'];
|
172 |
-
else $end_date_range = "";
|
173 |
-
|
174 |
-
$start_date = strtotime( $start_date_range." 00:01:01" );
|
175 |
-
$end_date = strtotime( $end_date_range." 23:59:59" );
|
176 |
-
|
177 |
-
$query_ac = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite WHERE abandoned_cart_time >= %d AND abandoned_cart_time <= %d AND recovered_cart > 0 ORDER BY recovered_cart desc";
|
178 |
-
$ac_results = $wpdb->get_results( $wpdb->prepare( $query_ac, $start_date, $end_date ) );
|
179 |
-
|
180 |
-
$templates_count = count($ac_results);
|
181 |
-
$this->total_count = $templates_count;
|
182 |
-
}
|
183 |
-
|
184 |
-
public function wacp_recovered_orders_data_lite() {
|
185 |
-
global $wpdb;
|
186 |
-
|
187 |
-
$wcap_class = new woocommerce_abandon_cart ();
|
188 |
-
|
189 |
-
if ( isset( $_POST['duration_select'] ) ) $duration_range = $_POST['duration_select'];
|
190 |
-
else $duration_range = "";
|
191 |
-
|
192 |
-
if ( $duration_range == "" ) {
|
193 |
-
|
194 |
-
if ( isset( $_GET['duration_select'] ) ) $duration_range = $_GET['duration_select'];
|
195 |
-
}
|
196 |
-
|
197 |
-
if ( $duration_range == "" ) $duration_range = "last_seven";
|
198 |
-
else $duration_range = "";
|
199 |
-
|
200 |
-
if ( isset( $_POST['start_date'] ) ) $start_date_range = $_POST['start_date'];
|
201 |
-
else $start_date_range = "";
|
202 |
-
|
203 |
-
if ( $start_date_range == "" ) {
|
204 |
-
|
205 |
-
|
206 |
-
$start_date_range = $wcap_class->start_end_dates[$duration_range]['start_date'];
|
207 |
-
|
208 |
-
}
|
209 |
-
|
210 |
-
if ( isset( $_POST['end_date'] ) ) $end_date_range = $_POST['end_date'];
|
211 |
-
else $end_date_range = "";
|
212 |
-
|
213 |
-
if ( $end_date_range == "" ) {
|
214 |
-
$end_date_range = $wcap_class->start_end_dates[$duration_range]['end_date'];
|
215 |
-
}
|
216 |
-
|
217 |
-
$start_date = strtotime( $start_date_range." 00:01:01" );
|
218 |
-
$end_date = strtotime( $end_date_range." 23:59:59" );
|
219 |
-
|
220 |
-
$query_ac = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite WHERE abandoned_cart_time >= %d AND abandoned_cart_time <= %d AND recovered_cart > 0 ORDER BY recovered_cart desc";
|
221 |
-
$ac_results = $wpdb->get_results( $wpdb->prepare( $query_ac, $start_date, $end_date ) );
|
222 |
-
|
223 |
-
$query_ac_carts = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite WHERE abandoned_cart_time >= %d AND abandoned_cart_time <= %d ";
|
224 |
-
$ac_carts_results = $wpdb->get_results( $wpdb->prepare( $query_ac_carts, $start_date, $end_date ) );
|
225 |
-
|
226 |
-
$recovered_item = $recovered_total = $count_carts = $total_value = $order_total = 0;
|
227 |
-
|
228 |
-
$return_recovered_orders = array();
|
229 |
-
$per_page = $this->per_page;
|
230 |
-
$i = 1;
|
231 |
-
|
232 |
-
|
233 |
-
foreach ( $ac_carts_results as $key => $value ) {
|
234 |
-
|
235 |
-
$count_carts += 1;
|
236 |
-
$cart_detail = json_decode( $value->abandoned_cart_info );
|
237 |
-
$product_details = array();
|
238 |
-
if( isset( $cart_detail->cart ) ){
|
239 |
-
$product_details = $cart_detail->cart;
|
240 |
-
}
|
241 |
-
$line_total = 0;
|
242 |
-
|
243 |
-
if ( isset( $product_details ) && count( $product_details ) > 0 && $product_details != false ) {
|
244 |
-
|
245 |
-
foreach ( $product_details as $k => $v ) {
|
246 |
-
|
247 |
-
if( $v->line_subtotal_tax != 0 && $v->line_subtotal_tax > 0 ) {
|
248 |
-
$line_total = $line_total + $v->line_total + $v->line_subtotal_tax;
|
249 |
-
} else {
|
250 |
-
$line_total = $line_total + $v->line_total;
|
251 |
-
}
|
252 |
-
}
|
253 |
-
}
|
254 |
-
$total_value += $line_total;
|
255 |
-
|
256 |
-
}
|
257 |
-
$total_value = round( $total_value, 2 );
|
258 |
-
|
259 |
-
|
260 |
-
$this->total_order_amount = $total_value ;
|
261 |
-
$this->total_abandoned_cart_count = $count_carts ;
|
262 |
-
|
263 |
-
$recovered_order_total = 0;
|
264 |
-
|
265 |
-
$this->total_recover_amount = round( $recovered_order_total, 2 ) ;
|
266 |
-
|
267 |
-
|
268 |
-
$table_data = "";
|
269 |
-
|
270 |
-
foreach ( $ac_results as $key => $value ) {
|
271 |
-
|
272 |
-
|
273 |
-
if( $value->recovered_cart != 0 ) {
|
274 |
-
|
275 |
-
$return_recovered_orders[$i] = new stdClass();
|
276 |
-
|
277 |
-
$recovered_id = $value->recovered_cart;
|
278 |
-
$rec_order = get_post_meta( $recovered_id );
|
279 |
-
$woo_order = new WC_Order( $recovered_id );
|
280 |
-
$recovered_date = strtotime( $woo_order->order_date );
|
281 |
-
$recovered_date_new = date( 'd M, Y h:i A', $recovered_date );
|
282 |
-
$recovered_item += 1;
|
283 |
-
|
284 |
-
if ( isset($rec_order) && $rec_order != false ) {
|
285 |
-
$recovered_total += $rec_order['_order_total'][0];
|
286 |
-
}
|
287 |
-
$abandoned_date = date( 'd M, Y h:i A', $value->abandoned_cart_time );
|
288 |
-
$abandoned_order_id = $value->id;
|
289 |
-
$billing_first_name = $billing_last_name = $billing_email = '';
|
290 |
-
$recovered_order_total = 0;
|
291 |
-
|
292 |
-
if ( isset( $rec_order['_billing_first_name'][0] ) ) {
|
293 |
-
$billing_first_name = $rec_order['_billing_first_name'][0];
|
294 |
-
}
|
295 |
-
|
296 |
-
if ( isset( $rec_order['_billing_last_name'][0] ) ) {
|
297 |
-
$billing_last_name = $rec_order['_billing_last_name'][0];
|
298 |
-
}
|
299 |
-
|
300 |
-
if ( isset( $rec_order['_billing_email'][0] ) ) {
|
301 |
-
$billing_email = $rec_order['_billing_email'][0];
|
302 |
-
}
|
303 |
-
|
304 |
-
if ( isset( $rec_order['_order_total'][0] ) ) {
|
305 |
-
$recovered_order_total = $rec_order['_order_total'][0];
|
306 |
-
}
|
307 |
-
|
308 |
-
$return_recovered_orders[ $i ]->user_name = $billing_first_name . " " . $billing_last_name ;
|
309 |
-
$return_recovered_orders[ $i ]->user_email_id = $billing_email;
|
310 |
-
$return_recovered_orders[ $i ]->created_on = $abandoned_date;
|
311 |
-
$return_recovered_orders[ $i ]->recovered_date = $recovered_date_new;
|
312 |
-
$return_recovered_orders[ $i ]->recovered_id = $recovered_id;
|
313 |
-
$return_recovered_orders[ $i ]->recover_order_date = $recovered_date;
|
314 |
-
$return_recovered_orders[ $i ]->abandoned_date = $value->abandoned_cart_time;
|
315 |
-
$return_recovered_orders[ $i ]->order_total = get_woocommerce_currency_symbol() . $recovered_order_total;
|
316 |
-
|
317 |
-
|
318 |
-
$this->recovered_item = $recovered_item;
|
319 |
-
$this->total_recover_amount = round( ( $recovered_order_total + $this->total_recover_amount ) , 2 ) ;
|
320 |
-
|
321 |
-
$i++;
|
322 |
-
}
|
323 |
-
|
324 |
-
|
325 |
-
}
|
326 |
-
|
327 |
-
// sort for order date
|
328 |
-
if (isset($_GET['orderby']) && $_GET['orderby'] == 'created_on') {
|
329 |
-
if (isset($_GET['order']) && $_GET['order'] == 'asc') {
|
330 |
-
usort( $return_recovered_orders, array( __CLASS__ ,"wcap_class_recovered_created_on_asc") );
|
331 |
-
}else {
|
332 |
-
usort( $return_recovered_orders, array( __CLASS__ ,"wcap_class_recovered_created_on_dsc") );
|
333 |
-
}
|
334 |
-
}
|
335 |
-
|
336 |
-
// sort for customer name
|
337 |
-
else if ( isset( $_GET['orderby']) && $_GET['orderby'] == 'recovered_date' ) {
|
338 |
-
if ( isset( $_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
339 |
-
usort( $return_recovered_orders, array( __CLASS__ ,"wcap_class_recovered_date_asc" ) );
|
340 |
-
}else {
|
341 |
-
usort( $return_recovered_orders, array( __CLASS__ ,"wcap_class_recovered_date_dsc" ) );
|
342 |
-
}
|
343 |
-
}
|
344 |
-
|
345 |
-
|
346 |
-
return apply_filters( 'wcap_recovered_orders_table_data', $return_recovered_orders );
|
347 |
-
}
|
348 |
-
|
349 |
-
function wcap_class_recovered_created_on_asc($value1,$value2) {
|
350 |
-
return $value1->abandoned_date - $value2->abandoned_date;
|
351 |
-
}
|
352 |
-
|
353 |
-
function wcap_class_recovered_created_on_dsc ($value1,$value2) {
|
354 |
-
return $value2->abandoned_date - $value1->abandoned_date;
|
355 |
-
}
|
356 |
-
|
357 |
-
function wcap_class_recovered_date_asc($value1,$value2) {
|
358 |
-
return $value1->recover_order_date - $value2->recover_order_date;
|
359 |
-
}
|
360 |
-
|
361 |
-
function wcap_class_recovered_date_dsc ($value1,$value2) {
|
362 |
-
return $value2->recover_order_date - $value1->recover_order_date;
|
363 |
-
}
|
364 |
-
|
365 |
-
|
366 |
-
public function column_default( $wcap_abadoned_orders, $column_name ) {
|
367 |
-
$value = '';
|
368 |
-
switch ( $column_name ) {
|
369 |
-
|
370 |
-
case 'user_email_id' :
|
371 |
-
if(isset($wcap_abadoned_orders->user_email_id)){
|
372 |
-
|
373 |
-
$user_email_id = "<a href= mailto:$wcap_abadoned_orders->user_email_id>". $wcap_abadoned_orders->user_email_id."</a>" ;
|
374 |
-
$value = $user_email_id;
|
375 |
-
}
|
376 |
-
break;
|
377 |
-
|
378 |
-
case 'created_on' :
|
379 |
-
if(isset($wcap_abadoned_orders->created_on)){
|
380 |
-
$value = $wcap_abadoned_orders->created_on;
|
381 |
-
}
|
382 |
-
break;
|
383 |
-
|
384 |
-
case 'recovered_date' :
|
385 |
-
if(isset($wcap_abadoned_orders->recovered_date)){
|
386 |
-
$value = $wcap_abadoned_orders->recovered_date;
|
387 |
-
}
|
388 |
-
break;
|
389 |
-
|
390 |
-
case 'order_total' :
|
391 |
-
if(isset($wcap_abadoned_orders->order_total)){
|
392 |
-
$value = $wcap_abadoned_orders->order_total;
|
393 |
-
}
|
394 |
-
break;
|
395 |
-
default:
|
396 |
-
|
397 |
-
$value = isset( $wcap_abadoned_orders->$column_name ) ? $wcap_abadoned_orders->$column_name : '';
|
398 |
-
break;
|
399 |
-
}
|
400 |
-
|
401 |
-
return apply_filters( 'wcap_recovered_orders_column_default', $value, $wcap_abadoned_orders, $column_name );
|
402 |
-
}
|
403 |
-
}
|
404 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class-templates-table.php
DELETED
@@ -1,295 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
// Load WP_List_Table if not loaded
|
4 |
-
if ( ! class_exists( 'WP_List_Table' ) ) {
|
5 |
-
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
6 |
-
}
|
7 |
-
|
8 |
-
class WACP_Templates_Table extends WP_List_Table {
|
9 |
-
|
10 |
-
/**
|
11 |
-
* Number of results to show per page
|
12 |
-
*
|
13 |
-
* @var string
|
14 |
-
* @since 2.5.2
|
15 |
-
*/
|
16 |
-
public $per_page = 30;
|
17 |
-
|
18 |
-
/**
|
19 |
-
* URL of this page
|
20 |
-
*
|
21 |
-
* @var string
|
22 |
-
* @since 2.5.2
|
23 |
-
*/
|
24 |
-
public $base_url;
|
25 |
-
|
26 |
-
/**
|
27 |
-
* Total number of bookings
|
28 |
-
*
|
29 |
-
* @var int
|
30 |
-
* @since 2.5.3
|
31 |
-
*/
|
32 |
-
public $total_count;
|
33 |
-
|
34 |
-
/**
|
35 |
-
* Get things started
|
36 |
-
*
|
37 |
-
* @see WP_List_Table::__construct()
|
38 |
-
*/
|
39 |
-
public function __construct() {
|
40 |
-
|
41 |
-
global $status, $page;
|
42 |
-
|
43 |
-
// Set parent defaults
|
44 |
-
parent::__construct( array(
|
45 |
-
'singular' => __( 'template_id', 'woocommerce-ac' ), //singular name of the listed records
|
46 |
-
'plural' => __( 'template_ids', 'woocommerce-ac' ), //plural name of the listed records
|
47 |
-
'ajax' => false // Does this table support ajax?
|
48 |
-
) );
|
49 |
-
$this->wcap_get_templates_count();
|
50 |
-
$this->process_bulk_action();
|
51 |
-
$this->base_url = admin_url( 'admin.php?page=woocommerce_ac_page&action=emailtemplates' );
|
52 |
-
}
|
53 |
-
|
54 |
-
public function wcap_templates_prepare_items() {
|
55 |
-
|
56 |
-
$columns = $this->get_columns();
|
57 |
-
$hidden = array(); // No hidden columns
|
58 |
-
$sortable = $this->templates_get_sortable_columns();
|
59 |
-
$data = $this->wacp_templates_data_lite();
|
60 |
-
|
61 |
-
$this->_column_headers = array( $columns, $hidden, $sortable);
|
62 |
-
$total_items = $this->total_count;
|
63 |
-
$this->items = $data;
|
64 |
-
|
65 |
-
$this->set_pagination_args( array(
|
66 |
-
'total_items' => $total_items, // WE have to calculate the total number of items
|
67 |
-
'per_page' => $this->per_page, // WE have to determine how many items to show on a page
|
68 |
-
'total_pages' => ceil( $total_items / $this->per_page ) // WE have to calculate the total number of pages
|
69 |
-
)
|
70 |
-
);
|
71 |
-
}
|
72 |
-
|
73 |
-
public function get_columns() {
|
74 |
-
|
75 |
-
$columns = array(
|
76 |
-
'cb' => '<input type="checkbox" />',
|
77 |
-
'sr' => __( 'Sr', 'woocommerce-ac' ),
|
78 |
-
'template_name' => __( 'Name Of Template', 'woocommerce-ac' ),
|
79 |
-
'sent_time' => __( 'Sent After Set Time', 'woocommerce-ac' ),
|
80 |
-
'activate' => __( 'Active ?', 'woocommerce-ac' )
|
81 |
-
);
|
82 |
-
|
83 |
-
return apply_filters( 'wcap_templates_columns', $columns );
|
84 |
-
}
|
85 |
-
|
86 |
-
/***
|
87 |
-
* It is used to add the check box for the items
|
88 |
-
*/
|
89 |
-
function column_cb( $item ){
|
90 |
-
|
91 |
-
$template_id = '';
|
92 |
-
if( isset($item->id) && "" != $item->id ){
|
93 |
-
$template_id = $item->id;
|
94 |
-
}
|
95 |
-
return sprintf(
|
96 |
-
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
97 |
-
'template_id',
|
98 |
-
$template_id
|
99 |
-
);
|
100 |
-
}
|
101 |
-
|
102 |
-
public function templates_get_sortable_columns() {
|
103 |
-
$columns = array(
|
104 |
-
'template_name' => array( 'template_name', false ),
|
105 |
-
'sent_time' => array( 'sent_time',false),
|
106 |
-
);
|
107 |
-
return apply_filters( 'wcap_templates_sortable_columns', $columns );
|
108 |
-
}
|
109 |
-
|
110 |
-
/**
|
111 |
-
* Render the Email Column
|
112 |
-
*
|
113 |
-
* @access public
|
114 |
-
* @since 2.5.2
|
115 |
-
* @param array $abadoned_row_info Contains all the data of the template row
|
116 |
-
* @return string Data shown in the Email column
|
117 |
-
*
|
118 |
-
* This function used for individual delete of row, It is for hover effect delete.
|
119 |
-
*/
|
120 |
-
public function column_template_name( $template_row_info ) {
|
121 |
-
|
122 |
-
$row_actions = array();
|
123 |
-
$value = '';
|
124 |
-
$template_id = 0;
|
125 |
-
if( isset($template_row_info->template_name) ){
|
126 |
-
|
127 |
-
$template_id = $template_row_info->id ;
|
128 |
-
|
129 |
-
$row_actions['edit'] = '<a href="' . wp_nonce_url( add_query_arg( array( 'action' => 'emailtemplates', 'mode'=>'edittemplate', 'id' => $template_row_info->id ), $this->base_url ), 'abandoned_order_nonce') . '">' . __( 'Edit', 'woocommerce-ac' ) . '</a>';
|
130 |
-
$row_actions['delete'] = '<a href="' . wp_nonce_url( add_query_arg( array( 'action' => 'wcap_delete_template', 'template_id' => $template_row_info->id ), $this->base_url ), 'abandoned_order_nonce') . '">' . __( 'Delete', 'woocommerce-ac' ) . '</a>';
|
131 |
-
|
132 |
-
$email = $template_row_info->template_name;
|
133 |
-
$value = $email . $this->row_actions( $row_actions );
|
134 |
-
|
135 |
-
}
|
136 |
-
|
137 |
-
return apply_filters( 'wcap_template_single_column', $value, $template_id, 'email' );
|
138 |
-
}
|
139 |
-
|
140 |
-
/***
|
141 |
-
* This function used to get the abadoned orders count
|
142 |
-
*/
|
143 |
-
public function wcap_get_templates_count() {
|
144 |
-
|
145 |
-
global $wpdb;
|
146 |
-
$results = array();
|
147 |
-
|
148 |
-
// get main site's table prefix
|
149 |
-
$main_prefix = $wpdb->get_blog_prefix(1);
|
150 |
-
$query = "SELECT * FROM `" . $wpdb->prefix."ac_email_templates_lite`";
|
151 |
-
$results = $wpdb->get_results($query);
|
152 |
-
|
153 |
-
$templates_count = count($results);
|
154 |
-
$this->total_count = $templates_count;
|
155 |
-
}
|
156 |
-
|
157 |
-
public function wacp_templates_data_lite() {
|
158 |
-
global $wpdb;
|
159 |
-
|
160 |
-
$return_bookings = array();
|
161 |
-
$per_page = $this->per_page;
|
162 |
-
$results = array();
|
163 |
-
|
164 |
-
$query = "SELECT wpet . * FROM `" . $wpdb->prefix . "ac_email_templates_lite` AS wpet ORDER BY day_or_hour desc , frequency asc";
|
165 |
-
$results = $wpdb->get_results( $query );
|
166 |
-
|
167 |
-
$i = 1;
|
168 |
-
|
169 |
-
foreach ( $results as $key => $value ) {
|
170 |
-
|
171 |
-
$return_templates_data[$i] = new stdClass();
|
172 |
-
|
173 |
-
|
174 |
-
$id = $value->id;
|
175 |
-
$query_no_emails = "SELECT * FROM " . $wpdb->prefix . "ac_sent_history_lite WHERE template_id= %d";
|
176 |
-
|
177 |
-
$from = $value->from_email;
|
178 |
-
$subject = $value->subject;
|
179 |
-
$body = $value->body;
|
180 |
-
$is_active = $value->is_active;
|
181 |
-
|
182 |
-
if ( $is_active == '1' ) {
|
183 |
-
$active = "Deactivate";
|
184 |
-
} else {
|
185 |
-
$active = "Activate";
|
186 |
-
}
|
187 |
-
$frequency = $value->frequency;
|
188 |
-
$day_or_hour = $value->day_or_hour;
|
189 |
-
|
190 |
-
$return_templates_data[ $i ]->sr = $i;
|
191 |
-
$return_templates_data[ $i ]->id = $id;
|
192 |
-
$return_templates_data[ $i ]->template_name = $value->template_name;
|
193 |
-
$return_templates_data[ $i ]->sent_time = __( $frequency . " " . $day_or_hour . " After Abandonment", 'woocommerce-ac' );
|
194 |
-
$return_templates_data[ $i ]->activate = $active;
|
195 |
-
$return_templates_data[ $i ]->is_active = $is_active;
|
196 |
-
$i++;
|
197 |
-
|
198 |
-
}
|
199 |
-
|
200 |
-
// sort for order date
|
201 |
-
if (isset($_GET['orderby']) && $_GET['orderby'] == 'template_name') {
|
202 |
-
if (isset($_GET['order']) && $_GET['order'] == 'asc') {
|
203 |
-
usort( $return_templates_data, array( __CLASS__ ,"wcap_class_template_name_asc") );
|
204 |
-
}else {
|
205 |
-
usort( $return_templates_data, array( __CLASS__ ,"wcap_class_template_name_dsc") );
|
206 |
-
}
|
207 |
-
}
|
208 |
-
|
209 |
-
// sort for customer name
|
210 |
-
else if ( isset( $_GET['orderby']) && $_GET['orderby'] == 'sent_time' ) {
|
211 |
-
if ( isset( $_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
212 |
-
usort( $return_templates_data, array( __CLASS__ ,"wcap_class_sent_time_asc" ) );
|
213 |
-
}else {
|
214 |
-
usort( $return_templates_data, array( __CLASS__ ,"wcap_class_sent_time_dsc" ) );
|
215 |
-
}
|
216 |
-
}
|
217 |
-
|
218 |
-
|
219 |
-
return apply_filters( 'wcap_templates_table_data', $return_templates_data );
|
220 |
-
}
|
221 |
-
|
222 |
-
function wcap_class_template_name_asc($value1,$value2) {
|
223 |
-
return strcasecmp($value1->template_name,$value2->template_name );
|
224 |
-
}
|
225 |
-
|
226 |
-
function wcap_class_template_name_dsc ($value1,$value2) {
|
227 |
-
return strcasecmp($value2->template_name,$value1->template_name );
|
228 |
-
}
|
229 |
-
|
230 |
-
function wcap_class_sent_time_asc($value1,$value2) {
|
231 |
-
return strnatcasecmp($value1->sent_time,$value2->sent_time );
|
232 |
-
}
|
233 |
-
|
234 |
-
function wcap_class_sent_time_dsc ($value1,$value2) {
|
235 |
-
return strnatcasecmp($value2->sent_time,$value1->sent_time );
|
236 |
-
}
|
237 |
-
|
238 |
-
|
239 |
-
public function column_default( $wcap_abadoned_orders, $column_name ) {
|
240 |
-
$value = '';
|
241 |
-
switch ( $column_name ) {
|
242 |
-
|
243 |
-
case 'sr' :
|
244 |
-
if(isset($wcap_abadoned_orders->sr)){
|
245 |
-
$value = $wcap_abadoned_orders->sr;
|
246 |
-
}
|
247 |
-
break;
|
248 |
-
|
249 |
-
case 'template_name' :
|
250 |
-
if(isset($wcap_abadoned_orders->template_name)){
|
251 |
-
$value = $wcap_abadoned_orders->template_name;
|
252 |
-
}
|
253 |
-
break;
|
254 |
-
|
255 |
-
case 'sent_time' :
|
256 |
-
if(isset($wcap_abadoned_orders->sent_time)){
|
257 |
-
$value = $wcap_abadoned_orders->sent_time;
|
258 |
-
}
|
259 |
-
break;
|
260 |
-
|
261 |
-
case 'activate' :
|
262 |
-
if(isset($wcap_abadoned_orders->activate)){
|
263 |
-
|
264 |
-
$active = $wcap_abadoned_orders->activate;
|
265 |
-
$id = $wcap_abadoned_orders->id;
|
266 |
-
$is_active = $wcap_abadoned_orders->is_active;
|
267 |
-
|
268 |
-
$active = '';
|
269 |
-
if ( $is_active == '1' ) {
|
270 |
-
$active = "Deactivate";
|
271 |
-
} else {
|
272 |
-
$active = "Activate";
|
273 |
-
}
|
274 |
-
$active_text = __( $active, 'woocommerce-ac' );
|
275 |
-
$value = '<a href="#" onclick="activate_email_template('. $id.', '.$is_active.' )"> '.$active_text.'</a>';
|
276 |
-
//$value = $wcap_abadoned_orders->activate;
|
277 |
-
}
|
278 |
-
break;
|
279 |
-
|
280 |
-
default:
|
281 |
-
|
282 |
-
$value = isset( $wcap_abadoned_orders->$column_name ) ? $wcap_abadoned_orders->$column_name : '';
|
283 |
-
break;
|
284 |
-
}
|
285 |
-
|
286 |
-
return apply_filters( 'wcap_template_column_default', $value, $wcap_abadoned_orders, $column_name );
|
287 |
-
}
|
288 |
-
|
289 |
-
public function get_bulk_actions() {
|
290 |
-
return array(
|
291 |
-
'wcap_delete_template' => __( 'Delete', 'woocommerce-ac' )
|
292 |
-
);
|
293 |
-
}
|
294 |
-
}
|
295 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cron/send_email.php
DELETED
@@ -1,447 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
if( defined('WP_CONTENT_FOLDERNAME' ) ) {
|
4 |
-
$wp_content_dir_name = WP_CONTENT_FOLDERNAME;
|
5 |
-
}elseif( defined( 'WP_CONTENT_DIR' ) ) {
|
6 |
-
$url = WP_CONTENT_DIR;
|
7 |
-
$explode_url = explode( "/", $url );
|
8 |
-
$wp_content_dir_name = end( $explode_url );
|
9 |
-
}else{
|
10 |
-
$wp_content_dir_name = "wp-content";
|
11 |
-
}
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
$url = dirname( __FILE__ );
|
16 |
-
$my_url = explode( $wp_content_dir_name , $url );
|
17 |
-
$path = $my_url[0];
|
18 |
-
|
19 |
-
require_once $path . 'wp-load.php';
|
20 |
-
/**
|
21 |
-
* woocommerce_abandon_cart_cron class
|
22 |
-
**/
|
23 |
-
if ( !class_exists( 'woocommerce_abandon_cart_cron' ) ) {
|
24 |
-
|
25 |
-
class woocommerce_abandon_cart_cron {
|
26 |
-
|
27 |
-
var $cart_settings_cron;
|
28 |
-
var $cart_abandon_cut_off_time_cron;
|
29 |
-
|
30 |
-
public function __construct() {
|
31 |
-
|
32 |
-
$this->cart_settings_cron = get_option( 'ac_lite_cart_abandoned_time' );
|
33 |
-
|
34 |
-
$this->cart_abandon_cut_off_time_cron = ( $this->cart_settings_cron ) * 60;
|
35 |
-
}
|
36 |
-
|
37 |
-
/*-----------------------------------------------------------------------------------*/
|
38 |
-
/* Class Functions */
|
39 |
-
/*-----------------------------------------------------------------------------------*/
|
40 |
-
|
41 |
-
/**
|
42 |
-
* Function to send emails
|
43 |
-
*/
|
44 |
-
function woocommerce_ac_send_email() {
|
45 |
-
|
46 |
-
global $wpdb, $woocommerce;
|
47 |
-
|
48 |
-
// Delete any guest ac carts that might be pending because user did not go to Order Received page after payment
|
49 |
-
//search for the guest carts
|
50 |
-
$query_guest_records = "SELECT id,email_id FROM `" . $wpdb->prefix . "ac_guest_abandoned_cart_history_lite`";
|
51 |
-
$results_guest_list = $wpdb->get_results( $query_guest_records );
|
52 |
-
|
53 |
-
// This is to ensure that recovered guest carts r removed from the delete list
|
54 |
-
$query_records = "SELECT user_id FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_type = 'GUEST' AND recovered_cart != '0'";
|
55 |
-
$results_query = $wpdb->get_results( $query_records );
|
56 |
-
|
57 |
-
foreach ( $results_guest_list as $key => $value ) {
|
58 |
-
$record_found = "NO";
|
59 |
-
foreach ( $results_query as $k => $v ) {
|
60 |
-
if ( $value->id == $v->user_id ) {
|
61 |
-
$record_found = "YES";
|
62 |
-
}
|
63 |
-
}
|
64 |
-
if ( $record_found == "YES" ) {
|
65 |
-
unset( $results_guest_list[ $key ] );
|
66 |
-
}
|
67 |
-
}
|
68 |
-
foreach ( $results_guest_list as $key => $value ) {
|
69 |
-
$query_email_id = "SELECT post_id FROM `" . $wpdb->prefix . "postmeta` WHERE meta_key = '_billing_email' AND meta_value = %s";
|
70 |
-
$results_query_email = $wpdb->get_results( $wpdb->prepare( $query_email_id, $value->email_id ) );
|
71 |
-
|
72 |
-
//if any orders are found with the same email addr..delete those ac records
|
73 |
-
if ( $results_query_email ) {
|
74 |
-
|
75 |
-
for ( $i = 0; $i < count( $results_query_email ); $i++ ) {
|
76 |
-
$query_post = "SELECT post_date,post_status FROM `" . $wpdb->prefix . "posts` WHERE ID = %d";
|
77 |
-
$results_post = $wpdb->get_results ( $wpdb->prepare( $query_post, $results_query_email[ $i ]->post_id ) );
|
78 |
-
|
79 |
-
if ( $results_post[0]->post_status == "wc-pending" || $results_post[0]->post_status == "wc-failed" ) {
|
80 |
-
continue;
|
81 |
-
}
|
82 |
-
$order_date_time = $results_post[0]->post_date;
|
83 |
-
$order_date = substr( $order_date_time , 0 , 10 );
|
84 |
-
$current_time = current_time( 'timestamp' );
|
85 |
-
$today_date = date( 'Y-m-d', $current_time );
|
86 |
-
|
87 |
-
if ( $order_date == $today_date ) {
|
88 |
-
$query_delete = "DELETE FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_id = '" . $value->id . "'";
|
89 |
-
$wpdb->query( $query_delete );
|
90 |
-
$query_guest = "DELETE FROM `" . $wpdb->prefix . "ac_guest_abandoned_cart_history_lite` WHERE email_id = '" . $value->email_id . "'";
|
91 |
-
$wpdb->query( $query_guest );
|
92 |
-
break;
|
93 |
-
}
|
94 |
-
}
|
95 |
-
}
|
96 |
-
}
|
97 |
-
|
98 |
-
// Delete any logged in user carts that might be pending because user did not go to Order Received page after payment
|
99 |
-
$query_records = "SELECT DISTINCT user_id FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_type = 'REGISTERED' AND cart_ignored = '0' AND recovered_cart = '0'";
|
100 |
-
$results_list = $wpdb->get_results( $query_records );
|
101 |
-
|
102 |
-
|
103 |
-
foreach ( $results_list as $key => $value ) {
|
104 |
-
$user_id = $value->user_id;
|
105 |
-
$query_email = '';
|
106 |
-
if ( is_multisite() ){
|
107 |
-
// get main site's table prefix
|
108 |
-
$main_prefix = $wpdb->get_blog_prefix(1);
|
109 |
-
$query_email = "SELECT user_email FROM `".$main_prefix."users` WHERE ID = %d";
|
110 |
-
|
111 |
-
}else{
|
112 |
-
// non-multisite - regular table name
|
113 |
-
$query_email = "SELECT user_email FROM `".$wpdb->prefix."users` WHERE ID = %d";
|
114 |
-
}
|
115 |
-
|
116 |
-
|
117 |
-
$results_email = $wpdb->get_results( $wpdb->prepare( $query_email, $user_id ) );
|
118 |
-
|
119 |
-
|
120 |
-
$query_email_id = "SELECT post_id FROM `" . $wpdb->prefix . "postmeta` WHERE meta_key = '_billing_email' AND meta_value = %s";
|
121 |
-
$results_query_email = $wpdb->get_results( $wpdb->prepare( $query_email_id, $results_email[0]->user_email ) );
|
122 |
-
|
123 |
-
|
124 |
-
//if any orders are found with the same email addr..delete those ac records
|
125 |
-
if ( is_array( $results_query_email ) && count( $results_query_email ) > 0 ) {
|
126 |
-
|
127 |
-
for ( $i = 0; $i < count( $results_query_email ); $i++ ) {
|
128 |
-
|
129 |
-
$query_post = "SELECT post_date,post_status FROM `" . $wpdb->prefix . "posts` WHERE ID = %d ";
|
130 |
-
$results_post = $wpdb->get_results ( $wpdb->prepare( $query_post, $results_query_email[ $i ]->post_id ) );
|
131 |
-
|
132 |
-
if ( $results_post[0]->post_status == "wc-pending" || $results_post[0]->post_status == "wc-failed" ) {
|
133 |
-
continue;
|
134 |
-
|
135 |
-
}
|
136 |
-
$order_date_time = $results_post[0]->post_date;
|
137 |
-
$order_date = substr( $order_date_time, 0, 10 );
|
138 |
-
$current_time = current_time( 'timestamp' );
|
139 |
-
$today_date = date( 'Y-m-d', $current_time );
|
140 |
-
|
141 |
-
if ( $order_date == $today_date ) {
|
142 |
-
$query_delete = "DELETE FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
143 |
-
WHERE user_id = '" . $user_id . "'
|
144 |
-
AND cart_ignored = '0'
|
145 |
-
AND recovered_cart = '0'";
|
146 |
-
|
147 |
-
$wpdb->query( $query_delete );
|
148 |
-
break;
|
149 |
-
}
|
150 |
-
}
|
151 |
-
}
|
152 |
-
}
|
153 |
-
|
154 |
-
//Grab the cart abandoned cut-off time from database.
|
155 |
-
$cart_settings = get_option( 'ac_lite_cart_abandoned_time' );
|
156 |
-
|
157 |
-
$cart_abandon_cut_off_time = $cart_settings * 60;
|
158 |
-
|
159 |
-
//Fetch all active templates present in the system
|
160 |
-
$query = "SELECT wpet . *
|
161 |
-
FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet
|
162 |
-
WHERE wpet.is_active = '1'
|
163 |
-
ORDER BY `day_or_hour` DESC, `frequency` ASC ";
|
164 |
-
$results = $wpdb->get_results( $query );
|
165 |
-
|
166 |
-
$hour_seconds = 3600; // 60 * 60
|
167 |
-
$day_seconds = 86400; // 24 * 60 * 60
|
168 |
-
foreach ( $results as $key => $value )
|
169 |
-
{
|
170 |
-
if ( $value->day_or_hour == 'Days' )
|
171 |
-
{
|
172 |
-
$time_to_send_template_after = $value->frequency * $day_seconds;
|
173 |
-
}
|
174 |
-
elseif ( $value->day_or_hour == 'Hours' )
|
175 |
-
{
|
176 |
-
$time_to_send_template_after = $value->frequency * $hour_seconds;
|
177 |
-
}
|
178 |
-
|
179 |
-
$carts = $this->get_carts( $time_to_send_template_after, $cart_abandon_cut_off_time );
|
180 |
-
|
181 |
-
$email_frequency = $value->frequency;
|
182 |
-
$email_body_template = $value->body;
|
183 |
-
$email_subject = $value->subject;
|
184 |
-
$headers = "From: " . $value->from_name . " <" . $value->from_email . ">" . "\r\n";
|
185 |
-
$headers .= "Content-Type: text/html"."\r\n";
|
186 |
-
$headers .= "Reply-To: " . $value->reply_email . " " . "\r\n";
|
187 |
-
$template_id = $value->id;
|
188 |
-
$is_wc_template = $value->is_wc_template;
|
189 |
-
|
190 |
-
foreach ( $carts as $key => $value )
|
191 |
-
{
|
192 |
-
if ( $value->user_type == "GUEST" ) {
|
193 |
-
$value->user_login = "";
|
194 |
-
$query_guest = "SELECT billing_first_name, billing_last_name, email_id FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE id = %d";
|
195 |
-
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $value->user_id ) );
|
196 |
-
$value->user_email = $results_guest[0]->email_id;
|
197 |
-
}else{
|
198 |
-
|
199 |
-
$user_id = $value->user_id;
|
200 |
-
$key = 'billing_email';
|
201 |
-
$single = true;
|
202 |
-
$user_biiling_email = get_user_meta( $user_id, $key, $single );
|
203 |
-
if( isset( $user_biiling_email ) && $user_biiling_email != '' ){
|
204 |
-
$value->user_email = $user_biiling_email;
|
205 |
-
}
|
206 |
-
}
|
207 |
-
|
208 |
-
$cart_info_db_field = json_decode( $value->abandoned_cart_info );
|
209 |
-
if ( count( $cart_info_db_field->cart ) > 0 )
|
210 |
-
{
|
211 |
-
$cart_update_time = $value->abandoned_cart_time;
|
212 |
-
|
213 |
-
$new_user = $this->check_sent_history( $value->user_id, $cart_update_time, $template_id, $value->id );
|
214 |
-
if ( $new_user == true )
|
215 |
-
{
|
216 |
-
$cart_info_db = $value->abandoned_cart_info;
|
217 |
-
|
218 |
-
$email_body = $email_body_template;
|
219 |
-
|
220 |
-
if ( $value->user_type == "GUEST" ) {
|
221 |
-
if ( isset( $results_guest[0]->billing_first_name ) ) {
|
222 |
-
$email_body = str_replace( "{{customer.firstname}}", $results_guest[0]->billing_first_name, $email_body );
|
223 |
-
$email_subject = str_replace( "{{customer.firstname}}", $results_guest[0]->billing_first_name, $email_subject );
|
224 |
-
}
|
225 |
-
|
226 |
-
if ( isset( $results_guest[0]->billing_last_name ) ) $email_body = str_replace( "{{customer.lastname}}", $results_guest[0]->billing_last_name, $email_body );
|
227 |
-
|
228 |
-
if ( isset( $results_guest[0]->billing_first_name ) && isset( $results_guest[0]->billing_last_name ) ) $email_body = str_replace( "{{customer.fullname}}", $results_guest[0]->billing_first_name." ".$results_guest[0]->billing_last_name, $email_body );
|
229 |
-
else if ( isset( $results_guest[0]->billing_first_name ) ) $email_body = str_replace( "{{customer.fullname}}", $results_guest[0]->billing_first_name, $email_body );
|
230 |
-
else if ( isset( $results_guest[0]->billing_last_name)) $email_body = str_replace( "{{customer.fullname}}", $results_guest[0]->billing_last_name, $email_body );
|
231 |
-
} else {
|
232 |
-
$email_body = str_replace( "{{customer.firstname}}", get_user_meta( $value->user_id, 'first_name', true ), $email_body );
|
233 |
-
$email_subject = str_replace( "{{customer.firstname}}", get_user_meta( $value->user_id, 'first_name', true ), $email_subject );
|
234 |
-
$email_body = str_replace( "{{customer.lastname}}", get_user_meta( $value->user_id, 'last_name', true ), $email_body );
|
235 |
-
$email_body = str_replace( "{{customer.fullname}}", get_user_meta( $value->user_id, 'first_name', true )." ".get_user_meta( $value->user_id, 'last_name', true ), $email_body );
|
236 |
-
}
|
237 |
-
|
238 |
-
$order_date = "";
|
239 |
-
|
240 |
-
if ( $cart_update_time != "" && $cart_update_time != 0 ) {
|
241 |
-
$order_date = date( 'd M, Y h:i A', $cart_update_time );
|
242 |
-
}
|
243 |
-
|
244 |
-
$email_body = str_replace( "{{cart.abandoned_date}}", $order_date, $email_body );
|
245 |
-
|
246 |
-
$query_sent = "INSERT INTO `".$wpdb->prefix."ac_sent_history_lite` ( template_id, abandoned_order_id, sent_time, sent_email_id )
|
247 |
-
VALUES ( %s, %s, '".current_time( 'mysql' )."', %s )";
|
248 |
-
|
249 |
-
$wpdb->query( $wpdb->prepare( $query_sent, $template_id, $value->id, $value->user_email ) );
|
250 |
-
|
251 |
-
$query_id = "SELECT * FROM `".$wpdb->prefix."ac_sent_history_lite`
|
252 |
-
WHERE template_id = %s AND abandoned_order_id = %s
|
253 |
-
ORDER BY id DESC
|
254 |
-
LIMIT 1 ";
|
255 |
-
|
256 |
-
$results_sent = $wpdb->get_results( $wpdb->prepare( $query_id, $template_id, $value->id ) );
|
257 |
-
|
258 |
-
|
259 |
-
$email_sent_id = $results_sent[0]->id;
|
260 |
-
|
261 |
-
$var = '';
|
262 |
-
if( preg_match( "{{products.cart}}", $email_body, $matched ) ) {
|
263 |
-
$var = '<h3>'.__( "Your Shopping Cart", "woocommerce-ac" ).'</h3>
|
264 |
-
<table border="0" cellpadding="10" cellspacing="0" class="templateDataTable">
|
265 |
-
<tr>
|
266 |
-
<th>'.__( "Item", "woocommerce-ac" ).'</th>
|
267 |
-
<th>'.__( "Name", "woocommerce-ac" ).'</th>
|
268 |
-
<th>'.__( "Quantity", "woocommerce-ac" ).'</th>
|
269 |
-
<th>'.__( "Price", "woocommerce-ac" ).'</th>
|
270 |
-
<th>'.__( "Line Subtotal", "woocommerce-ac" ).'</th>
|
271 |
-
</tr>';
|
272 |
-
|
273 |
-
$cart_details = $cart_info_db_field->cart;
|
274 |
-
$cart_total = $item_subtotal = $item_total = 0;
|
275 |
-
$sub_line_prod_name = '';
|
276 |
-
foreach ( $cart_details as $k => $v ) {
|
277 |
-
$quantity_total = $v->quantity;
|
278 |
-
$product_id = $v->product_id;
|
279 |
-
$prod_name = get_post( $product_id );
|
280 |
-
$product_link_track = get_permalink( $product_id );
|
281 |
-
$product_name = $prod_name->post_title;
|
282 |
-
if ( $sub_line_prod_name == '' ) {
|
283 |
-
$sub_line_prod_name = $product_name;
|
284 |
-
}
|
285 |
-
// Item subtotal is calculated as product total including taxes
|
286 |
-
if( $v->line_subtotal_tax != 0 && $v->line_subtotal_tax > 0 ) {
|
287 |
-
$item_subtotal = $item_subtotal + $v->line_total + $v->line_subtotal_tax;
|
288 |
-
} else {
|
289 |
-
$item_subtotal = $item_subtotal + $v->line_total;
|
290 |
-
}
|
291 |
-
|
292 |
-
// Line total
|
293 |
-
$item_total = $item_subtotal;
|
294 |
-
$item_subtotal = $item_subtotal / $quantity_total;
|
295 |
-
$item_total_display = number_format( $item_total, 2 );
|
296 |
-
$item_subtotal = number_format( $item_subtotal, 2 );
|
297 |
-
$product = get_product( $product_id );
|
298 |
-
$prod_image = $product->get_image();
|
299 |
-
$image_url = wp_get_attachment_url( get_post_thumbnail_id( $product_id ) );
|
300 |
-
$var .='<tr align="center">
|
301 |
-
<td> <a href="'.$product_link_track.'"> <img src="' . $image_url . '" alt="" height="42" width="42" /> </a></td>
|
302 |
-
<td> <a href="'.$product_link_track.'">'.__( $product_name, "woocommerce-ac" ).'</a></td>
|
303 |
-
<td> '.$quantity_total.'</td>
|
304 |
-
<td> '.get_woocommerce_currency_symbol()."".$item_subtotal.'</td>
|
305 |
-
<td> '.get_woocommerce_currency_symbol()."".$item_total_display.'</td>
|
306 |
-
</tr>';
|
307 |
-
$cart_total += $item_total;
|
308 |
-
$item_subtotal = $item_total = 0;
|
309 |
-
}
|
310 |
-
$cart_total = number_format( $cart_total, 2 );
|
311 |
-
$var .= '<tr align="center">
|
312 |
-
<td> </td>
|
313 |
-
<td> </td>
|
314 |
-
<td> </td>
|
315 |
-
<td>'.__( "Cart Total:", "woocommerce-ac" ).'</td>
|
316 |
-
<td> '.get_woocommerce_currency_symbol()."".$cart_total.'</td>
|
317 |
-
</tr>';
|
318 |
-
$var .= '</table>
|
319 |
-
';
|
320 |
-
$email_body = str_replace( "{{products.cart}}", $var, $email_body );
|
321 |
-
$email_subject = str_replace( "{{product.name}}", __( $sub_line_prod_name, "woocommerce-ac" ), $email_subject );
|
322 |
-
}
|
323 |
-
|
324 |
-
if ( $woocommerce->version < '2.3' ) {
|
325 |
-
$cart_page_link = $woocommerce->cart->get_cart_url();
|
326 |
-
} else {
|
327 |
-
$cart_page_id = woocommerce_get_page_id( 'cart' );
|
328 |
-
$cart_page_link = $cart_page_id ? get_permalink( $cart_page_id ) : '';
|
329 |
-
}
|
330 |
-
|
331 |
-
$encoding_cart = $email_sent_id.'&url='.$cart_page_link;
|
332 |
-
|
333 |
-
$validate_cart = $this->encrypt_validate ($encoding_cart);
|
334 |
-
$cart_link_track = get_option('siteurl').'/?wacp_action=track_links&validate=' . $validate_cart;
|
335 |
-
$email_body = str_replace( "{{cart.link}}", $cart_link_track, $email_body );
|
336 |
-
|
337 |
-
$user_email = $value->user_email;
|
338 |
-
|
339 |
-
$email_body_final = stripslashes( $email_body );
|
340 |
-
|
341 |
-
if ( isset( $is_wc_template ) && "1" == $is_wc_template ){
|
342 |
-
|
343 |
-
ob_start();
|
344 |
-
|
345 |
-
$email_heading = __( 'Abandoned cart reminder', 'woocommerce' );
|
346 |
-
|
347 |
-
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $email_heading ) );
|
348 |
-
|
349 |
-
$email_body_template_header = ob_get_clean();
|
350 |
-
|
351 |
-
ob_start();
|
352 |
-
|
353 |
-
wc_get_template( 'emails/email-footer.php' );
|
354 |
-
|
355 |
-
$email_body_template_footer = ob_get_clean();
|
356 |
-
|
357 |
-
$final_email_body = $email_body_template_header . $email_body_final . $email_body_template_footer;
|
358 |
-
|
359 |
-
wc_mail( $user_email, $email_subject, $final_email_body, $headers );
|
360 |
-
|
361 |
-
}else{
|
362 |
-
wp_mail( $user_email, $email_subject, __( $email_body_final, 'woocommerce-ac' ), $headers );
|
363 |
-
}
|
364 |
-
}
|
365 |
-
|
366 |
-
}
|
367 |
-
}
|
368 |
-
|
369 |
-
}
|
370 |
-
|
371 |
-
}
|
372 |
-
|
373 |
-
/**
|
374 |
-
* get all carts which have the creation time earlier than the one that is passed
|
375 |
-
*
|
376 |
-
*/
|
377 |
-
function get_carts( $template_to_send_after_time, $cart_abandon_cut_off_time ) {
|
378 |
-
|
379 |
-
global $wpdb;
|
380 |
-
|
381 |
-
$cart_time = current_time( 'timestamp' ) - $template_to_send_after_time - $cart_abandon_cut_off_time;
|
382 |
-
|
383 |
-
$cart_ignored = 0;
|
384 |
-
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email
|
385 |
-
FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
|
386 |
-
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
387 |
-
WHERE cart_ignored = %s
|
388 |
-
AND abandoned_cart_time < $cart_time
|
389 |
-
ORDER BY `id` ASC ";
|
390 |
-
|
391 |
-
$results = $wpdb->get_results( $wpdb->prepare( $query, $cart_ignored ) );
|
392 |
-
|
393 |
-
return $results;
|
394 |
-
|
395 |
-
exit;
|
396 |
-
}
|
397 |
-
|
398 |
-
/******
|
399 |
-
* This function is used to encode the validate string.
|
400 |
-
******/
|
401 |
-
function encrypt_validate( $validate ) {
|
402 |
-
|
403 |
-
$cryptKey = 'qJB0rGtIn5UB1xG03efyCp';
|
404 |
-
$validate_encoded = base64_encode( mcrypt_encrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), $validate, MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ) );
|
405 |
-
return $validate_encoded;
|
406 |
-
}
|
407 |
-
|
408 |
-
function check_sent_history( $user_id, $cart_update_time, $template_id, $id ) {
|
409 |
-
|
410 |
-
global $wpdb;
|
411 |
-
|
412 |
-
$query = "SELECT wpcs . * , wpac . abandoned_cart_time , wpac . user_id
|
413 |
-
FROM `".$wpdb->prefix."ac_sent_history_lite` AS wpcs
|
414 |
-
LEFT JOIN ".$wpdb->prefix."ac_abandoned_cart_history_lite AS wpac ON wpcs.abandoned_order_id = wpac.id
|
415 |
-
WHERE
|
416 |
-
template_id = %s
|
417 |
-
AND
|
418 |
-
wpcs.abandoned_order_id = %d
|
419 |
-
ORDER BY 'id' DESC
|
420 |
-
LIMIT 1 ";
|
421 |
-
|
422 |
-
$results = $wpdb->get_results( $wpdb->prepare( $query, $template_id, $id ) );
|
423 |
-
if ( count( $results ) == 0 )
|
424 |
-
{
|
425 |
-
return true;
|
426 |
-
}
|
427 |
-
elseif ( $results[0]->abandoned_cart_time < $cart_update_time )
|
428 |
-
{
|
429 |
-
return true;
|
430 |
-
}
|
431 |
-
else
|
432 |
-
{
|
433 |
-
return false;
|
434 |
-
}
|
435 |
-
|
436 |
-
}
|
437 |
-
|
438 |
-
|
439 |
-
}
|
440 |
-
|
441 |
-
}
|
442 |
-
|
443 |
-
$woocommerce_abandon_cart_cron = new woocommerce_abandon_cart_cron();
|
444 |
-
|
445 |
-
$woocommerce_abandon_cart_cron->woocommerce_ac_send_email();
|
446 |
-
|
447 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cron/wcal_send_email.php
ADDED
@@ -0,0 +1,491 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
static $wp_load; // Since this will be called twice, hold onto it.
|
4 |
+
if ( ! isset( $wp_load ) ) {
|
5 |
+
$wp_load = false;
|
6 |
+
$dir = __FILE__;
|
7 |
+
while( '/' != ( $dir = dirname( $dir ) ) ) {
|
8 |
+
if( file_exists( $wp_load = "{$dir}/wp-load.php" ) ) {
|
9 |
+
break;
|
10 |
+
}
|
11 |
+
}
|
12 |
+
}
|
13 |
+
$wcal_root = dirname( dirname(__FILE__) ); // go two level up for directory from this file.
|
14 |
+
require_once $wp_load;
|
15 |
+
require_once $wcal_root.'/includes/classes/class-wcal-aes.php';
|
16 |
+
require_once $wcal_root.'/includes/classes/class-wcal-aes-counter.php';
|
17 |
+
/**
|
18 |
+
* woocommerce_abandon_cart_cron class
|
19 |
+
**/
|
20 |
+
if ( !class_exists( 'woocommerce_abandon_cart_cron' ) ) {
|
21 |
+
|
22 |
+
class woocommerce_abandon_cart_cron {
|
23 |
+
var $cart_settings_cron;
|
24 |
+
var $cart_abandon_cut_off_time_cron;
|
25 |
+
public function __construct() {
|
26 |
+
$this->cart_settings_cron = get_option( 'ac_lite_cart_abandoned_time' );
|
27 |
+
$this->cart_abandon_cut_off_time_cron = ( $this->cart_settings_cron ) * 60;
|
28 |
+
}
|
29 |
+
/**
|
30 |
+
* Function to send emails
|
31 |
+
*/
|
32 |
+
function wcal_send_email_notification() {
|
33 |
+
global $wpdb, $woocommerce;
|
34 |
+
//Grab the cart abandoned cut-off time from database.
|
35 |
+
$cart_settings = get_option( 'ac_lite_cart_abandoned_time' );
|
36 |
+
$cart_abandon_cut_off_time = $cart_settings * 60;
|
37 |
+
//Fetch all active templates present in the system
|
38 |
+
$query = "SELECT wpet . * FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet
|
39 |
+
WHERE wpet.is_active = '1' ORDER BY `day_or_hour` DESC, `frequency` ASC ";
|
40 |
+
$results = $wpdb->get_results( $query );
|
41 |
+
$hour_seconds = 3600; // 60 * 60
|
42 |
+
$day_seconds = 86400; // 24 * 60 * 60
|
43 |
+
foreach ( $results as $key => $value ) {
|
44 |
+
if ( $value->day_or_hour == 'Days' ) {
|
45 |
+
$time_to_send_template_after = $value->frequency * $day_seconds;
|
46 |
+
} elseif ( $value->day_or_hour == 'Hours' ) {
|
47 |
+
$time_to_send_template_after = $value->frequency * $hour_seconds;
|
48 |
+
}
|
49 |
+
$carts = $this->wcal_get_carts( $time_to_send_template_after, $cart_abandon_cut_off_time );
|
50 |
+
/**
|
51 |
+
* When there are 3 templates and for cart id 1 all template time has been reached. BUt all templates are deactivated.
|
52 |
+
* If we activate all 3 template then at a 1 time all 3 email templates send to the users.
|
53 |
+
* So below function check that after first email is sent time and then from that time it will send the 2nd template time. ( It will not consider the cart abadoned time in this case. )
|
54 |
+
*/
|
55 |
+
$carts = $this->wcal_remove_cart_for_mutiple_templates( $carts, $time_to_send_template_after, $value->id );
|
56 |
+
$carts = woocommerce_abandon_cart_cron ::wcal_update_abandoned_cart_status_for_placed_orders ( $carts, $time_to_send_template_after );
|
57 |
+
$email_frequency = $value->frequency;
|
58 |
+
$email_body_template = $value->body;
|
59 |
+
$email_subject = stripslashes ( $value->subject );
|
60 |
+
if ( class_exists( 'WP_Better_Emails' ) ) {
|
61 |
+
$headers = "From: " . $value->from_name . " <" . $value->from_email . ">" . "\r\n";
|
62 |
+
$headers .= "Content-Type: text/plain"."\r\n";
|
63 |
+
$headers .= "Reply-To: " . $value->reply_email . " " . "\r\n";
|
64 |
+
} else {
|
65 |
+
$headers = "From: " . $value->from_name . " <" . $value->from_email . ">" . "\r\n";
|
66 |
+
$headers .= "Content-Type: text/html"."\r\n";
|
67 |
+
$headers .= "Reply-To: " . $value->reply_email . " " . "\r\n";
|
68 |
+
}
|
69 |
+
$template_id = $value->id;
|
70 |
+
$is_wc_template = $value->is_wc_template;
|
71 |
+
$wc_template_header_text = $value->wc_email_header != '' ? $value->wc_email_header : __( 'Abandoned cart reminder', 'woocommerce-ac');
|
72 |
+
$wc_template_header = stripslashes( $wc_template_header_text );
|
73 |
+
if ( '' != $email_body_template ) {
|
74 |
+
foreach ( $carts as $key => $value ) {
|
75 |
+
if ( $value->user_type == "GUEST" ) {
|
76 |
+
$value->user_login = "";
|
77 |
+
$query_guest = "SELECT billing_first_name, billing_last_name, email_id FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite`
|
78 |
+
WHERE id = %d";
|
79 |
+
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $value->user_id ) );
|
80 |
+
$value->user_email = $results_guest[0]->email_id;
|
81 |
+
} else {
|
82 |
+
if( isset( $value->user_id ) ) {
|
83 |
+
$user_id = $value->user_id;
|
84 |
+
}
|
85 |
+
$key = 'billing_email';
|
86 |
+
$single = true;
|
87 |
+
$user_biiling_email = get_user_meta( $user_id, $key, $single );
|
88 |
+
if ( isset( $user_biiling_email ) && $user_biiling_email != '' ) {
|
89 |
+
$value->user_email = $user_biiling_email;
|
90 |
+
}
|
91 |
+
}
|
92 |
+
if( isset( $value->abandoned_cart_info ) ) {
|
93 |
+
$cart_info_db_field = json_decode( $value->abandoned_cart_info );
|
94 |
+
}
|
95 |
+
if( count( $cart_info_db_field->cart ) > 0 ) {
|
96 |
+
$cart_update_time = $value->abandoned_cart_time;
|
97 |
+
$new_user = $this->wcal_check_sent_history( $value->user_id, $cart_update_time, $template_id, $value->id );
|
98 |
+
if ( $new_user == true ) {
|
99 |
+
$cart_info_db = $value->abandoned_cart_info;
|
100 |
+
$email_body = $email_body_template;
|
101 |
+
if ( $value->user_type == "GUEST" ) {
|
102 |
+
if ( isset( $results_guest[0]->billing_first_name ) ) {
|
103 |
+
$email_body = str_replace( "{{customer.firstname}}", $results_guest[0]->billing_first_name, $email_body );
|
104 |
+
$email_subject = str_replace( "{{customer.firstname}}", $results_guest[0]->billing_first_name, $email_subject );
|
105 |
+
}
|
106 |
+
if ( isset( $results_guest[0]->billing_last_name ) ) {
|
107 |
+
$email_body = str_replace( "{{customer.lastname}}", $results_guest[0]->billing_last_name, $email_body );
|
108 |
+
}
|
109 |
+
if ( isset( $results_guest[0]->billing_first_name ) && isset( $results_guest[0]->billing_last_name ) ) {
|
110 |
+
$email_body = str_replace( "{{customer.fullname}}", $results_guest[0]->billing_first_name." ".$results_guest[0]->billing_last_name, $email_body );
|
111 |
+
}
|
112 |
+
else if ( isset( $results_guest[0]->billing_first_name ) ) {
|
113 |
+
$email_body = str_replace( "{{customer.fullname}}", $results_guest[0]->billing_first_name, $email_body );
|
114 |
+
}
|
115 |
+
else if ( isset( $results_guest[0]->billing_last_name ) ) {
|
116 |
+
$email_body = str_replace( "{{customer.fullname}}", $results_guest[0]->billing_last_name, $email_body );
|
117 |
+
}
|
118 |
+
} else {
|
119 |
+
$user_first_name = '';
|
120 |
+
$user_first_name_temp = get_user_meta( $value->user_id, 'billing_first_name', true );
|
121 |
+
if( isset( $user_first_name_temp ) && "" == $user_first_name_temp ) {
|
122 |
+
$user_data = get_userdata( $user_id );
|
123 |
+
$user_first_name = $user_data->first_name;
|
124 |
+
} else {
|
125 |
+
$user_first_name = $user_first_name_temp;
|
126 |
+
}
|
127 |
+
$email_body = str_replace( "{{customer.firstname}}", $user_first_name, $email_body );
|
128 |
+
$email_subject = str_replace( "{{customer.firstname}}", $user_first_name, $email_subject );
|
129 |
+
$user_last_name = '';
|
130 |
+
$user_last_name_temp = get_user_meta( $value->user_id, 'billing_last_name', true );
|
131 |
+
if( isset( $user_last_name_temp ) && "" == $user_last_name_temp ) {
|
132 |
+
$user_data = get_userdata( $user_id );
|
133 |
+
$user_last_name = $user_data->last_name;
|
134 |
+
} else {
|
135 |
+
$user_last_name = $user_last_name_temp;
|
136 |
+
}
|
137 |
+
$email_body = str_replace( "{{customer.lastname}}", $user_last_name, $email_body );
|
138 |
+
$email_body = str_replace( "{{customer.fullname}}", $user_first_name." ".$user_last_name, $email_body );
|
139 |
+
}
|
140 |
+
$order_date = "";
|
141 |
+
if( $cart_update_time != "" && $cart_update_time != 0 ) {
|
142 |
+
$order_date = date( 'd M, Y h:i A', $cart_update_time );
|
143 |
+
}
|
144 |
+
$email_body = str_replace( "{{cart.abandoned_date}}", $order_date, $email_body );
|
145 |
+
$query_sent = "INSERT INTO `".$wpdb->prefix."ac_sent_history_lite` ( template_id, abandoned_order_id, sent_time, sent_email_id )
|
146 |
+
VALUES ( %s, %s, '".current_time( 'mysql' )."', %s )";
|
147 |
+
|
148 |
+
$wpdb->query( $wpdb->prepare( $query_sent, $template_id, $value->id, $value->user_email ) );
|
149 |
+
|
150 |
+
$query_id = "SELECT * FROM `".$wpdb->prefix."ac_sent_history_lite`
|
151 |
+
WHERE template_id = %s AND abandoned_order_id = %s
|
152 |
+
ORDER BY id DESC
|
153 |
+
LIMIT 1 ";
|
154 |
+
$results_sent = $wpdb->get_results( $wpdb->prepare( $query_id, $template_id, $value->id ) );
|
155 |
+
$email_sent_id = $results_sent[0]->id;
|
156 |
+
|
157 |
+
if( $woocommerce->version < '2.3' ) {
|
158 |
+
$cart_page_link = $woocommerce->cart->get_cart_url();
|
159 |
+
} else {
|
160 |
+
$cart_page_id = woocommerce_get_page_id( 'cart' );
|
161 |
+
$cart_page_link = $cart_page_id ? get_permalink( $cart_page_id ) : '';
|
162 |
+
}
|
163 |
+
|
164 |
+
$encoding_cart = $email_sent_id.'&url='.$cart_page_link;
|
165 |
+
$validate_cart = $this->wcal_encrypt_validate( $encoding_cart );
|
166 |
+
$cart_link_track = get_option('siteurl').'/?wcal_action=track_links&validate=' . $validate_cart;
|
167 |
+
$email_body = str_replace( "{{cart.link}}", $cart_link_track, $email_body );
|
168 |
+
|
169 |
+
$validate_unsubscribe = $this->wcal_encrypt_validate( $email_sent_id );
|
170 |
+
$email_sent_id_address = $results_sent[0]->sent_email_id;
|
171 |
+
$encrypt_email_sent_id_address = hash( 'sha256', $email_sent_id_address );
|
172 |
+
$plugins_url = get_option( 'siteurl' ) . "/?wcal_track_unsubscribe=wcal_unsubscribe&validate=" . $validate_unsubscribe . "&track_email_id=" . $encrypt_email_sent_id_address;
|
173 |
+
$unsubscribe_link_track = $plugins_url;
|
174 |
+
$email_body = str_replace( "{{cart.unsubscribe}}" , $unsubscribe_link_track , $email_body );
|
175 |
+
$var = '';
|
176 |
+
if( preg_match( "{{products.cart}}", $email_body, $matched ) ) {
|
177 |
+
if ( class_exists( 'WP_Better_Emails' ) ) {
|
178 |
+
$var = '<table width = 100%>
|
179 |
+
<tr> <td colspan="5"> <h3>'.__( "Your Shopping Cart", "woocommerce-ac" ).'</h3> </td></tr>
|
180 |
+
<tr>
|
181 |
+
<th>'.__( "Item", "woocommerce-ac" ).'</th>
|
182 |
+
<th>'.__( "Name", "woocommerce-ac" ).'</th>
|
183 |
+
<th>'.__( "Quantity", "woocommerce-ac" ).'</th>
|
184 |
+
<th>'.__( "Price", "woocommerce-ac" ).'</th>
|
185 |
+
<th>'.__( "Line Subtotal", "woocommerce-ac" ).'</th>
|
186 |
+
</tr>';
|
187 |
+
} else {
|
188 |
+
$var = '<h3>'.__( "Your Shopping Cart", "woocommerce-ac" ).'</h3>
|
189 |
+
<table border="0" cellpadding="10" cellspacing="0" class="templateDataTable">
|
190 |
+
<tr>
|
191 |
+
<th>'.__( "Item", "woocommerce-ac" ).'</th>
|
192 |
+
<th>'.__( "Name", "woocommerce-ac" ).'</th>
|
193 |
+
<th>'.__( "Quantity", "woocommerce-ac" ).'</th>
|
194 |
+
<th>'.__( "Price", "woocommerce-ac" ).'</th>
|
195 |
+
<th>'.__( "Line Subtotal", "woocommerce-ac" ).'</th>
|
196 |
+
</tr>';
|
197 |
+
}
|
198 |
+
$cart_details = $cart_info_db_field->cart;
|
199 |
+
$cart_total = $item_subtotal = $item_total = 0;
|
200 |
+
$sub_line_prod_name = '';
|
201 |
+
foreach ( $cart_details as $k => $v ) {
|
202 |
+
$quantity_total = $v->quantity;
|
203 |
+
$product_id = $v->product_id;
|
204 |
+
$prod_name = get_post( $product_id );
|
205 |
+
$product_link_track = get_permalink( $product_id );
|
206 |
+
$product_name = $prod_name->post_title;
|
207 |
+
if( $sub_line_prod_name == '' ) {
|
208 |
+
$sub_line_prod_name = $product_name;
|
209 |
+
}
|
210 |
+
// Item subtotal is calculated as product total including taxes
|
211 |
+
if( $v->line_subtotal_tax != 0 && $v->line_subtotal_tax > 0 ) {
|
212 |
+
$item_subtotal = $item_subtotal + $v->line_total + $v->line_subtotal_tax;
|
213 |
+
} else {
|
214 |
+
$item_subtotal = $item_subtotal + $v->line_total;
|
215 |
+
}
|
216 |
+
// Line total
|
217 |
+
$item_total = $item_subtotal;
|
218 |
+
$item_subtotal = $item_subtotal / $quantity_total;
|
219 |
+
$item_total_display = wc_price( $item_total );
|
220 |
+
$item_subtotal = wc_price( $item_subtotal );
|
221 |
+
$product = get_product( $product_id );
|
222 |
+
$prod_image = $product->get_image();
|
223 |
+
$image_url = wp_get_attachment_url( get_post_thumbnail_id( $product_id ) );
|
224 |
+
if ( isset( $v->variation_id ) && '' != $v->variation_id ) {
|
225 |
+
$variation_id = $v->variation_id;
|
226 |
+
$variation = wc_get_product( $variation_id );
|
227 |
+
$name = $variation->get_formatted_name() ;
|
228 |
+
$explode_all = explode ( "–", $name );
|
229 |
+
$pro_name_variation = array_slice( $explode_all, 1, -1 );
|
230 |
+
$product_name_with_variable = '';
|
231 |
+
$explode_many_varaition = array();
|
232 |
+
foreach ( $pro_name_variation as $pro_name_variation_key => $pro_name_variation_value ){
|
233 |
+
$explode_many_varaition = explode ( ",", $pro_name_variation_value );
|
234 |
+
if ( !empty( $explode_many_varaition ) ) {
|
235 |
+
foreach( $explode_many_varaition as $explode_many_varaition_key => $explode_many_varaition_value ){
|
236 |
+
$product_name_with_variable = $product_name_with_variable . "<br>". html_entity_decode ( $explode_many_varaition_value );
|
237 |
+
}
|
238 |
+
} else {
|
239 |
+
$product_name_with_variable = $product_name_with_variable . "<br>". html_entity_decode ( $explode_many_varaition_value );
|
240 |
+
}
|
241 |
+
}
|
242 |
+
$product_name = $product_name_with_variable;
|
243 |
+
}
|
244 |
+
$var .='<tr align="center">
|
245 |
+
<td> <a href="'.$cart_link_track.'"> <img src="' . $image_url . '" alt="" height="42" width="42" /> </a></td>
|
246 |
+
<td> <a href="'.$cart_link_track.'">'.__( $product_name, "woocommerce-ac" ).'</a></td>
|
247 |
+
<td> '.$quantity_total.'</td>
|
248 |
+
<td> '.$item_subtotal.'</td>
|
249 |
+
<td> '.$item_total_display.'</td>
|
250 |
+
</tr>';
|
251 |
+
$cart_total += $item_total;
|
252 |
+
$item_subtotal = $item_total = 0;
|
253 |
+
}
|
254 |
+
$cart_total = wc_price( $cart_total );
|
255 |
+
$var .= '<tr align="center">
|
256 |
+
<td> </td>
|
257 |
+
<td> </td>
|
258 |
+
<td> </td>
|
259 |
+
<td>'.__( "Cart Total:", "woocommerce-ac" ).'</td>
|
260 |
+
<td> '.$cart_total.'</td>
|
261 |
+
</tr>';
|
262 |
+
$var .= '</table>
|
263 |
+
';
|
264 |
+
$email_body = str_replace( "{{products.cart}}", $var, $email_body );
|
265 |
+
$email_subject = str_replace( "{{product.name}}", __( $sub_line_prod_name, "woocommerce-ac" ), $email_subject );
|
266 |
+
}
|
267 |
+
|
268 |
+
$user_email = $value->user_email;
|
269 |
+
$email_body_final = stripslashes( $email_body );
|
270 |
+
|
271 |
+
if ( isset( $is_wc_template ) && "1" == $is_wc_template ){
|
272 |
+
ob_start();
|
273 |
+
|
274 |
+
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $wc_template_header ) );
|
275 |
+
$email_body_template_header = ob_get_clean();
|
276 |
+
|
277 |
+
ob_start();
|
278 |
+
|
279 |
+
wc_get_template( 'emails/email-footer.php' );
|
280 |
+
$email_body_template_footer = ob_get_clean();
|
281 |
+
|
282 |
+
$final_email_body = $email_body_template_header . $email_body_final . $email_body_template_footer;
|
283 |
+
|
284 |
+
wc_mail( $user_email, $email_subject, $final_email_body, $headers );
|
285 |
+
|
286 |
+
} else {
|
287 |
+
wp_mail( $user_email, $email_subject, __( $email_body_final, 'woocommerce-ac' ), $headers );
|
288 |
+
}
|
289 |
+
}
|
290 |
+
}
|
291 |
+
}
|
292 |
+
}
|
293 |
+
}
|
294 |
+
}
|
295 |
+
/**
|
296 |
+
* get all carts which have the creation time earlier than the one that is passed
|
297 |
+
*/
|
298 |
+
function wcal_get_carts( $template_to_send_after_time, $cart_abandon_cut_off_time ) {
|
299 |
+
global $wpdb;
|
300 |
+
$cart_time = current_time( 'timestamp' ) - $template_to_send_after_time - $cart_abandon_cut_off_time;
|
301 |
+
$cart_ignored = 0;
|
302 |
+
$unsubscribe = 0;
|
303 |
+
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
|
304 |
+
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
305 |
+
WHERE cart_ignored = %s AND unsubscribe_link = %s AND abandoned_cart_time < $cart_time
|
306 |
+
ORDER BY `id` ASC ";
|
307 |
+
|
308 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $cart_ignored, $unsubscribe ) );
|
309 |
+
return $results;
|
310 |
+
exit;
|
311 |
+
}
|
312 |
+
|
313 |
+
public static function wcal_update_abandoned_cart_status_for_placed_orders( $carts, $time_to_send_template_after ){
|
314 |
+
global $wpdb;
|
315 |
+
foreach( $carts as $carts_key => $carts_value ) {
|
316 |
+
$abandoned_cart_time = $carts_value->abandoned_cart_time;
|
317 |
+
$user_id = $carts_value->user_id;
|
318 |
+
$user_type = $carts_value->user_type;
|
319 |
+
$cart_id = $carts_value->id;
|
320 |
+
if( $user_id >= '63000000' && 'GUEST' == $user_type ) {
|
321 |
+
$query_guest_records = "SELECT id FROM `" . $wpdb->prefix . "ac_guest_abandoned_cart_history_lite` ORDER BY id DESC LIMIT 1";
|
322 |
+
$results_guest_list = $wpdb->get_results( $query_guest_records );
|
323 |
+
$last_guest_id = 0 ;
|
324 |
+
$get_last_checked_id = get_option( 'wcal_guest_last_id_checked' );
|
325 |
+
if( isset( $results_guest_list ) && count( $results_guest_list ) > 0 ) {
|
326 |
+
$last_guest_id = $results_guest_list[0]->id;
|
327 |
+
}
|
328 |
+
if( false == $get_last_checked_id || $get_last_checked_id < $last_guest_id ) {
|
329 |
+
$updated_value = woocommerce_abandon_cart_cron ::wcal_update_status_of_guest( $cart_id, $abandoned_cart_time , $time_to_send_template_after );
|
330 |
+
if( 1 == $updated_value ) {
|
331 |
+
unset ( $carts [ $carts_key ] );
|
332 |
+
}
|
333 |
+
update_option ( 'wcal_guest_last_id_checked' , $last_guest_id );
|
334 |
+
}
|
335 |
+
} elseif ( $user_id < '63000000' && 'REGISTERED' == $user_type ) {
|
336 |
+
$updated_value = woocommerce_abandon_cart_cron ::wcal_update_status_of_loggedin ( $cart_id, $abandoned_cart_time , $time_to_send_template_after );
|
337 |
+
if( 1 == $updated_value ) {
|
338 |
+
unset( $carts [ $carts_key ] );
|
339 |
+
}
|
340 |
+
}
|
341 |
+
}
|
342 |
+
return $carts;
|
343 |
+
}
|
344 |
+
|
345 |
+
public static function wcal_update_status_of_guest( $cart_id, $abandoned_cart_time , $time_to_send_template_after ) {
|
346 |
+
global $wpdb;
|
347 |
+
$get_last_checked_id = get_option( 'wcal_guest_last_id_checked' );
|
348 |
+
if( false == $get_last_checked_id ) {
|
349 |
+
$get_last_checked_id = 63000000;
|
350 |
+
}
|
351 |
+
$query_guest_records = "SELECT id,email_id FROM `" . $wpdb->prefix . "ac_guest_abandoned_cart_history_lite` WHERE id > $get_last_checked_id";
|
352 |
+
$results_guest_list = $wpdb->get_results( $query_guest_records );
|
353 |
+
// This is to ensure that recovered guest carts r removed from the delete list
|
354 |
+
$query_records = "SELECT user_id FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_type = 'GUEST' AND recovered_cart != '0'";
|
355 |
+
$results_query = $wpdb->get_results( $query_records );
|
356 |
+
foreach( $results_guest_list as $key => $value ) {
|
357 |
+
$record_found = "NO";
|
358 |
+
foreach( $results_query as $k => $v ) {
|
359 |
+
if ( $value->id == $v->user_id ) {
|
360 |
+
$record_found = "YES";
|
361 |
+
}
|
362 |
+
}
|
363 |
+
if( $record_found == "YES" ) {
|
364 |
+
unset( $results_guest_list[ $key ] );
|
365 |
+
}
|
366 |
+
}
|
367 |
+
if ( ! empty( $results_query ) ) {
|
368 |
+
foreach( $results_guest_list as $key => $value ) {
|
369 |
+
$query_email_id = "SELECT post_id FROM `" . $wpdb->prefix . "postmeta` WHERE meta_key = '_billing_email' AND meta_value = %s";
|
370 |
+
$results_query_email = $wpdb->get_results( $wpdb->prepare( $query_email_id, $value->email_id ) );
|
371 |
+
//if any orders are found with the same email addr..delete those ac records
|
372 |
+
if( $results_query_email ) {
|
373 |
+
for( $i = 0; $i < count( $results_query_email ); $i++ ) {
|
374 |
+
$query_post = "SELECT post_date,post_status FROM `" . $wpdb->prefix . "posts` WHERE ID = %d";
|
375 |
+
$results_post = $wpdb->get_results ( $wpdb->prepare( $query_post, $results_query_email[ $i ]->post_id ) );
|
376 |
+
if( $results_post[0]->post_status == "wc-pending" || $results_post[0]->post_status == "wc-failed" ) {
|
377 |
+
continue;
|
378 |
+
}
|
379 |
+
$order_date_time = $results_post[0]->post_date;
|
380 |
+
$order_date_with_time = $results_post[0]->post_date;
|
381 |
+
$order_date = substr( $order_date_with_time, 0, 10 );
|
382 |
+
$current_time = current_time( 'timestamp' );
|
383 |
+
$today_date = date( 'Y-m-d', $current_time );
|
384 |
+
if( strtotime( $order_date_time ) > $abandoned_cart_time || $order_date == $today_date ) {
|
385 |
+
$query_ignored = "UPDATE `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` SET cart_ignored = '1' WHERE id ='" . $cart_id . "'";
|
386 |
+
$wpdb->query( $query_ignored );
|
387 |
+
return 1; //We return here 1 so it indicate that the cart has been modifed so do not sent email and delete from the array.
|
388 |
+
}
|
389 |
+
}
|
390 |
+
}
|
391 |
+
}
|
392 |
+
return 0;
|
393 |
+
}
|
394 |
+
}
|
395 |
+
public static function wcal_update_status_of_loggedin( $cart_id, $abandoned_cart_time , $time_to_send_template_after ) {
|
396 |
+
global $wpdb;
|
397 |
+
// Update the record of the loggedin user who had paid before the first abandoned cart reminder email send to customer.
|
398 |
+
$query_records = "SELECT DISTINCT user_id FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_type = 'REGISTERED' AND id = $cart_id AND recovered_cart = '0'";
|
399 |
+
$results_list = $wpdb->get_results( $query_records );
|
400 |
+
foreach( $results_list as $key => $value ) {
|
401 |
+
$user_id = $value->user_id;
|
402 |
+
$key = 'billing_email';
|
403 |
+
$single = true;
|
404 |
+
$user_billing_email = get_user_meta( $user_id, $key, $single );
|
405 |
+
if( isset( $user_billing_email ) && $user_billing_email == '' ){
|
406 |
+
$user_id = $value->user_id;
|
407 |
+
if( is_multisite() ) {
|
408 |
+
$main_prefix = $wpdb->get_blog_prefix(1);
|
409 |
+
$query_email = "SELECT user_email FROM `".$main_prefix."users` WHERE ID = %d";
|
410 |
+
} else {
|
411 |
+
$query_email = "SELECT user_email FROM `".$wpdb->prefix."users` WHERE ID = %d";
|
412 |
+
}
|
413 |
+
$results_email = $wpdb->get_results( $wpdb->prepare( $query_email, $user_id ) );
|
414 |
+
$user_billing_email = $results_email[0]->user_email;
|
415 |
+
}
|
416 |
+
$query_email_id = "SELECT post_id FROM `" . $wpdb->prefix . "postmeta` WHERE meta_key = '_billing_email' AND meta_value = %s";
|
417 |
+
$results_query_email = $wpdb->get_results( $wpdb->prepare( $query_email_id, $user_billing_email ) );
|
418 |
+
//if any orders are found with the same email addr..delete those ac records
|
419 |
+
if( is_array( $results_query_email ) && count( $results_query_email ) > 0 ) {
|
420 |
+
for( $i = 0; $i < count( $results_query_email ); $i++ ) {
|
421 |
+
$cart_abandoned_time = date ('Y-m-d h:i:s', $abandoned_cart_time);
|
422 |
+
$query_post = "SELECT post_date,post_status FROM `" . $wpdb->prefix . "posts` WHERE ID = %d AND post_date >= %s";
|
423 |
+
$results_post = $wpdb->get_results( $wpdb->prepare( $query_post, $results_query_email[ $i ]->post_id, $cart_abandoned_time ) );
|
424 |
+
if( count ($results_post) > 0 ) {
|
425 |
+
if( $results_post[0]->post_status == "wc-pending" || $results_post[0]->post_status == "wc-failed" ) {
|
426 |
+
return 0; //if status of the order is pending or falied then return 0 so it will not delete that cart and send reminder email
|
427 |
+
}
|
428 |
+
$order_date_time = $results_post[0]->post_date;
|
429 |
+
$order_date_with_time = $results_post[0]->post_date;
|
430 |
+
$order_date = substr( $order_date_with_time, 0, 10 );
|
431 |
+
$current_time = current_time( 'timestamp' );
|
432 |
+
$today_date = date( 'Y-m-d', $current_time );
|
433 |
+
if ( strtotime( $order_date_time ) >= $abandoned_cart_time || $order_date == $today_date ) {
|
434 |
+
$query_ignored = "UPDATE `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` SET cart_ignored = '1' WHERE id ='" . $cart_id . "'";
|
435 |
+
$wpdb->query( $query_ignored );
|
436 |
+
return 1; //We return here 1 so it indicate that the cart has been modifed so do not sent email and delete from the array.
|
437 |
+
}
|
438 |
+
}
|
439 |
+
}
|
440 |
+
}
|
441 |
+
}
|
442 |
+
return 0;
|
443 |
+
}
|
444 |
+
|
445 |
+
public static function wcal_remove_cart_for_mutiple_templates( $carts, $time_to_send_template_after, $template_id ) {
|
446 |
+
global $wpdb;
|
447 |
+
|
448 |
+
foreach( $carts as $carts_key => $carts_value ) {
|
449 |
+
$wcal_get_last_email_sent_time = "SELECT * FROM `" . $wpdb->prefix . "ac_sent_history_lite` WHERE abandoned_order_id = $carts_value->id ORDER BY `sent_time` DESC LIMIT 1";
|
450 |
+
$wcal_get_last_email_sent_time_results_list = $wpdb->get_results( $wcal_get_last_email_sent_time );
|
451 |
+
if( count( $wcal_get_last_email_sent_time_results_list ) > 0 ) {
|
452 |
+
$last_template_send_time = strtotime( $wcal_get_last_email_sent_time_results_list[0]->sent_time );
|
453 |
+
$second_template_send_time = $last_template_send_time + $time_to_send_template_after ;
|
454 |
+
$current_time_test = current_time( 'timestamp' );
|
455 |
+
if( $second_template_send_time > $current_time_test ) {
|
456 |
+
unset( $carts [ $carts_key ] );
|
457 |
+
}
|
458 |
+
}
|
459 |
+
}
|
460 |
+
return $carts;
|
461 |
+
}
|
462 |
+
/******
|
463 |
+
* This function is used to encode the validate string.
|
464 |
+
******/
|
465 |
+
function wcal_encrypt_validate( $validate ) {
|
466 |
+
$cryptKey = get_option( 'wcal_security_key' );
|
467 |
+
$validate_encoded = Wcal_Aes_Ctr::encrypt( $validate, $cryptKey, 256 );
|
468 |
+
return( $validate_encoded );
|
469 |
+
}
|
470 |
+
|
471 |
+
function wcal_check_sent_history( $user_id, $cart_update_time, $template_id, $id ) {
|
472 |
+
global $wpdb;
|
473 |
+
$query = "SELECT wpcs . * , wpac . abandoned_cart_time , wpac . user_id FROM `".$wpdb->prefix."ac_sent_history_lite` AS wpcs
|
474 |
+
LEFT JOIN ".$wpdb->prefix."ac_abandoned_cart_history_lite AS wpac ON wpcs.abandoned_order_id = wpac.id
|
475 |
+
WHERE template_id = %s AND wpcs.abandoned_order_id = %d ORDER BY 'id' DESC LIMIT 1 ";
|
476 |
+
|
477 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $template_id, $id ) );
|
478 |
+
if ( count( $results ) == 0 ) {
|
479 |
+
return true;
|
480 |
+
} elseif ( $results[0]->abandoned_cart_time < $cart_update_time ) {
|
481 |
+
return true;
|
482 |
+
} else {
|
483 |
+
return false;
|
484 |
+
}
|
485 |
+
}
|
486 |
+
}
|
487 |
+
}
|
488 |
+
$woocommerce_abandon_cart_cron = new woocommerce_abandon_cart_cron();
|
489 |
+
$woocommerce_abandon_cart_cron->wcal_send_email_notification();
|
490 |
+
|
491 |
+
?>
|
{languages → i18n/languages}/woocommerce-ac-de_DE.mo
RENAMED
File without changes
|
{languages → i18n/languages}/woocommerce-ac-de_DE.po
RENAMED
@@ -1,283 +1,283 @@
|
|
1 |
-
# SOME DESCRIPTIVE TITLE.
|
2 |
-
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
-
# This file is distributed under the same license as the PACKAGE package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
-
#
|
6 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: \n"
|
9 |
-
"Report-Msgid-Bugs-To: \n"
|
10 |
-
"POT-Creation-Date: 2015-08-28 16:46+0200\n"
|
11 |
-
"PO-Revision-Date: 2015-08-28 17:51+0200\n"
|
12 |
-
"Language-Team: \n"
|
13 |
-
"MIME-Version: 1.0\n"
|
14 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
-
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
"X-Generator: Poedit 1.8.4\n"
|
17 |
-
"Last-Translator: \n"
|
18 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19 |
-
"Language: de_DE\n"
|
20 |
-
|
21 |
-
#: woocommerce-ac.php:22
|
22 |
-
msgid "Once Every Five Minutes"
|
23 |
-
msgstr "Alle fünf Minuten"
|
24 |
-
|
25 |
-
#: woocommerce-ac.php:204
|
26 |
-
#, php-format
|
27 |
-
msgid ""
|
28 |
-
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
29 |
-
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
30 |
-
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
31 |
-
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
32 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
33 |
-
msgstr ""
|
34 |
-
"Sie können auf die <a href=\"https://www.tychesoftwares.com/store/premium-"
|
35 |
-
"plugins/woocommerce-abandoned-cart-pro/\">PRO version von WooCommerce "
|
36 |
-
"Abandoned Cart plugin</a> mit 20% Rabatt upgraden. Nutzen Sie den Coupon-"
|
37 |
-
"Code <b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
38 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Jetzt kaufen </a> & $24 sparen!"
|
39 |
-
|
40 |
-
#: woocommerce-ac.php:314
|
41 |
-
msgid "Abandoned Carts"
|
42 |
-
msgstr "Verlassene Warenkörbe"
|
43 |
-
|
44 |
-
#: woocommerce-ac.php:516
|
45 |
-
msgid "Abandoned Orders"
|
46 |
-
msgstr "Abgebrochene Bestellungen"
|
47 |
-
|
48 |
-
#: woocommerce-ac.php:517
|
49 |
-
msgid "Email Templates"
|
50 |
-
msgstr "E-Mail-Vorlagen"
|
51 |
-
|
52 |
-
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
53 |
-
msgid "Settings"
|
54 |
-
msgstr "Einstellungen"
|
55 |
-
|
56 |
-
#: woocommerce-ac.php:519
|
57 |
-
msgid "Recovered Orders"
|
58 |
-
msgstr "Gerettete Bestellungen"
|
59 |
-
|
60 |
-
#: woocommerce-ac.php:661
|
61 |
-
msgid "You do not have sufficient permissions to access this page."
|
62 |
-
msgstr "Sie sind nicht befugt, auf diese Seite zuzugreifen."
|
63 |
-
|
64 |
-
#: woocommerce-ac.php:670
|
65 |
-
msgid "WooCommerce - Abandon Cart Lite"
|
66 |
-
msgstr "WooCommerce - Abandon Cart Lite"
|
67 |
-
|
68 |
-
#: woocommerce-ac.php:696
|
69 |
-
msgid "Your settings have been saved."
|
70 |
-
msgstr "Die Einstellungen wurden gespeichert."
|
71 |
-
|
72 |
-
#: woocommerce-ac.php:718
|
73 |
-
msgid "Cart abandoned cut-off time"
|
74 |
-
msgstr "Verlassene Warenkörbe Cut-Off Zeit"
|
75 |
-
|
76 |
-
#: woocommerce-ac.php:741
|
77 |
-
msgid "minutes"
|
78 |
-
msgstr "Minuten"
|
79 |
-
|
80 |
-
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
81 |
-
msgid ""
|
82 |
-
"Consider cart abandoned after X minutes of item being added to cart & order "
|
83 |
-
"not placed"
|
84 |
-
msgstr ""
|
85 |
-
"Warenkorb gilt nach X Minuten zwischen Warenkorb gefüllt und Bestellung "
|
86 |
-
"abgebrochen als verlassen."
|
87 |
-
|
88 |
-
#: woocommerce-ac.php:753
|
89 |
-
msgid "Save Changes"
|
90 |
-
msgstr "Änderungen Speichern"
|
91 |
-
|
92 |
-
#: woocommerce-ac.php:763
|
93 |
-
msgid ""
|
94 |
-
"The list below shows all Abandoned Carts which have remained in cart for a "
|
95 |
-
"time higher than the \"Cart abandoned cut-off time\" setting."
|
96 |
-
msgstr ""
|
97 |
-
"Die untenstehende Liste zeigt alle verlassenen Warenkörbe, die nach der Zeit "
|
98 |
-
"bei \"Verlassene Warenkörbe Cut-Off Zeit\" noch existieren."
|
99 |
-
|
100 |
-
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
101 |
-
msgid "Customer"
|
102 |
-
msgstr "Kunde"
|
103 |
-
|
104 |
-
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
105 |
-
msgid "Order Total"
|
106 |
-
msgstr "Bestellung gesamt"
|
107 |
-
|
108 |
-
#: woocommerce-ac.php:862
|
109 |
-
msgid "Date"
|
110 |
-
msgstr "Datum:"
|
111 |
-
|
112 |
-
#: woocommerce-ac.php:868
|
113 |
-
msgid "Status"
|
114 |
-
msgstr "Status"
|
115 |
-
|
116 |
-
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
117 |
-
msgid "Actions"
|
118 |
-
msgstr "Aktionen"
|
119 |
-
|
120 |
-
#: woocommerce-ac.php:953
|
121 |
-
msgid ""
|
122 |
-
"Add email templates at different intervals to maximize the possibility of "
|
123 |
-
"recovering your abandoned carts."
|
124 |
-
msgstr ""
|
125 |
-
"Fügen Sie E-Mail Vorlagen für unterschiedliche Zeitintervalle hinzu, um die "
|
126 |
-
"Chancen zu erhöhen, einen verlassenen Warenkorb in eine Bestellung zu "
|
127 |
-
"konvertieren."
|
128 |
-
|
129 |
-
#: woocommerce-ac.php:1054
|
130 |
-
msgid "The Email Template has been successfully added."
|
131 |
-
msgstr "Die E-Mail Vorlage wurde erfolgreich hinzugefügt."
|
132 |
-
|
133 |
-
#: woocommerce-ac.php:1057
|
134 |
-
msgid "The Email Template has been successfully updated."
|
135 |
-
msgstr "Die E-Mail Vorlage wurde erfolgreich angepasst."
|
136 |
-
|
137 |
-
#: woocommerce-ac.php:1145
|
138 |
-
msgid "Sr"
|
139 |
-
msgstr "Nr."
|
140 |
-
|
141 |
-
#: woocommerce-ac.php:1148
|
142 |
-
msgid "Template Name"
|
143 |
-
msgstr "Vorlagenname"
|
144 |
-
|
145 |
-
#: woocommerce-ac.php:1154
|
146 |
-
msgid "Sent"
|
147 |
-
msgstr "Gesendet"
|
148 |
-
|
149 |
-
#: woocommerce-ac.php:1158
|
150 |
-
msgid "Active ?"
|
151 |
-
msgstr "aktiv?"
|
152 |
-
|
153 |
-
#: woocommerce-ac.php:1276
|
154 |
-
msgid ""
|
155 |
-
"The Report below shows how many Abandoned Carts we were able to recover for "
|
156 |
-
"you by sending automatic emails to encourage shoppers."
|
157 |
-
msgstr ""
|
158 |
-
"Der untenstehende Report zeigt, wieviele verlassene Warenkörbe aufgrund der "
|
159 |
-
"E-Mailautomatik gerettet wurden."
|
160 |
-
|
161 |
-
#: woocommerce-ac.php:1331
|
162 |
-
msgid "Start Date:"
|
163 |
-
msgstr "Startdatum:"
|
164 |
-
|
165 |
-
#: woocommerce-ac.php:1334
|
166 |
-
msgid "End Date:"
|
167 |
-
msgstr "Enddatum:"
|
168 |
-
|
169 |
-
#: woocommerce-ac.php:1337
|
170 |
-
msgid "Go"
|
171 |
-
msgstr "Los"
|
172 |
-
|
173 |
-
#: woocommerce-ac.php:1495
|
174 |
-
msgid "During the selected range"
|
175 |
-
msgstr "Während des gewählten Zeitraums wurden"
|
176 |
-
|
177 |
-
#: woocommerce-ac.php:1495
|
178 |
-
msgid "carts totaling"
|
179 |
-
msgstr "Warenkörbe mit einem Gesamtwert von"
|
180 |
-
|
181 |
-
#: woocommerce-ac.php:1495
|
182 |
-
msgid "were abandoned. We were able to recover"
|
183 |
-
msgstr "verlassen. Es konnten"
|
184 |
-
|
185 |
-
#: woocommerce-ac.php:1495
|
186 |
-
msgid "of them, which led to an extra"
|
187 |
-
msgstr "dieser Warenkörbe gerettet werden, was zu einem Extra-Umsatz von"
|
188 |
-
|
189 |
-
#: woocommerce-ac.php:1495
|
190 |
-
msgid "in sales"
|
191 |
-
msgstr "führte."
|
192 |
-
|
193 |
-
#: woocommerce-ac.php:1504
|
194 |
-
msgid "Created On"
|
195 |
-
msgstr "Erstellt Am"
|
196 |
-
|
197 |
-
#: woocommerce-ac.php:1510
|
198 |
-
msgid "Recovered Date"
|
199 |
-
msgstr "Datum der Rettung"
|
200 |
-
|
201 |
-
#: woocommerce-ac.php:1561
|
202 |
-
msgid "Template Name:"
|
203 |
-
msgstr "Vorlagenname"
|
204 |
-
|
205 |
-
#: woocommerce-ac.php:1572
|
206 |
-
msgid "Enter a template name for reference"
|
207 |
-
msgstr "Geben Sie einen Vorlagennamen als Referenz an"
|
208 |
-
|
209 |
-
#: woocommerce-ac.php:1577
|
210 |
-
msgid "Send From This Name:"
|
211 |
-
msgstr "Absendername"
|
212 |
-
|
213 |
-
#: woocommerce-ac.php:1588
|
214 |
-
msgid "Enter the name that should appear in the email sent"
|
215 |
-
msgstr "Geben Sie den Absendernamen an, der erscheinen soll"
|
216 |
-
|
217 |
-
#: woocommerce-ac.php:1594
|
218 |
-
msgid "Subject:"
|
219 |
-
msgstr "Betreff:"
|
220 |
-
|
221 |
-
#: woocommerce-ac.php:1605
|
222 |
-
msgid "Enter the subject that should appear in the email sent"
|
223 |
-
msgstr "Geben Sie den Betreff an, der in der Mail erscheinen soll"
|
224 |
-
|
225 |
-
#: woocommerce-ac.php:1611
|
226 |
-
msgid "Email Body:"
|
227 |
-
msgstr "E-Mail-Text:"
|
228 |
-
|
229 |
-
#: woocommerce-ac.php:1627
|
230 |
-
msgid "Message to be sent in the reminder email."
|
231 |
-
msgstr "Zu sendende Nachricht in der Erinnerungsmail."
|
232 |
-
|
233 |
-
#: woocommerce-ac.php:1634
|
234 |
-
msgid "Send this email:"
|
235 |
-
msgstr "Senden Sie diese e-Mail:"
|
236 |
-
|
237 |
-
#: woocommerce-ac.php:1686
|
238 |
-
msgid "after cart is abandoned."
|
239 |
-
msgstr "nachdem der Waernkorb verlassen wurde."
|
240 |
-
|
241 |
-
#: woocommerce-ac.php:1693
|
242 |
-
msgid "Send a test email to:"
|
243 |
-
msgstr "Sende Test E-Mail an:"
|
244 |
-
|
245 |
-
#: woocommerce-ac.php:1699
|
246 |
-
msgid "Enter the email id to which the test email needs to be sent."
|
247 |
-
msgstr "Geben Sie die Mailadresse für die Test E-Mail ein"
|
248 |
-
|
249 |
-
#: woocommerce-ac.php:1835 send_email.php:109
|
250 |
-
msgid "Your Shopping Cart"
|
251 |
-
msgstr "Ihr Warenkorb"
|
252 |
-
|
253 |
-
#: woocommerce-ac.php:1838 send_email.php:112
|
254 |
-
msgid "Item"
|
255 |
-
msgstr "Art."
|
256 |
-
|
257 |
-
#: woocommerce-ac.php:1839 send_email.php:113
|
258 |
-
msgid "Name"
|
259 |
-
msgstr "Name"
|
260 |
-
|
261 |
-
#: woocommerce-ac.php:1840 send_email.php:114
|
262 |
-
msgid "Quantity"
|
263 |
-
msgstr "Anzahl"
|
264 |
-
|
265 |
-
#: woocommerce-ac.php:1841 send_email.php:115
|
266 |
-
msgid "Price"
|
267 |
-
msgstr "Preis"
|
268 |
-
|
269 |
-
#: woocommerce-ac.php:1842 send_email.php:116
|
270 |
-
msgid "Line Subtotal"
|
271 |
-
msgstr "Zwischensumme"
|
272 |
-
|
273 |
-
#: woocommerce-ac.php:1846
|
274 |
-
msgid "Men\\'\\s Formal Shoes"
|
275 |
-
msgstr "Herrenschuhe"
|
276 |
-
|
277 |
-
#: woocommerce-ac.php:1853
|
278 |
-
msgid "Woman\\'\\s Hand Bags"
|
279 |
-
msgstr "Frauen Handtaschen"
|
280 |
-
|
281 |
-
#: woocommerce-ac.php:1862 send_email.php:160
|
282 |
-
msgid "Cart Total:"
|
283 |
-
msgstr "Warenkorb Total:"
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: \n"
|
9 |
+
"Report-Msgid-Bugs-To: \n"
|
10 |
+
"POT-Creation-Date: 2015-08-28 16:46+0200\n"
|
11 |
+
"PO-Revision-Date: 2015-08-28 17:51+0200\n"
|
12 |
+
"Language-Team: \n"
|
13 |
+
"MIME-Version: 1.0\n"
|
14 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
+
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
"X-Generator: Poedit 1.8.4\n"
|
17 |
+
"Last-Translator: \n"
|
18 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19 |
+
"Language: de_DE\n"
|
20 |
+
|
21 |
+
#: woocommerce-ac.php:22
|
22 |
+
msgid "Once Every Five Minutes"
|
23 |
+
msgstr "Alle fünf Minuten"
|
24 |
+
|
25 |
+
#: woocommerce-ac.php:204
|
26 |
+
#, php-format
|
27 |
+
msgid ""
|
28 |
+
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
29 |
+
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
30 |
+
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
31 |
+
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
32 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
33 |
+
msgstr ""
|
34 |
+
"Sie können auf die <a href=\"https://www.tychesoftwares.com/store/premium-"
|
35 |
+
"plugins/woocommerce-abandoned-cart-pro/\">PRO version von WooCommerce "
|
36 |
+
"Abandoned Cart plugin</a> mit 20% Rabatt upgraden. Nutzen Sie den Coupon-"
|
37 |
+
"Code <b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
38 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Jetzt kaufen </a> & $24 sparen!"
|
39 |
+
|
40 |
+
#: woocommerce-ac.php:314
|
41 |
+
msgid "Abandoned Carts"
|
42 |
+
msgstr "Verlassene Warenkörbe"
|
43 |
+
|
44 |
+
#: woocommerce-ac.php:516
|
45 |
+
msgid "Abandoned Orders"
|
46 |
+
msgstr "Abgebrochene Bestellungen"
|
47 |
+
|
48 |
+
#: woocommerce-ac.php:517
|
49 |
+
msgid "Email Templates"
|
50 |
+
msgstr "E-Mail-Vorlagen"
|
51 |
+
|
52 |
+
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
53 |
+
msgid "Settings"
|
54 |
+
msgstr "Einstellungen"
|
55 |
+
|
56 |
+
#: woocommerce-ac.php:519
|
57 |
+
msgid "Recovered Orders"
|
58 |
+
msgstr "Gerettete Bestellungen"
|
59 |
+
|
60 |
+
#: woocommerce-ac.php:661
|
61 |
+
msgid "You do not have sufficient permissions to access this page."
|
62 |
+
msgstr "Sie sind nicht befugt, auf diese Seite zuzugreifen."
|
63 |
+
|
64 |
+
#: woocommerce-ac.php:670
|
65 |
+
msgid "WooCommerce - Abandon Cart Lite"
|
66 |
+
msgstr "WooCommerce - Abandon Cart Lite"
|
67 |
+
|
68 |
+
#: woocommerce-ac.php:696
|
69 |
+
msgid "Your settings have been saved."
|
70 |
+
msgstr "Die Einstellungen wurden gespeichert."
|
71 |
+
|
72 |
+
#: woocommerce-ac.php:718
|
73 |
+
msgid "Cart abandoned cut-off time"
|
74 |
+
msgstr "Verlassene Warenkörbe Cut-Off Zeit"
|
75 |
+
|
76 |
+
#: woocommerce-ac.php:741
|
77 |
+
msgid "minutes"
|
78 |
+
msgstr "Minuten"
|
79 |
+
|
80 |
+
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
81 |
+
msgid ""
|
82 |
+
"Consider cart abandoned after X minutes of item being added to cart & order "
|
83 |
+
"not placed"
|
84 |
+
msgstr ""
|
85 |
+
"Warenkorb gilt nach X Minuten zwischen Warenkorb gefüllt und Bestellung "
|
86 |
+
"abgebrochen als verlassen."
|
87 |
+
|
88 |
+
#: woocommerce-ac.php:753
|
89 |
+
msgid "Save Changes"
|
90 |
+
msgstr "Änderungen Speichern"
|
91 |
+
|
92 |
+
#: woocommerce-ac.php:763
|
93 |
+
msgid ""
|
94 |
+
"The list below shows all Abandoned Carts which have remained in cart for a "
|
95 |
+
"time higher than the \"Cart abandoned cut-off time\" setting."
|
96 |
+
msgstr ""
|
97 |
+
"Die untenstehende Liste zeigt alle verlassenen Warenkörbe, die nach der Zeit "
|
98 |
+
"bei \"Verlassene Warenkörbe Cut-Off Zeit\" noch existieren."
|
99 |
+
|
100 |
+
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
101 |
+
msgid "Customer"
|
102 |
+
msgstr "Kunde"
|
103 |
+
|
104 |
+
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
105 |
+
msgid "Order Total"
|
106 |
+
msgstr "Bestellung gesamt"
|
107 |
+
|
108 |
+
#: woocommerce-ac.php:862
|
109 |
+
msgid "Date"
|
110 |
+
msgstr "Datum:"
|
111 |
+
|
112 |
+
#: woocommerce-ac.php:868
|
113 |
+
msgid "Status"
|
114 |
+
msgstr "Status"
|
115 |
+
|
116 |
+
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
117 |
+
msgid "Actions"
|
118 |
+
msgstr "Aktionen"
|
119 |
+
|
120 |
+
#: woocommerce-ac.php:953
|
121 |
+
msgid ""
|
122 |
+
"Add email templates at different intervals to maximize the possibility of "
|
123 |
+
"recovering your abandoned carts."
|
124 |
+
msgstr ""
|
125 |
+
"Fügen Sie E-Mail Vorlagen für unterschiedliche Zeitintervalle hinzu, um die "
|
126 |
+
"Chancen zu erhöhen, einen verlassenen Warenkorb in eine Bestellung zu "
|
127 |
+
"konvertieren."
|
128 |
+
|
129 |
+
#: woocommerce-ac.php:1054
|
130 |
+
msgid "The Email Template has been successfully added."
|
131 |
+
msgstr "Die E-Mail Vorlage wurde erfolgreich hinzugefügt."
|
132 |
+
|
133 |
+
#: woocommerce-ac.php:1057
|
134 |
+
msgid "The Email Template has been successfully updated."
|
135 |
+
msgstr "Die E-Mail Vorlage wurde erfolgreich angepasst."
|
136 |
+
|
137 |
+
#: woocommerce-ac.php:1145
|
138 |
+
msgid "Sr"
|
139 |
+
msgstr "Nr."
|
140 |
+
|
141 |
+
#: woocommerce-ac.php:1148
|
142 |
+
msgid "Template Name"
|
143 |
+
msgstr "Vorlagenname"
|
144 |
+
|
145 |
+
#: woocommerce-ac.php:1154
|
146 |
+
msgid "Sent"
|
147 |
+
msgstr "Gesendet"
|
148 |
+
|
149 |
+
#: woocommerce-ac.php:1158
|
150 |
+
msgid "Active ?"
|
151 |
+
msgstr "aktiv?"
|
152 |
+
|
153 |
+
#: woocommerce-ac.php:1276
|
154 |
+
msgid ""
|
155 |
+
"The Report below shows how many Abandoned Carts we were able to recover for "
|
156 |
+
"you by sending automatic emails to encourage shoppers."
|
157 |
+
msgstr ""
|
158 |
+
"Der untenstehende Report zeigt, wieviele verlassene Warenkörbe aufgrund der "
|
159 |
+
"E-Mailautomatik gerettet wurden."
|
160 |
+
|
161 |
+
#: woocommerce-ac.php:1331
|
162 |
+
msgid "Start Date:"
|
163 |
+
msgstr "Startdatum:"
|
164 |
+
|
165 |
+
#: woocommerce-ac.php:1334
|
166 |
+
msgid "End Date:"
|
167 |
+
msgstr "Enddatum:"
|
168 |
+
|
169 |
+
#: woocommerce-ac.php:1337
|
170 |
+
msgid "Go"
|
171 |
+
msgstr "Los"
|
172 |
+
|
173 |
+
#: woocommerce-ac.php:1495
|
174 |
+
msgid "During the selected range"
|
175 |
+
msgstr "Während des gewählten Zeitraums wurden"
|
176 |
+
|
177 |
+
#: woocommerce-ac.php:1495
|
178 |
+
msgid "carts totaling"
|
179 |
+
msgstr "Warenkörbe mit einem Gesamtwert von"
|
180 |
+
|
181 |
+
#: woocommerce-ac.php:1495
|
182 |
+
msgid "were abandoned. We were able to recover"
|
183 |
+
msgstr "verlassen. Es konnten"
|
184 |
+
|
185 |
+
#: woocommerce-ac.php:1495
|
186 |
+
msgid "of them, which led to an extra"
|
187 |
+
msgstr "dieser Warenkörbe gerettet werden, was zu einem Extra-Umsatz von"
|
188 |
+
|
189 |
+
#: woocommerce-ac.php:1495
|
190 |
+
msgid "in sales"
|
191 |
+
msgstr "führte."
|
192 |
+
|
193 |
+
#: woocommerce-ac.php:1504
|
194 |
+
msgid "Created On"
|
195 |
+
msgstr "Erstellt Am"
|
196 |
+
|
197 |
+
#: woocommerce-ac.php:1510
|
198 |
+
msgid "Recovered Date"
|
199 |
+
msgstr "Datum der Rettung"
|
200 |
+
|
201 |
+
#: woocommerce-ac.php:1561
|
202 |
+
msgid "Template Name:"
|
203 |
+
msgstr "Vorlagenname"
|
204 |
+
|
205 |
+
#: woocommerce-ac.php:1572
|
206 |
+
msgid "Enter a template name for reference"
|
207 |
+
msgstr "Geben Sie einen Vorlagennamen als Referenz an"
|
208 |
+
|
209 |
+
#: woocommerce-ac.php:1577
|
210 |
+
msgid "Send From This Name:"
|
211 |
+
msgstr "Absendername"
|
212 |
+
|
213 |
+
#: woocommerce-ac.php:1588
|
214 |
+
msgid "Enter the name that should appear in the email sent"
|
215 |
+
msgstr "Geben Sie den Absendernamen an, der erscheinen soll"
|
216 |
+
|
217 |
+
#: woocommerce-ac.php:1594
|
218 |
+
msgid "Subject:"
|
219 |
+
msgstr "Betreff:"
|
220 |
+
|
221 |
+
#: woocommerce-ac.php:1605
|
222 |
+
msgid "Enter the subject that should appear in the email sent"
|
223 |
+
msgstr "Geben Sie den Betreff an, der in der Mail erscheinen soll"
|
224 |
+
|
225 |
+
#: woocommerce-ac.php:1611
|
226 |
+
msgid "Email Body:"
|
227 |
+
msgstr "E-Mail-Text:"
|
228 |
+
|
229 |
+
#: woocommerce-ac.php:1627
|
230 |
+
msgid "Message to be sent in the reminder email."
|
231 |
+
msgstr "Zu sendende Nachricht in der Erinnerungsmail."
|
232 |
+
|
233 |
+
#: woocommerce-ac.php:1634
|
234 |
+
msgid "Send this email:"
|
235 |
+
msgstr "Senden Sie diese e-Mail:"
|
236 |
+
|
237 |
+
#: woocommerce-ac.php:1686
|
238 |
+
msgid "after cart is abandoned."
|
239 |
+
msgstr "nachdem der Waernkorb verlassen wurde."
|
240 |
+
|
241 |
+
#: woocommerce-ac.php:1693
|
242 |
+
msgid "Send a test email to:"
|
243 |
+
msgstr "Sende Test E-Mail an:"
|
244 |
+
|
245 |
+
#: woocommerce-ac.php:1699
|
246 |
+
msgid "Enter the email id to which the test email needs to be sent."
|
247 |
+
msgstr "Geben Sie die Mailadresse für die Test E-Mail ein"
|
248 |
+
|
249 |
+
#: woocommerce-ac.php:1835 send_email.php:109
|
250 |
+
msgid "Your Shopping Cart"
|
251 |
+
msgstr "Ihr Warenkorb"
|
252 |
+
|
253 |
+
#: woocommerce-ac.php:1838 send_email.php:112
|
254 |
+
msgid "Item"
|
255 |
+
msgstr "Art."
|
256 |
+
|
257 |
+
#: woocommerce-ac.php:1839 send_email.php:113
|
258 |
+
msgid "Name"
|
259 |
+
msgstr "Name"
|
260 |
+
|
261 |
+
#: woocommerce-ac.php:1840 send_email.php:114
|
262 |
+
msgid "Quantity"
|
263 |
+
msgstr "Anzahl"
|
264 |
+
|
265 |
+
#: woocommerce-ac.php:1841 send_email.php:115
|
266 |
+
msgid "Price"
|
267 |
+
msgstr "Preis"
|
268 |
+
|
269 |
+
#: woocommerce-ac.php:1842 send_email.php:116
|
270 |
+
msgid "Line Subtotal"
|
271 |
+
msgstr "Zwischensumme"
|
272 |
+
|
273 |
+
#: woocommerce-ac.php:1846
|
274 |
+
msgid "Men\\'\\s Formal Shoes"
|
275 |
+
msgstr "Herrenschuhe"
|
276 |
+
|
277 |
+
#: woocommerce-ac.php:1853
|
278 |
+
msgid "Woman\\'\\s Hand Bags"
|
279 |
+
msgstr "Frauen Handtaschen"
|
280 |
+
|
281 |
+
#: woocommerce-ac.php:1862 send_email.php:160
|
282 |
+
msgid "Cart Total:"
|
283 |
+
msgstr "Warenkorb Total:"
|
{languages → i18n/languages}/woocommerce-ac-he_IL.mo
RENAMED
File without changes
|
{languages → i18n/languages}/woocommerce-ac-he_IL.po
RENAMED
@@ -1,281 +1,281 @@
|
|
1 |
-
# SOME DESCRIPTIVE TITLE.
|
2 |
-
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
-
# This file is distributed under the same license as the PACKAGE package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
-
#
|
6 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: \n"
|
9 |
-
"Report-Msgid-Bugs-To: \n"
|
10 |
-
"POT-Creation-Date: 2015-08-11 18:39+0300\n"
|
11 |
-
"PO-Revision-Date: 2015-08-11 19:03+0300\n"
|
12 |
-
"Language-Team: \n"
|
13 |
-
"MIME-Version: 1.0\n"
|
14 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
-
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
"X-Generator: Poedit 1.8.4\n"
|
17 |
-
"Last-Translator: \n"
|
18 |
-
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19 |
-
"Language: he_IL\n"
|
20 |
-
|
21 |
-
#: woocommerce-ac.php:22
|
22 |
-
msgid "Once Every Five Minutes"
|
23 |
-
msgstr "פעם אחת כל חמש דקות"
|
24 |
-
|
25 |
-
#: woocommerce-ac.php:204
|
26 |
-
#, php-format
|
27 |
-
msgid ""
|
28 |
-
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
29 |
-
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
30 |
-
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
31 |
-
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
32 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
33 |
-
msgstr ""
|
34 |
-
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
35 |
-
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
36 |
-
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
37 |
-
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
38 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
39 |
-
|
40 |
-
#: woocommerce-ac.php:314
|
41 |
-
msgid "Abandoned Carts"
|
42 |
-
msgstr "עגלות שננטשו"
|
43 |
-
|
44 |
-
#: woocommerce-ac.php:516
|
45 |
-
msgid "Abandoned Orders"
|
46 |
-
msgstr "הזמנות שננטשו"
|
47 |
-
|
48 |
-
#: woocommerce-ac.php:517
|
49 |
-
msgid "Email Templates"
|
50 |
-
msgstr "תבניות אימייל"
|
51 |
-
|
52 |
-
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
53 |
-
msgid "Settings"
|
54 |
-
msgstr "הגדרות"
|
55 |
-
|
56 |
-
#: woocommerce-ac.php:519
|
57 |
-
msgid "Recovered Orders"
|
58 |
-
msgstr "הזמנות ששוחזרו"
|
59 |
-
|
60 |
-
#: woocommerce-ac.php:661
|
61 |
-
msgid "You do not have sufficient permissions to access this page."
|
62 |
-
msgstr "אין לך הרשאה מתאימה לגשת לעמוד זה."
|
63 |
-
|
64 |
-
#: woocommerce-ac.php:670
|
65 |
-
msgid "WooCommerce - Abandon Cart Lite"
|
66 |
-
msgstr "Woocommerce - עגלות נטושות לייט"
|
67 |
-
|
68 |
-
#: woocommerce-ac.php:696
|
69 |
-
msgid "Your settings have been saved."
|
70 |
-
msgstr "ההגדרות שלך נשמרו"
|
71 |
-
|
72 |
-
#: woocommerce-ac.php:718
|
73 |
-
msgid "Cart abandoned cut-off time"
|
74 |
-
msgstr "זמן חישוב עגלה כנטושה"
|
75 |
-
|
76 |
-
#: woocommerce-ac.php:741
|
77 |
-
msgid "minutes"
|
78 |
-
msgstr "דקות"
|
79 |
-
|
80 |
-
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
81 |
-
msgid ""
|
82 |
-
"Consider cart abandoned after X minutes of item being added to cart & order "
|
83 |
-
"not placed"
|
84 |
-
msgstr ""
|
85 |
-
"החשב עגלה כנטושה אחרי X דקות מאז הפריט הוסף לעגלת הקניות וההזמנה לא בוצעה"
|
86 |
-
|
87 |
-
#: woocommerce-ac.php:753
|
88 |
-
msgid "Save Changes"
|
89 |
-
msgstr "שמור שינויים"
|
90 |
-
|
91 |
-
#: woocommerce-ac.php:763
|
92 |
-
msgid ""
|
93 |
-
"The list below shows all Abandoned Carts which have remained in cart for a "
|
94 |
-
"time higher than the \"Cart abandoned cut-off time\" setting."
|
95 |
-
msgstr ""
|
96 |
-
"רשימה זו מציגה את כל העגלות שננטשו אשר נותרו בעגלה לפרק זמן העולה על ״זמן "
|
97 |
-
"חישוב עגלה כנטושה״."
|
98 |
-
|
99 |
-
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
100 |
-
msgid "Customer"
|
101 |
-
msgstr "לקוח"
|
102 |
-
|
103 |
-
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
104 |
-
msgid "Order Total"
|
105 |
-
msgstr "סה״כ להזמנה"
|
106 |
-
|
107 |
-
#: woocommerce-ac.php:862
|
108 |
-
msgid "Date"
|
109 |
-
msgstr "תאריך"
|
110 |
-
|
111 |
-
#: woocommerce-ac.php:868
|
112 |
-
msgid "Status"
|
113 |
-
msgstr "סטטוס"
|
114 |
-
|
115 |
-
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
116 |
-
msgid "Actions"
|
117 |
-
msgstr "פעולות"
|
118 |
-
|
119 |
-
#: woocommerce-ac.php:953
|
120 |
-
msgid ""
|
121 |
-
"Add email templates at different intervals to maximize the possibility of "
|
122 |
-
"recovering your abandoned carts."
|
123 |
-
msgstr ""
|
124 |
-
"הוסף תבניות אימייל בפרקי זמן שונים כדי למקסם את האפשרות לשחזר עגלות נטושות "
|
125 |
-
"שלך."
|
126 |
-
|
127 |
-
#: woocommerce-ac.php:1054
|
128 |
-
msgid "The Email Template has been successfully added."
|
129 |
-
msgstr "תבנית אימייל התווספה בהצלחה."
|
130 |
-
|
131 |
-
#: woocommerce-ac.php:1057
|
132 |
-
msgid "The Email Template has been successfully updated."
|
133 |
-
msgstr "תבנית אימייל עודכנה בהצלחה."
|
134 |
-
|
135 |
-
#: woocommerce-ac.php:1145
|
136 |
-
msgid "Sr"
|
137 |
-
msgstr "Sr"
|
138 |
-
|
139 |
-
#: woocommerce-ac.php:1148
|
140 |
-
msgid "Template Name"
|
141 |
-
msgstr "שם תבנית"
|
142 |
-
|
143 |
-
#: woocommerce-ac.php:1154
|
144 |
-
msgid "Sent"
|
145 |
-
msgstr "נשלח"
|
146 |
-
|
147 |
-
#: woocommerce-ac.php:1158
|
148 |
-
msgid "Active ?"
|
149 |
-
msgstr "פעיל?"
|
150 |
-
|
151 |
-
#: woocommerce-ac.php:1276
|
152 |
-
msgid ""
|
153 |
-
"The Report below shows how many Abandoned Carts we were able to recover for "
|
154 |
-
"you by sending automatic emails to encourage shoppers."
|
155 |
-
msgstr ""
|
156 |
-
"הדו״ח שלהלן מציג כמה עגלות שננטשו שוחזרו עבורך על ידי שליחה אוטומטית של "
|
157 |
-
"אימיילים לטובת עידוד קונים."
|
158 |
-
|
159 |
-
#: woocommerce-ac.php:1331
|
160 |
-
msgid "Start Date:"
|
161 |
-
msgstr "תאריך התחלה:"
|
162 |
-
|
163 |
-
#: woocommerce-ac.php:1334
|
164 |
-
msgid "End Date:"
|
165 |
-
msgstr "תאריך סיום:"
|
166 |
-
|
167 |
-
#: woocommerce-ac.php:1337
|
168 |
-
msgid "Go"
|
169 |
-
msgstr "שלח"
|
170 |
-
|
171 |
-
#: woocommerce-ac.php:1495
|
172 |
-
msgid "During the selected range"
|
173 |
-
msgstr "במהלך התקופה הנקובה"
|
174 |
-
|
175 |
-
#: woocommerce-ac.php:1495
|
176 |
-
msgid "carts totaling"
|
177 |
-
msgstr "עגלות בסך"
|
178 |
-
|
179 |
-
#: woocommerce-ac.php:1495
|
180 |
-
msgid "were abandoned. We were able to recover"
|
181 |
-
msgstr "ננטשו. הצלחנו לשחזר"
|
182 |
-
|
183 |
-
#: woocommerce-ac.php:1495
|
184 |
-
msgid "of them, which led to an extra"
|
185 |
-
msgstr "מתוכן, אשר הוביל לתוספת של"
|
186 |
-
|
187 |
-
#: woocommerce-ac.php:1495
|
188 |
-
msgid "in sales"
|
189 |
-
msgstr "במכירות"
|
190 |
-
|
191 |
-
#: woocommerce-ac.php:1504
|
192 |
-
msgid "Created On"
|
193 |
-
msgstr "נוצר ב"
|
194 |
-
|
195 |
-
#: woocommerce-ac.php:1510
|
196 |
-
msgid "Recovered Date"
|
197 |
-
msgstr "תאריך שחזור"
|
198 |
-
|
199 |
-
#: woocommerce-ac.php:1561
|
200 |
-
msgid "Template Name:"
|
201 |
-
msgstr "שם תבנית:"
|
202 |
-
|
203 |
-
#: woocommerce-ac.php:1572
|
204 |
-
msgid "Enter a template name for reference"
|
205 |
-
msgstr "הכנס שם לתבנית לטובת סימוכין"
|
206 |
-
|
207 |
-
#: woocommerce-ac.php:1577
|
208 |
-
msgid "Send From This Name:"
|
209 |
-
msgstr "מאת:"
|
210 |
-
|
211 |
-
#: woocommerce-ac.php:1588
|
212 |
-
msgid "Enter the name that should appear in the email sent"
|
213 |
-
msgstr "הכנס את השם אשר יופיע באימייל שיישלח"
|
214 |
-
|
215 |
-
#: woocommerce-ac.php:1594
|
216 |
-
msgid "Subject:"
|
217 |
-
msgstr "נושא:"
|
218 |
-
|
219 |
-
#: woocommerce-ac.php:1605
|
220 |
-
msgid "Enter the subject that should appear in the email sent"
|
221 |
-
msgstr "הכנס את הנושא אשר יופיע באימייל שיישלח"
|
222 |
-
|
223 |
-
#: woocommerce-ac.php:1611
|
224 |
-
msgid "Email Body:"
|
225 |
-
msgstr "גוף האימייל:"
|
226 |
-
|
227 |
-
#: woocommerce-ac.php:1627
|
228 |
-
msgid "Message to be sent in the reminder email."
|
229 |
-
msgstr "הודעה אשר תישלח באימייל תזכורת."
|
230 |
-
|
231 |
-
#: woocommerce-ac.php:1634
|
232 |
-
msgid "Send this email:"
|
233 |
-
msgstr "שלח אימייל זה:"
|
234 |
-
|
235 |
-
#: woocommerce-ac.php:1686
|
236 |
-
msgid "after cart is abandoned."
|
237 |
-
msgstr "אחרי שננטשת עגלה."
|
238 |
-
|
239 |
-
#: woocommerce-ac.php:1693
|
240 |
-
msgid "Send a test email to:"
|
241 |
-
msgstr "שלח מייל בדיקה אל:"
|
242 |
-
|
243 |
-
#: woocommerce-ac.php:1699
|
244 |
-
msgid "Enter the email id to which the test email needs to be sent."
|
245 |
-
msgstr "הכנס את כתובת האימייל אליה יישלח מייל בדיקה."
|
246 |
-
|
247 |
-
#: woocommerce-ac.php:1835 send_email.php:109
|
248 |
-
msgid "Your Shopping Cart"
|
249 |
-
msgstr "עגלת הקניות שלך"
|
250 |
-
|
251 |
-
#: woocommerce-ac.php:1838 send_email.php:112
|
252 |
-
msgid "Item"
|
253 |
-
msgstr "פריט"
|
254 |
-
|
255 |
-
#: woocommerce-ac.php:1839 send_email.php:113
|
256 |
-
msgid "Name"
|
257 |
-
msgstr "שם"
|
258 |
-
|
259 |
-
#: woocommerce-ac.php:1840 send_email.php:114
|
260 |
-
msgid "Quantity"
|
261 |
-
msgstr "כמות"
|
262 |
-
|
263 |
-
#: woocommerce-ac.php:1841 send_email.php:115
|
264 |
-
msgid "Price"
|
265 |
-
msgstr "מחיר"
|
266 |
-
|
267 |
-
#: woocommerce-ac.php:1842 send_email.php:116
|
268 |
-
msgid "Line Subtotal"
|
269 |
-
msgstr "סכום ביניים"
|
270 |
-
|
271 |
-
#: woocommerce-ac.php:1846
|
272 |
-
msgid "Men\\'\\s Formal Shoes"
|
273 |
-
msgstr "נעלי גברים"
|
274 |
-
|
275 |
-
#: woocommerce-ac.php:1853
|
276 |
-
msgid "Woman\\'\\s Hand Bags"
|
277 |
-
msgstr "תיקי יד של נשים"
|
278 |
-
|
279 |
-
#: woocommerce-ac.php:1862 send_email.php:160
|
280 |
-
msgid "Cart Total:"
|
281 |
-
msgstr "סה״כ בעגלה:"
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: \n"
|
9 |
+
"Report-Msgid-Bugs-To: \n"
|
10 |
+
"POT-Creation-Date: 2015-08-11 18:39+0300\n"
|
11 |
+
"PO-Revision-Date: 2015-08-11 19:03+0300\n"
|
12 |
+
"Language-Team: \n"
|
13 |
+
"MIME-Version: 1.0\n"
|
14 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
+
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
"X-Generator: Poedit 1.8.4\n"
|
17 |
+
"Last-Translator: \n"
|
18 |
+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
19 |
+
"Language: he_IL\n"
|
20 |
+
|
21 |
+
#: woocommerce-ac.php:22
|
22 |
+
msgid "Once Every Five Minutes"
|
23 |
+
msgstr "פעם אחת כל חמש דקות"
|
24 |
+
|
25 |
+
#: woocommerce-ac.php:204
|
26 |
+
#, php-format
|
27 |
+
msgid ""
|
28 |
+
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
29 |
+
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
30 |
+
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
31 |
+
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
32 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
33 |
+
msgstr ""
|
34 |
+
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
35 |
+
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
36 |
+
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
37 |
+
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
38 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
39 |
+
|
40 |
+
#: woocommerce-ac.php:314
|
41 |
+
msgid "Abandoned Carts"
|
42 |
+
msgstr "עגלות שננטשו"
|
43 |
+
|
44 |
+
#: woocommerce-ac.php:516
|
45 |
+
msgid "Abandoned Orders"
|
46 |
+
msgstr "הזמנות שננטשו"
|
47 |
+
|
48 |
+
#: woocommerce-ac.php:517
|
49 |
+
msgid "Email Templates"
|
50 |
+
msgstr "תבניות אימייל"
|
51 |
+
|
52 |
+
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
53 |
+
msgid "Settings"
|
54 |
+
msgstr "הגדרות"
|
55 |
+
|
56 |
+
#: woocommerce-ac.php:519
|
57 |
+
msgid "Recovered Orders"
|
58 |
+
msgstr "הזמנות ששוחזרו"
|
59 |
+
|
60 |
+
#: woocommerce-ac.php:661
|
61 |
+
msgid "You do not have sufficient permissions to access this page."
|
62 |
+
msgstr "אין לך הרשאה מתאימה לגשת לעמוד זה."
|
63 |
+
|
64 |
+
#: woocommerce-ac.php:670
|
65 |
+
msgid "WooCommerce - Abandon Cart Lite"
|
66 |
+
msgstr "Woocommerce - עגלות נטושות לייט"
|
67 |
+
|
68 |
+
#: woocommerce-ac.php:696
|
69 |
+
msgid "Your settings have been saved."
|
70 |
+
msgstr "ההגדרות שלך נשמרו"
|
71 |
+
|
72 |
+
#: woocommerce-ac.php:718
|
73 |
+
msgid "Cart abandoned cut-off time"
|
74 |
+
msgstr "זמן חישוב עגלה כנטושה"
|
75 |
+
|
76 |
+
#: woocommerce-ac.php:741
|
77 |
+
msgid "minutes"
|
78 |
+
msgstr "דקות"
|
79 |
+
|
80 |
+
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
81 |
+
msgid ""
|
82 |
+
"Consider cart abandoned after X minutes of item being added to cart & order "
|
83 |
+
"not placed"
|
84 |
+
msgstr ""
|
85 |
+
"החשב עגלה כנטושה אחרי X דקות מאז הפריט הוסף לעגלת הקניות וההזמנה לא בוצעה"
|
86 |
+
|
87 |
+
#: woocommerce-ac.php:753
|
88 |
+
msgid "Save Changes"
|
89 |
+
msgstr "שמור שינויים"
|
90 |
+
|
91 |
+
#: woocommerce-ac.php:763
|
92 |
+
msgid ""
|
93 |
+
"The list below shows all Abandoned Carts which have remained in cart for a "
|
94 |
+
"time higher than the \"Cart abandoned cut-off time\" setting."
|
95 |
+
msgstr ""
|
96 |
+
"רשימה זו מציגה את כל העגלות שננטשו אשר נותרו בעגלה לפרק זמן העולה על ״זמן "
|
97 |
+
"חישוב עגלה כנטושה״."
|
98 |
+
|
99 |
+
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
100 |
+
msgid "Customer"
|
101 |
+
msgstr "לקוח"
|
102 |
+
|
103 |
+
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
104 |
+
msgid "Order Total"
|
105 |
+
msgstr "סה״כ להזמנה"
|
106 |
+
|
107 |
+
#: woocommerce-ac.php:862
|
108 |
+
msgid "Date"
|
109 |
+
msgstr "תאריך"
|
110 |
+
|
111 |
+
#: woocommerce-ac.php:868
|
112 |
+
msgid "Status"
|
113 |
+
msgstr "סטטוס"
|
114 |
+
|
115 |
+
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
116 |
+
msgid "Actions"
|
117 |
+
msgstr "פעולות"
|
118 |
+
|
119 |
+
#: woocommerce-ac.php:953
|
120 |
+
msgid ""
|
121 |
+
"Add email templates at different intervals to maximize the possibility of "
|
122 |
+
"recovering your abandoned carts."
|
123 |
+
msgstr ""
|
124 |
+
"הוסף תבניות אימייל בפרקי זמן שונים כדי למקסם את האפשרות לשחזר עגלות נטושות "
|
125 |
+
"שלך."
|
126 |
+
|
127 |
+
#: woocommerce-ac.php:1054
|
128 |
+
msgid "The Email Template has been successfully added."
|
129 |
+
msgstr "תבנית אימייל התווספה בהצלחה."
|
130 |
+
|
131 |
+
#: woocommerce-ac.php:1057
|
132 |
+
msgid "The Email Template has been successfully updated."
|
133 |
+
msgstr "תבנית אימייל עודכנה בהצלחה."
|
134 |
+
|
135 |
+
#: woocommerce-ac.php:1145
|
136 |
+
msgid "Sr"
|
137 |
+
msgstr "Sr"
|
138 |
+
|
139 |
+
#: woocommerce-ac.php:1148
|
140 |
+
msgid "Template Name"
|
141 |
+
msgstr "שם תבנית"
|
142 |
+
|
143 |
+
#: woocommerce-ac.php:1154
|
144 |
+
msgid "Sent"
|
145 |
+
msgstr "נשלח"
|
146 |
+
|
147 |
+
#: woocommerce-ac.php:1158
|
148 |
+
msgid "Active ?"
|
149 |
+
msgstr "פעיל?"
|
150 |
+
|
151 |
+
#: woocommerce-ac.php:1276
|
152 |
+
msgid ""
|
153 |
+
"The Report below shows how many Abandoned Carts we were able to recover for "
|
154 |
+
"you by sending automatic emails to encourage shoppers."
|
155 |
+
msgstr ""
|
156 |
+
"הדו״ח שלהלן מציג כמה עגלות שננטשו שוחזרו עבורך על ידי שליחה אוטומטית של "
|
157 |
+
"אימיילים לטובת עידוד קונים."
|
158 |
+
|
159 |
+
#: woocommerce-ac.php:1331
|
160 |
+
msgid "Start Date:"
|
161 |
+
msgstr "תאריך התחלה:"
|
162 |
+
|
163 |
+
#: woocommerce-ac.php:1334
|
164 |
+
msgid "End Date:"
|
165 |
+
msgstr "תאריך סיום:"
|
166 |
+
|
167 |
+
#: woocommerce-ac.php:1337
|
168 |
+
msgid "Go"
|
169 |
+
msgstr "שלח"
|
170 |
+
|
171 |
+
#: woocommerce-ac.php:1495
|
172 |
+
msgid "During the selected range"
|
173 |
+
msgstr "במהלך התקופה הנקובה"
|
174 |
+
|
175 |
+
#: woocommerce-ac.php:1495
|
176 |
+
msgid "carts totaling"
|
177 |
+
msgstr "עגלות בסך"
|
178 |
+
|
179 |
+
#: woocommerce-ac.php:1495
|
180 |
+
msgid "were abandoned. We were able to recover"
|
181 |
+
msgstr "ננטשו. הצלחנו לשחזר"
|
182 |
+
|
183 |
+
#: woocommerce-ac.php:1495
|
184 |
+
msgid "of them, which led to an extra"
|
185 |
+
msgstr "מתוכן, אשר הוביל לתוספת של"
|
186 |
+
|
187 |
+
#: woocommerce-ac.php:1495
|
188 |
+
msgid "in sales"
|
189 |
+
msgstr "במכירות"
|
190 |
+
|
191 |
+
#: woocommerce-ac.php:1504
|
192 |
+
msgid "Created On"
|
193 |
+
msgstr "נוצר ב"
|
194 |
+
|
195 |
+
#: woocommerce-ac.php:1510
|
196 |
+
msgid "Recovered Date"
|
197 |
+
msgstr "תאריך שחזור"
|
198 |
+
|
199 |
+
#: woocommerce-ac.php:1561
|
200 |
+
msgid "Template Name:"
|
201 |
+
msgstr "שם תבנית:"
|
202 |
+
|
203 |
+
#: woocommerce-ac.php:1572
|
204 |
+
msgid "Enter a template name for reference"
|
205 |
+
msgstr "הכנס שם לתבנית לטובת סימוכין"
|
206 |
+
|
207 |
+
#: woocommerce-ac.php:1577
|
208 |
+
msgid "Send From This Name:"
|
209 |
+
msgstr "מאת:"
|
210 |
+
|
211 |
+
#: woocommerce-ac.php:1588
|
212 |
+
msgid "Enter the name that should appear in the email sent"
|
213 |
+
msgstr "הכנס את השם אשר יופיע באימייל שיישלח"
|
214 |
+
|
215 |
+
#: woocommerce-ac.php:1594
|
216 |
+
msgid "Subject:"
|
217 |
+
msgstr "נושא:"
|
218 |
+
|
219 |
+
#: woocommerce-ac.php:1605
|
220 |
+
msgid "Enter the subject that should appear in the email sent"
|
221 |
+
msgstr "הכנס את הנושא אשר יופיע באימייל שיישלח"
|
222 |
+
|
223 |
+
#: woocommerce-ac.php:1611
|
224 |
+
msgid "Email Body:"
|
225 |
+
msgstr "גוף האימייל:"
|
226 |
+
|
227 |
+
#: woocommerce-ac.php:1627
|
228 |
+
msgid "Message to be sent in the reminder email."
|
229 |
+
msgstr "הודעה אשר תישלח באימייל תזכורת."
|
230 |
+
|
231 |
+
#: woocommerce-ac.php:1634
|
232 |
+
msgid "Send this email:"
|
233 |
+
msgstr "שלח אימייל זה:"
|
234 |
+
|
235 |
+
#: woocommerce-ac.php:1686
|
236 |
+
msgid "after cart is abandoned."
|
237 |
+
msgstr "אחרי שננטשת עגלה."
|
238 |
+
|
239 |
+
#: woocommerce-ac.php:1693
|
240 |
+
msgid "Send a test email to:"
|
241 |
+
msgstr "שלח מייל בדיקה אל:"
|
242 |
+
|
243 |
+
#: woocommerce-ac.php:1699
|
244 |
+
msgid "Enter the email id to which the test email needs to be sent."
|
245 |
+
msgstr "הכנס את כתובת האימייל אליה יישלח מייל בדיקה."
|
246 |
+
|
247 |
+
#: woocommerce-ac.php:1835 send_email.php:109
|
248 |
+
msgid "Your Shopping Cart"
|
249 |
+
msgstr "עגלת הקניות שלך"
|
250 |
+
|
251 |
+
#: woocommerce-ac.php:1838 send_email.php:112
|
252 |
+
msgid "Item"
|
253 |
+
msgstr "פריט"
|
254 |
+
|
255 |
+
#: woocommerce-ac.php:1839 send_email.php:113
|
256 |
+
msgid "Name"
|
257 |
+
msgstr "שם"
|
258 |
+
|
259 |
+
#: woocommerce-ac.php:1840 send_email.php:114
|
260 |
+
msgid "Quantity"
|
261 |
+
msgstr "כמות"
|
262 |
+
|
263 |
+
#: woocommerce-ac.php:1841 send_email.php:115
|
264 |
+
msgid "Price"
|
265 |
+
msgstr "מחיר"
|
266 |
+
|
267 |
+
#: woocommerce-ac.php:1842 send_email.php:116
|
268 |
+
msgid "Line Subtotal"
|
269 |
+
msgstr "סכום ביניים"
|
270 |
+
|
271 |
+
#: woocommerce-ac.php:1846
|
272 |
+
msgid "Men\\'\\s Formal Shoes"
|
273 |
+
msgstr "נעלי גברים"
|
274 |
+
|
275 |
+
#: woocommerce-ac.php:1853
|
276 |
+
msgid "Woman\\'\\s Hand Bags"
|
277 |
+
msgstr "תיקי יד של נשים"
|
278 |
+
|
279 |
+
#: woocommerce-ac.php:1862 send_email.php:160
|
280 |
+
msgid "Cart Total:"
|
281 |
+
msgstr "סה״כ בעגלה:"
|
{languages → i18n/languages}/woocommerce-ac-sk_SK.mo
RENAMED
File without changes
|
{languages → i18n/languages}/woocommerce-ac-sk_SK.po
RENAMED
@@ -1,283 +1,283 @@
|
|
1 |
-
# SOME DESCRIPTIVE TITLE.
|
2 |
-
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
-
# This file is distributed under the same license as the PACKAGE package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
-
#
|
6 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: woocommerce-ac\n"
|
9 |
-
"Report-Msgid-Bugs-To: \n"
|
10 |
-
"POT-Creation-Date: 2015-07-08 16:30+0530\n"
|
11 |
-
"PO-Revision-Date: 2015-12-16 10:00+0100\n"
|
12 |
-
"Last-Translator: \n"
|
13 |
-
"Language-Team: Mauro <marek9.danko@gmail.com>\n"
|
14 |
-
"MIME-Version: 1.0\n"
|
15 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
-
"Content-Transfer-Encoding: 8bit\n"
|
17 |
-
"X-Generator: Poedit 1.8.1\n"
|
18 |
-
"X-Poedit-KeywordsList: __;_e\n"
|
19 |
-
"X-Poedit-Basepath: .\n"
|
20 |
-
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
21 |
-
"Language: sk_SK\n"
|
22 |
-
|
23 |
-
#: woocommerce-ac.php:22
|
24 |
-
msgid "Once Every Five Minutes"
|
25 |
-
msgstr "Po každých piatich minútach"
|
26 |
-
|
27 |
-
#: woocommerce-ac.php:204
|
28 |
-
msgid ""
|
29 |
-
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
30 |
-
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
31 |
-
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
32 |
-
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
33 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
34 |
-
msgstr ""
|
35 |
-
"Môžete upgradovať na <a href=\"https://www.tychesoftwares.com/store/premium-"
|
36 |
-
"plugins/woocommerce-abandoned-cart-pro/\">PRO verziu WooCommerce Abandoned "
|
37 |
-
"Cart plugin</a> s <b>20% zľavou</b>. Použite kód: <b>ACPRO20</b>.<a href="
|
38 |
-
"\"https://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-"
|
39 |
-
"cart-pro/\"> Zakúpte teraz </a> a ušetrite 24$ !"
|
40 |
-
|
41 |
-
#: woocommerce-ac.php:314
|
42 |
-
msgid "Abandoned Carts"
|
43 |
-
msgstr "Opustené Košíky"
|
44 |
-
|
45 |
-
#: woocommerce-ac.php:516
|
46 |
-
msgid "Abandoned Orders"
|
47 |
-
msgstr "Opustené Objednávky"
|
48 |
-
|
49 |
-
#: woocommerce-ac.php:517
|
50 |
-
msgid "Email Templates"
|
51 |
-
msgstr "E-mailové šablóny"
|
52 |
-
|
53 |
-
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
54 |
-
msgid "Settings"
|
55 |
-
msgstr "Nastavenia"
|
56 |
-
|
57 |
-
#: woocommerce-ac.php:519
|
58 |
-
msgid "Recovered Orders"
|
59 |
-
msgstr "Spätne získaná objednávka "
|
60 |
-
|
61 |
-
#: woocommerce-ac.php:661
|
62 |
-
msgid "You do not have sufficient permissions to access this page."
|
63 |
-
msgstr "Nemáte dostatočné oprávnenia k prístupu na túto stránku."
|
64 |
-
|
65 |
-
#: woocommerce-ac.php:670
|
66 |
-
msgid "WooCommerce - Abandon Cart Lite"
|
67 |
-
msgstr ""
|
68 |
-
|
69 |
-
#: woocommerce-ac.php:696
|
70 |
-
msgid "Your settings have been saved."
|
71 |
-
msgstr "Vaše nastavenia boli uložené."
|
72 |
-
|
73 |
-
#: woocommerce-ac.php:718
|
74 |
-
msgid "Cart abandoned cut-off time"
|
75 |
-
msgstr "Limit pre opustený košík"
|
76 |
-
|
77 |
-
#: woocommerce-ac.php:741
|
78 |
-
msgid "minutes"
|
79 |
-
msgstr "minút"
|
80 |
-
|
81 |
-
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
82 |
-
msgid ""
|
83 |
-
"Consider cart abandoned after X minutes of item being added to cart & order "
|
84 |
-
"not placed"
|
85 |
-
msgstr ""
|
86 |
-
"Košík je opustený po X minútach potom čo bola položka vložená do košíka ale "
|
87 |
-
"objednávka nebola odoslaná"
|
88 |
-
|
89 |
-
#: woocommerce-ac.php:753
|
90 |
-
msgid "Save Changes"
|
91 |
-
msgstr "Uložiť zmeny"
|
92 |
-
|
93 |
-
#: woocommerce-ac.php:763
|
94 |
-
msgid ""
|
95 |
-
"The list below shows all Abandoned Carts which have remained in cart for a "
|
96 |
-
"time higher than the \"Cart abandoned cut-off time\" setting."
|
97 |
-
msgstr ""
|
98 |
-
"Tento zoznam ukazuje všetky opustené košíky, pri ktorých nebol zmenený stav "
|
99 |
-
"dlhší čas ako je nastavený \"Limit pre opustený košík\"."
|
100 |
-
|
101 |
-
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
102 |
-
msgid "Customer"
|
103 |
-
msgstr "Zákazník"
|
104 |
-
|
105 |
-
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
106 |
-
msgid "Order Total"
|
107 |
-
msgstr "Objednávka Celkom"
|
108 |
-
|
109 |
-
#: woocommerce-ac.php:862
|
110 |
-
msgid "Date"
|
111 |
-
msgstr "Dátum"
|
112 |
-
|
113 |
-
#: woocommerce-ac.php:868
|
114 |
-
msgid "Status"
|
115 |
-
msgstr "Stav"
|
116 |
-
|
117 |
-
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
118 |
-
msgid "Actions"
|
119 |
-
msgstr "Akcie"
|
120 |
-
|
121 |
-
#: woocommerce-ac.php:953
|
122 |
-
msgid ""
|
123 |
-
"Add email templates at different intervals to maximize the possibility of "
|
124 |
-
"recovering your abandoned carts."
|
125 |
-
msgstr ""
|
126 |
-
"Add email templates at different intervals to maximize the possibility of "
|
127 |
-
"recovering your abandoned carts."
|
128 |
-
|
129 |
-
#: woocommerce-ac.php:1054
|
130 |
-
msgid "The Email Template has been successfully added."
|
131 |
-
msgstr "Emailová šablóna bola úspešne pridaná."
|
132 |
-
|
133 |
-
#: woocommerce-ac.php:1057
|
134 |
-
msgid "The Email Template has been successfully updated."
|
135 |
-
msgstr "Emailová šablóna bola úspešne uložená."
|
136 |
-
|
137 |
-
#: woocommerce-ac.php:1145
|
138 |
-
msgid "Sr"
|
139 |
-
msgstr ""
|
140 |
-
|
141 |
-
#: woocommerce-ac.php:1148
|
142 |
-
msgid "Template Name"
|
143 |
-
msgstr "Názov šablóny"
|
144 |
-
|
145 |
-
#: woocommerce-ac.php:1154
|
146 |
-
msgid "Sent"
|
147 |
-
msgstr "Odoslané"
|
148 |
-
|
149 |
-
#: woocommerce-ac.php:1158
|
150 |
-
msgid "Active ?"
|
151 |
-
msgstr "Aktívne ?"
|
152 |
-
|
153 |
-
#: woocommerce-ac.php:1276
|
154 |
-
msgid ""
|
155 |
-
"The Report below shows how many Abandoned Carts we were able to recover for "
|
156 |
-
"you by sending automatic emails to encourage shoppers."
|
157 |
-
msgstr ""
|
158 |
-
"Tento report ukazuje koľko Opustených košíkov sme boli schopný znovuzískať "
|
159 |
-
"pre Vás po odoslaní automatického emailu pre povzbudenie nakupujúceho."
|
160 |
-
|
161 |
-
#: woocommerce-ac.php:1331
|
162 |
-
msgid "Start Date:"
|
163 |
-
msgstr "Začiatočný dátum:"
|
164 |
-
|
165 |
-
#: woocommerce-ac.php:1334
|
166 |
-
msgid "End Date:"
|
167 |
-
msgstr "Dátum ukončenia:"
|
168 |
-
|
169 |
-
#: woocommerce-ac.php:1337
|
170 |
-
msgid "Go"
|
171 |
-
msgstr "Spustiť"
|
172 |
-
|
173 |
-
#: woocommerce-ac.php:1495
|
174 |
-
msgid "During the selected range"
|
175 |
-
msgstr "Vo vybranom intarvale: "
|
176 |
-
|
177 |
-
#: woocommerce-ac.php:1495
|
178 |
-
msgid "carts totaling"
|
179 |
-
msgstr "(v celkovej výške: "
|
180 |
-
|
181 |
-
#: woocommerce-ac.php:1495
|
182 |
-
msgid "were abandoned. We were able to recover"
|
183 |
-
msgstr ") opustených košíkov. Objednávku sme spätne získali z"
|
184 |
-
|
185 |
-
#: woocommerce-ac.php:1495
|
186 |
-
msgid "of them, which led to an extra"
|
187 |
-
msgstr ",čo viedlo k "
|
188 |
-
|
189 |
-
#: woocommerce-ac.php:1495
|
190 |
-
msgid "in sales"
|
191 |
-
msgstr "obratu."
|
192 |
-
|
193 |
-
#: woocommerce-ac.php:1504
|
194 |
-
msgid "Created On"
|
195 |
-
msgstr "Vytvorené"
|
196 |
-
|
197 |
-
#: woocommerce-ac.php:1510
|
198 |
-
msgid "Recovered Date"
|
199 |
-
msgstr "Dátum znovuzískania"
|
200 |
-
|
201 |
-
#: woocommerce-ac.php:1561
|
202 |
-
msgid "Template Name:"
|
203 |
-
msgstr "Názov šablóny:"
|
204 |
-
|
205 |
-
#: woocommerce-ac.php:1572
|
206 |
-
msgid "Enter a template name for reference"
|
207 |
-
msgstr "Zadajte názov šablóny pre priradenie"
|
208 |
-
|
209 |
-
#: woocommerce-ac.php:1577
|
210 |
-
msgid "Send From This Name:"
|
211 |
-
msgstr "Meno odosielateľa:"
|
212 |
-
|
213 |
-
#: woocommerce-ac.php:1588
|
214 |
-
msgid "Enter the name that should appear in the email sent"
|
215 |
-
msgstr "Zadajte meno ktoré sa zobrazí ako odosielateľ"
|
216 |
-
|
217 |
-
#: woocommerce-ac.php:1594
|
218 |
-
msgid "Subject:"
|
219 |
-
msgstr "Predmet:"
|
220 |
-
|
221 |
-
#: woocommerce-ac.php:1605
|
222 |
-
msgid "Enter the subject that should appear in the email sent"
|
223 |
-
msgstr "Zadajte predmet, ktorý by sa mal objaviť v odolsanom emaile"
|
224 |
-
|
225 |
-
#: woocommerce-ac.php:1611
|
226 |
-
msgid "Email Body:"
|
227 |
-
msgstr "Telo emailu:"
|
228 |
-
|
229 |
-
#: woocommerce-ac.php:1627
|
230 |
-
msgid "Message to be sent in the reminder email."
|
231 |
-
msgstr "Správa odoslaná ako pripomienkobý email."
|
232 |
-
|
233 |
-
#: woocommerce-ac.php:1634
|
234 |
-
msgid "Send this email:"
|
235 |
-
msgstr "Odoslat tento email."
|
236 |
-
|
237 |
-
#: woocommerce-ac.php:1686
|
238 |
-
msgid "after cart is abandoned."
|
239 |
-
msgstr "po opustení košíka."
|
240 |
-
|
241 |
-
#: woocommerce-ac.php:1693
|
242 |
-
msgid "Send a test email to:"
|
243 |
-
msgstr "Odoslať testovací email na:"
|
244 |
-
|
245 |
-
#: woocommerce-ac.php:1699
|
246 |
-
msgid "Enter the email id to which the test email needs to be sent."
|
247 |
-
msgstr "Zadajte email na ktorý sa ma testovací email odoslať."
|
248 |
-
|
249 |
-
#: woocommerce-ac.php:1835 send_email.php:109
|
250 |
-
msgid "Your Shopping Cart"
|
251 |
-
msgstr "Váš nakúpný košík"
|
252 |
-
|
253 |
-
#: woocommerce-ac.php:1838 send_email.php:112
|
254 |
-
msgid "Item"
|
255 |
-
msgstr "Položka"
|
256 |
-
|
257 |
-
#: woocommerce-ac.php:1839 send_email.php:113
|
258 |
-
msgid "Name"
|
259 |
-
msgstr "Meno"
|
260 |
-
|
261 |
-
#: woocommerce-ac.php:1840 send_email.php:114
|
262 |
-
msgid "Quantity"
|
263 |
-
msgstr "Množstvo"
|
264 |
-
|
265 |
-
#: woocommerce-ac.php:1841 send_email.php:115
|
266 |
-
msgid "Price"
|
267 |
-
msgstr "Cena"
|
268 |
-
|
269 |
-
#: woocommerce-ac.php:1842 send_email.php:116
|
270 |
-
msgid "Line Subtotal"
|
271 |
-
msgstr "Subtotal"
|
272 |
-
|
273 |
-
#: woocommerce-ac.php:1846
|
274 |
-
msgid "Men\\'\\s Formal Shoes"
|
275 |
-
msgstr ""
|
276 |
-
|
277 |
-
#: woocommerce-ac.php:1853
|
278 |
-
msgid "Woman\\'\\s Hand Bags"
|
279 |
-
msgstr ""
|
280 |
-
|
281 |
-
#: woocommerce-ac.php:1862 send_email.php:160
|
282 |
-
msgid "Cart Total:"
|
283 |
-
msgstr "Košík spolu:"
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: woocommerce-ac\n"
|
9 |
+
"Report-Msgid-Bugs-To: \n"
|
10 |
+
"POT-Creation-Date: 2015-07-08 16:30+0530\n"
|
11 |
+
"PO-Revision-Date: 2015-12-16 10:00+0100\n"
|
12 |
+
"Last-Translator: \n"
|
13 |
+
"Language-Team: Mauro <marek9.danko@gmail.com>\n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"X-Generator: Poedit 1.8.1\n"
|
18 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
19 |
+
"X-Poedit-Basepath: .\n"
|
20 |
+
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
|
21 |
+
"Language: sk_SK\n"
|
22 |
+
|
23 |
+
#: woocommerce-ac.php:22
|
24 |
+
msgid "Once Every Five Minutes"
|
25 |
+
msgstr "Po každých piatich minútach"
|
26 |
+
|
27 |
+
#: woocommerce-ac.php:204
|
28 |
+
msgid ""
|
29 |
+
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
30 |
+
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
31 |
+
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
32 |
+
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
33 |
+
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
34 |
+
msgstr ""
|
35 |
+
"Môžete upgradovať na <a href=\"https://www.tychesoftwares.com/store/premium-"
|
36 |
+
"plugins/woocommerce-abandoned-cart-pro/\">PRO verziu WooCommerce Abandoned "
|
37 |
+
"Cart plugin</a> s <b>20% zľavou</b>. Použite kód: <b>ACPRO20</b>.<a href="
|
38 |
+
"\"https://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-"
|
39 |
+
"cart-pro/\"> Zakúpte teraz </a> a ušetrite 24$ !"
|
40 |
+
|
41 |
+
#: woocommerce-ac.php:314
|
42 |
+
msgid "Abandoned Carts"
|
43 |
+
msgstr "Opustené Košíky"
|
44 |
+
|
45 |
+
#: woocommerce-ac.php:516
|
46 |
+
msgid "Abandoned Orders"
|
47 |
+
msgstr "Opustené Objednávky"
|
48 |
+
|
49 |
+
#: woocommerce-ac.php:517
|
50 |
+
msgid "Email Templates"
|
51 |
+
msgstr "E-mailové šablóny"
|
52 |
+
|
53 |
+
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
54 |
+
msgid "Settings"
|
55 |
+
msgstr "Nastavenia"
|
56 |
+
|
57 |
+
#: woocommerce-ac.php:519
|
58 |
+
msgid "Recovered Orders"
|
59 |
+
msgstr "Spätne získaná objednávka "
|
60 |
+
|
61 |
+
#: woocommerce-ac.php:661
|
62 |
+
msgid "You do not have sufficient permissions to access this page."
|
63 |
+
msgstr "Nemáte dostatočné oprávnenia k prístupu na túto stránku."
|
64 |
+
|
65 |
+
#: woocommerce-ac.php:670
|
66 |
+
msgid "WooCommerce - Abandon Cart Lite"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: woocommerce-ac.php:696
|
70 |
+
msgid "Your settings have been saved."
|
71 |
+
msgstr "Vaše nastavenia boli uložené."
|
72 |
+
|
73 |
+
#: woocommerce-ac.php:718
|
74 |
+
msgid "Cart abandoned cut-off time"
|
75 |
+
msgstr "Limit pre opustený košík"
|
76 |
+
|
77 |
+
#: woocommerce-ac.php:741
|
78 |
+
msgid "minutes"
|
79 |
+
msgstr "minút"
|
80 |
+
|
81 |
+
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
82 |
+
msgid ""
|
83 |
+
"Consider cart abandoned after X minutes of item being added to cart & order "
|
84 |
+
"not placed"
|
85 |
+
msgstr ""
|
86 |
+
"Košík je opustený po X minútach potom čo bola položka vložená do košíka ale "
|
87 |
+
"objednávka nebola odoslaná"
|
88 |
+
|
89 |
+
#: woocommerce-ac.php:753
|
90 |
+
msgid "Save Changes"
|
91 |
+
msgstr "Uložiť zmeny"
|
92 |
+
|
93 |
+
#: woocommerce-ac.php:763
|
94 |
+
msgid ""
|
95 |
+
"The list below shows all Abandoned Carts which have remained in cart for a "
|
96 |
+
"time higher than the \"Cart abandoned cut-off time\" setting."
|
97 |
+
msgstr ""
|
98 |
+
"Tento zoznam ukazuje všetky opustené košíky, pri ktorých nebol zmenený stav "
|
99 |
+
"dlhší čas ako je nastavený \"Limit pre opustený košík\"."
|
100 |
+
|
101 |
+
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
102 |
+
msgid "Customer"
|
103 |
+
msgstr "Zákazník"
|
104 |
+
|
105 |
+
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
106 |
+
msgid "Order Total"
|
107 |
+
msgstr "Objednávka Celkom"
|
108 |
+
|
109 |
+
#: woocommerce-ac.php:862
|
110 |
+
msgid "Date"
|
111 |
+
msgstr "Dátum"
|
112 |
+
|
113 |
+
#: woocommerce-ac.php:868
|
114 |
+
msgid "Status"
|
115 |
+
msgstr "Stav"
|
116 |
+
|
117 |
+
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
118 |
+
msgid "Actions"
|
119 |
+
msgstr "Akcie"
|
120 |
+
|
121 |
+
#: woocommerce-ac.php:953
|
122 |
+
msgid ""
|
123 |
+
"Add email templates at different intervals to maximize the possibility of "
|
124 |
+
"recovering your abandoned carts."
|
125 |
+
msgstr ""
|
126 |
+
"Add email templates at different intervals to maximize the possibility of "
|
127 |
+
"recovering your abandoned carts."
|
128 |
+
|
129 |
+
#: woocommerce-ac.php:1054
|
130 |
+
msgid "The Email Template has been successfully added."
|
131 |
+
msgstr "Emailová šablóna bola úspešne pridaná."
|
132 |
+
|
133 |
+
#: woocommerce-ac.php:1057
|
134 |
+
msgid "The Email Template has been successfully updated."
|
135 |
+
msgstr "Emailová šablóna bola úspešne uložená."
|
136 |
+
|
137 |
+
#: woocommerce-ac.php:1145
|
138 |
+
msgid "Sr"
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: woocommerce-ac.php:1148
|
142 |
+
msgid "Template Name"
|
143 |
+
msgstr "Názov šablóny"
|
144 |
+
|
145 |
+
#: woocommerce-ac.php:1154
|
146 |
+
msgid "Sent"
|
147 |
+
msgstr "Odoslané"
|
148 |
+
|
149 |
+
#: woocommerce-ac.php:1158
|
150 |
+
msgid "Active ?"
|
151 |
+
msgstr "Aktívne ?"
|
152 |
+
|
153 |
+
#: woocommerce-ac.php:1276
|
154 |
+
msgid ""
|
155 |
+
"The Report below shows how many Abandoned Carts we were able to recover for "
|
156 |
+
"you by sending automatic emails to encourage shoppers."
|
157 |
+
msgstr ""
|
158 |
+
"Tento report ukazuje koľko Opustených košíkov sme boli schopný znovuzískať "
|
159 |
+
"pre Vás po odoslaní automatického emailu pre povzbudenie nakupujúceho."
|
160 |
+
|
161 |
+
#: woocommerce-ac.php:1331
|
162 |
+
msgid "Start Date:"
|
163 |
+
msgstr "Začiatočný dátum:"
|
164 |
+
|
165 |
+
#: woocommerce-ac.php:1334
|
166 |
+
msgid "End Date:"
|
167 |
+
msgstr "Dátum ukončenia:"
|
168 |
+
|
169 |
+
#: woocommerce-ac.php:1337
|
170 |
+
msgid "Go"
|
171 |
+
msgstr "Spustiť"
|
172 |
+
|
173 |
+
#: woocommerce-ac.php:1495
|
174 |
+
msgid "During the selected range"
|
175 |
+
msgstr "Vo vybranom intarvale: "
|
176 |
+
|
177 |
+
#: woocommerce-ac.php:1495
|
178 |
+
msgid "carts totaling"
|
179 |
+
msgstr "(v celkovej výške: "
|
180 |
+
|
181 |
+
#: woocommerce-ac.php:1495
|
182 |
+
msgid "were abandoned. We were able to recover"
|
183 |
+
msgstr ") opustených košíkov. Objednávku sme spätne získali z"
|
184 |
+
|
185 |
+
#: woocommerce-ac.php:1495
|
186 |
+
msgid "of them, which led to an extra"
|
187 |
+
msgstr ",čo viedlo k "
|
188 |
+
|
189 |
+
#: woocommerce-ac.php:1495
|
190 |
+
msgid "in sales"
|
191 |
+
msgstr "obratu."
|
192 |
+
|
193 |
+
#: woocommerce-ac.php:1504
|
194 |
+
msgid "Created On"
|
195 |
+
msgstr "Vytvorené"
|
196 |
+
|
197 |
+
#: woocommerce-ac.php:1510
|
198 |
+
msgid "Recovered Date"
|
199 |
+
msgstr "Dátum znovuzískania"
|
200 |
+
|
201 |
+
#: woocommerce-ac.php:1561
|
202 |
+
msgid "Template Name:"
|
203 |
+
msgstr "Názov šablóny:"
|
204 |
+
|
205 |
+
#: woocommerce-ac.php:1572
|
206 |
+
msgid "Enter a template name for reference"
|
207 |
+
msgstr "Zadajte názov šablóny pre priradenie"
|
208 |
+
|
209 |
+
#: woocommerce-ac.php:1577
|
210 |
+
msgid "Send From This Name:"
|
211 |
+
msgstr "Meno odosielateľa:"
|
212 |
+
|
213 |
+
#: woocommerce-ac.php:1588
|
214 |
+
msgid "Enter the name that should appear in the email sent"
|
215 |
+
msgstr "Zadajte meno ktoré sa zobrazí ako odosielateľ"
|
216 |
+
|
217 |
+
#: woocommerce-ac.php:1594
|
218 |
+
msgid "Subject:"
|
219 |
+
msgstr "Predmet:"
|
220 |
+
|
221 |
+
#: woocommerce-ac.php:1605
|
222 |
+
msgid "Enter the subject that should appear in the email sent"
|
223 |
+
msgstr "Zadajte predmet, ktorý by sa mal objaviť v odolsanom emaile"
|
224 |
+
|
225 |
+
#: woocommerce-ac.php:1611
|
226 |
+
msgid "Email Body:"
|
227 |
+
msgstr "Telo emailu:"
|
228 |
+
|
229 |
+
#: woocommerce-ac.php:1627
|
230 |
+
msgid "Message to be sent in the reminder email."
|
231 |
+
msgstr "Správa odoslaná ako pripomienkobý email."
|
232 |
+
|
233 |
+
#: woocommerce-ac.php:1634
|
234 |
+
msgid "Send this email:"
|
235 |
+
msgstr "Odoslat tento email."
|
236 |
+
|
237 |
+
#: woocommerce-ac.php:1686
|
238 |
+
msgid "after cart is abandoned."
|
239 |
+
msgstr "po opustení košíka."
|
240 |
+
|
241 |
+
#: woocommerce-ac.php:1693
|
242 |
+
msgid "Send a test email to:"
|
243 |
+
msgstr "Odoslať testovací email na:"
|
244 |
+
|
245 |
+
#: woocommerce-ac.php:1699
|
246 |
+
msgid "Enter the email id to which the test email needs to be sent."
|
247 |
+
msgstr "Zadajte email na ktorý sa ma testovací email odoslať."
|
248 |
+
|
249 |
+
#: woocommerce-ac.php:1835 send_email.php:109
|
250 |
+
msgid "Your Shopping Cart"
|
251 |
+
msgstr "Váš nakúpný košík"
|
252 |
+
|
253 |
+
#: woocommerce-ac.php:1838 send_email.php:112
|
254 |
+
msgid "Item"
|
255 |
+
msgstr "Položka"
|
256 |
+
|
257 |
+
#: woocommerce-ac.php:1839 send_email.php:113
|
258 |
+
msgid "Name"
|
259 |
+
msgstr "Meno"
|
260 |
+
|
261 |
+
#: woocommerce-ac.php:1840 send_email.php:114
|
262 |
+
msgid "Quantity"
|
263 |
+
msgstr "Množstvo"
|
264 |
+
|
265 |
+
#: woocommerce-ac.php:1841 send_email.php:115
|
266 |
+
msgid "Price"
|
267 |
+
msgstr "Cena"
|
268 |
+
|
269 |
+
#: woocommerce-ac.php:1842 send_email.php:116
|
270 |
+
msgid "Line Subtotal"
|
271 |
+
msgstr "Subtotal"
|
272 |
+
|
273 |
+
#: woocommerce-ac.php:1846
|
274 |
+
msgid "Men\\'\\s Formal Shoes"
|
275 |
+
msgstr ""
|
276 |
+
|
277 |
+
#: woocommerce-ac.php:1853
|
278 |
+
msgid "Woman\\'\\s Hand Bags"
|
279 |
+
msgstr ""
|
280 |
+
|
281 |
+
#: woocommerce-ac.php:1862 send_email.php:160
|
282 |
+
msgid "Cart Total:"
|
283 |
+
msgstr "Košík spolu:"
|
{languages → i18n/languages}/woocommerce-ac.mo
RENAMED
Binary file
|
i18n/languages/woocommerce-ac.po
ADDED
@@ -0,0 +1,500 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
msgid ""
|
7 |
+
msgstr ""
|
8 |
+
"Project-Id-Version: woocommerce-ac\n"
|
9 |
+
"Report-Msgid-Bugs-To: \n"
|
10 |
+
"POT-Creation-Date: 2017-01-21 15:02+0530\n"
|
11 |
+
"PO-Revision-Date: 2017-01-21 15:03+0530\n"
|
12 |
+
"Last-Translator: \n"
|
13 |
+
"Language-Team: \n"
|
14 |
+
"MIME-Version: 1.0\n"
|
15 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
+
"Content-Transfer-Encoding: 8bit\n"
|
17 |
+
"X-Generator: Poedit 1.8.11\n"
|
18 |
+
"X-Poedit-KeywordsList: __;_e\n"
|
19 |
+
"X-Poedit-Basepath: .\n"
|
20 |
+
|
21 |
+
#: woocommerce-ac.php:28
|
22 |
+
msgid "Once Every Fifteen Minutes"
|
23 |
+
msgstr ""
|
24 |
+
|
25 |
+
#: woocommerce-ac.php:298 woocommerce-ac.php:1317
|
26 |
+
msgid "This order was abandoned & subsequently recovered."
|
27 |
+
msgstr ""
|
28 |
+
|
29 |
+
#: woocommerce-ac.php:323
|
30 |
+
msgid ""
|
31 |
+
"The Lite & Pro version of Abandoned Cart plugin for WooCommerce (from Tyche "
|
32 |
+
"Softwares) are active on your website. <br> In this case, the abandoned "
|
33 |
+
"carts will be captured in both plugins & email reminders will also be sent "
|
34 |
+
"from both plugins. <br> It is recommended that you deactivate the Lite "
|
35 |
+
"version & keep the Pro version active."
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: woocommerce-ac.php:350
|
39 |
+
msgid "HTML Email Template"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: woocommerce-ac.php:356
|
43 |
+
msgid "Abandoned cart Email Template"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: woocommerce-ac.php:490 woocommerce-ac.php:1471
|
47 |
+
msgid "Settings"
|
48 |
+
msgstr ""
|
49 |
+
|
50 |
+
#: woocommerce-ac.php:497
|
51 |
+
msgid "Cart abandoned cut-off time"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: woocommerce-ac.php:501
|
55 |
+
msgid ""
|
56 |
+
"Consider cart abandoned after X minutes of item being added to cart & order "
|
57 |
+
"not placed."
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#: woocommerce-ac.php:506
|
61 |
+
msgid "Email admin On Order Recovery"
|
62 |
+
msgstr ""
|
63 |
+
|
64 |
+
#: woocommerce-ac.php:510
|
65 |
+
msgid "Sends email to Admin if an Abandoned Cart Order is recovered."
|
66 |
+
msgstr ""
|
67 |
+
|
68 |
+
#: woocommerce-ac.php:558
|
69 |
+
msgid ""
|
70 |
+
"Abandoned cart cut off time should be numeric and has to be greater than 0."
|
71 |
+
msgstr ""
|
72 |
+
|
73 |
+
#: woocommerce-ac.php:769 woocommerce-ac.php:816
|
74 |
+
msgid "New Customer Order - Recovered"
|
75 |
+
msgstr ""
|
76 |
+
|
77 |
+
#: woocommerce-ac.php:843
|
78 |
+
msgid "Abandoned Carts"
|
79 |
+
msgstr ""
|
80 |
+
|
81 |
+
#: woocommerce-ac.php:1469
|
82 |
+
msgid "Abandoned Orders"
|
83 |
+
msgstr ""
|
84 |
+
|
85 |
+
#: woocommerce-ac.php:1470
|
86 |
+
msgid "Email Templates"
|
87 |
+
msgstr ""
|
88 |
+
|
89 |
+
#: woocommerce-ac.php:1472
|
90 |
+
msgid "Recovered Orders"
|
91 |
+
msgstr ""
|
92 |
+
|
93 |
+
#: woocommerce-ac.php:1473
|
94 |
+
msgid "Product Report"
|
95 |
+
msgstr ""
|
96 |
+
|
97 |
+
#: woocommerce-ac.php:1570
|
98 |
+
msgid "You do not have sufficient permissions to access this page."
|
99 |
+
msgstr ""
|
100 |
+
|
101 |
+
#: woocommerce-ac.php:1574
|
102 |
+
msgid "WooCommerce - Abandon Cart Lite"
|
103 |
+
msgstr ""
|
104 |
+
|
105 |
+
#: woocommerce-ac.php:1640
|
106 |
+
msgid "The Abandoned cart has been successfully deleted."
|
107 |
+
msgstr ""
|
108 |
+
|
109 |
+
#: woocommerce-ac.php:1646
|
110 |
+
msgid "The Template has been successfully deleted."
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: woocommerce-ac.php:1660
|
114 |
+
msgid ""
|
115 |
+
"Change settings for sending email notifications to Customers after X minute."
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: woocommerce-ac.php:1673
|
119 |
+
msgid ""
|
120 |
+
"The list below shows all Abandoned Carts which have remained in cart for a "
|
121 |
+
"time higher than the \"Cart abandoned cut-off time\" setting."
|
122 |
+
msgstr ""
|
123 |
+
|
124 |
+
#: woocommerce-ac.php:1694
|
125 |
+
msgid ""
|
126 |
+
"Add email templates at different intervals to maximize the possibility of "
|
127 |
+
"recovering your abandoned carts."
|
128 |
+
msgstr ""
|
129 |
+
|
130 |
+
#: woocommerce-ac.php:2011
|
131 |
+
msgid "The Email Template has been successfully added."
|
132 |
+
msgstr ""
|
133 |
+
|
134 |
+
#: woocommerce-ac.php:2014
|
135 |
+
msgid ""
|
136 |
+
" There was a problem adding the email template. Please contact the plugin "
|
137 |
+
"author via <a href= \"https://wordpress.org/support/plugin/woocommerce-"
|
138 |
+
"abandoned-cart\">support forum</a>."
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: woocommerce-ac.php:2019
|
142 |
+
msgid "The Email Template has been successfully updated."
|
143 |
+
msgstr ""
|
144 |
+
|
145 |
+
#: woocommerce-ac.php:2022
|
146 |
+
msgid ""
|
147 |
+
" There was a problem updating the email template. Please contact the plugin "
|
148 |
+
"author via <a href= \"https://wordpress.org/support/plugin/woocommerce-"
|
149 |
+
"abandoned-cart\">support forum</a>."
|
150 |
+
msgstr ""
|
151 |
+
|
152 |
+
#: woocommerce-ac.php:2028
|
153 |
+
msgid "Add New Template"
|
154 |
+
msgstr ""
|
155 |
+
|
156 |
+
#: woocommerce-ac.php:2120
|
157 |
+
msgid ""
|
158 |
+
"The Report below shows how many Abandoned Carts we were able to recover for "
|
159 |
+
"you by sending automatic emails to encourage shoppers."
|
160 |
+
msgstr ""
|
161 |
+
|
162 |
+
#: woocommerce-ac.php:2172
|
163 |
+
msgid "Start Date:"
|
164 |
+
msgstr ""
|
165 |
+
|
166 |
+
#: woocommerce-ac.php:2174
|
167 |
+
msgid "End Date:"
|
168 |
+
msgstr ""
|
169 |
+
|
170 |
+
#: woocommerce-ac.php:2176
|
171 |
+
msgid "Go"
|
172 |
+
msgstr ""
|
173 |
+
|
174 |
+
#: woocommerce-ac.php:2182
|
175 |
+
msgid "During the selected range "
|
176 |
+
msgstr ""
|
177 |
+
|
178 |
+
#: woocommerce-ac.php:2187
|
179 |
+
msgid "carts totaling"
|
180 |
+
msgstr ""
|
181 |
+
|
182 |
+
#: woocommerce-ac.php:2193
|
183 |
+
msgid " were abandoned. We were able to recover"
|
184 |
+
msgstr ""
|
185 |
+
|
186 |
+
#: woocommerce-ac.php:2200
|
187 |
+
msgid " of them, which led to an extra"
|
188 |
+
msgstr ""
|
189 |
+
|
190 |
+
#: woocommerce-ac.php:2226 woocommerce-ac.php:2964 cron/wcal_send_email.php:310
|
191 |
+
msgid "Item"
|
192 |
+
msgstr ""
|
193 |
+
|
194 |
+
#: woocommerce-ac.php:2227 woocommerce-ac.php:2965 cron/wcal_send_email.php:311
|
195 |
+
msgid "Name"
|
196 |
+
msgstr ""
|
197 |
+
|
198 |
+
#: woocommerce-ac.php:2228 woocommerce-ac.php:2966 cron/wcal_send_email.php:312
|
199 |
+
msgid "Quantity"
|
200 |
+
msgstr ""
|
201 |
+
|
202 |
+
#: woocommerce-ac.php:2229 woocommerce-ac.php:2968 cron/wcal_send_email.php:314
|
203 |
+
msgid "Line Subtotal"
|
204 |
+
msgstr ""
|
205 |
+
|
206 |
+
#: woocommerce-ac.php:2230
|
207 |
+
msgid "Line Total"
|
208 |
+
msgstr ""
|
209 |
+
|
210 |
+
#: woocommerce-ac.php:2474
|
211 |
+
msgid "Customer Details"
|
212 |
+
msgstr ""
|
213 |
+
|
214 |
+
#: woocommerce-ac.php:2478
|
215 |
+
msgid "Billing Details"
|
216 |
+
msgstr ""
|
217 |
+
|
218 |
+
#: woocommerce-ac.php:2479
|
219 |
+
msgid "Name:"
|
220 |
+
msgstr ""
|
221 |
+
|
222 |
+
#: woocommerce-ac.php:2482 woocommerce-ac.php:2502
|
223 |
+
msgid "Address:"
|
224 |
+
msgstr ""
|
225 |
+
|
226 |
+
#: woocommerce-ac.php:2492
|
227 |
+
msgid "Email:"
|
228 |
+
msgstr ""
|
229 |
+
|
230 |
+
#: woocommerce-ac.php:2496
|
231 |
+
msgid "Phone:"
|
232 |
+
msgstr ""
|
233 |
+
|
234 |
+
#: woocommerce-ac.php:2501
|
235 |
+
msgid "Shipping Details"
|
236 |
+
msgstr ""
|
237 |
+
|
238 |
+
#: woocommerce-ac.php:2586
|
239 |
+
msgid "Template Name:"
|
240 |
+
msgstr ""
|
241 |
+
|
242 |
+
#: woocommerce-ac.php:2597
|
243 |
+
msgid "Enter a template name for reference"
|
244 |
+
msgstr ""
|
245 |
+
|
246 |
+
#: woocommerce-ac.php:2603
|
247 |
+
msgid "Send From This Name:"
|
248 |
+
msgstr ""
|
249 |
+
|
250 |
+
#: woocommerce-ac.php:2614
|
251 |
+
msgid "Enter the name that should appear in the email sent"
|
252 |
+
msgstr ""
|
253 |
+
|
254 |
+
#: woocommerce-ac.php:2620
|
255 |
+
msgid "Send From This Email Address:"
|
256 |
+
msgstr ""
|
257 |
+
|
258 |
+
#: woocommerce-ac.php:2630
|
259 |
+
msgid ""
|
260 |
+
"Which email address should be shown in the \"From Email\" field for this "
|
261 |
+
"email?"
|
262 |
+
msgstr ""
|
263 |
+
|
264 |
+
#: woocommerce-ac.php:2636
|
265 |
+
msgid "Send Reply Emails to:"
|
266 |
+
msgstr ""
|
267 |
+
|
268 |
+
#: woocommerce-ac.php:2647
|
269 |
+
msgid ""
|
270 |
+
"When a contact receives your email and clicks reply, which email address "
|
271 |
+
"should that reply be sent to?"
|
272 |
+
msgstr ""
|
273 |
+
|
274 |
+
#: woocommerce-ac.php:2653
|
275 |
+
msgid "Subject:"
|
276 |
+
msgstr ""
|
277 |
+
|
278 |
+
#: woocommerce-ac.php:2664
|
279 |
+
msgid "Enter the subject that should appear in the email sent"
|
280 |
+
msgstr ""
|
281 |
+
|
282 |
+
#: woocommerce-ac.php:2670
|
283 |
+
msgid "Email Body:"
|
284 |
+
msgstr ""
|
285 |
+
|
286 |
+
#: woocommerce-ac.php:2698
|
287 |
+
msgid "Message to be sent in the reminder email."
|
288 |
+
msgstr ""
|
289 |
+
|
290 |
+
#: woocommerce-ac.php:2705
|
291 |
+
msgid "Use WooCommerce Template Style:"
|
292 |
+
msgstr ""
|
293 |
+
|
294 |
+
#: woocommerce-ac.php:2720
|
295 |
+
msgid ""
|
296 |
+
"Use WooCommerce default style template for abandoned cart reminder emails."
|
297 |
+
msgstr ""
|
298 |
+
|
299 |
+
#: woocommerce-ac.php:2727
|
300 |
+
msgid "Email Template Header Text: "
|
301 |
+
msgstr ""
|
302 |
+
|
303 |
+
#: woocommerce-ac.php:2742
|
304 |
+
msgid ""
|
305 |
+
"Enter the header which will appear in the abandoned WooCommerce email sent. "
|
306 |
+
"This is only applicable when only used when \"Use WooCommerce Template Style:"
|
307 |
+
"\" is checked."
|
308 |
+
msgstr ""
|
309 |
+
|
310 |
+
#: woocommerce-ac.php:2748
|
311 |
+
msgid "Active:"
|
312 |
+
msgstr ""
|
313 |
+
|
314 |
+
#: woocommerce-ac.php:2773
|
315 |
+
msgid ""
|
316 |
+
"The email template will be sent to customers only if the \"Active\" checkbox "
|
317 |
+
"is enabled. Leave this unchecked if you want to add the email template but "
|
318 |
+
"not send it to customers."
|
319 |
+
msgstr ""
|
320 |
+
|
321 |
+
#: woocommerce-ac.php:2779
|
322 |
+
msgid "Send this email:"
|
323 |
+
msgstr ""
|
324 |
+
|
325 |
+
#: woocommerce-ac.php:2825
|
326 |
+
msgid "after cart is abandoned."
|
327 |
+
msgstr ""
|
328 |
+
|
329 |
+
#: woocommerce-ac.php:2832
|
330 |
+
msgid "Send a test email to:"
|
331 |
+
msgstr ""
|
332 |
+
|
333 |
+
#: woocommerce-ac.php:2837
|
334 |
+
msgid "Enter the email id to which the test email needs to be sent."
|
335 |
+
msgstr ""
|
336 |
+
|
337 |
+
#: woocommerce-ac.php:2961 cron/wcal_send_email.php:307
|
338 |
+
msgid "Your Shopping Cart"
|
339 |
+
msgstr ""
|
340 |
+
|
341 |
+
#: woocommerce-ac.php:2967 cron/wcal_send_email.php:313
|
342 |
+
msgid "Price"
|
343 |
+
msgstr ""
|
344 |
+
|
345 |
+
#: woocommerce-ac.php:2972
|
346 |
+
msgid "Men\\'\\s Formal Shoes"
|
347 |
+
msgstr ""
|
348 |
+
|
349 |
+
#: woocommerce-ac.php:2979
|
350 |
+
msgid "Woman\\'\\s Hand Bags"
|
351 |
+
msgstr ""
|
352 |
+
|
353 |
+
#: woocommerce-ac.php:2988 cron/wcal_send_email.php:381
|
354 |
+
msgid "Cart Total:"
|
355 |
+
msgstr ""
|
356 |
+
|
357 |
+
#: cron/wcal_send_email.php:191
|
358 |
+
msgid "Abandoned cart reminder"
|
359 |
+
msgstr ""
|
360 |
+
|
361 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:42
|
362 |
+
msgid "abandoned_order_id"
|
363 |
+
msgstr ""
|
364 |
+
|
365 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:43
|
366 |
+
msgid "abandoned_order_ids"
|
367 |
+
msgstr ""
|
368 |
+
|
369 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:76
|
370 |
+
msgid "Id"
|
371 |
+
msgstr ""
|
372 |
+
|
373 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:77
|
374 |
+
#: includes/classes/class-wcal-recover-orders-table.php:106
|
375 |
+
msgid "Email Address"
|
376 |
+
msgstr ""
|
377 |
+
|
378 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:78
|
379 |
+
msgid "Customer"
|
380 |
+
msgstr ""
|
381 |
+
|
382 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:79
|
383 |
+
#: includes/classes/class-wcal-recover-orders-table.php:109
|
384 |
+
msgid "Order Total"
|
385 |
+
msgstr ""
|
386 |
+
|
387 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:80
|
388 |
+
msgid "Abandoned Date"
|
389 |
+
msgstr ""
|
390 |
+
|
391 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:81
|
392 |
+
msgid "Status of Cart"
|
393 |
+
msgstr ""
|
394 |
+
|
395 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:127
|
396 |
+
msgid "View order"
|
397 |
+
msgstr ""
|
398 |
+
|
399 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:128
|
400 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:394
|
401 |
+
#: includes/classes/class-wcal-templates-table.php:120
|
402 |
+
#: includes/classes/class-wcal-templates-table.php:256
|
403 |
+
msgid "Delete"
|
404 |
+
msgstr ""
|
405 |
+
|
406 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:246
|
407 |
+
msgid "item"
|
408 |
+
msgstr ""
|
409 |
+
|
410 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:248
|
411 |
+
msgid "items"
|
412 |
+
msgstr ""
|
413 |
+
|
414 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:252
|
415 |
+
msgid "Abandoned"
|
416 |
+
msgstr ""
|
417 |
+
|
418 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:254
|
419 |
+
msgid "Abandoned but new"
|
420 |
+
msgstr ""
|
421 |
+
|
422 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:254
|
423 |
+
msgid "cart created after this"
|
424 |
+
msgstr ""
|
425 |
+
|
426 |
+
#: includes/classes/class-wcal-product-report-table.php:82
|
427 |
+
msgid "product_id"
|
428 |
+
msgstr ""
|
429 |
+
|
430 |
+
#: includes/classes/class-wcal-product-report-table.php:83
|
431 |
+
msgid "product_ids"
|
432 |
+
msgstr ""
|
433 |
+
|
434 |
+
#: includes/classes/class-wcal-product-report-table.php:106
|
435 |
+
msgid "Product Name"
|
436 |
+
msgstr ""
|
437 |
+
|
438 |
+
#: includes/classes/class-wcal-product-report-table.php:107
|
439 |
+
msgid "Number of Times Abandoned"
|
440 |
+
msgstr ""
|
441 |
+
|
442 |
+
#: includes/classes/class-wcal-product-report-table.php:108
|
443 |
+
msgid "Number of Times Recovered"
|
444 |
+
msgstr ""
|
445 |
+
|
446 |
+
#: includes/classes/class-wcal-recover-orders-table.php:76
|
447 |
+
msgid "rec_abandoned_id"
|
448 |
+
msgstr ""
|
449 |
+
|
450 |
+
#: includes/classes/class-wcal-recover-orders-table.php:77
|
451 |
+
msgid "rec_abandoned_ids"
|
452 |
+
msgstr ""
|
453 |
+
|
454 |
+
#: includes/classes/class-wcal-recover-orders-table.php:105
|
455 |
+
msgid "Customer Name"
|
456 |
+
msgstr ""
|
457 |
+
|
458 |
+
#: includes/classes/class-wcal-recover-orders-table.php:107
|
459 |
+
msgid "Cart Abandoned Date"
|
460 |
+
msgstr ""
|
461 |
+
|
462 |
+
#: includes/classes/class-wcal-recover-orders-table.php:108
|
463 |
+
msgid "Cart Recovered Date"
|
464 |
+
msgstr ""
|
465 |
+
|
466 |
+
#: includes/classes/class-wcal-recover-orders-table.php:139
|
467 |
+
msgid "View Details"
|
468 |
+
msgstr ""
|
469 |
+
|
470 |
+
#: includes/classes/class-wcal-templates-table.php:43
|
471 |
+
msgid "template_id"
|
472 |
+
msgstr ""
|
473 |
+
|
474 |
+
#: includes/classes/class-wcal-templates-table.php:44
|
475 |
+
msgid "template_ids"
|
476 |
+
msgstr ""
|
477 |
+
|
478 |
+
#: includes/classes/class-wcal-templates-table.php:72
|
479 |
+
msgid "Sr"
|
480 |
+
msgstr ""
|
481 |
+
|
482 |
+
#: includes/classes/class-wcal-templates-table.php:73
|
483 |
+
msgid "Name Of Template"
|
484 |
+
msgstr ""
|
485 |
+
|
486 |
+
#: includes/classes/class-wcal-templates-table.php:74
|
487 |
+
msgid "Sent After Set Time"
|
488 |
+
msgstr ""
|
489 |
+
|
490 |
+
#: includes/classes/class-wcal-templates-table.php:75
|
491 |
+
msgid "Active ?"
|
492 |
+
msgstr ""
|
493 |
+
|
494 |
+
#: includes/classes/class-wcal-templates-table.php:119
|
495 |
+
msgid "Edit"
|
496 |
+
msgstr ""
|
497 |
+
|
498 |
+
#: includes/classes/class-wcal-templates-table.php:156
|
499 |
+
msgid " "
|
500 |
+
msgstr ""
|
i18n/languages/woocommerce-ac.pot
ADDED
@@ -0,0 +1,505 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# SOME DESCRIPTIVE TITLE.
|
2 |
+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
+
# This file is distributed under the same license as the PACKAGE package.
|
4 |
+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
+
#
|
6 |
+
#, fuzzy
|
7 |
+
msgid ""
|
8 |
+
msgstr ""
|
9 |
+
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
+
"Report-Msgid-Bugs-To: \n"
|
11 |
+
"POT-Creation-Date: 2016-12-27 18:29+0530\n"
|
12 |
+
"PO-Revision-Date: 2016-12-27 18:30+0500\n"
|
13 |
+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
+
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
+
"Language: \n"
|
16 |
+
"MIME-Version: 1.0\n"
|
17 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
18 |
+
"Content-Transfer-Encoding: 8bit\n"
|
19 |
+
"Plural-Forms: \n"
|
20 |
+
"X-Generator: Eazy Po 0.9.5.3\n"
|
21 |
+
|
22 |
+
#: woocommerce-ac.php:28
|
23 |
+
msgid "Once Every Fifteen Minutes"
|
24 |
+
msgstr ""
|
25 |
+
|
26 |
+
#: woocommerce-ac.php:298 woocommerce-ac.php:1317
|
27 |
+
msgid "This order was abandoned & subsequently recovered."
|
28 |
+
msgstr ""
|
29 |
+
|
30 |
+
#: woocommerce-ac.php:323
|
31 |
+
msgid ""
|
32 |
+
"The Lite & Pro version of Abandoned Cart plugin for WooCommerce (from Tyche "
|
33 |
+
"Softwares) are active on your website. <br> In this case, the abandoned "
|
34 |
+
"carts will be captured in both plugins & email reminders will also be sent "
|
35 |
+
"from both plugins. <br> It is recommended that you deactivate the Lite "
|
36 |
+
"version & keep the Pro version active."
|
37 |
+
msgstr ""
|
38 |
+
|
39 |
+
#: woocommerce-ac.php:350
|
40 |
+
msgid "HTML Email Template"
|
41 |
+
msgstr ""
|
42 |
+
|
43 |
+
#: woocommerce-ac.php:356
|
44 |
+
msgid "Abandoned cart Email Template"
|
45 |
+
msgstr ""
|
46 |
+
|
47 |
+
#: woocommerce-ac.php:490 woocommerce-ac.php:1471
|
48 |
+
msgid "Settings"
|
49 |
+
msgstr ""
|
50 |
+
|
51 |
+
#: woocommerce-ac.php:497
|
52 |
+
msgid "Cart abandoned cut-off time"
|
53 |
+
msgstr ""
|
54 |
+
|
55 |
+
#: woocommerce-ac.php:501
|
56 |
+
msgid ""
|
57 |
+
"Consider cart abandoned after X minutes of item being added to cart & order "
|
58 |
+
"not placed."
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: woocommerce-ac.php:506
|
62 |
+
msgid "Email admin On Order Recovery"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: woocommerce-ac.php:510
|
66 |
+
msgid "Sends email to Admin if an Abandoned Cart Order is recovered."
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: woocommerce-ac.php:558
|
70 |
+
msgid ""
|
71 |
+
"Abandoned cart cut off time should be numeric and has to be greater than 0."
|
72 |
+
msgstr ""
|
73 |
+
|
74 |
+
#: woocommerce-ac.php:769 woocommerce-ac.php:816
|
75 |
+
msgid "New Customer Order - Recovered"
|
76 |
+
msgstr ""
|
77 |
+
|
78 |
+
#: woocommerce-ac.php:843
|
79 |
+
msgid "Abandoned Carts"
|
80 |
+
msgstr ""
|
81 |
+
|
82 |
+
#: woocommerce-ac.php:1469
|
83 |
+
msgid "Abandoned Orders"
|
84 |
+
msgstr ""
|
85 |
+
|
86 |
+
#: woocommerce-ac.php:1470
|
87 |
+
msgid "Email Templates"
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: woocommerce-ac.php:1472
|
91 |
+
msgid "Recovered Orders"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: woocommerce-ac.php:1473
|
95 |
+
msgid "Product Report"
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: woocommerce-ac.php:1570
|
99 |
+
msgid "You do not have sufficient permissions to access this page."
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: woocommerce-ac.php:1574
|
103 |
+
msgid "WooCommerce - Abandon Cart Lite"
|
104 |
+
msgstr ""
|
105 |
+
|
106 |
+
#: woocommerce-ac.php:1640
|
107 |
+
msgid "The Abandoned cart has been successfully deleted."
|
108 |
+
msgstr ""
|
109 |
+
|
110 |
+
#: woocommerce-ac.php:1646
|
111 |
+
msgid "The Template has been successfully deleted."
|
112 |
+
msgstr ""
|
113 |
+
|
114 |
+
#: woocommerce-ac.php:1660
|
115 |
+
msgid ""
|
116 |
+
"Change settings for sending email notifications to Customers after X minute."
|
117 |
+
msgstr ""
|
118 |
+
|
119 |
+
#: woocommerce-ac.php:1673
|
120 |
+
msgid ""
|
121 |
+
"The list below shows all Abandoned Carts which have remained in cart for a "
|
122 |
+
"time higher than the \"Cart abandoned cut-off time\" setting."
|
123 |
+
msgstr ""
|
124 |
+
|
125 |
+
#: woocommerce-ac.php:1694
|
126 |
+
msgid ""
|
127 |
+
"Add email templates at different intervals to maximize the possibility of "
|
128 |
+
"recovering your abandoned carts."
|
129 |
+
msgstr ""
|
130 |
+
|
131 |
+
#: woocommerce-ac.php:2011
|
132 |
+
msgid "The Email Template has been successfully added."
|
133 |
+
msgstr ""
|
134 |
+
|
135 |
+
#: woocommerce-ac.php:2014
|
136 |
+
msgid ""
|
137 |
+
" There was a problem adding the email template. Please contact the plugin "
|
138 |
+
"author via <a href= \"https://wordpress.org/support/plugin/woocommerce-"
|
139 |
+
"abandoned-cart\">support forum</a>."
|
140 |
+
msgstr ""
|
141 |
+
|
142 |
+
#: woocommerce-ac.php:2019
|
143 |
+
msgid "The Email Template has been successfully updated."
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: woocommerce-ac.php:2022
|
147 |
+
msgid ""
|
148 |
+
" There was a problem updating the email template. Please contact the plugin "
|
149 |
+
"author via <a href= \"https://wordpress.org/support/plugin/woocommerce-"
|
150 |
+
"abandoned-cart\">support forum</a>."
|
151 |
+
msgstr ""
|
152 |
+
|
153 |
+
#: woocommerce-ac.php:2028
|
154 |
+
msgid "Add New Template"
|
155 |
+
msgstr ""
|
156 |
+
|
157 |
+
#: woocommerce-ac.php:2120
|
158 |
+
msgid ""
|
159 |
+
"The Report below shows how many Abandoned Carts we were able to recover for "
|
160 |
+
"you by sending automatic emails to encourage shoppers."
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: woocommerce-ac.php:2172
|
164 |
+
msgid "Start Date:"
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: woocommerce-ac.php:2174
|
168 |
+
msgid "End Date:"
|
169 |
+
msgstr ""
|
170 |
+
|
171 |
+
#: woocommerce-ac.php:2176
|
172 |
+
msgid "Go"
|
173 |
+
msgstr ""
|
174 |
+
|
175 |
+
#: woocommerce-ac.php:2182
|
176 |
+
msgid "During the selected range "
|
177 |
+
msgstr ""
|
178 |
+
|
179 |
+
#: woocommerce-ac.php:2187
|
180 |
+
msgid "carts totaling"
|
181 |
+
msgstr ""
|
182 |
+
|
183 |
+
#: woocommerce-ac.php:2193
|
184 |
+
msgid " were abandoned. We were able to recover"
|
185 |
+
msgstr ""
|
186 |
+
|
187 |
+
#: woocommerce-ac.php:2200
|
188 |
+
msgid " of them, which led to an extra"
|
189 |
+
msgstr ""
|
190 |
+
|
191 |
+
#: woocommerce-ac.php:2226 woocommerce-ac.php:2964
|
192 |
+
#: cron/wcal_send_email.php:310
|
193 |
+
msgid "Item"
|
194 |
+
msgstr ""
|
195 |
+
|
196 |
+
#: woocommerce-ac.php:2227 woocommerce-ac.php:2965
|
197 |
+
#: cron/wcal_send_email.php:311
|
198 |
+
msgid "Name"
|
199 |
+
msgstr ""
|
200 |
+
|
201 |
+
#: woocommerce-ac.php:2228 woocommerce-ac.php:2966
|
202 |
+
#: cron/wcal_send_email.php:312
|
203 |
+
msgid "Quantity"
|
204 |
+
msgstr ""
|
205 |
+
|
206 |
+
#: woocommerce-ac.php:2229 woocommerce-ac.php:2968
|
207 |
+
#: cron/wcal_send_email.php:314
|
208 |
+
msgid "Line Subtotal"
|
209 |
+
msgstr ""
|
210 |
+
|
211 |
+
#: woocommerce-ac.php:2230
|
212 |
+
msgid "Line Total"
|
213 |
+
msgstr ""
|
214 |
+
|
215 |
+
#: woocommerce-ac.php:2474
|
216 |
+
msgid "Customer Details"
|
217 |
+
msgstr ""
|
218 |
+
|
219 |
+
#: woocommerce-ac.php:2478
|
220 |
+
msgid "Billing Details"
|
221 |
+
msgstr ""
|
222 |
+
|
223 |
+
#: woocommerce-ac.php:2479
|
224 |
+
msgid "Name:"
|
225 |
+
msgstr ""
|
226 |
+
|
227 |
+
#: woocommerce-ac.php:2482 woocommerce-ac.php:2502
|
228 |
+
msgid "Address:"
|
229 |
+
msgstr ""
|
230 |
+
|
231 |
+
#: woocommerce-ac.php:2492
|
232 |
+
msgid "Email:"
|
233 |
+
msgstr ""
|
234 |
+
|
235 |
+
#: woocommerce-ac.php:2496
|
236 |
+
msgid "Phone:"
|
237 |
+
msgstr ""
|
238 |
+
|
239 |
+
#: woocommerce-ac.php:2501
|
240 |
+
msgid "Shipping Details"
|
241 |
+
msgstr ""
|
242 |
+
|
243 |
+
#: woocommerce-ac.php:2586
|
244 |
+
msgid "Template Name:"
|
245 |
+
msgstr ""
|
246 |
+
|
247 |
+
#: woocommerce-ac.php:2597
|
248 |
+
msgid "Enter a template name for reference"
|
249 |
+
msgstr ""
|
250 |
+
|
251 |
+
#: woocommerce-ac.php:2603
|
252 |
+
msgid "Send From This Name:"
|
253 |
+
msgstr ""
|
254 |
+
|
255 |
+
#: woocommerce-ac.php:2614
|
256 |
+
msgid "Enter the name that should appear in the email sent"
|
257 |
+
msgstr ""
|
258 |
+
|
259 |
+
#: woocommerce-ac.php:2620
|
260 |
+
msgid "Send From This Email Address:"
|
261 |
+
msgstr ""
|
262 |
+
|
263 |
+
#: woocommerce-ac.php:2630
|
264 |
+
msgid ""
|
265 |
+
"Which email address should be shown in the \"From Email\" field for this "
|
266 |
+
"email?"
|
267 |
+
msgstr ""
|
268 |
+
|
269 |
+
#: woocommerce-ac.php:2636
|
270 |
+
msgid "Send Reply Emails to:"
|
271 |
+
msgstr ""
|
272 |
+
|
273 |
+
#: woocommerce-ac.php:2647
|
274 |
+
msgid ""
|
275 |
+
"When a contact receives your email and clicks reply, which email address "
|
276 |
+
"should that reply be sent to?"
|
277 |
+
msgstr ""
|
278 |
+
|
279 |
+
#: woocommerce-ac.php:2653
|
280 |
+
msgid "Subject:"
|
281 |
+
msgstr ""
|
282 |
+
|
283 |
+
#: woocommerce-ac.php:2664
|
284 |
+
msgid "Enter the subject that should appear in the email sent"
|
285 |
+
msgstr ""
|
286 |
+
|
287 |
+
#: woocommerce-ac.php:2670
|
288 |
+
msgid "Email Body:"
|
289 |
+
msgstr ""
|
290 |
+
|
291 |
+
#: woocommerce-ac.php:2698
|
292 |
+
msgid "Message to be sent in the reminder email."
|
293 |
+
msgstr ""
|
294 |
+
|
295 |
+
#: woocommerce-ac.php:2705
|
296 |
+
msgid "Use WooCommerce Template Style:"
|
297 |
+
msgstr ""
|
298 |
+
|
299 |
+
#: woocommerce-ac.php:2720
|
300 |
+
msgid ""
|
301 |
+
"Use WooCommerce default style template for abandoned cart reminder emails."
|
302 |
+
msgstr ""
|
303 |
+
|
304 |
+
#: woocommerce-ac.php:2727
|
305 |
+
msgid "Email Template Header Text: "
|
306 |
+
msgstr ""
|
307 |
+
|
308 |
+
#: woocommerce-ac.php:2742
|
309 |
+
msgid ""
|
310 |
+
"Enter the header which will appear in the abandoned WooCommerce email sent. "
|
311 |
+
"This is only applicable when only used when \"Use WooCommerce Template Style:"
|
312 |
+
"\" is checked."
|
313 |
+
msgstr ""
|
314 |
+
|
315 |
+
#: woocommerce-ac.php:2748
|
316 |
+
msgid "Active:"
|
317 |
+
msgstr ""
|
318 |
+
|
319 |
+
#: woocommerce-ac.php:2773
|
320 |
+
msgid ""
|
321 |
+
"The email template will be sent to customers only if the \"Active\" checkbox "
|
322 |
+
"is enabled. Leave this unchecked if you want to add the email template but "
|
323 |
+
"not send it to customers."
|
324 |
+
msgstr ""
|
325 |
+
|
326 |
+
#: woocommerce-ac.php:2779
|
327 |
+
msgid "Send this email:"
|
328 |
+
msgstr ""
|
329 |
+
|
330 |
+
#: woocommerce-ac.php:2825
|
331 |
+
msgid "after cart is abandoned."
|
332 |
+
msgstr ""
|
333 |
+
|
334 |
+
#: woocommerce-ac.php:2832
|
335 |
+
msgid "Send a test email to:"
|
336 |
+
msgstr ""
|
337 |
+
|
338 |
+
#: woocommerce-ac.php:2837
|
339 |
+
msgid "Enter the email id to which the test email needs to be sent."
|
340 |
+
msgstr ""
|
341 |
+
|
342 |
+
#: woocommerce-ac.php:2961 cron/wcal_send_email.php:307
|
343 |
+
msgid "Your Shopping Cart"
|
344 |
+
msgstr ""
|
345 |
+
|
346 |
+
#: woocommerce-ac.php:2967 cron/wcal_send_email.php:313
|
347 |
+
msgid "Price"
|
348 |
+
msgstr ""
|
349 |
+
|
350 |
+
#: woocommerce-ac.php:2972
|
351 |
+
msgid "Men\\'\\s Formal Shoes"
|
352 |
+
msgstr ""
|
353 |
+
|
354 |
+
#: woocommerce-ac.php:2979
|
355 |
+
msgid "Woman\\'\\s Hand Bags"
|
356 |
+
msgstr ""
|
357 |
+
|
358 |
+
#: woocommerce-ac.php:2988 cron/wcal_send_email.php:381
|
359 |
+
msgid "Cart Total:"
|
360 |
+
msgstr ""
|
361 |
+
|
362 |
+
#: cron/wcal_send_email.php:191
|
363 |
+
msgid "Abandoned cart reminder"
|
364 |
+
msgstr ""
|
365 |
+
|
366 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:42
|
367 |
+
msgid "abandoned_order_id"
|
368 |
+
msgstr ""
|
369 |
+
|
370 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:43
|
371 |
+
msgid "abandoned_order_ids"
|
372 |
+
msgstr ""
|
373 |
+
|
374 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:76
|
375 |
+
msgid "Id"
|
376 |
+
msgstr ""
|
377 |
+
|
378 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:77
|
379 |
+
#: includes/classes/class-wcal-recover-orders-table.php:106
|
380 |
+
msgid "Email Address"
|
381 |
+
msgstr ""
|
382 |
+
|
383 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:78
|
384 |
+
msgid "Customer"
|
385 |
+
msgstr ""
|
386 |
+
|
387 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:79
|
388 |
+
#: includes/classes/class-wcal-recover-orders-table.php:109
|
389 |
+
msgid "Order Total"
|
390 |
+
msgstr ""
|
391 |
+
|
392 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:80
|
393 |
+
msgid "Abandoned Date"
|
394 |
+
msgstr ""
|
395 |
+
|
396 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:81
|
397 |
+
msgid "Status of Cart"
|
398 |
+
msgstr ""
|
399 |
+
|
400 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:127
|
401 |
+
msgid "View order"
|
402 |
+
msgstr ""
|
403 |
+
|
404 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:128
|
405 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:394
|
406 |
+
#: includes/classes/class-wcal-templates-table.php:120
|
407 |
+
#: includes/classes/class-wcal-templates-table.php:256
|
408 |
+
msgid "Delete"
|
409 |
+
msgstr ""
|
410 |
+
|
411 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:246
|
412 |
+
msgid "item"
|
413 |
+
msgstr ""
|
414 |
+
|
415 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:248
|
416 |
+
msgid "items"
|
417 |
+
msgstr ""
|
418 |
+
|
419 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:252
|
420 |
+
msgid "Abandoned"
|
421 |
+
msgstr ""
|
422 |
+
|
423 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:254
|
424 |
+
msgid "Abandoned but new"
|
425 |
+
msgstr ""
|
426 |
+
|
427 |
+
#: includes/classes/class-wcal-abandoned-orders-table.php:254
|
428 |
+
msgid "cart created after this"
|
429 |
+
msgstr ""
|
430 |
+
|
431 |
+
#: includes/classes/class-wcal-product-report-table.php:82
|
432 |
+
msgid "product_id"
|
433 |
+
msgstr ""
|
434 |
+
|
435 |
+
#: includes/classes/class-wcal-product-report-table.php:83
|
436 |
+
msgid "product_ids"
|
437 |
+
msgstr ""
|
438 |
+
|
439 |
+
#: includes/classes/class-wcal-product-report-table.php:106
|
440 |
+
msgid "Product Name"
|
441 |
+
msgstr ""
|
442 |
+
|
443 |
+
#: includes/classes/class-wcal-product-report-table.php:107
|
444 |
+
msgid "Number of Times Abandoned"
|
445 |
+
msgstr ""
|
446 |
+
|
447 |
+
#: includes/classes/class-wcal-product-report-table.php:108
|
448 |
+
msgid "Number of Times Recovered"
|
449 |
+
msgstr ""
|
450 |
+
|
451 |
+
#: includes/classes/class-wcal-recover-orders-table.php:76
|
452 |
+
msgid "rec_abandoned_id"
|
453 |
+
msgstr ""
|
454 |
+
|
455 |
+
#: includes/classes/class-wcal-recover-orders-table.php:77
|
456 |
+
msgid "rec_abandoned_ids"
|
457 |
+
msgstr ""
|
458 |
+
|
459 |
+
#: includes/classes/class-wcal-recover-orders-table.php:105
|
460 |
+
msgid "Customer Name"
|
461 |
+
msgstr ""
|
462 |
+
|
463 |
+
#: includes/classes/class-wcal-recover-orders-table.php:107
|
464 |
+
msgid "Cart Abandoned Date"
|
465 |
+
msgstr ""
|
466 |
+
|
467 |
+
#: includes/classes/class-wcal-recover-orders-table.php:108
|
468 |
+
msgid "Cart Recovered Date"
|
469 |
+
msgstr ""
|
470 |
+
|
471 |
+
#: includes/classes/class-wcal-recover-orders-table.php:139
|
472 |
+
msgid "View Details"
|
473 |
+
msgstr ""
|
474 |
+
|
475 |
+
#: includes/classes/class-wcal-templates-table.php:43
|
476 |
+
msgid "template_id"
|
477 |
+
msgstr ""
|
478 |
+
|
479 |
+
#: includes/classes/class-wcal-templates-table.php:44
|
480 |
+
msgid "template_ids"
|
481 |
+
msgstr ""
|
482 |
+
|
483 |
+
#: includes/classes/class-wcal-templates-table.php:72
|
484 |
+
msgid "Sr"
|
485 |
+
msgstr ""
|
486 |
+
|
487 |
+
#: includes/classes/class-wcal-templates-table.php:73
|
488 |
+
msgid "Name Of Template"
|
489 |
+
msgstr ""
|
490 |
+
|
491 |
+
#: includes/classes/class-wcal-templates-table.php:74
|
492 |
+
msgid "Sent After Set Time"
|
493 |
+
msgstr ""
|
494 |
+
|
495 |
+
#: includes/classes/class-wcal-templates-table.php:75
|
496 |
+
msgid "Active ?"
|
497 |
+
msgstr ""
|
498 |
+
|
499 |
+
#: includes/classes/class-wcal-templates-table.php:119
|
500 |
+
msgid "Edit"
|
501 |
+
msgstr ""
|
502 |
+
|
503 |
+
#: includes/classes/class-wcal-templates-table.php:156
|
504 |
+
msgid " "
|
505 |
+
msgstr ""
|
includes/classes/class-wcal-abandoned-orders-table.php
ADDED
@@ -0,0 +1,392 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// Load WP_List_Table if not loaded
|
3 |
+
if ( ! class_exists( 'WP_List_Table' ) ) {
|
4 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
5 |
+
}
|
6 |
+
|
7 |
+
class WCAL_Abandoned_Orders_Table extends WP_List_Table {
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Number of results to show per page
|
11 |
+
*
|
12 |
+
* @var string
|
13 |
+
* @since 2.5.2
|
14 |
+
*/
|
15 |
+
public $per_page = 30;
|
16 |
+
|
17 |
+
/**
|
18 |
+
* URL of this page
|
19 |
+
*
|
20 |
+
* @var string
|
21 |
+
* @since 2.5.2
|
22 |
+
*/
|
23 |
+
public $base_url;
|
24 |
+
|
25 |
+
/**
|
26 |
+
* Total number of bookings
|
27 |
+
*
|
28 |
+
* @var int
|
29 |
+
* @since 2.5.2
|
30 |
+
*/
|
31 |
+
public $total_count;
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Get things started
|
35 |
+
*
|
36 |
+
* @see WP_List_Table::__construct()
|
37 |
+
*/
|
38 |
+
public function __construct() {
|
39 |
+
global $status, $page;
|
40 |
+
// Set parent defaults
|
41 |
+
parent::__construct( array(
|
42 |
+
'singular' => __( 'abandoned_order_id', 'woocommerce-ac' ), //singular name of the listed records
|
43 |
+
'plural' => __( 'abandoned_order_ids', 'woocommerce-ac' ), //plural name of the listed records
|
44 |
+
'ajax' => false // Does this table support ajax?
|
45 |
+
) );
|
46 |
+
$this->process_bulk_action();
|
47 |
+
$this->base_url = admin_url( 'admin.php?page=woocommerce_ac_page' );
|
48 |
+
}
|
49 |
+
|
50 |
+
public function wcal_abandoned_order_prepare_items() {
|
51 |
+
$columns = $this->get_columns();
|
52 |
+
$hidden = array(); // No hidden columns
|
53 |
+
$sortable = $this->get_sortable_columns();
|
54 |
+
$this->total_count = 0;
|
55 |
+
$data = $this->wcal_abandoned_cart_data();
|
56 |
+
$this->_column_headers = array( $columns, $hidden, $sortable );
|
57 |
+
$total_items = $this->total_count;
|
58 |
+
|
59 |
+
if( count( $data ) > 0 ) {
|
60 |
+
$this->items = $data;
|
61 |
+
} else {
|
62 |
+
$this->items = array();
|
63 |
+
}
|
64 |
+
$this->set_pagination_args( array(
|
65 |
+
'total_items' => $total_items, // WE have to calculate the total number of items
|
66 |
+
'per_page' => $this->per_page, // WE have to determine how many items to show on a page
|
67 |
+
'total_pages' => ceil( $total_items / $this->per_page ) // WE have to calculate the total number of pages
|
68 |
+
)
|
69 |
+
);
|
70 |
+
}
|
71 |
+
|
72 |
+
public function get_columns() {
|
73 |
+
$columns = array();
|
74 |
+
$columns = array(
|
75 |
+
'cb' => '<input type="checkbox" />',
|
76 |
+
'id' => __( 'Id', 'woocommerce-ac' ),
|
77 |
+
'email' => __( 'Email Address', 'woocommerce-ac' ),
|
78 |
+
'customer' => __( 'Customer', 'woocommerce-ac' ),
|
79 |
+
'order_total' => __( 'Order Total', 'woocommerce-ac' ),
|
80 |
+
'date' => __( 'Abandoned Date', 'woocommerce-ac' ),
|
81 |
+
'status' => __( 'Status of Cart', 'woocommerce-ac' )
|
82 |
+
);
|
83 |
+
return apply_filters( 'wcal_abandoned_orders_columns', $columns );
|
84 |
+
}
|
85 |
+
|
86 |
+
/***
|
87 |
+
* It is used to add the check box for the items
|
88 |
+
*/
|
89 |
+
function column_cb( $item ){
|
90 |
+
$abandoned_order_id = '';
|
91 |
+
if( isset( $item->id ) && "" != $item->id ) {
|
92 |
+
$abandoned_order_id = $item->id;
|
93 |
+
}
|
94 |
+
return sprintf(
|
95 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
96 |
+
'abandoned_order_id',
|
97 |
+
$abandoned_order_id
|
98 |
+
);
|
99 |
+
}
|
100 |
+
|
101 |
+
public function get_sortable_columns() {
|
102 |
+
$columns = array(
|
103 |
+
'date' => array( 'date', false ),
|
104 |
+
'status' => array( 'status',false),
|
105 |
+
);
|
106 |
+
return apply_filters( 'wcal_abandoned_orders_sortable_columns', $columns );
|
107 |
+
}
|
108 |
+
|
109 |
+
/**
|
110 |
+
* Render the Email Column
|
111 |
+
*
|
112 |
+
* @access public
|
113 |
+
* @since 2.4.8
|
114 |
+
* @param array $abandoned_row_info Contains all the data of the abandoned order tabs row
|
115 |
+
* @return string Data shown in the Email column
|
116 |
+
*
|
117 |
+
* This function used for individual delete of row, It is for hover effect delete.
|
118 |
+
*/
|
119 |
+
public function column_email( $abandoned_row_info ) {
|
120 |
+
$row_actions = array();
|
121 |
+
$value = '';
|
122 |
+
$abandoned_order_id = 0;
|
123 |
+
|
124 |
+
if( isset( $abandoned_row_info->email ) ) {
|
125 |
+
$abandoned_order_id = $abandoned_row_info->id ;
|
126 |
+
$row_actions['edit'] = '<a href="' . wp_nonce_url( add_query_arg( array( 'action' => 'orderdetails', 'id' => $abandoned_row_info->id ), $this->base_url ), 'abandoned_order_nonce') . '">' . __( 'View order', 'woocommerce-ac' ) . '</a>';
|
127 |
+
$row_actions['delete'] = '<a href="' . wp_nonce_url( add_query_arg( array( 'action' => 'wcal_delete', 'abandoned_order_id' => $abandoned_row_info->id ), $this->base_url ), 'abandoned_order_nonce') . '">' . __( 'Delete', 'woocommerce-ac' ) . '</a>';
|
128 |
+
$email = $abandoned_row_info->email;
|
129 |
+
$value = $email . $this->row_actions( $row_actions );
|
130 |
+
}
|
131 |
+
return apply_filters( 'wcal_abandoned_orders_single_column', $value, $abandoned_order_id, 'email' );
|
132 |
+
}
|
133 |
+
|
134 |
+
public function wcal_abandoned_cart_data() {
|
135 |
+
global $wpdb;
|
136 |
+
$return_abandoned_orders = array();
|
137 |
+
$per_page = $this->per_page;
|
138 |
+
$results = array();
|
139 |
+
$blank_cart_info = '{"cart":[]}';
|
140 |
+
$blank_cart_info_guest = '[]';
|
141 |
+
|
142 |
+
// non-multisite - regular table name
|
143 |
+
$query = "SELECT wpac . * , wpu.user_login, wpu.user_email FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` AS wpac
|
144 |
+
LEFT JOIN ".$wpdb->base_prefix."users AS wpu ON wpac.user_id = wpu.id
|
145 |
+
WHERE recovered_cart = '0'
|
146 |
+
AND wpac.abandoned_cart_info NOT LIKE '%$blank_cart_info%' AND wpac.abandoned_cart_info NOT LIKE '$blank_cart_info_guest' ORDER BY wpac.abandoned_cart_time DESC";
|
147 |
+
$results = $wpdb->get_results($query);
|
148 |
+
$i = 0;
|
149 |
+
|
150 |
+
foreach( $results as $key => $value ) {
|
151 |
+
if( $value->user_type == "GUEST" ) {
|
152 |
+
$query_guest = "SELECT * from `" . $wpdb->prefix . "ac_guest_abandoned_cart_history_lite` WHERE id = %d";
|
153 |
+
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $value->user_id ) );
|
154 |
+
}
|
155 |
+
$abandoned_order_id = $value->id;
|
156 |
+
$user_id = $value->user_id;
|
157 |
+
$user_login = $value->user_login;
|
158 |
+
|
159 |
+
if ( $value->user_type == "GUEST" ) {
|
160 |
+
|
161 |
+
if ( isset( $results_guest[0]->email_id ) ) {
|
162 |
+
$user_email = $results_guest[0]->email_id;
|
163 |
+
}
|
164 |
+
|
165 |
+
if ( isset( $results_guest[0]->billing_first_name ) ) {
|
166 |
+
$user_first_name = $results_guest[0]->billing_first_name;
|
167 |
+
} else {
|
168 |
+
$user_first_name = "";
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( isset( $results_guest[0]->billing_last_name ) ) {
|
172 |
+
$user_last_name = $results_guest[0]->billing_last_name;
|
173 |
+
} else {
|
174 |
+
$user_last_name = "";
|
175 |
+
}
|
176 |
+
} else {
|
177 |
+
$user_email_billing = get_user_meta( $value->user_id, 'billing_email', true );
|
178 |
+
if( $user_email_billing != '' ) {
|
179 |
+
$user_email = $user_email_billing;
|
180 |
+
} else {
|
181 |
+
$user_data = get_userdata( $value->user_id );
|
182 |
+
$user_email = $user_data->user_email;
|
183 |
+
}
|
184 |
+
$user_first_name = "";
|
185 |
+
$user_first_name_temp = get_user_meta( $user_id, 'billing_first_name', true );
|
186 |
+
if( isset( $user_first_name_temp ) && "" == $user_first_name_temp ) {
|
187 |
+
$user_data = get_userdata( $user_id );
|
188 |
+
$user_first_name = $user_data->first_name;
|
189 |
+
} else {
|
190 |
+
$user_first_name = $user_first_name_temp;
|
191 |
+
}
|
192 |
+
|
193 |
+
$user_last_name = "";
|
194 |
+
$user_last_name_temp = get_user_meta( $user_id, 'billing_last_name', true );
|
195 |
+
if( isset( $user_last_name_temp ) && "" == $user_last_name_temp ) {
|
196 |
+
$user_data = get_userdata( $user_id );
|
197 |
+
$user_last_name = $user_data->last_name;
|
198 |
+
} else {
|
199 |
+
$user_last_name = $user_last_name_temp;
|
200 |
+
}
|
201 |
+
}
|
202 |
+
|
203 |
+
$cart_info = json_decode( $value->abandoned_cart_info );
|
204 |
+
$order_date = "";
|
205 |
+
$cart_update_time = $value->abandoned_cart_time;
|
206 |
+
|
207 |
+
if ( $cart_update_time != "" && $cart_update_time != 0 ) {
|
208 |
+
$order_date = date( 'd M, Y h:i A', $cart_update_time );
|
209 |
+
}
|
210 |
+
|
211 |
+
$ac_cutoff_time = get_option( 'ac_lite_cart_abandoned_time' );
|
212 |
+
$cut_off_time = $ac_cutoff_time * 60;
|
213 |
+
$current_time = current_time( 'timestamp' );
|
214 |
+
$compare_time = $current_time - $cart_update_time;
|
215 |
+
$cart_details = array();
|
216 |
+
if( isset( $cart_info->cart ) ){
|
217 |
+
$cart_details = $cart_info->cart;
|
218 |
+
}
|
219 |
+
$line_total = 0;
|
220 |
+
|
221 |
+
if( count( $cart_details ) > 0 ) {
|
222 |
+
foreach( $cart_details as $k => $v ) {
|
223 |
+
if( $v->line_subtotal_tax != 0 && $v->line_subtotal_tax > 0 ) {
|
224 |
+
$line_total = $line_total + $v->line_total + $v->line_subtotal_tax;
|
225 |
+
} else {
|
226 |
+
$line_total = $line_total + $v->line_total;
|
227 |
+
}
|
228 |
+
}
|
229 |
+
}
|
230 |
+
//$number_decimal = wc_get_price_decimals();
|
231 |
+
$line_total = wc_price( $line_total );
|
232 |
+
$quantity_total = 0;
|
233 |
+
|
234 |
+
if ( count( $cart_details ) > 0) {
|
235 |
+
foreach( $cart_details as $k => $v ) {
|
236 |
+
$quantity_total = $quantity_total + $v->quantity;
|
237 |
+
}
|
238 |
+
}
|
239 |
+
|
240 |
+
if ( 1 == $quantity_total ) {
|
241 |
+
$item_disp = __("item", "woocommerce-ac");
|
242 |
+
} else {
|
243 |
+
$item_disp = __("items", "woocommerce-ac");
|
244 |
+
}
|
245 |
+
|
246 |
+
if( $value->cart_ignored == 0 && $value->recovered_cart == 0 ) {
|
247 |
+
$ac_status = __( "Abandoned", "woocommerce-ac" );
|
248 |
+
} elseif( $value->cart_ignored == 1 && $value->recovered_cart == 0 ) {
|
249 |
+
$ac_status = __( "Abandoned but new","woocommerce-ac" )."</br>". __( "cart created after this", "woocommerce-ac" );
|
250 |
+
} else {
|
251 |
+
$ac_status = "";
|
252 |
+
}
|
253 |
+
|
254 |
+
if( $compare_time > $cut_off_time && $ac_status != "" ) {
|
255 |
+
$return_abandoned_orders[$i] = new stdClass();
|
256 |
+
if( $quantity_total > 0 ) {
|
257 |
+
$abandoned_order_id = $abandoned_order_id;
|
258 |
+
$customer_information = $user_first_name . " ".$user_last_name;
|
259 |
+
$return_abandoned_orders[ $i ]->id = $abandoned_order_id;
|
260 |
+
$return_abandoned_orders[ $i ]->email = $user_email;
|
261 |
+
$return_abandoned_orders[ $i ]->customer = $customer_information;
|
262 |
+
$return_abandoned_orders[ $i ]->order_total = $line_total;
|
263 |
+
$return_abandoned_orders[ $i ]->date = $order_date;
|
264 |
+
$return_abandoned_orders[ $i ]->status = $ac_status;
|
265 |
+
}else {
|
266 |
+
$abandoned_order_id = $abandoned_order_id;
|
267 |
+
$return_abandoned_orders[ $i ]->id = $abandoned_order_id;
|
268 |
+
$return_abandoned_orders[ $i ]->date = $order_date;
|
269 |
+
$return_abandoned_orders[ $i ]->status = $ac_status;
|
270 |
+
}
|
271 |
+
// To get the abandoned orders count
|
272 |
+
$this->total_count = count( $return_abandoned_orders );
|
273 |
+
$i++;
|
274 |
+
}
|
275 |
+
}
|
276 |
+
// sort for order date
|
277 |
+
if( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'date' ) {
|
278 |
+
if( isset( $_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
279 |
+
usort( $return_abandoned_orders, array( __CLASS__ , "wcal_class_order_date_asc") );
|
280 |
+
}
|
281 |
+
else {
|
282 |
+
usort( $return_abandoned_orders, array( __CLASS__ , "wcal_class_order_date_dsc") );
|
283 |
+
}
|
284 |
+
}
|
285 |
+
// sort for customer name
|
286 |
+
else if( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'status' ) {
|
287 |
+
if( isset( $_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
288 |
+
usort( $return_abandoned_orders, array( __CLASS__ , "wcal_class_status_asc" ) );
|
289 |
+
} else {
|
290 |
+
usort( $return_abandoned_orders, array( __CLASS__ , "wcal_class_status_dsc" ) );
|
291 |
+
}
|
292 |
+
}
|
293 |
+
|
294 |
+
if( isset( $_GET['paged'] ) && $_GET['paged'] > 1 ) {
|
295 |
+
$page_number = $_GET['paged'] - 1;
|
296 |
+
$k = $per_page * $page_number;
|
297 |
+
} else {
|
298 |
+
$k = 0;
|
299 |
+
}
|
300 |
+
$return_abandoned_orders_display = array();
|
301 |
+
for( $j = $k; $j < ( $k+$per_page ); $j++ ) {
|
302 |
+
if( isset( $return_abandoned_orders[$j] ) ) {
|
303 |
+
$return_abandoned_orders_display[$j] = $return_abandoned_orders[$j];
|
304 |
+
} else {
|
305 |
+
break;
|
306 |
+
}
|
307 |
+
}
|
308 |
+
return apply_filters( 'wcal_abandoned_orders_table_data', $return_abandoned_orders_display );
|
309 |
+
}
|
310 |
+
|
311 |
+
function wcal_class_order_date_asc( $value1,$value2 ) {
|
312 |
+
$date_two = $date_one = '';
|
313 |
+
$value_one = $value1->date;
|
314 |
+
$value_two = $value2->date;
|
315 |
+
$date_formatted_one = date_create_from_format( 'd M, Y h:i A', $value_one );
|
316 |
+
if( isset( $date_formatted_one ) && $date_formatted_one != '' ) {
|
317 |
+
$date_one = date_format( $date_formatted_one, 'Y-m-d h:i A' );
|
318 |
+
}
|
319 |
+
|
320 |
+
$date_formatted_two = date_create_from_format( 'd M, Y h:i A', $value_two );
|
321 |
+
if( isset( $date_formatted_two ) && $date_formatted_two != '' ) {
|
322 |
+
$date_two = date_format( $date_formatted_two, 'Y-m-d h:i A' );
|
323 |
+
}
|
324 |
+
return strtotime( $date_one ) - strtotime( $date_two );
|
325 |
+
}
|
326 |
+
|
327 |
+
function wcal_class_order_date_dsc( $value1,$value2 ) {
|
328 |
+
$date_two = $date_one = '';
|
329 |
+
$value_one = $value1->date;
|
330 |
+
$value_two = $value2->date;
|
331 |
+
$date_formatted_one = date_create_from_format( 'd M, Y h:i A', $value_one );
|
332 |
+
if( isset( $date_formatted_one ) && $date_formatted_one != '' ) {
|
333 |
+
$date_one = date_format( $date_formatted_one, 'Y-m-d h:i A' );
|
334 |
+
}
|
335 |
+
|
336 |
+
$date_formatted_two = date_create_from_format( 'd M, Y h:i A', $value_two );
|
337 |
+
if( isset( $date_formatted_two ) && $date_formatted_two != '' ) {
|
338 |
+
$date_two = date_format( $date_formatted_two, 'Y-m-d h:i A' );
|
339 |
+
}
|
340 |
+
return strtotime($date_two) - strtotime($date_one);
|
341 |
+
}
|
342 |
+
|
343 |
+
function wcal_class_status_asc( $value1,$value2 ) {
|
344 |
+
return strcasecmp( $value1->status,$value2->status );
|
345 |
+
}
|
346 |
+
|
347 |
+
function wcal_class_status_dsc( $value1,$value2 ) {
|
348 |
+
return strcasecmp( $value2->status,$value1->status );
|
349 |
+
}
|
350 |
+
|
351 |
+
public function column_default( $wcal_abandoned_orders, $column_name ) {
|
352 |
+
$value = '';
|
353 |
+
switch( $column_name ) {
|
354 |
+
case 'id' :
|
355 |
+
if( isset($wcal_abandoned_orders->id ) ) {
|
356 |
+
$value = '<strong><a href="admin.php?page=woocommerce_ac_page&action=orderdetails&id='.$wcal_abandoned_orders->id.' ">'.$wcal_abandoned_orders->id.'</a> </strong>';
|
357 |
+
}
|
358 |
+
break;
|
359 |
+
case 'customer' :
|
360 |
+
if( isset( $wcal_abandoned_orders->customer ) ) {
|
361 |
+
$value = $wcal_abandoned_orders->customer;
|
362 |
+
}
|
363 |
+
break;
|
364 |
+
case 'order_total' :
|
365 |
+
if( isset( $wcal_abandoned_orders->order_total ) ) {
|
366 |
+
$value = $wcal_abandoned_orders->order_total;
|
367 |
+
}
|
368 |
+
break;
|
369 |
+
case 'date' :
|
370 |
+
if( isset( $wcal_abandoned_orders->date ) ) {
|
371 |
+
$value = $wcal_abandoned_orders->date;
|
372 |
+
}
|
373 |
+
break;
|
374 |
+
case 'status' :
|
375 |
+
if( isset( $wcal_abandoned_orders->status ) ) {
|
376 |
+
$value = $wcal_abandoned_orders->status;
|
377 |
+
}
|
378 |
+
break;
|
379 |
+
default:
|
380 |
+
$value = isset( $wcal_abandoned_orders->$column_name ) ? $wcal_abandoned_orders->$column_name : '';
|
381 |
+
break;
|
382 |
+
}
|
383 |
+
return apply_filters( 'wcal_abandoned_orders_column_default', $value, $wcal_abandoned_orders, $column_name );
|
384 |
+
}
|
385 |
+
|
386 |
+
public function get_bulk_actions() {
|
387 |
+
return array(
|
388 |
+
'wcal_delete' => __( 'Delete', 'woocommerce-ac' )
|
389 |
+
);
|
390 |
+
}
|
391 |
+
}
|
392 |
+
?>
|
includes/classes/class-wcal-aes-counter.php
ADDED
@@ -0,0 +1,171 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
3 |
+
/* AES counter (CTR) mode implementation in PHP */
|
4 |
+
/* (c) Chris Veness 2005-2014 www.movable-type.co.uk/scripts */
|
5 |
+
/* Right of free use is granted for all commercial or non-commercial use under CC-BY licence. */
|
6 |
+
/* No warranty of any form is offered. */
|
7 |
+
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
8 |
+
|
9 |
+
Class Wcal_Aes_Ctr extends Wcal_Aes
|
10 |
+
{
|
11 |
+
|
12 |
+
/**
|
13 |
+
* Encrypt a text using AES encryption in Counter mode of operation
|
14 |
+
* - see http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
|
15 |
+
*
|
16 |
+
* Unicode multi-byte character safe
|
17 |
+
*
|
18 |
+
* @param plaintext source text to be encrypted
|
19 |
+
* @param password the password to use to generate a key
|
20 |
+
* @param nBits number of bits to be used in the key (128, 192, or 256)
|
21 |
+
* @return encrypted text
|
22 |
+
*/
|
23 |
+
public static function encrypt($plaintext, $password, $nBits)
|
24 |
+
{
|
25 |
+
$blockSize = 16; // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
|
26 |
+
if (!($nBits == 128 || $nBits == 192 || $nBits == 256)) return ''; // standard allows 128/192/256 bit keys
|
27 |
+
// note PHP (5) gives us plaintext and password in UTF8 encoding!
|
28 |
+
|
29 |
+
// use AES itself to encrypt password to get cipher key (using plain password as source for
|
30 |
+
// key expansion) - gives us well encrypted key
|
31 |
+
$nBytes = $nBits / 8; // no bytes in key
|
32 |
+
$pwBytes = array();
|
33 |
+
for ($i = 0; $i < $nBytes; $i++) $pwBytes[$i] = ord(substr($password, $i, 1)) & 0xff;
|
34 |
+
$key = Wcal_Aes::cipher($pwBytes, Wcal_Aes::keyExpansion($pwBytes));
|
35 |
+
$key = array_merge($key, array_slice($key, 0, $nBytes - 16)); // expand key to 16/24/32 bytes long
|
36 |
+
|
37 |
+
// initialise 1st 8 bytes of counter block with nonce (NIST SP800-38A �B.2): [0-1] = millisec,
|
38 |
+
// [2-3] = random, [4-7] = seconds, giving guaranteed sub-ms uniqueness up to Feb 2106
|
39 |
+
$counterBlock = array();
|
40 |
+
$nonce = floor(microtime(true) * 1000); // timestamp: milliseconds since 1-Jan-1970
|
41 |
+
$nonceMs = $nonce % 1000;
|
42 |
+
$nonceSec = floor($nonce / 1000);
|
43 |
+
$nonceRnd = floor(rand(0, 0xffff));
|
44 |
+
|
45 |
+
for ($i = 0; $i < 2; $i++) $counterBlock[$i] = self::urs($nonceMs, $i * 8) & 0xff;
|
46 |
+
for ($i = 0; $i < 2; $i++) $counterBlock[$i + 2] = self::urs($nonceRnd, $i * 8) & 0xff;
|
47 |
+
for ($i = 0; $i < 4; $i++) $counterBlock[$i + 4] = self::urs($nonceSec, $i * 8) & 0xff;
|
48 |
+
|
49 |
+
// and convert it to a string to go on the front of the ciphertext
|
50 |
+
$ctrTxt = '';
|
51 |
+
for ($i = 0; $i < 8; $i++) $ctrTxt .= chr($counterBlock[$i]);
|
52 |
+
|
53 |
+
// generate key schedule - an expansion of the key into distinct Key Rounds for each round
|
54 |
+
$keySchedule = Wcal_Aes::keyExpansion($key);
|
55 |
+
//print_r($keySchedule);
|
56 |
+
|
57 |
+
$blockCount = ceil(strlen($plaintext) / $blockSize);
|
58 |
+
$ciphertxt = array(); // ciphertext as array of strings
|
59 |
+
|
60 |
+
for ($b = 0; $b < $blockCount; $b++) {
|
61 |
+
// set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)
|
62 |
+
// done in two stages for 32-bit ops: using two words allows us to go past 2^32 blocks (68GB)
|
63 |
+
for ($c = 0; $c < 4; $c++) $counterBlock[15 - $c] = self::urs($b, $c * 8) & 0xff;
|
64 |
+
for ($c = 0; $c < 4; $c++) $counterBlock[15 - $c - 4] = self::urs($b / 0x100000000, $c * 8);
|
65 |
+
|
66 |
+
$cipherCntr = Wcal_Aes::cipher($counterBlock, $keySchedule); // -- encrypt counter block --
|
67 |
+
|
68 |
+
// block size is reduced on final block
|
69 |
+
$blockLength = $b < $blockCount - 1 ? $blockSize : (strlen($plaintext) - 1) % $blockSize + 1;
|
70 |
+
$cipherByte = array();
|
71 |
+
|
72 |
+
for ($i = 0; $i < $blockLength; $i++) { // -- xor plaintext with ciphered counter byte-by-byte --
|
73 |
+
$cipherByte[$i] = $cipherCntr[$i] ^ ord(substr($plaintext, $b * $blockSize + $i, 1));
|
74 |
+
$cipherByte[$i] = chr($cipherByte[$i]);
|
75 |
+
}
|
76 |
+
$ciphertxt[$b] = implode('', $cipherByte); // escape troublesome characters in ciphertext
|
77 |
+
}
|
78 |
+
|
79 |
+
// implode is more efficient than repeated string concatenation
|
80 |
+
$ciphertext = $ctrTxt . implode('', $ciphertxt);
|
81 |
+
$ciphertext = base64_encode($ciphertext);
|
82 |
+
return $ciphertext;
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
/**
|
87 |
+
* Decrypt a text encrypted by AES in counter mode of operation
|
88 |
+
*
|
89 |
+
* @param ciphertext source text to be decrypted
|
90 |
+
* @param password the password to use to generate a key
|
91 |
+
* @param nBits number of bits to be used in the key (128, 192, or 256)
|
92 |
+
* @return decrypted text
|
93 |
+
*/
|
94 |
+
public static function decrypt($ciphertext, $password, $nBits)
|
95 |
+
{
|
96 |
+
$blockSize = 16; // block size fixed at 16 bytes / 128 bits (Nb=4) for AES
|
97 |
+
if (!($nBits == 128 || $nBits == 192 || $nBits == 256)) return ''; // standard allows 128/192/256 bit keys
|
98 |
+
$ciphertext = base64_decode($ciphertext);
|
99 |
+
|
100 |
+
// use AES to encrypt password (mirroring encrypt routine)
|
101 |
+
$nBytes = $nBits / 8; // no bytes in key
|
102 |
+
$pwBytes = array();
|
103 |
+
for ($i = 0; $i < $nBytes; $i++) $pwBytes[$i] = ord(substr($password, $i, 1)) & 0xff;
|
104 |
+
$key = Wcal_Aes::cipher($pwBytes, Wcal_Aes::keyExpansion($pwBytes));
|
105 |
+
$key = array_merge($key, array_slice($key, 0, $nBytes - 16)); // expand key to 16/24/32 bytes long
|
106 |
+
|
107 |
+
// recover nonce from 1st element of ciphertext
|
108 |
+
$counterBlock = array();
|
109 |
+
$ctrTxt = substr($ciphertext, 0, 8);
|
110 |
+
for ($i = 0; $i < 8; $i++) $counterBlock[$i] = ord(substr($ctrTxt, $i, 1));
|
111 |
+
|
112 |
+
// generate key schedule
|
113 |
+
$keySchedule = Wcal_Aes::keyExpansion($key);
|
114 |
+
|
115 |
+
// separate ciphertext into blocks (skipping past initial 8 bytes)
|
116 |
+
$nBlocks = ceil((strlen($ciphertext) - 8) / $blockSize);
|
117 |
+
$ct = array();
|
118 |
+
for ($b = 0; $b < $nBlocks; $b++) $ct[$b] = substr($ciphertext, 8 + $b * $blockSize, 16);
|
119 |
+
$ciphertext = $ct; // ciphertext is now array of block-length strings
|
120 |
+
|
121 |
+
// plaintext will get generated block-by-block into array of block-length strings
|
122 |
+
$plaintxt = array();
|
123 |
+
|
124 |
+
for ($b = 0; $b < $nBlocks; $b++) {
|
125 |
+
// set counter (block #) in last 8 bytes of counter block (leaving nonce in 1st 8 bytes)
|
126 |
+
for ($c = 0; $c < 4; $c++) $counterBlock[15 - $c] = self::urs($b, $c * 8) & 0xff;
|
127 |
+
for ($c = 0; $c < 4; $c++) $counterBlock[15 - $c - 4] = self::urs(($b + 1) / 0x100000000 - 1, $c * 8) & 0xff;
|
128 |
+
|
129 |
+
$cipherCntr = Wcal_Aes::cipher($counterBlock, $keySchedule); // encrypt counter block
|
130 |
+
|
131 |
+
$plaintxtByte = array();
|
132 |
+
for ($i = 0; $i < strlen($ciphertext[$b]); $i++) {
|
133 |
+
// -- xor plaintext with ciphered counter byte-by-byte --
|
134 |
+
$plaintxtByte[$i] = $cipherCntr[$i] ^ ord(substr($ciphertext[$b], $i, 1));
|
135 |
+
$plaintxtByte[$i] = chr($plaintxtByte[$i]);
|
136 |
+
|
137 |
+
}
|
138 |
+
$plaintxt[$b] = implode('', $plaintxtByte);
|
139 |
+
}
|
140 |
+
|
141 |
+
// join array of blocks into single plaintext string
|
142 |
+
$plaintext = implode('', $plaintxt);
|
143 |
+
|
144 |
+
return $plaintext;
|
145 |
+
}
|
146 |
+
|
147 |
+
|
148 |
+
/*
|
149 |
+
* Unsigned right shift function, since PHP has neither >>> operator nor unsigned ints
|
150 |
+
*
|
151 |
+
* @param a number to be shifted (32-bit integer)
|
152 |
+
* @param b number of bits to shift a to the right (0..31)
|
153 |
+
* @return a right-shifted and zero-filled by b bits
|
154 |
+
*/
|
155 |
+
private static function urs($a, $b)
|
156 |
+
{
|
157 |
+
$a &= 0xffffffff;
|
158 |
+
$b &= 0x1f; // (bounds check)
|
159 |
+
if ($a & 0x80000000 && $b > 0) { // if left-most bit set
|
160 |
+
$a = ($a >> 1) & 0x7fffffff; // right-shift one bit & clear left-most bit
|
161 |
+
$check = $b - 1 ;
|
162 |
+
$a = $a >> ($check); // remaining right-shifts
|
163 |
+
} else { // otherwise
|
164 |
+
$a = ($a >> $b); // use normal right-shift
|
165 |
+
}
|
166 |
+
return $a;
|
167 |
+
}
|
168 |
+
|
169 |
+
}
|
170 |
+
|
171 |
+
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
includes/classes/class-wcal-aes.php
ADDED
@@ -0,0 +1,190 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
3 |
+
/* AES implementation in PHP */
|
4 |
+
/* (c) Chris Veness 2005-2014 www.movable-type.co.uk/scripts */
|
5 |
+
/* Right of free use is granted for all commercial or non-commercial use under CC-BY licence. */
|
6 |
+
/* No warranty of any form is offered. */
|
7 |
+
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
8 |
+
|
9 |
+
Class Wcal_Aes
|
10 |
+
{
|
11 |
+
/**
|
12 |
+
* AES Cipher function [�5.1]: encrypt 'input' with Rijndael algorithm
|
13 |
+
*
|
14 |
+
* @param input message as byte-array (16 bytes)
|
15 |
+
* @param w key schedule as 2D byte-array (Nr+1 x Nb bytes) -
|
16 |
+
* generated from the cipher key by keyExpansion()
|
17 |
+
* @return ciphertext as byte-array (16 bytes)
|
18 |
+
*/
|
19 |
+
public static function cipher($input, $w)
|
20 |
+
{
|
21 |
+
$Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES)
|
22 |
+
$Nr = count($w) / $Nb - 1; // no of rounds: 10/12/14 for 128/192/256-bit keys
|
23 |
+
$state = array(); // initialise 4xNb byte-array 'state' with input [�3.4]
|
24 |
+
for( $i = 0; $i < 4 * $Nb; $i++ ) $state[$i % 4][floor($i / 4)] = $input[$i];
|
25 |
+
|
26 |
+
$state = self::addRoundKey( $state, $w, 0, $Nb );
|
27 |
+
|
28 |
+
for ( $round = 1; $round < $Nr; $round++ ) { // apply Nr rounds
|
29 |
+
$state = self::subBytes( $state, $Nb );
|
30 |
+
$state = self::shiftRows( $state, $Nb );
|
31 |
+
$state = self::mixColumns( $state, $Nb );
|
32 |
+
$state = self::addRoundKey( $state, $w, $round, $Nb );
|
33 |
+
}
|
34 |
+
|
35 |
+
$state = self::subBytes( $state, $Nb );
|
36 |
+
$state = self::shiftRows( $state, $Nb );
|
37 |
+
$state = self::addRoundKey( $state, $w, $Nr, $Nb );
|
38 |
+
|
39 |
+
$output = array( 4 * $Nb ); // convert state to 1-d array before returning [�3.4]
|
40 |
+
for( $i = 0; $i < 4 * $Nb; $i++ ) $output[$i] = $state[$i % 4][floor($i / 4)];
|
41 |
+
return $output;
|
42 |
+
}
|
43 |
+
/**
|
44 |
+
* Xor Round Key into state S [�5.1.4].
|
45 |
+
*/
|
46 |
+
private static function addRoundKey( $state, $w, $rnd, $Nb )
|
47 |
+
{
|
48 |
+
for( $r = 0; $r < 4; $r++ ) {
|
49 |
+
for ($c = 0; $c < $Nb; $c++) $state[$r][$c] ^= $w[$rnd * 4 + $c][$r];
|
50 |
+
}
|
51 |
+
return $state;
|
52 |
+
}
|
53 |
+
|
54 |
+
/**
|
55 |
+
* Apply SBox to state S [�5.1.1].
|
56 |
+
*/
|
57 |
+
private static function subBytes($s, $Nb)
|
58 |
+
{
|
59 |
+
for( $r = 0; $r < 4; $r++ ) {
|
60 |
+
for( $c = 0; $c < $Nb; $c++ ) $s[$r][$c] = self::$sBox[$s[$r][$c]];
|
61 |
+
}
|
62 |
+
return $s;
|
63 |
+
}
|
64 |
+
|
65 |
+
/**
|
66 |
+
* Shift row r of state S left by r bytes [�5.1.2].
|
67 |
+
*/
|
68 |
+
private static function shiftRows($s, $Nb)
|
69 |
+
{
|
70 |
+
$t = array(4);
|
71 |
+
for ($r = 1; $r < 4; $r++) {
|
72 |
+
for ($c = 0; $c < 4; $c++) $t[$c] = $s[$r][($c + $r) % $Nb]; // shift into temp copy
|
73 |
+
for ($c = 0; $c < 4; $c++) $s[$r][$c] = $t[$c]; // and copy back
|
74 |
+
} // note that this will work for Nb=4,5,6, but not 7,8 (always 4 for AES):
|
75 |
+
return $s; // see fp.gladman.plus.com/cryptography_technology/rijndael/aes.spec.311.pdf
|
76 |
+
}
|
77 |
+
|
78 |
+
/**
|
79 |
+
* Combine bytes of each col of state S [�5.1.3].
|
80 |
+
*/
|
81 |
+
private static function mixColumns($s, $Nb)
|
82 |
+
{
|
83 |
+
for ($c = 0; $c < 4; $c++) {
|
84 |
+
$a = array(4); // 'a' is a copy of the current column from 's'
|
85 |
+
$b = array(4); // 'b' is a�{02} in GF(2^8)
|
86 |
+
for ($i = 0; $i < 4; $i++) {
|
87 |
+
$a[$i] = $s[$i][$c];
|
88 |
+
$b[$i] = $s[$i][$c] & 0x80 ? $s[$i][$c] << 1 ^ 0x011b : $s[$i][$c] << 1;
|
89 |
+
}
|
90 |
+
// a[n] ^ b[n] is a�{03} in GF(2^8)
|
91 |
+
$s[0][$c] = $b[0] ^ $a[1] ^ $b[1] ^ $a[2] ^ $a[3]; // 2*a0 + 3*a1 + a2 + a3
|
92 |
+
$s[1][$c] = $a[0] ^ $b[1] ^ $a[2] ^ $b[2] ^ $a[3]; // a0 * 2*a1 + 3*a2 + a3
|
93 |
+
$s[2][$c] = $a[0] ^ $a[1] ^ $b[2] ^ $a[3] ^ $b[3]; // a0 + a1 + 2*a2 + 3*a3
|
94 |
+
$s[3][$c] = $a[0] ^ $b[0] ^ $a[1] ^ $a[2] ^ $b[3]; // 3*a0 + a1 + a2 + 2*a3
|
95 |
+
}
|
96 |
+
return $s;
|
97 |
+
}
|
98 |
+
|
99 |
+
/**
|
100 |
+
* Generate Key Schedule from Cipher Key [�5.2].
|
101 |
+
*
|
102 |
+
* Perform key expansion on cipher key to generate a key schedule.
|
103 |
+
*
|
104 |
+
* @param key cipher key byte-array (16 bytes).
|
105 |
+
* @return key schedule as 2D byte-array (Nr+1 x Nb bytes).
|
106 |
+
*/
|
107 |
+
public static function keyExpansion($key)
|
108 |
+
{
|
109 |
+
$Nb = 4; // block size (in words): no of columns in state (fixed at 4 for AES)
|
110 |
+
$Nk = count($key) / 4; // key length (in words): 4/6/8 for 128/192/256-bit keys
|
111 |
+
$Nr = $Nk + 6; // no of rounds: 10/12/14 for 128/192/256-bit keys
|
112 |
+
|
113 |
+
$w = array();
|
114 |
+
$temp = array();
|
115 |
+
|
116 |
+
for ($i = 0; $i < $Nk; $i++) {
|
117 |
+
$r = array($key[4 * $i], $key[4 * $i + 1], $key[4 * $i + 2], $key[4 * $i + 3]);
|
118 |
+
$w[$i] = $r;
|
119 |
+
}
|
120 |
+
|
121 |
+
for ($i = $Nk; $i < ($Nb * ($Nr + 1)); $i++) {
|
122 |
+
$w[$i] = array();
|
123 |
+
for ($t = 0; $t < 4; $t++) $temp[$t] = $w[$i - 1][$t];
|
124 |
+
if ($i % $Nk == 0) {
|
125 |
+
$temp = self::subWord(self::rotWord($temp));
|
126 |
+
for ($t = 0; $t < 4; $t++) $temp[$t] ^= self::$rCon[$i / $Nk][$t];
|
127 |
+
} else if ($Nk > 6 && $i % $Nk == 4) {
|
128 |
+
$temp = self::subWord($temp);
|
129 |
+
}
|
130 |
+
for ($t = 0; $t < 4; $t++) $w[$i][$t] = $w[$i - $Nk][$t] ^ $temp[$t];
|
131 |
+
}
|
132 |
+
return $w;
|
133 |
+
}
|
134 |
+
|
135 |
+
/**
|
136 |
+
* Apply SBox to 4-byte word w.
|
137 |
+
*/
|
138 |
+
private static function subWord($w)
|
139 |
+
{
|
140 |
+
for ($i = 0; $i < 4; $i++) $w[$i] = self::$sBox[$w[$i]];
|
141 |
+
return $w;
|
142 |
+
}
|
143 |
+
|
144 |
+
/**
|
145 |
+
* Rotate 4-byte word w left by one byte.
|
146 |
+
*/
|
147 |
+
private static function rotWord($w)
|
148 |
+
{
|
149 |
+
$tmp = $w[0];
|
150 |
+
for ($i = 0; $i < 3; $i++) $w[$i] = $w[$i + 1];
|
151 |
+
$w[3] = $tmp;
|
152 |
+
return $w;
|
153 |
+
}
|
154 |
+
|
155 |
+
// sBox is pre-computed multiplicative inverse in GF(2^8) used in subBytes and keyExpansion [�5.1.1]
|
156 |
+
private static $sBox = array(
|
157 |
+
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76,
|
158 |
+
0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0,
|
159 |
+
0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,
|
160 |
+
0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75,
|
161 |
+
0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
|
162 |
+
0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
|
163 |
+
0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
|
164 |
+
0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2,
|
165 |
+
0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73,
|
166 |
+
0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb,
|
167 |
+
0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79,
|
168 |
+
0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08,
|
169 |
+
0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a,
|
170 |
+
0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
|
171 |
+
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf,
|
172 |
+
0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16);
|
173 |
+
|
174 |
+
// rCon is Round Constant used for the Key Expansion [1st col is 2^(r-1) in GF(2^8)] [�5.2]
|
175 |
+
private static $rCon = array(
|
176 |
+
array(0x00, 0x00, 0x00, 0x00),
|
177 |
+
array(0x01, 0x00, 0x00, 0x00),
|
178 |
+
array(0x02, 0x00, 0x00, 0x00),
|
179 |
+
array(0x04, 0x00, 0x00, 0x00),
|
180 |
+
array(0x08, 0x00, 0x00, 0x00),
|
181 |
+
array(0x10, 0x00, 0x00, 0x00),
|
182 |
+
array(0x20, 0x00, 0x00, 0x00),
|
183 |
+
array(0x40, 0x00, 0x00, 0x00),
|
184 |
+
array(0x80, 0x00, 0x00, 0x00),
|
185 |
+
array(0x1b, 0x00, 0x00, 0x00),
|
186 |
+
array(0x36, 0x00, 0x00, 0x00));
|
187 |
+
|
188 |
+
}
|
189 |
+
|
190 |
+
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
|
includes/classes/class-wcal-product-report-table.php
ADDED
@@ -0,0 +1,258 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if( session_id() === '' ){
|
4 |
+
//session has not started
|
5 |
+
session_start();
|
6 |
+
}
|
7 |
+
// Load WP_List_Table if not loaded
|
8 |
+
if ( ! class_exists( 'WP_List_Table' ) ) {
|
9 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
10 |
+
}
|
11 |
+
|
12 |
+
class WCAL_Product_Report_Table extends WP_List_Table {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* Number of results to show per page
|
16 |
+
*
|
17 |
+
* @var string
|
18 |
+
* @since 2.5.3
|
19 |
+
*/
|
20 |
+
public $per_page = 30;
|
21 |
+
|
22 |
+
/**
|
23 |
+
* URL of this page
|
24 |
+
*
|
25 |
+
* @var string
|
26 |
+
* @since 2.5.3
|
27 |
+
*/
|
28 |
+
public $base_url;
|
29 |
+
|
30 |
+
/**
|
31 |
+
* Total number of recovred orders
|
32 |
+
*
|
33 |
+
* @var int
|
34 |
+
* @since 2.5.3
|
35 |
+
*/
|
36 |
+
public $total_count;
|
37 |
+
|
38 |
+
|
39 |
+
/**
|
40 |
+
* Total number of recovred orders
|
41 |
+
*
|
42 |
+
* @var int
|
43 |
+
* @since 2.5.3
|
44 |
+
*/
|
45 |
+
public $open_emails;
|
46 |
+
|
47 |
+
/**
|
48 |
+
* Total amount of abandoned orders
|
49 |
+
*
|
50 |
+
* @var int
|
51 |
+
* @since 2.5.3
|
52 |
+
*/
|
53 |
+
public $link_click_count;
|
54 |
+
|
55 |
+
/**
|
56 |
+
* Total number recovred orders
|
57 |
+
*
|
58 |
+
* @var int
|
59 |
+
* @since 2.5.3
|
60 |
+
*/
|
61 |
+
public $start_date_db;
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Total number recovred orders total
|
65 |
+
*
|
66 |
+
* @var int
|
67 |
+
* @since 2.5.3
|
68 |
+
*/
|
69 |
+
public $end_date_db;
|
70 |
+
|
71 |
+
public $duration;
|
72 |
+
|
73 |
+
/**
|
74 |
+
* Get things started
|
75 |
+
*
|
76 |
+
* @see WP_List_Table::__construct()
|
77 |
+
*/
|
78 |
+
public function __construct() {
|
79 |
+
global $status, $page;
|
80 |
+
// Set parent defaults
|
81 |
+
parent::__construct( array(
|
82 |
+
'singular' => __( 'product_id', 'woocommerce-ac' ), //singular name of the listed records
|
83 |
+
'plural' => __( 'product_ids', 'woocommerce-ac' ), //plural name of the listed records
|
84 |
+
'ajax' => false // Does this table support ajax?
|
85 |
+
) );
|
86 |
+
$this->base_url = admin_url( 'admin.php?page=woocommerce_ac_page&action=stats' );
|
87 |
+
}
|
88 |
+
|
89 |
+
public function wcal_product_report_prepare_items() {
|
90 |
+
$columns = $this->get_columns();
|
91 |
+
$hidden = array(); // No hidden columns
|
92 |
+
$data = $this->wcal_product_report_data ();
|
93 |
+
$total_items = $this->total_count;
|
94 |
+
$this->items = $data;
|
95 |
+
$this->_column_headers = array( $columns, $hidden);
|
96 |
+
$this->set_pagination_args( array(
|
97 |
+
'total_items' => $total_items, // WE have to calculate the total number of items
|
98 |
+
'per_page' => $this->per_page, // WE have to determine how many items to show on a page
|
99 |
+
'total_pages' => ceil( $total_items / $this->per_page ) // WE have to calculate the total number of pages
|
100 |
+
)
|
101 |
+
);
|
102 |
+
}
|
103 |
+
|
104 |
+
public function get_columns() {
|
105 |
+
$columns = array(
|
106 |
+
'product_name' => __( 'Product Name', 'woocommerce-ac' ),
|
107 |
+
'abandoned_number' => __( 'Number of Times Abandoned', 'woocommerce-ac' ),
|
108 |
+
'recover_number' => __( 'Number of Times Recovered', 'woocommerce-ac' )
|
109 |
+
);
|
110 |
+
return apply_filters( 'wcal_product_report_columns', $columns );
|
111 |
+
}
|
112 |
+
|
113 |
+
/**
|
114 |
+
* Render the user name Column
|
115 |
+
*
|
116 |
+
* @access public
|
117 |
+
* @since 2.5.3
|
118 |
+
* @param array $abandoned_row_info Contains all the data of the template row
|
119 |
+
* @return string Data shown in the Email column
|
120 |
+
*
|
121 |
+
* This function used for individual delete of row, It is for hover effect delete.
|
122 |
+
*/
|
123 |
+
public function wcal_product_report_data () {
|
124 |
+
global $wpdb;
|
125 |
+
$wcal_class = new woocommerce_abandon_cart_lite ();
|
126 |
+
$per_page = $this->per_page;
|
127 |
+
$i = 0;
|
128 |
+
$order = "desc";
|
129 |
+
$query = "SELECT abandoned_cart_time, abandoned_cart_info, recovered_cart FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` ORDER BY recovered_cart DESC";
|
130 |
+
$recover_query = $wpdb->get_results( $query );
|
131 |
+
$rec_carts_array = array ( );
|
132 |
+
$recover_product_array = array( );
|
133 |
+
$return_product_report = array();
|
134 |
+
|
135 |
+
foreach( $recover_query as $recovered_cart_key => $recovered_cart_value ) {
|
136 |
+
$recovered_cart_info = json_decode( $recovered_cart_value->abandoned_cart_info );
|
137 |
+
$recovered_cart_dat = json_decode( $recovered_cart_value->recovered_cart);
|
138 |
+
$order_date = "";
|
139 |
+
$cart_update_time = $recovered_cart_value->abandoned_cart_time;
|
140 |
+
$quantity_total = 0;
|
141 |
+
$cart_details = array();
|
142 |
+
if( isset( $recovered_cart_info->cart ) ){
|
143 |
+
$cart_details = $recovered_cart_info->cart;
|
144 |
+
}
|
145 |
+
if ( count( $cart_details ) > 0) {
|
146 |
+
foreach ( $cart_details as $k => $v ) {
|
147 |
+
$quantity_total = $quantity_total + $v->quantity;
|
148 |
+
}
|
149 |
+
}
|
150 |
+
|
151 |
+
if ( $cart_update_time != "" && $cart_update_time != 0 ) {
|
152 |
+
$order_date = date( 'd M, Y h:i A', $cart_update_time );
|
153 |
+
}
|
154 |
+
$ac_cutoff_time = get_option( 'ac_lite_cart_abandoned_time' );
|
155 |
+
$cut_off_time = $ac_cutoff_time * 60 ;
|
156 |
+
$current_time = current_time( 'timestamp' );
|
157 |
+
$compare_time = $current_time - $cart_update_time;
|
158 |
+
if ( is_array( $recovered_cart_info ) || is_object( $recovered_cart_info ) ) {
|
159 |
+
foreach ( $recovered_cart_info as $rec_cart_key => $rec_cart_value ) {
|
160 |
+
foreach ( $rec_cart_value as $rec_product_id_key => $rec_product_id_value ) {
|
161 |
+
$product_id = $rec_product_id_value->product_id;
|
162 |
+
if ( $compare_time > $cut_off_time ) {
|
163 |
+
$rec_carts_array [] = $product_id;
|
164 |
+
}
|
165 |
+
if($recovered_cart_dat != 0) {
|
166 |
+
$recover_product_array[] = $product_id;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
172 |
+
|
173 |
+
$count = array_count_values( $rec_carts_array );
|
174 |
+
$count1 = $count;
|
175 |
+
$count_new = $wcal_class->bubble_sort_function ( $count1 ,$order );
|
176 |
+
$recover_cart = "0";
|
177 |
+
$count_css = 0;
|
178 |
+
$chunck_array = array_chunk( $count_new,10, true ); // keep True for retaing the Array Index number which is product ids in our case.
|
179 |
+
$chunck_array_value = array();
|
180 |
+
|
181 |
+
foreach ( $chunck_array as $chunck_array_key => $chunck_array_value ) {
|
182 |
+
foreach ( $chunck_array_value as $k => $v ) {
|
183 |
+
$return_product_report[$i] = new stdClass();
|
184 |
+
$prod_name = get_post( $k );
|
185 |
+
if ( NULL != $prod_name || '' != $prod_name ) {
|
186 |
+
$product_name = $prod_name->post_title;
|
187 |
+
$abandoned_count = $v;
|
188 |
+
$recover = array_count_values( $recover_product_array );
|
189 |
+
foreach ( $recover as $ke => $ve ) {
|
190 |
+
if( array_key_exists ( $ke, $count ) ) {
|
191 |
+
if ( $ke == $k ) {
|
192 |
+
$recover_cart = $ve;
|
193 |
+
}
|
194 |
+
}
|
195 |
+
if( ! array_key_exists ( $k, $recover ) ) {
|
196 |
+
$recover_cart = "0";
|
197 |
+
}
|
198 |
+
}
|
199 |
+
|
200 |
+
$return_product_report[ $i ]->product_name = $product_name ;
|
201 |
+
$return_product_report[ $i ]->abandoned_number = $abandoned_count;
|
202 |
+
$return_product_report[ $i ]->recover_number = $recover_cart;
|
203 |
+
$return_product_report[ $i ]->product_id = $k;
|
204 |
+
$i++;
|
205 |
+
}
|
206 |
+
}
|
207 |
+
}
|
208 |
+
$this->total_count = count ( $return_product_report ) > 0 ? count ( $return_product_report ) : 0 ;
|
209 |
+
|
210 |
+
// Pagination per page
|
211 |
+
if( isset( $_GET['paged'] ) && $_GET['paged'] > 1 ) {
|
212 |
+
$page_number = $_GET['paged'] - 1;
|
213 |
+
$k = $per_page * $page_number;
|
214 |
+
} else {
|
215 |
+
$k = 0;
|
216 |
+
}
|
217 |
+
$return_product_report_display = array();
|
218 |
+
for( $j = $k; $j < ( $k+$per_page ); $j++ ) {
|
219 |
+
if( isset( $return_product_report[$j] ) ) {
|
220 |
+
$return_product_report_display[$j] = $return_product_report[$j];
|
221 |
+
} else {
|
222 |
+
break;
|
223 |
+
}
|
224 |
+
}
|
225 |
+
return apply_filters( 'wcal_product_report_table_data', $return_product_report_display );
|
226 |
+
}
|
227 |
+
|
228 |
+
public function column_default( $wcal_sent_emails, $column_name ) {
|
229 |
+
$value = '';
|
230 |
+
switch ( $column_name ) {
|
231 |
+
|
232 |
+
case 'product_name' :
|
233 |
+
if( isset( $wcal_sent_emails->product_name ) ) {
|
234 |
+
$value = "<a href= post.php?post=$wcal_sent_emails->product_id&action=edit title = product name > $wcal_sent_emails->product_name </a>";
|
235 |
+
}
|
236 |
+
break;
|
237 |
+
|
238 |
+
case 'abandoned_number' :
|
239 |
+
if( isset( $wcal_sent_emails->abandoned_number ) ) {
|
240 |
+
$value = $wcal_sent_emails->abandoned_number;
|
241 |
+
}
|
242 |
+
break;
|
243 |
+
|
244 |
+
case 'recover_number' :
|
245 |
+
if( isset( $wcal_sent_emails->recover_number ) ) {
|
246 |
+
$value = $wcal_sent_emails->recover_number;
|
247 |
+
}
|
248 |
+
break;
|
249 |
+
default:
|
250 |
+
|
251 |
+
$value = isset( $wcal_sent_emails->$column_name ) ? $wcal_sent_emails->$column_name : '';
|
252 |
+
break;
|
253 |
+
}
|
254 |
+
|
255 |
+
return apply_filters( 'wcal_product_report_column_default', $value, $wcal_sent_emails, $column_name );
|
256 |
+
}
|
257 |
+
}
|
258 |
+
?>
|
includes/classes/class-wcal-recover-orders-table.php
ADDED
@@ -0,0 +1,371 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Load WP_List_Table if not loaded
|
4 |
+
if ( ! class_exists( 'WP_List_Table' ) ) {
|
5 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
6 |
+
}
|
7 |
+
|
8 |
+
class wcal_Recover_Orders_Table extends WP_List_Table {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Number of results to show per page
|
12 |
+
*
|
13 |
+
* @var string
|
14 |
+
* @since 2.5.2
|
15 |
+
*/
|
16 |
+
public $per_page = 30;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* URL of this page
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
* @since 2.5.2
|
23 |
+
*/
|
24 |
+
public $base_url;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Total number of recovered orders
|
28 |
+
*
|
29 |
+
* @var int
|
30 |
+
* @since 2.5.2
|
31 |
+
*/
|
32 |
+
public $total_count;
|
33 |
+
|
34 |
+
|
35 |
+
/**
|
36 |
+
* Total number of abandoned orders
|
37 |
+
*
|
38 |
+
* @var int
|
39 |
+
* @since 2.5.2
|
40 |
+
*/
|
41 |
+
public $total_abandoned_cart_count;
|
42 |
+
|
43 |
+
/**
|
44 |
+
* Total amount of abandoned orders
|
45 |
+
*
|
46 |
+
* @var int
|
47 |
+
* @since 2.5.2
|
48 |
+
*/
|
49 |
+
public $total_order_amount;
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Total number recovered orders
|
53 |
+
*
|
54 |
+
* @var int
|
55 |
+
* @since 2.5.2
|
56 |
+
*/
|
57 |
+
public $recovered_item;
|
58 |
+
|
59 |
+
/**
|
60 |
+
* Total number recovred orders total
|
61 |
+
*
|
62 |
+
* @var int
|
63 |
+
* @since 2.5.2
|
64 |
+
*/
|
65 |
+
public $total_recover_amount;
|
66 |
+
|
67 |
+
/**
|
68 |
+
* Get things started
|
69 |
+
*
|
70 |
+
* @see WP_List_Table::__construct()
|
71 |
+
*/
|
72 |
+
public function __construct() {
|
73 |
+
global $status, $page;
|
74 |
+
// Set parent defaults
|
75 |
+
parent::__construct( array(
|
76 |
+
'singular' => __( 'rec_abandoned_id', 'woocommerce-ac' ), //singular name of the listed records
|
77 |
+
'plural' => __( 'rec_abandoned_ids', 'woocommerce-ac' ), //plural name of the listed records
|
78 |
+
'ajax' => false // Does this table support ajax?
|
79 |
+
) );
|
80 |
+
$this->base_url = admin_url( 'admin.php?page=woocommerce_ac_page&action=stats' );
|
81 |
+
}
|
82 |
+
|
83 |
+
public function wcal_recovered_orders_prepare_items() {
|
84 |
+
$columns = $this->get_columns();
|
85 |
+
$hidden = array(); // No hidden columns
|
86 |
+
$sortable = $this->recovered_orders_get_sortable_columns();
|
87 |
+
$data = $this->wcal_recovered_orders_data();
|
88 |
+
$total_items = $this->total_count;
|
89 |
+
$total_abandoned_cart_count = $this->total_abandoned_cart_count;
|
90 |
+
$total_order_amount = $this->total_order_amount;
|
91 |
+
$total_recover_amount = $this->total_recover_amount;
|
92 |
+
$recovered_item = $this->recovered_item;
|
93 |
+
$this->items = $data;
|
94 |
+
$this->_column_headers = array( $columns, $hidden, $sortable);
|
95 |
+
$this->set_pagination_args( array(
|
96 |
+
'total_items' => $total_items, // WE have to calculate the total number of items
|
97 |
+
'per_page' => $this->per_page, // WE have to determine how many items to show on a page
|
98 |
+
'total_pages' => ceil( $total_items / $this->per_page ) // WE have to calculate the total number of pages
|
99 |
+
)
|
100 |
+
);
|
101 |
+
}
|
102 |
+
|
103 |
+
public function get_columns() {
|
104 |
+
$columns = array(
|
105 |
+
'user_name' => __( 'Customer Name', 'woocommerce-ac' ),
|
106 |
+
'user_email_id' => __( 'Email Address', 'woocommerce-ac' ),
|
107 |
+
'created_on' => __( 'Cart Abandoned Date', 'woocommerce-ac' ),
|
108 |
+
'recovered_date' => __( 'Cart Recovered Date' , 'woocommerce-ac'),
|
109 |
+
'order_total' => __( 'Order Total', 'woocommerce-ac' )
|
110 |
+
);
|
111 |
+
return apply_filters( 'wcal_recovered_orders_columns', $columns );
|
112 |
+
}
|
113 |
+
|
114 |
+
public function recovered_orders_get_sortable_columns() {
|
115 |
+
$columns = array(
|
116 |
+
'created_on' => array( 'created_on', false ),
|
117 |
+
'recovered_date' => array( 'recovered_date',false)
|
118 |
+
);
|
119 |
+
return apply_filters( 'wcal_templates_sortable_columns', $columns );
|
120 |
+
}
|
121 |
+
|
122 |
+
/**
|
123 |
+
* Render the user name Column
|
124 |
+
*
|
125 |
+
* @access public
|
126 |
+
* @since 2.5.2
|
127 |
+
* @param array $abandoned_row_info Contains all the data of the template row
|
128 |
+
* @return string Data shown in the Email column
|
129 |
+
*
|
130 |
+
* This function used for individual delete of row, It is for hover effect delete.
|
131 |
+
*/
|
132 |
+
public function column_user_name( $recovered_orders_row_info ) {
|
133 |
+
$row_actions = array();
|
134 |
+
$value = '';
|
135 |
+
$recovered_id = 0;
|
136 |
+
|
137 |
+
if( isset( $recovered_orders_row_info->user_name ) ) {
|
138 |
+
$recovered_id = $recovered_orders_row_info->recovered_id ;
|
139 |
+
$row_actions['view_details'] = "<a target=_blank href = post.php?post=$recovered_id&action=edit>". __( 'View Details', 'woocommerce-ac' )."</a>";
|
140 |
+
$user_name = $recovered_orders_row_info->user_name;
|
141 |
+
$value = $user_name . $this->row_actions( $row_actions );
|
142 |
+
}
|
143 |
+
return apply_filters( 'wcal_recovered_orders_single_column', $value, $recovered_id, 'email' );
|
144 |
+
}
|
145 |
+
|
146 |
+
public function wcal_recovered_orders_data() {
|
147 |
+
global $wpdb;
|
148 |
+
$wcal_class = new woocommerce_abandon_cart_lite ();
|
149 |
+
$number_decimal = wc_get_price_decimals();
|
150 |
+
|
151 |
+
if ( isset( $_POST['duration_select'] ) ) {
|
152 |
+
$duration_range = $_POST['duration_select'];
|
153 |
+
}
|
154 |
+
else {
|
155 |
+
$duration_range = "";
|
156 |
+
}
|
157 |
+
|
158 |
+
if ( $duration_range == "" ) {
|
159 |
+
if ( isset( $_GET['duration_select'] ) ) {
|
160 |
+
$duration_range = $_GET['duration_select'];
|
161 |
+
}
|
162 |
+
}
|
163 |
+
|
164 |
+
if ( $duration_range == "" ) {
|
165 |
+
$duration_range = "last_seven";
|
166 |
+
}
|
167 |
+
else {
|
168 |
+
$duration_range = "";
|
169 |
+
}
|
170 |
+
|
171 |
+
if ( isset( $_POST['start_date'] ) ) {
|
172 |
+
$start_date_range = $_POST['start_date'];
|
173 |
+
}
|
174 |
+
else {
|
175 |
+
$start_date_range = "";
|
176 |
+
}
|
177 |
+
|
178 |
+
if ( $start_date_range == "" ) {
|
179 |
+
$start_date_range = $wcal_class->start_end_dates[$duration_range]['start_date'];
|
180 |
+
}
|
181 |
+
|
182 |
+
if ( isset( $_POST['end_date'] ) ) $end_date_range = $_POST['end_date'];
|
183 |
+
else $end_date_range = "";
|
184 |
+
|
185 |
+
if ( $end_date_range == "" ) {
|
186 |
+
$end_date_range = $wcal_class->start_end_dates[$duration_range]['end_date'];
|
187 |
+
}
|
188 |
+
|
189 |
+
$start_date = strtotime( $start_date_range." 00:01:01" );
|
190 |
+
$end_date = strtotime( $end_date_range." 23:59:59" );
|
191 |
+
|
192 |
+
$ac_cutoff_time = get_option( 'ac_lite_cart_abandoned_time' );
|
193 |
+
$cut_off_time = $ac_cutoff_time * 60;
|
194 |
+
$current_time = current_time( 'timestamp' );
|
195 |
+
$compare_time = $current_time - $cut_off_time;
|
196 |
+
|
197 |
+
$query_ac = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite
|
198 |
+
WHERE abandoned_cart_time >= %d AND abandoned_cart_time <= %d AND recovered_cart > 0 AND abandoned_cart_time <= '$compare_time' ORDER BY recovered_cart desc";
|
199 |
+
$ac_results = $wpdb->get_results( $wpdb->prepare( $query_ac, $start_date, $end_date ) );
|
200 |
+
|
201 |
+
$query_ac_carts = "SELECT * FROM " . $wpdb->prefix . "ac_abandoned_cart_history_lite
|
202 |
+
WHERE abandoned_cart_time >= %d AND abandoned_cart_time <= %d AND abandoned_cart_time <= '$compare_time' ";
|
203 |
+
$ac_carts_results = $wpdb->get_results( $wpdb->prepare( $query_ac_carts, $start_date, $end_date ) );
|
204 |
+
|
205 |
+
$recovered_item = $recovered_total = $count_carts = $total_value = $order_total = 0;
|
206 |
+
$return_recovered_orders = array();
|
207 |
+
$per_page = $this->per_page;
|
208 |
+
$i = 0;
|
209 |
+
|
210 |
+
foreach ( $ac_carts_results as $key => $value ) {
|
211 |
+
$count_carts += 1;
|
212 |
+
$cart_detail = json_decode( $value->abandoned_cart_info );
|
213 |
+
$product_details = array();
|
214 |
+
if( isset( $cart_detail->cart ) ) {
|
215 |
+
$product_details = $cart_detail->cart;
|
216 |
+
}
|
217 |
+
$line_total = 0;
|
218 |
+
|
219 |
+
if ( isset( $product_details ) && count( $product_details ) > 0 && $product_details != false ) {
|
220 |
+
foreach ( $product_details as $k => $v ) {
|
221 |
+
if( $v->line_subtotal_tax != 0 && $v->line_subtotal_tax > 0 ) {
|
222 |
+
$line_total = $line_total + $v->line_total + $v->line_subtotal_tax;
|
223 |
+
} else {
|
224 |
+
$line_total = $line_total + $v->line_total;
|
225 |
+
}
|
226 |
+
}
|
227 |
+
}
|
228 |
+
$total_value += $line_total;
|
229 |
+
}
|
230 |
+
$total_value = wc_price( $total_value );
|
231 |
+
$this->total_order_amount = $total_value ;
|
232 |
+
$this->total_abandoned_cart_count = $count_carts ;
|
233 |
+
$recovered_order_total = 0;
|
234 |
+
$this->total_recover_amount = round( $recovered_order_total, $number_decimal ) ;
|
235 |
+
$this->recovered_item = 0;
|
236 |
+
$table_data = "";
|
237 |
+
|
238 |
+
foreach ( $ac_results as $key => $value ) {
|
239 |
+
if( $value->recovered_cart != 0 ) {
|
240 |
+
$return_recovered_orders[$i] = new stdClass();
|
241 |
+
|
242 |
+
$recovered_id = $value->recovered_cart;
|
243 |
+
$rec_order = get_post_meta( $recovered_id );
|
244 |
+
$woo_order = new WC_Order( $recovered_id );
|
245 |
+
$recovered_date = strtotime( $woo_order->order_date );
|
246 |
+
$recovered_date_new = date( 'd M, Y h:i A', $recovered_date );
|
247 |
+
$recovered_item += 1;
|
248 |
+
|
249 |
+
if ( isset( $rec_order ) && $rec_order != false ) {
|
250 |
+
$recovered_total += $rec_order['_order_total'][0];
|
251 |
+
}
|
252 |
+
$abandoned_date = date( 'd M, Y h:i A', $value->abandoned_cart_time );
|
253 |
+
$abandoned_order_id = $value->id;
|
254 |
+
$billing_first_name = $billing_last_name = $billing_email = '';
|
255 |
+
$recovered_order_total = 0;
|
256 |
+
|
257 |
+
if ( isset( $rec_order['_billing_first_name'][0] ) ) {
|
258 |
+
$billing_first_name = $rec_order['_billing_first_name'][0];
|
259 |
+
}
|
260 |
+
|
261 |
+
if ( isset( $rec_order['_billing_last_name'][0] ) ) {
|
262 |
+
$billing_last_name = $rec_order['_billing_last_name'][0];
|
263 |
+
}
|
264 |
+
|
265 |
+
if ( isset( $rec_order['_billing_email'][0] ) ) {
|
266 |
+
$billing_email = $rec_order['_billing_email'][0];
|
267 |
+
}
|
268 |
+
|
269 |
+
if ( isset( $rec_order['_order_total'][0] ) ) {
|
270 |
+
$recovered_order_total = $rec_order['_order_total'][0];
|
271 |
+
}
|
272 |
+
|
273 |
+
$return_recovered_orders[ $i ]->user_name = $billing_first_name . " " . $billing_last_name ;
|
274 |
+
$return_recovered_orders[ $i ]->user_email_id = $billing_email;
|
275 |
+
$return_recovered_orders[ $i ]->created_on = $abandoned_date;
|
276 |
+
$return_recovered_orders[ $i ]->recovered_date = $recovered_date_new;
|
277 |
+
$return_recovered_orders[ $i ]->recovered_id = $recovered_id;
|
278 |
+
$return_recovered_orders[ $i ]->recover_order_date = $recovered_date;
|
279 |
+
$return_recovered_orders[ $i ]->abandoned_date = $value->abandoned_cart_time;
|
280 |
+
$return_recovered_orders[ $i ]->order_total = wc_price($recovered_order_total);
|
281 |
+
|
282 |
+
$this->recovered_item = $recovered_item;
|
283 |
+
$this->total_recover_amount = round( ( $recovered_order_total + $this->total_recover_amount ) , $number_decimal );
|
284 |
+
$i++;
|
285 |
+
}
|
286 |
+
}
|
287 |
+
$templates_count = count( $return_recovered_orders );
|
288 |
+
$this->total_count = $templates_count;
|
289 |
+
// sort for order date
|
290 |
+
if( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'created_on' ) {
|
291 |
+
if( isset( $_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
292 |
+
usort( $return_recovered_orders, array( __CLASS__ , "wcal_class_recovered_created_on_asc" ) );
|
293 |
+
} else {
|
294 |
+
usort( $return_recovered_orders, array( __CLASS__ , "wcal_class_recovered_created_on_dsc" ) );
|
295 |
+
}
|
296 |
+
}
|
297 |
+
// sort for customer name
|
298 |
+
else if ( isset( $_GET['orderby']) && $_GET['orderby'] == 'recovered_date' ) {
|
299 |
+
if( isset( $_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
300 |
+
usort( $return_recovered_orders, array( __CLASS__ , "wcal_class_recovered_date_asc" ) );
|
301 |
+
}else {
|
302 |
+
usort( $return_recovered_orders, array( __CLASS__ , "wcal_class_recovered_date_dsc" ) );
|
303 |
+
}
|
304 |
+
}
|
305 |
+
// Pagination per page
|
306 |
+
if( isset( $_GET['paged'] ) && $_GET['paged'] > 1 ) {
|
307 |
+
$page_number = $_GET['paged'] - 1;
|
308 |
+
$k = $per_page * $page_number;
|
309 |
+
} else {
|
310 |
+
$k = 0;
|
311 |
+
}
|
312 |
+
$return_recovered_orders_display = array();
|
313 |
+
for( $j = $k; $j < ( $k+$per_page ); $j++ ) {
|
314 |
+
if( isset( $return_recovered_orders[$j] ) ) {
|
315 |
+
$return_recovered_orders_display[$j] = $return_recovered_orders[$j];
|
316 |
+
} else {
|
317 |
+
break;
|
318 |
+
}
|
319 |
+
}
|
320 |
+
return apply_filters( 'wcal_recovered_orders_table_data', $return_recovered_orders_display );
|
321 |
+
}
|
322 |
+
|
323 |
+
function wcal_class_recovered_created_on_asc( $value1,$value2 ) {
|
324 |
+
return $value1->abandoned_date - $value2->abandoned_date;
|
325 |
+
}
|
326 |
+
|
327 |
+
function wcal_class_recovered_created_on_dsc( $value1,$value2 ) {
|
328 |
+
return $value2->abandoned_date - $value1->abandoned_date;
|
329 |
+
}
|
330 |
+
|
331 |
+
function wcal_class_recovered_date_asc( $value1,$value2 ) {
|
332 |
+
return $value1->recover_order_date - $value2->recover_order_date;
|
333 |
+
}
|
334 |
+
|
335 |
+
function wcal_class_recovered_date_dsc( $value1,$value2 ) {
|
336 |
+
return $value2->recover_order_date - $value1->recover_order_date;
|
337 |
+
}
|
338 |
+
|
339 |
+
public function column_default( $wcal_abandoned_orders, $column_name ) {
|
340 |
+
$value = '';
|
341 |
+
switch ( $column_name ) {
|
342 |
+
case 'user_email_id' :
|
343 |
+
if( isset( $wcal_abandoned_orders->user_email_id ) ) {
|
344 |
+
|
345 |
+
$user_email_id = "<a href= mailto:$wcal_abandoned_orders->user_email_id>". $wcal_abandoned_orders->user_email_id."</a>" ;
|
346 |
+
$value = $user_email_id;
|
347 |
+
}
|
348 |
+
break;
|
349 |
+
case 'created_on' :
|
350 |
+
if( isset( $wcal_abandoned_orders->created_on ) ) {
|
351 |
+
$value = $wcal_abandoned_orders->created_on;
|
352 |
+
}
|
353 |
+
break;
|
354 |
+
case 'recovered_date' :
|
355 |
+
if( isset( $wcal_abandoned_orders->recovered_date ) ) {
|
356 |
+
$value = $wcal_abandoned_orders->recovered_date;
|
357 |
+
}
|
358 |
+
break;
|
359 |
+
case 'order_total' :
|
360 |
+
if( isset( $wcal_abandoned_orders->order_total ) ) {
|
361 |
+
$value = $wcal_abandoned_orders->order_total;
|
362 |
+
}
|
363 |
+
break;
|
364 |
+
default:
|
365 |
+
$value = isset( $wcal_abandoned_orders->$column_name ) ? $wcal_abandoned_orders->$column_name : '';
|
366 |
+
break;
|
367 |
+
}
|
368 |
+
return apply_filters( 'wcal_recovered_orders_column_default', $value, $wcal_abandoned_orders, $column_name );
|
369 |
+
}
|
370 |
+
}
|
371 |
+
?>
|
includes/classes/class-wcal-templates-table.php
ADDED
@@ -0,0 +1,260 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// Load WP_List_Table if not loaded
|
4 |
+
if ( ! class_exists( 'WP_List_Table' ) ) {
|
5 |
+
require_once ABSPATH . 'wp-admin/includes/class-wp-list-table.php';
|
6 |
+
}
|
7 |
+
|
8 |
+
class WCAL_Templates_Table extends WP_List_Table {
|
9 |
+
|
10 |
+
/**
|
11 |
+
* Number of results to show per page
|
12 |
+
*
|
13 |
+
* @var string
|
14 |
+
* @since 2.5.2
|
15 |
+
*/
|
16 |
+
public $per_page = 30;
|
17 |
+
|
18 |
+
/**
|
19 |
+
* URL of this page
|
20 |
+
*
|
21 |
+
* @var string
|
22 |
+
* @since 2.5.2
|
23 |
+
*/
|
24 |
+
public $base_url;
|
25 |
+
|
26 |
+
/**
|
27 |
+
* Total number of email templates
|
28 |
+
*
|
29 |
+
* @var int
|
30 |
+
* @since 2.5.3
|
31 |
+
*/
|
32 |
+
public $total_count;
|
33 |
+
|
34 |
+
/**
|
35 |
+
* Get things started
|
36 |
+
*
|
37 |
+
* @see WP_List_Table::__construct()
|
38 |
+
*/
|
39 |
+
public function __construct() {
|
40 |
+
global $status, $page;
|
41 |
+
// Set parent defaults
|
42 |
+
parent::__construct( array(
|
43 |
+
'singular' => __( 'template_id', 'woocommerce-ac' ), //singular name of the listed records
|
44 |
+
'plural' => __( 'template_ids', 'woocommerce-ac' ), //plural name of the listed records
|
45 |
+
'ajax' => false // Does this table support ajax?
|
46 |
+
) );
|
47 |
+
$this->process_bulk_action();
|
48 |
+
$this->base_url = admin_url( 'admin.php?page=woocommerce_ac_page&action=emailtemplates' );
|
49 |
+
}
|
50 |
+
|
51 |
+
public function wcal_templates_prepare_items() {
|
52 |
+
$columns = $this->get_columns();
|
53 |
+
$hidden = array(); // No hidden columns
|
54 |
+
$sortable = $this->templates_get_sortable_columns();
|
55 |
+
$data = $this->wcal_templates_data();
|
56 |
+
|
57 |
+
$this->_column_headers = array( $columns, $hidden, $sortable );
|
58 |
+
$total_items = $this->total_count;
|
59 |
+
$this->items = $data;
|
60 |
+
|
61 |
+
$this->set_pagination_args( array(
|
62 |
+
'total_items' => $total_items, // WE have to calculate the total number of items
|
63 |
+
'per_page' => $this->per_page, // WE have to determine how many items to show on a page
|
64 |
+
'total_pages' => ceil( $total_items / $this->per_page ) // WE have to calculate the total number of pages
|
65 |
+
)
|
66 |
+
);
|
67 |
+
}
|
68 |
+
|
69 |
+
public function get_columns() {
|
70 |
+
$columns = array(
|
71 |
+
'cb' => '<input type="checkbox" />',
|
72 |
+
'sr' => __( 'Sr', 'woocommerce-ac' ),
|
73 |
+
'template_name' => __( 'Name Of Template', 'woocommerce-ac' ),
|
74 |
+
'sent_time' => __( 'Sent After Set Time', 'woocommerce-ac' ),
|
75 |
+
'activate' => __( 'Active ?', 'woocommerce-ac' )
|
76 |
+
);
|
77 |
+
return apply_filters( 'wcal_templates_columns', $columns );
|
78 |
+
}
|
79 |
+
/***
|
80 |
+
* It is used to add the check box for the items
|
81 |
+
*/
|
82 |
+
function column_cb( $item ) {
|
83 |
+
$template_id = '';
|
84 |
+
if( isset( $item->id ) && "" != $item->id ) {
|
85 |
+
$template_id = $item->id;
|
86 |
+
}
|
87 |
+
return sprintf(
|
88 |
+
'<input type="checkbox" name="%1$s[]" value="%2$s" />',
|
89 |
+
'template_id',
|
90 |
+
$template_id
|
91 |
+
);
|
92 |
+
}
|
93 |
+
|
94 |
+
public function templates_get_sortable_columns() {
|
95 |
+
$columns = array(
|
96 |
+
'template_name' => array( 'template_name', false ),
|
97 |
+
'sent_time' => array( 'sent_time',false),
|
98 |
+
);
|
99 |
+
return apply_filters( 'wcal_templates_sortable_columns', $columns );
|
100 |
+
}
|
101 |
+
|
102 |
+
/**
|
103 |
+
* Render the Email Column
|
104 |
+
*
|
105 |
+
* @access public
|
106 |
+
* @since 2.5.2
|
107 |
+
* @param array $abandoned_row_info Contains all the data of the template row
|
108 |
+
* @return string Data shown in the Email column
|
109 |
+
*
|
110 |
+
* This function used for individual delete of row, It is for hover effect delete.
|
111 |
+
*/
|
112 |
+
public function column_template_name( $template_row_info ) {
|
113 |
+
$row_actions = array();
|
114 |
+
$value = '';
|
115 |
+
$template_id = 0;
|
116 |
+
if( isset( $template_row_info->template_name ) ) {
|
117 |
+
$template_id = $template_row_info->id ;
|
118 |
+
|
119 |
+
$row_actions['edit'] = '<a href="' . wp_nonce_url( add_query_arg( array( 'action' => 'emailtemplates', 'mode'=>'edittemplate', 'id' => $template_row_info->id ), $this->base_url ), 'abandoned_order_nonce') . '">' . __( 'Edit', 'woocommerce-ac' ) . '</a>';
|
120 |
+
$row_actions['delete'] = '<a href="' . wp_nonce_url( add_query_arg( array( 'action' => 'wcal_delete_template', 'template_id' => $template_row_info->id ), $this->base_url ), 'abandoned_order_nonce') . '">' . __( 'Delete', 'woocommerce-ac' ) . '</a>';
|
121 |
+
|
122 |
+
$email = $template_row_info->template_name;
|
123 |
+
$value = $email . $this->row_actions( $row_actions );
|
124 |
+
}
|
125 |
+
return apply_filters( 'wcal_template_single_column', $value, $template_id, 'email' );
|
126 |
+
}
|
127 |
+
|
128 |
+
public function wcal_templates_data() {
|
129 |
+
global $wpdb;
|
130 |
+
$return_templates_data = array();
|
131 |
+
$per_page = $this->per_page;
|
132 |
+
$results = array();
|
133 |
+
$query = "SELECT wpet . * FROM `" . $wpdb->prefix . "ac_email_templates_lite` AS wpet ORDER BY day_or_hour desc , frequency asc";
|
134 |
+
$results = $wpdb->get_results( $query );
|
135 |
+
$i = 0;
|
136 |
+
|
137 |
+
foreach ( $results as $key => $value ) {
|
138 |
+
$return_templates_data[$i] = new stdClass();
|
139 |
+
$id = $value->id;
|
140 |
+
$query_no_emails = "SELECT * FROM " . $wpdb->prefix . "ac_sent_history_lite WHERE template_id= %d";
|
141 |
+
$from = $value->from_email;
|
142 |
+
$subject = $value->subject;
|
143 |
+
$body = $value->body;
|
144 |
+
$is_active = $value->is_active;
|
145 |
+
|
146 |
+
if ( $is_active == '1' ) {
|
147 |
+
$active = "Deactivate";
|
148 |
+
} else {
|
149 |
+
$active = "Activate";
|
150 |
+
}
|
151 |
+
$frequency = $value->frequency;
|
152 |
+
$day_or_hour = $value->day_or_hour;
|
153 |
+
$return_templates_data[ $i ]->sr = $i+1;
|
154 |
+
$return_templates_data[ $i ]->id = $id;
|
155 |
+
$return_templates_data[ $i ]->template_name = $value->template_name;
|
156 |
+
$return_templates_data[ $i ]->sent_time = __( $frequency . " " . $day_or_hour . " After Abandonment", 'woocommerce-ac' );
|
157 |
+
$return_templates_data[ $i ]->activate = $active;
|
158 |
+
$return_templates_data[ $i ]->is_active = $is_active;
|
159 |
+
$i++;
|
160 |
+
}
|
161 |
+
$templates_count = count( $return_templates_data );
|
162 |
+
$this->total_count = $templates_count;
|
163 |
+
// sort for order date
|
164 |
+
if( isset( $_GET['orderby'] ) && $_GET['orderby'] == 'template_name' ) {
|
165 |
+
if( isset($_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
166 |
+
usort( $return_templates_data, array( __CLASS__ , "wcal_class_template_name_asc" ) );
|
167 |
+
} else {
|
168 |
+
usort( $return_templates_data, array( __CLASS__ , "wcal_class_template_name_dsc") );
|
169 |
+
}
|
170 |
+
}
|
171 |
+
// sort for customer name
|
172 |
+
else if ( isset( $_GET['orderby']) && $_GET['orderby'] == 'sent_time' ) {
|
173 |
+
if ( isset( $_GET['order'] ) && $_GET['order'] == 'asc' ) {
|
174 |
+
usort( $return_templates_data, array( __CLASS__ , "wcal_class_sent_time_asc" ) );
|
175 |
+
} else {
|
176 |
+
usort( $return_templates_data, array( __CLASS__ , "wcal_class_sent_time_dsc" ) );
|
177 |
+
}
|
178 |
+
}
|
179 |
+
// Pagination per page
|
180 |
+
if( isset( $_GET['paged'] ) && $_GET['paged'] > 1 ) {
|
181 |
+
$page_number = $_GET['paged'] - 1;
|
182 |
+
$k = $per_page * $page_number;
|
183 |
+
} else {
|
184 |
+
$k = 0;
|
185 |
+
}
|
186 |
+
$return_templates_data_display = array();
|
187 |
+
for( $j = $k; $j < ( $k+$per_page ); $j++ ) {
|
188 |
+
if( isset( $return_templates_data[$j] ) ) {
|
189 |
+
$return_templates_data_display[$j] = $return_templates_data[$j];
|
190 |
+
} else {
|
191 |
+
break;
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
return apply_filters( 'wcal_templates_table_data', $return_templates_data_display );
|
196 |
+
}
|
197 |
+
|
198 |
+
function wcal_class_template_name_asc( $value1,$value2 ) {
|
199 |
+
return strcasecmp( $value1->template_name,$value2->template_name );
|
200 |
+
}
|
201 |
+
|
202 |
+
function wcal_class_template_name_dsc( $value1,$value2 ) {
|
203 |
+
return strcasecmp( $value2->template_name,$value1->template_name );
|
204 |
+
}
|
205 |
+
|
206 |
+
function wcal_class_sent_time_asc( $value1,$value2 ) {
|
207 |
+
return strnatcasecmp( $value1->sent_time,$value2->sent_time );
|
208 |
+
}
|
209 |
+
|
210 |
+
function wcal_class_sent_time_dsc( $value1,$value2 ) {
|
211 |
+
return strnatcasecmp( $value2->sent_time,$value1->sent_time );
|
212 |
+
}
|
213 |
+
|
214 |
+
public function column_default( $wcal_abandoned_orders, $column_name ) {
|
215 |
+
$value = '';
|
216 |
+
switch ( $column_name ) {
|
217 |
+
case 'sr' :
|
218 |
+
if( isset( $wcal_abandoned_orders->sr ) ) {
|
219 |
+
$value = $wcal_abandoned_orders->sr;
|
220 |
+
}
|
221 |
+
break;
|
222 |
+
case 'template_name' :
|
223 |
+
if( isset( $wcal_abandoned_orders->template_name ) ) {
|
224 |
+
$value = $wcal_abandoned_orders->template_name;
|
225 |
+
}
|
226 |
+
break;
|
227 |
+
case 'sent_time' :
|
228 |
+
if( isset( $wcal_abandoned_orders->sent_time ) ) {
|
229 |
+
$value = $wcal_abandoned_orders->sent_time;
|
230 |
+
}
|
231 |
+
break;
|
232 |
+
case 'activate' :
|
233 |
+
if( isset( $wcal_abandoned_orders->activate ) ) {
|
234 |
+
$active = $wcal_abandoned_orders->activate;
|
235 |
+
$id = $wcal_abandoned_orders->id;
|
236 |
+
$is_active = $wcal_abandoned_orders->is_active;
|
237 |
+
$active = '';
|
238 |
+
if ( $is_active == '1' ) {
|
239 |
+
$active = "Deactivate";
|
240 |
+
} else {
|
241 |
+
$active = "Activate";
|
242 |
+
}
|
243 |
+
$active_text = __( $active, 'woocommerce-ac' );
|
244 |
+
$value = '<a href="#" onclick="wcal_activate_email_template('. $id.', '.$is_active.' )"> '.$active_text.'</a>';
|
245 |
+
}
|
246 |
+
break;
|
247 |
+
default:
|
248 |
+
$value = isset( $wcal_abandoned_orders->$column_name ) ? $wcal_abandoned_orders->$column_name : '';
|
249 |
+
break;
|
250 |
+
}
|
251 |
+
return apply_filters( 'wcal_template_column_default', $value, $wcal_abandoned_orders, $column_name );
|
252 |
+
}
|
253 |
+
|
254 |
+
public function get_bulk_actions() {
|
255 |
+
return array(
|
256 |
+
'wcal_delete_template' => __( 'Delete', 'woocommerce-ac' )
|
257 |
+
);
|
258 |
+
}
|
259 |
+
}
|
260 |
+
?>
|
actions.php → includes/wcal_actions.php
RENAMED
@@ -1,46 +1,46 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
*
|
9 |
-
*
|
10 |
-
* @
|
11 |
-
* @
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
$get_user_id = "SELECT user_id FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
20 |
-
|
21 |
-
$
|
22 |
-
|
23 |
-
|
24 |
-
$
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
$
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
}
|
36 |
-
function
|
37 |
-
global $wpdb;
|
38 |
-
|
39 |
-
$
|
40 |
-
|
41 |
-
$wpdb->query( $query_remove );
|
42 |
-
|
43 |
-
wp_safe_redirect( admin_url( '/admin.php?page=woocommerce_ac_page&action=emailtemplates&
|
44 |
-
|
45 |
-
}
|
46 |
}
|
1 |
+
<?php
|
2 |
+
// Exit if accessed directly
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Trigger a abandoned cart Deletion
|
9 |
+
*
|
10 |
+
* @since 2.5.2
|
11 |
+
* @param $abandoned_cart_id Arguments passed
|
12 |
+
* @return void
|
13 |
+
*/
|
14 |
+
|
15 |
+
class wcal_delete_bulk_action_handler {
|
16 |
+
|
17 |
+
function wcal_delete_bulk_action_handler_function( $abandoned_cart_id ) {
|
18 |
+
global $wpdb;
|
19 |
+
$get_user_id = "SELECT user_id FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
20 |
+
WHERE id = '$abandoned_cart_id' ";
|
21 |
+
$results_get_user_id = $wpdb->get_results( $get_user_id );
|
22 |
+
$user_id_of_guest = $results_get_user_id[0]->user_id;
|
23 |
+
|
24 |
+
$query_delete = "DELETE FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
25 |
+
WHERE id = '$abandoned_cart_id' ";
|
26 |
+
$results_delete = $wpdb->get_results( $query_delete );
|
27 |
+
|
28 |
+
if ( $user_id_of_guest >= '63000000' ) {
|
29 |
+
$guest_query_delete = "DELETE FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
30 |
+
WHERE id = '" . $user_id_of_guest . "'";
|
31 |
+
$results_guest = $wpdb->get_results( $guest_query_delete );
|
32 |
+
//guest user
|
33 |
+
}
|
34 |
+
wp_safe_redirect( admin_url( '/admin.php?page=woocommerce_ac_page&wcal_deleted=YES' ) );
|
35 |
+
}
|
36 |
+
function wcal_delete_template_bulk_action_handler_function( $template_id ) {
|
37 |
+
global $wpdb;
|
38 |
+
$id_remove = $template_id;
|
39 |
+
$query_remove = "DELETE FROM `" . $wpdb->prefix . "ac_email_templates_lite`
|
40 |
+
WHERE id='" . $id_remove . "' ";
|
41 |
+
$wpdb->query( $query_remove );
|
42 |
+
|
43 |
+
wp_safe_redirect( admin_url( '/admin.php?page=woocommerce_ac_page&action=emailtemplates&wcal_template_deleted=YES' ) );
|
44 |
+
|
45 |
+
}
|
46 |
}
|
includes/wcal_class-guest.php
ADDED
@@ -0,0 +1,235 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
* Woocommerce Abandoned Cart Lite Plugin - Saves guest cart information
|
4 |
+
*/
|
5 |
+
if ( ! class_exists( 'woocommerce_guest_ac' ) ) {
|
6 |
+
|
7 |
+
class woocommerce_guest_ac {
|
8 |
+
var $a;
|
9 |
+
public function __construct() {
|
10 |
+
add_action( 'woocommerce_after_checkout_billing_form', 'user_side_js' );
|
11 |
+
add_action( 'init','load_ac_ajax' );
|
12 |
+
add_filter( 'woocommerce_checkout_fields', 'guest_checkout_fields' );
|
13 |
+
}
|
14 |
+
}
|
15 |
+
/*-----------------------------------------------------------------------------------*/
|
16 |
+
/* Class Functions */
|
17 |
+
/*-----------------------------------------------------------------------------------*/
|
18 |
+
function load_ac_ajax() {
|
19 |
+
if ( ! is_user_logged_in() ) {
|
20 |
+
add_action( 'wp_ajax_nopriv_save_data', 'save_data' );
|
21 |
+
} else {
|
22 |
+
add_action( 'wp_ajax_save_data', 'save_data' );
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
function user_side_js() {
|
27 |
+
?>
|
28 |
+
<script type="text/javascript">
|
29 |
+
jQuery( 'input#billing_email' ).on( 'change', function() {
|
30 |
+
var data = {
|
31 |
+
billing_first_name : jQuery('#billing_first_name').val(),
|
32 |
+
billing_last_name : jQuery('#billing_last_name').val(),
|
33 |
+
billing_company : jQuery('#billing_company').val(),
|
34 |
+
billing_address_1 : jQuery('#billing_address_1').val(),
|
35 |
+
billing_address_2 : jQuery('#billing_address_2').val(),
|
36 |
+
billing_city : jQuery('#billing_city').val(),
|
37 |
+
billing_state : jQuery('#billing_state').val(),
|
38 |
+
billing_postcode : jQuery('#billing_postcode').val(),
|
39 |
+
billing_country : jQuery('#billing_country').val(),
|
40 |
+
billing_phone : jQuery('#billing_phone').val(),
|
41 |
+
billing_email : jQuery('#billing_email').val(),
|
42 |
+
order_notes : jQuery('#order_comments').val(),
|
43 |
+
shipping_first_name : jQuery('#shipping_first_name').val(),
|
44 |
+
shipping_last_name : jQuery('#shipping_last_name').val(),
|
45 |
+
shipping_company : jQuery('#shipping_company').val(),
|
46 |
+
shipping_address_1 : jQuery('#shipping_address_1').val(),
|
47 |
+
shipping_address_2 : jQuery('#shipping_address_2').val(),
|
48 |
+
shipping_city : jQuery('#shipping_city').val(),
|
49 |
+
shipping_state : jQuery('#shipping_state').val(),
|
50 |
+
shipping_postcode : jQuery('#shipping_postcode').val(),
|
51 |
+
shipping_country : jQuery('#shipping_country').val(),
|
52 |
+
ship_to_billing : jQuery('#shiptobilling-checkbox').val(),
|
53 |
+
action: 'save_data'
|
54 |
+
};
|
55 |
+
jQuery.post( "<?php echo get_admin_url();?>admin-ajax.php", data, function(response) {
|
56 |
+
});
|
57 |
+
});
|
58 |
+
</script>
|
59 |
+
<?php
|
60 |
+
}
|
61 |
+
|
62 |
+
function save_data() {
|
63 |
+
if ( ! is_user_logged_in() ) {
|
64 |
+
if( session_id() === '' ) {
|
65 |
+
//session has not started
|
66 |
+
session_start();
|
67 |
+
}
|
68 |
+
global $wpdb, $woocommerce;
|
69 |
+
if ( isset($_POST['billing_first_name']) && $_POST['billing_first_name'] != '' ){
|
70 |
+
$_SESSION['billing_first_name'] = $_POST['billing_first_name'];
|
71 |
+
}
|
72 |
+
if ( isset($_POST['billing_last_name']) && $_POST['billing_last_name'] != '' ) {
|
73 |
+
$_SESSION['billing_last_name'] = $_POST['billing_last_name'];
|
74 |
+
}
|
75 |
+
if ( isset($_POST['billing_company']) && $_POST['billing_company'] != '' ) {
|
76 |
+
$_SESSION['billing_company'] = $_POST['billing_company'];
|
77 |
+
}
|
78 |
+
if ( isset($_POST['billing_address_1']) && $_POST['billing_address_1'] != '' ) {
|
79 |
+
$_SESSION['billing_address_1'] = $_POST['billing_address_1'];
|
80 |
+
}
|
81 |
+
if ( isset($_POST['billing_address_2']) && $_POST['billing_address_2'] != '' ) {
|
82 |
+
$_SESSION['billing_address_2'] = $_POST['billing_address_2'];
|
83 |
+
}
|
84 |
+
if ( isset($_POST['billing_city']) && $_POST['billing_city'] != '' ) {
|
85 |
+
$_SESSION['billing_city'] = $_POST['billing_city'];
|
86 |
+
}
|
87 |
+
if ( isset($_POST['billing_state']) && $_POST['billing_state'] != '' ) {
|
88 |
+
$_SESSION['billing_state'] = $_POST['billing_state'];
|
89 |
+
}
|
90 |
+
if ( isset($_POST['billing_postcode']) && $_POST['billing_postcode'] != '' ) {
|
91 |
+
$_SESSION['billing_postcode'] = $_POST['billing_postcode'];
|
92 |
+
}
|
93 |
+
if ( isset($_POST['billing_country']) && $_POST['billing_country'] != '' ) {
|
94 |
+
$_SESSION['billing_country'] = $_POST['billing_country'];
|
95 |
+
}
|
96 |
+
if ( isset($_POST['billing_email']) && $_POST['billing_email'] != '' ) {
|
97 |
+
$_SESSION['billing_email'] = $_POST['billing_email'];
|
98 |
+
}
|
99 |
+
if ( isset($_POST['billing_phone']) && $_POST['billing_phone'] != '' ) {
|
100 |
+
$_SESSION['billing_phone'] = $_POST['billing_phone'];
|
101 |
+
}
|
102 |
+
if ( isset($_POST['order_notes']) && $_POST['order_notes'] != '' ) {
|
103 |
+
$_SESSION['order_notes'] = $_POST['order_notes'];
|
104 |
+
}
|
105 |
+
if( isset( $_POST['ship_to_billing'] ) && $_POST['ship_to_billing'] != '' ) {
|
106 |
+
$_SESSION['ship_to_billing'] = $_POST['ship_to_billing'];
|
107 |
+
}
|
108 |
+
if ( isset($_POST['shipping_first_name']) && $_POST['shipping_first_name'] != '' ) {
|
109 |
+
$_SESSION['shipping_first_name'] = $_POST['shipping_first_name'];
|
110 |
+
}
|
111 |
+
if ( isset($_POST['shipping_last_name']) && $_POST['shipping_last_name'] != '' ) {
|
112 |
+
$_SESSION['shipping_last_name'] = $_POST['shipping_last_name'];
|
113 |
+
}
|
114 |
+
if ( isset($_POST['shipping_company']) && $_POST['shipping_company'] != '' ) {
|
115 |
+
$_SESSION['shipping_company'] = $_POST['shipping_company'];
|
116 |
+
}
|
117 |
+
if ( isset($_POST['shipping_address_1']) && $_POST['shipping_address_1'] != '' ) {
|
118 |
+
$_SESSION['shipping_address_1'] = $_POST['shipping_address_1'];
|
119 |
+
}
|
120 |
+
if ( isset($_POST['shipping_address_2']) && $_POST['shipping_address_2'] != '' ) {
|
121 |
+
$_SESSION['shipping_address_2'] = $_POST['shipping_address_2'];
|
122 |
+
}
|
123 |
+
if ( isset($_POST['shipping_city']) && $_POST['shipping_city'] != '' ) {
|
124 |
+
$_SESSION['shipping_city'] = $_POST['shipping_city'];
|
125 |
+
}
|
126 |
+
if ( isset($_POST['shipping_state']) && $_POST['shipping_state'] != '' ) {
|
127 |
+
$_SESSION['shipping_state'] = $_POST['shipping_state'];
|
128 |
+
}
|
129 |
+
if ( isset($_POST['shipping_postcode']) && $_POST['shipping_postcode'] != '' ) {
|
130 |
+
$_SESSION['shipping_postcode'] = $_POST['shipping_postcode'];
|
131 |
+
}
|
132 |
+
if ( isset($_POST['shipping_country']) && $_POST['shipping_country'] != '' ) {
|
133 |
+
$_SESSION['shipping_country'] = $_POST['shipping_country'];
|
134 |
+
}
|
135 |
+
// If a record is present in the guest cart history table for the same email id, then delete the previous records
|
136 |
+
$query_guest = "SELECT id FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite`
|
137 |
+
WHERE email_id = %s";
|
138 |
+
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $_SESSION['billing_email'] ) );
|
139 |
+
|
140 |
+
if ( $results_guest ) {
|
141 |
+
foreach ( $results_guest as $key => $value ) {
|
142 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
143 |
+
WHERE user_id = %d AND recovered_cart = '0'" ;
|
144 |
+
$result = $wpdb->get_results( $wpdb->prepare( $query, $value->id ) );
|
145 |
+
|
146 |
+
if ( $result ) {
|
147 |
+
$delete_sent_email = "DELETE FROM `".$wpdb->prefix."ac_sent_history_lite`
|
148 |
+
WHERE abandoned_order_id = '".$result[0]->id."'";
|
149 |
+
$wpdb->query( $delete_sent_email );
|
150 |
+
$delete_query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
151 |
+
WHERE user_id = '".$value->id."'";
|
152 |
+
$wpdb->query( $delete_query );
|
153 |
+
}
|
154 |
+
$guest_delete = "DELETE FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite`
|
155 |
+
WHERE id = '".$value->id."'";
|
156 |
+
$wpdb->query( $guest_delete );
|
157 |
+
}
|
158 |
+
}
|
159 |
+
// Insert record in guest table
|
160 |
+
if ( isset( $_SESSION['billing_first_name'] ) ) {
|
161 |
+
$billing_first_name = $_SESSION['billing_first_name'];
|
162 |
+
} else {
|
163 |
+
$billing_first_name = '';
|
164 |
+
}
|
165 |
+
if ( isset( $_SESSION['billing_last_name'] ) ) {
|
166 |
+
$billing_last_name = $_SESSION['billing_last_name'];
|
167 |
+
} else {
|
168 |
+
$billing_last_name = '';
|
169 |
+
}
|
170 |
+
$shipping_zipcode = $billing_zipcode = '';
|
171 |
+
|
172 |
+
if ( isset( $_SESSION['shipping_postcode'] ) && $_SESSION['shipping_postcode'] != "" ) {
|
173 |
+
$shipping_zipcode = $_SESSION['shipping_postcode'];
|
174 |
+
} elseif( isset( $_SESSION['billing_postcode'] ) && $_SESSION['billing_postcode'] != "" ) {
|
175 |
+
$shipping_zipcode = $billing_zipcode = $_SESSION['billing_postcode'];
|
176 |
+
}
|
177 |
+
$shipping_charges = $woocommerce->cart->shipping_total;
|
178 |
+
$insert_guest = "INSERT INTO `".$wpdb->prefix . "ac_guest_abandoned_cart_history_lite`( billing_first_name, billing_last_name, email_id, billing_zipcode, shipping_zipcode, shipping_charges )
|
179 |
+
VALUES ( '".$billing_first_name."', '".$billing_last_name."', '".$_SESSION['billing_email']."', '".$billing_zipcode."', '".$shipping_zipcode."', '".$shipping_charges."' )";
|
180 |
+
$wpdb->query( $insert_guest );
|
181 |
+
|
182 |
+
//Insert record in abandoned cart table for the guest user
|
183 |
+
$user_id = $wpdb->insert_id;
|
184 |
+
$_SESSION['user_id'] = $user_id;
|
185 |
+
$current_time = current_time( 'timestamp' );
|
186 |
+
$cut_off_time = get_option( 'ac_cart_abandoned_time' );
|
187 |
+
$cart_cut_off_time = $cut_off_time * 60;
|
188 |
+
$compare_time = $current_time - $cart_cut_off_time;
|
189 |
+
|
190 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
191 |
+
WHERE user_id = %d AND cart_ignored = '0' AND recovered_cart = '0' AND user_type = 'GUEST'";
|
192 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $user_id ) );
|
193 |
+
|
194 |
+
$cart = array();
|
195 |
+
|
196 |
+
if ( function_exists('WC') ) {
|
197 |
+
$cart['cart'] = WC()->session->cart;
|
198 |
+
} else {
|
199 |
+
$cart['cart'] = $woocommerce->session->cart;
|
200 |
+
}
|
201 |
+
|
202 |
+
if ( count( $results ) == 0 ) {
|
203 |
+
$cart_info = addslashes( json_encode( $cart ) );
|
204 |
+
$insert_query = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`( user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored, recovered_cart, user_type )
|
205 |
+
VALUES ( '".$user_id."', '".$cart_info."', '".$current_time."', '0', '0', 'GUEST' )";
|
206 |
+
$wpdb->query( $insert_query );
|
207 |
+
|
208 |
+
$abandoned_cart_id = $wpdb->insert_id;
|
209 |
+
$_SESSION['abandoned_cart_id_lite'] = $abandoned_cart_id;
|
210 |
+
|
211 |
+
$insert_persistent_cart = "INSERT INTO `".$wpdb->prefix."usermeta`( user_id, meta_key, meta_value )
|
212 |
+
VALUES ( '".$user_id."', '_woocommerce_persistent_cart', '".$cart_info."' )";
|
213 |
+
$wpdb->query( $insert_persistent_cart );
|
214 |
+
}
|
215 |
+
}
|
216 |
+
}
|
217 |
+
|
218 |
+
function guest_checkout_fields( $fields ) {
|
219 |
+
if ( isset( $_SESSION['guest_first_name'] ) && $_SESSION['guest_first_name'] != "" ) {
|
220 |
+
$_POST['billing_first_name'] = $_SESSION['guest_first_name'];
|
221 |
+
}
|
222 |
+
if ( isset( $_SESSION['guest_last_name'] ) && $_SESSION['guest_last_name'] != "" ) {
|
223 |
+
$_POST['billing_last_name'] = $_SESSION['guest_last_name'];
|
224 |
+
}
|
225 |
+
if ( isset( $_SESSION['guest_email']) && $_SESSION['guest_email'] != "" ) {
|
226 |
+
$_POST['billing_email'] = $_SESSION['guest_email'];
|
227 |
+
}
|
228 |
+
if ( isset( $_SESSION['guest_phone']) && $_SESSION['guest_phone'] != "" ) {
|
229 |
+
$_POST['billing_phone'] = $_SESSION['guest_phone'];
|
230 |
+
}
|
231 |
+
return $fields;
|
232 |
+
}
|
233 |
+
}
|
234 |
+
$woocommerce_guest_ac = new woocommerce_guest_ac();
|
235 |
+
?>
|
default-settings.php → includes/wcal_default-settings.php
RENAMED
@@ -1,56 +1,54 @@
|
|
1 |
-
<?php
|
2 |
-
class
|
3 |
-
/* This function will load default template while activating the plugin.
|
4 |
-
*
|
5 |
-
* @since: AFter 2.5 version
|
6 |
-
*/
|
7 |
-
function
|
8 |
-
global $wpdb;
|
9 |
-
|
10 |
-
$
|
11 |
-
$
|
12 |
-
$
|
13 |
-
$
|
14 |
-
$
|
15 |
-
$
|
16 |
-
$
|
17 |
-
|
18 |
-
<
|
19 |
-
<p>
|
20 |
-
<p>
|
21 |
-
<p>
|
22 |
-
<p>
|
23 |
-
<p>
|
24 |
-
<p>
|
25 |
-
<p>
|
26 |
-
<p>
|
27 |
-
<
|
28 |
-
<
|
29 |
-
<p>
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
$ac_from_name
|
34 |
-
$is_wc_template
|
35 |
-
$default_template
|
36 |
-
$from_email
|
37 |
-
$ac_email_reply
|
38 |
-
|
39 |
-
|
40 |
-
( subject, body, is_active, frequency, day_or_hour, template_name, from_name, is_wc_template, default_template, reply_email, from_email )
|
41 |
-
VALUES ( '" . $template_subject_array . "',
|
42 |
-
'" . $body_content_array . "',
|
43 |
-
'" . $active_post_array . "',
|
44 |
-
'" . $email_frequency_array . "',
|
45 |
-
'" . $day_or_hour_array . "',
|
46 |
-
'" . $template_name_array . "',
|
47 |
-
'" . $ac_from_name . "',
|
48 |
-
'" . $is_wc_template . "',
|
49 |
-
'" . $default_template . "',
|
50 |
-
'" . $ac_email_reply . "',
|
51 |
-
'" . $from_email . "' )";
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
}
|
56 |
-
}
|
1 |
+
<?php
|
2 |
+
class wcal_default_template_settings {
|
3 |
+
/* This function will load default template while activating the plugin.
|
4 |
+
*
|
5 |
+
* @since: AFter 2.5 version
|
6 |
+
*/
|
7 |
+
function wcal_create_default_templates() {
|
8 |
+
global $wpdb;
|
9 |
+
$template_name_array = 'Initial';
|
10 |
+
$site_title = get_bloginfo( 'name' );
|
11 |
+
$site_url = get_option( 'siteurl' );
|
12 |
+
$template_subject_array = $site_title . ": Did you have checkout trouble?";
|
13 |
+
$active_post_array = 0;
|
14 |
+
$email_frequency_array = 1;
|
15 |
+
$day_or_hour_array = 'Hours';
|
16 |
+
$body_content_array = addslashes( "<html>
|
17 |
+
<body>
|
18 |
+
<p> Hello {{customer.fullname}}, </p>
|
19 |
+
<p> </p>
|
20 |
+
<p> We\'re following up with you, because we noticed that on {{cart.abandoned_date}} you attempted to purchase the following products on $site_title. </p>
|
21 |
+
<p> </p>
|
22 |
+
<p> {{products.cart}} </p>
|
23 |
+
<p> </p>
|
24 |
+
<p> If you had any purchase troubles, could you please Contact to share them? </p>
|
25 |
+
<p> </p>
|
26 |
+
<p> Otherwise, how about giving us another chance? Shop <a href= $site_url >$site_title</a>. </p>
|
27 |
+
<hr></hr>
|
28 |
+
<p> You may <a href='{{cart.unsubscribe}}'>unsubscribe</a> to stop receiving these emails. </p>
|
29 |
+
<p> </p>
|
30 |
+
<p> <a href=$site_url>$site_title</a> appreciates your business. </p>
|
31 |
+
</body>
|
32 |
+
</html>" );
|
33 |
+
$ac_from_name = 'Admin';
|
34 |
+
$is_wc_template = 1 ;
|
35 |
+
$default_template = 1;
|
36 |
+
$from_email = get_option( 'admin_email' );
|
37 |
+
$ac_email_reply = get_option( 'admin_email' );
|
38 |
+
|
39 |
+
$query = "INSERT INTO `" . $wpdb->prefix . "ac_email_templates_lite`
|
40 |
+
( subject, body, is_active, frequency, day_or_hour, template_name, from_name, is_wc_template, default_template, reply_email, from_email )
|
41 |
+
VALUES ( '" . $template_subject_array . "',
|
42 |
+
'" . $body_content_array . "',
|
43 |
+
'" . $active_post_array . "',
|
44 |
+
'" . $email_frequency_array . "',
|
45 |
+
'" . $day_or_hour_array . "',
|
46 |
+
'" . $template_name_array . "',
|
47 |
+
'" . $ac_from_name . "',
|
48 |
+
'" . $is_wc_template . "',
|
49 |
+
'" . $default_template . "',
|
50 |
+
'" . $ac_email_reply . "',
|
51 |
+
'" . $from_email . "' )";
|
52 |
+
$wpdb->query( $query );
|
53 |
+
}
|
54 |
+
}
|
|
|
|
languages/messages.pot
DELETED
@@ -1,268 +0,0 @@
|
|
1 |
-
# SOME DESCRIPTIVE TITLE.
|
2 |
-
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
-
# This file is distributed under the same license as the PACKAGE package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
-
#
|
6 |
-
#, fuzzy
|
7 |
-
msgid ""
|
8 |
-
msgstr ""
|
9 |
-
"Project-Id-Version: PACKAGE VERSION\n"
|
10 |
-
"Report-Msgid-Bugs-To: \n"
|
11 |
-
"POT-Creation-Date: 2015-07-08 16:30+0530\n"
|
12 |
-
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
13 |
-
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
14 |
-
"Language-Team: LANGUAGE <LL@li.org>\n"
|
15 |
-
"Language: \n"
|
16 |
-
"MIME-Version: 1.0\n"
|
17 |
-
"Content-Type: text/plain; charset=CHARSET\n"
|
18 |
-
"Content-Transfer-Encoding: 8bit\n"
|
19 |
-
|
20 |
-
#: woocommerce-ac.php:22
|
21 |
-
msgid "Once Every Five Minutes"
|
22 |
-
msgstr ""
|
23 |
-
|
24 |
-
#: woocommerce-ac.php:204
|
25 |
-
#, php-format
|
26 |
-
msgid ""
|
27 |
-
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
28 |
-
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
29 |
-
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
30 |
-
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
31 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
32 |
-
msgstr ""
|
33 |
-
|
34 |
-
#: woocommerce-ac.php:314
|
35 |
-
msgid "Abandoned Carts"
|
36 |
-
msgstr ""
|
37 |
-
|
38 |
-
#: woocommerce-ac.php:516
|
39 |
-
msgid "Abandoned Orders"
|
40 |
-
msgstr ""
|
41 |
-
|
42 |
-
#: woocommerce-ac.php:517
|
43 |
-
msgid "Email Templates"
|
44 |
-
msgstr ""
|
45 |
-
|
46 |
-
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
47 |
-
msgid "Settings"
|
48 |
-
msgstr ""
|
49 |
-
|
50 |
-
#: woocommerce-ac.php:519
|
51 |
-
msgid "Recovered Orders"
|
52 |
-
msgstr ""
|
53 |
-
|
54 |
-
#: woocommerce-ac.php:661
|
55 |
-
msgid "You do not have sufficient permissions to access this page."
|
56 |
-
msgstr ""
|
57 |
-
|
58 |
-
#: woocommerce-ac.php:670
|
59 |
-
msgid "WooCommerce - Abandon Cart Lite"
|
60 |
-
msgstr ""
|
61 |
-
|
62 |
-
#: woocommerce-ac.php:696
|
63 |
-
msgid "Your settings have been saved."
|
64 |
-
msgstr ""
|
65 |
-
|
66 |
-
#: woocommerce-ac.php:718
|
67 |
-
msgid "Cart abandoned cut-off time"
|
68 |
-
msgstr ""
|
69 |
-
|
70 |
-
#: woocommerce-ac.php:741
|
71 |
-
msgid "minutes"
|
72 |
-
msgstr ""
|
73 |
-
|
74 |
-
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
75 |
-
msgid ""
|
76 |
-
"Consider cart abandoned after X minutes of item being added to cart & order "
|
77 |
-
"not placed"
|
78 |
-
msgstr ""
|
79 |
-
|
80 |
-
#: woocommerce-ac.php:753
|
81 |
-
msgid "Save Changes"
|
82 |
-
msgstr ""
|
83 |
-
|
84 |
-
#: woocommerce-ac.php:763
|
85 |
-
msgid ""
|
86 |
-
"The list below shows all Abandoned Carts which have remained in cart for a "
|
87 |
-
"time higher than the \"Cart abandoned cut-off time\" setting."
|
88 |
-
msgstr ""
|
89 |
-
|
90 |
-
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
91 |
-
msgid "Customer"
|
92 |
-
msgstr ""
|
93 |
-
|
94 |
-
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
95 |
-
msgid "Order Total"
|
96 |
-
msgstr ""
|
97 |
-
|
98 |
-
#: woocommerce-ac.php:862
|
99 |
-
msgid "Date"
|
100 |
-
msgstr ""
|
101 |
-
|
102 |
-
#: woocommerce-ac.php:868
|
103 |
-
msgid "Status"
|
104 |
-
msgstr ""
|
105 |
-
|
106 |
-
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
107 |
-
msgid "Actions"
|
108 |
-
msgstr ""
|
109 |
-
|
110 |
-
#: woocommerce-ac.php:953
|
111 |
-
msgid ""
|
112 |
-
"Add email templates at different intervals to maximize the possibility of "
|
113 |
-
"recovering your abandoned carts."
|
114 |
-
msgstr ""
|
115 |
-
|
116 |
-
#: woocommerce-ac.php:1054
|
117 |
-
msgid "The Email Template has been successfully added."
|
118 |
-
msgstr ""
|
119 |
-
|
120 |
-
#: woocommerce-ac.php:1057
|
121 |
-
msgid "The Email Template has been successfully updated."
|
122 |
-
msgstr ""
|
123 |
-
|
124 |
-
#: woocommerce-ac.php:1145
|
125 |
-
msgid "Sr"
|
126 |
-
msgstr ""
|
127 |
-
|
128 |
-
#: woocommerce-ac.php:1148
|
129 |
-
msgid "Template Name"
|
130 |
-
msgstr ""
|
131 |
-
|
132 |
-
#: woocommerce-ac.php:1154
|
133 |
-
msgid "Sent"
|
134 |
-
msgstr ""
|
135 |
-
|
136 |
-
#: woocommerce-ac.php:1158
|
137 |
-
msgid "Active ?"
|
138 |
-
msgstr ""
|
139 |
-
|
140 |
-
#: woocommerce-ac.php:1276
|
141 |
-
msgid ""
|
142 |
-
"The Report below shows how many Abandoned Carts we were able to recover for "
|
143 |
-
"you by sending automatic emails to encourage shoppers."
|
144 |
-
msgstr ""
|
145 |
-
|
146 |
-
#: woocommerce-ac.php:1331
|
147 |
-
msgid "Start Date:"
|
148 |
-
msgstr ""
|
149 |
-
|
150 |
-
#: woocommerce-ac.php:1334
|
151 |
-
msgid "End Date:"
|
152 |
-
msgstr ""
|
153 |
-
|
154 |
-
#: woocommerce-ac.php:1337
|
155 |
-
msgid "Go"
|
156 |
-
msgstr ""
|
157 |
-
|
158 |
-
#: woocommerce-ac.php:1495
|
159 |
-
msgid "During the selected range"
|
160 |
-
msgstr ""
|
161 |
-
|
162 |
-
#: woocommerce-ac.php:1495
|
163 |
-
msgid "carts totaling"
|
164 |
-
msgstr ""
|
165 |
-
|
166 |
-
#: woocommerce-ac.php:1495
|
167 |
-
msgid "were abandoned. We were able to recover"
|
168 |
-
msgstr ""
|
169 |
-
|
170 |
-
#: woocommerce-ac.php:1495
|
171 |
-
msgid "of them, which led to an extra"
|
172 |
-
msgstr ""
|
173 |
-
|
174 |
-
#: woocommerce-ac.php:1495
|
175 |
-
msgid "in sales"
|
176 |
-
msgstr ""
|
177 |
-
|
178 |
-
#: woocommerce-ac.php:1504
|
179 |
-
msgid "Created On"
|
180 |
-
msgstr ""
|
181 |
-
|
182 |
-
#: woocommerce-ac.php:1510
|
183 |
-
msgid "Recovered Date"
|
184 |
-
msgstr ""
|
185 |
-
|
186 |
-
#: woocommerce-ac.php:1561
|
187 |
-
msgid "Template Name:"
|
188 |
-
msgstr ""
|
189 |
-
|
190 |
-
#: woocommerce-ac.php:1572
|
191 |
-
msgid "Enter a template name for reference"
|
192 |
-
msgstr ""
|
193 |
-
|
194 |
-
#: woocommerce-ac.php:1577
|
195 |
-
msgid "Send From This Name:"
|
196 |
-
msgstr ""
|
197 |
-
|
198 |
-
#: woocommerce-ac.php:1588
|
199 |
-
msgid "Enter the name that should appear in the email sent"
|
200 |
-
msgstr ""
|
201 |
-
|
202 |
-
#: woocommerce-ac.php:1594
|
203 |
-
msgid "Subject:"
|
204 |
-
msgstr ""
|
205 |
-
|
206 |
-
#: woocommerce-ac.php:1605
|
207 |
-
msgid "Enter the subject that should appear in the email sent"
|
208 |
-
msgstr ""
|
209 |
-
|
210 |
-
#: woocommerce-ac.php:1611
|
211 |
-
msgid "Email Body:"
|
212 |
-
msgstr ""
|
213 |
-
|
214 |
-
#: woocommerce-ac.php:1627
|
215 |
-
msgid "Message to be sent in the reminder email."
|
216 |
-
msgstr ""
|
217 |
-
|
218 |
-
#: woocommerce-ac.php:1634
|
219 |
-
msgid "Send this email:"
|
220 |
-
msgstr ""
|
221 |
-
|
222 |
-
#: woocommerce-ac.php:1686
|
223 |
-
msgid "after cart is abandoned."
|
224 |
-
msgstr ""
|
225 |
-
|
226 |
-
#: woocommerce-ac.php:1693
|
227 |
-
msgid "Send a test email to:"
|
228 |
-
msgstr ""
|
229 |
-
|
230 |
-
#: woocommerce-ac.php:1699
|
231 |
-
msgid "Enter the email id to which the test email needs to be sent."
|
232 |
-
msgstr ""
|
233 |
-
|
234 |
-
#: woocommerce-ac.php:1835 send_email.php:109
|
235 |
-
msgid "Your Shopping Cart"
|
236 |
-
msgstr ""
|
237 |
-
|
238 |
-
#: woocommerce-ac.php:1838 send_email.php:112
|
239 |
-
msgid "Item"
|
240 |
-
msgstr ""
|
241 |
-
|
242 |
-
#: woocommerce-ac.php:1839 send_email.php:113
|
243 |
-
msgid "Name"
|
244 |
-
msgstr ""
|
245 |
-
|
246 |
-
#: woocommerce-ac.php:1840 send_email.php:114
|
247 |
-
msgid "Quantity"
|
248 |
-
msgstr ""
|
249 |
-
|
250 |
-
#: woocommerce-ac.php:1841 send_email.php:115
|
251 |
-
msgid "Price"
|
252 |
-
msgstr ""
|
253 |
-
|
254 |
-
#: woocommerce-ac.php:1842 send_email.php:116
|
255 |
-
msgid "Line Subtotal"
|
256 |
-
msgstr ""
|
257 |
-
|
258 |
-
#: woocommerce-ac.php:1846
|
259 |
-
msgid "Men\\'\\s Formal Shoes"
|
260 |
-
msgstr ""
|
261 |
-
|
262 |
-
#: woocommerce-ac.php:1853
|
263 |
-
msgid "Woman\\'\\s Hand Bags"
|
264 |
-
msgstr ""
|
265 |
-
|
266 |
-
#: woocommerce-ac.php:1862 send_email.php:160
|
267 |
-
msgid "Cart Total:"
|
268 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/woocommerce-ac.po
DELETED
@@ -1,269 +0,0 @@
|
|
1 |
-
# SOME DESCRIPTIVE TITLE.
|
2 |
-
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
3 |
-
# This file is distributed under the same license as the PACKAGE package.
|
4 |
-
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
5 |
-
#
|
6 |
-
msgid ""
|
7 |
-
msgstr ""
|
8 |
-
"Project-Id-Version: woocommerce-ac\n"
|
9 |
-
"Report-Msgid-Bugs-To: \n"
|
10 |
-
"POT-Creation-Date: 2015-07-08 16:30+0530\n"
|
11 |
-
"PO-Revision-Date: 2015-07-16 11:02+0530\n"
|
12 |
-
"Last-Translator: \n"
|
13 |
-
"Language-Team: \n"
|
14 |
-
"MIME-Version: 1.0\n"
|
15 |
-
"Content-Type: text/plain; charset=UTF-8\n"
|
16 |
-
"Content-Transfer-Encoding: 8bit\n"
|
17 |
-
"X-Generator: Poedit 1.5.7\n"
|
18 |
-
"X-Poedit-KeywordsList: __;_e\n"
|
19 |
-
"X-Poedit-Basepath: .\n"
|
20 |
-
|
21 |
-
#: woocommerce-ac.php:22
|
22 |
-
msgid "Once Every Five Minutes"
|
23 |
-
msgstr ""
|
24 |
-
|
25 |
-
#: woocommerce-ac.php:204
|
26 |
-
#, php-format
|
27 |
-
msgid ""
|
28 |
-
"You can upgrade to the <a href=\"https://www.tychesoftwares.com/store/"
|
29 |
-
"premium-plugins/woocommerce-abandoned-cart-pro/\">PRO version of WooCommerce "
|
30 |
-
"Abandoned Cart plugin</a> at a <b>20% discount</b>. Use the coupon code: "
|
31 |
-
"<b>ACPRO20</b>.<a href=\"https://www.tychesoftwares.com/store/premium-"
|
32 |
-
"plugins/woocommerce-abandoned-cart-pro/\"> Purchase now </a> & save $24!"
|
33 |
-
msgstr ""
|
34 |
-
|
35 |
-
#: woocommerce-ac.php:314
|
36 |
-
msgid "Abandoned Carts"
|
37 |
-
msgstr ""
|
38 |
-
|
39 |
-
#: woocommerce-ac.php:516
|
40 |
-
msgid "Abandoned Orders"
|
41 |
-
msgstr ""
|
42 |
-
|
43 |
-
#: woocommerce-ac.php:517
|
44 |
-
msgid "Email Templates"
|
45 |
-
msgstr ""
|
46 |
-
|
47 |
-
#: woocommerce-ac.php:518 woocommerce-ac.php:712
|
48 |
-
msgid "Settings"
|
49 |
-
msgstr ""
|
50 |
-
|
51 |
-
#: woocommerce-ac.php:519
|
52 |
-
msgid "Recovered Orders"
|
53 |
-
msgstr ""
|
54 |
-
|
55 |
-
#: woocommerce-ac.php:661
|
56 |
-
msgid "You do not have sufficient permissions to access this page."
|
57 |
-
msgstr ""
|
58 |
-
|
59 |
-
#: woocommerce-ac.php:670
|
60 |
-
msgid "WooCommerce - Abandon Cart Lite"
|
61 |
-
msgstr ""
|
62 |
-
|
63 |
-
#: woocommerce-ac.php:696
|
64 |
-
msgid "Your settings have been saved."
|
65 |
-
msgstr ""
|
66 |
-
|
67 |
-
#: woocommerce-ac.php:718
|
68 |
-
msgid "Cart abandoned cut-off time"
|
69 |
-
msgstr ""
|
70 |
-
|
71 |
-
#: woocommerce-ac.php:741
|
72 |
-
msgid "minutes"
|
73 |
-
msgstr ""
|
74 |
-
|
75 |
-
#: woocommerce-ac.php:742 woocommerce-ac.php:743
|
76 |
-
msgid ""
|
77 |
-
"Consider cart abandoned after X minutes of item being added to cart & order "
|
78 |
-
"not placed"
|
79 |
-
msgstr ""
|
80 |
-
|
81 |
-
#: woocommerce-ac.php:753
|
82 |
-
msgid "Save Changes"
|
83 |
-
msgstr ""
|
84 |
-
|
85 |
-
#: woocommerce-ac.php:763
|
86 |
-
msgid ""
|
87 |
-
"The list below shows all Abandoned Carts which have remained in cart for a "
|
88 |
-
"time higher than the \"Cart abandoned cut-off time\" setting."
|
89 |
-
msgstr ""
|
90 |
-
|
91 |
-
#: woocommerce-ac.php:858 woocommerce-ac.php:1501
|
92 |
-
msgid "Customer"
|
93 |
-
msgstr ""
|
94 |
-
|
95 |
-
#: woocommerce-ac.php:859 woocommerce-ac.php:1514
|
96 |
-
msgid "Order Total"
|
97 |
-
msgstr ""
|
98 |
-
|
99 |
-
#: woocommerce-ac.php:862
|
100 |
-
msgid "Date"
|
101 |
-
msgstr ""
|
102 |
-
|
103 |
-
#: woocommerce-ac.php:868
|
104 |
-
msgid "Status"
|
105 |
-
msgstr ""
|
106 |
-
|
107 |
-
#: woocommerce-ac.php:872 woocommerce-ac.php:1159
|
108 |
-
msgid "Actions"
|
109 |
-
msgstr ""
|
110 |
-
|
111 |
-
#: woocommerce-ac.php:953
|
112 |
-
msgid ""
|
113 |
-
"Add email templates at different intervals to maximize the possibility of "
|
114 |
-
"recovering your abandoned carts."
|
115 |
-
msgstr ""
|
116 |
-
|
117 |
-
#: woocommerce-ac.php:1054
|
118 |
-
msgid "The Email Template has been successfully added."
|
119 |
-
msgstr ""
|
120 |
-
|
121 |
-
#: woocommerce-ac.php:1057
|
122 |
-
msgid "The Email Template has been successfully updated."
|
123 |
-
msgstr ""
|
124 |
-
|
125 |
-
#: woocommerce-ac.php:1145
|
126 |
-
msgid "Sr"
|
127 |
-
msgstr ""
|
128 |
-
|
129 |
-
#: woocommerce-ac.php:1148
|
130 |
-
msgid "Template Name"
|
131 |
-
msgstr ""
|
132 |
-
|
133 |
-
#: woocommerce-ac.php:1154
|
134 |
-
msgid "Sent"
|
135 |
-
msgstr ""
|
136 |
-
|
137 |
-
#: woocommerce-ac.php:1158
|
138 |
-
msgid "Active ?"
|
139 |
-
msgstr ""
|
140 |
-
|
141 |
-
#: woocommerce-ac.php:1276
|
142 |
-
msgid ""
|
143 |
-
"The Report below shows how many Abandoned Carts we were able to recover for "
|
144 |
-
"you by sending automatic emails to encourage shoppers."
|
145 |
-
msgstr ""
|
146 |
-
|
147 |
-
#: woocommerce-ac.php:1331
|
148 |
-
msgid "Start Date:"
|
149 |
-
msgstr ""
|
150 |
-
|
151 |
-
#: woocommerce-ac.php:1334
|
152 |
-
msgid "End Date:"
|
153 |
-
msgstr ""
|
154 |
-
|
155 |
-
#: woocommerce-ac.php:1337
|
156 |
-
msgid "Go"
|
157 |
-
msgstr ""
|
158 |
-
|
159 |
-
#: woocommerce-ac.php:1495
|
160 |
-
msgid "During the selected range"
|
161 |
-
msgstr ""
|
162 |
-
|
163 |
-
#: woocommerce-ac.php:1495
|
164 |
-
msgid "carts totaling"
|
165 |
-
msgstr ""
|
166 |
-
|
167 |
-
#: woocommerce-ac.php:1495
|
168 |
-
msgid "were abandoned. We were able to recover"
|
169 |
-
msgstr ""
|
170 |
-
|
171 |
-
#: woocommerce-ac.php:1495
|
172 |
-
msgid "of them, which led to an extra"
|
173 |
-
msgstr ""
|
174 |
-
|
175 |
-
#: woocommerce-ac.php:1495
|
176 |
-
msgid "in sales"
|
177 |
-
msgstr ""
|
178 |
-
|
179 |
-
#: woocommerce-ac.php:1504
|
180 |
-
msgid "Created On"
|
181 |
-
msgstr ""
|
182 |
-
|
183 |
-
#: woocommerce-ac.php:1510
|
184 |
-
msgid "Recovered Date"
|
185 |
-
msgstr ""
|
186 |
-
|
187 |
-
#: woocommerce-ac.php:1561
|
188 |
-
msgid "Template Name:"
|
189 |
-
msgstr ""
|
190 |
-
|
191 |
-
#: woocommerce-ac.php:1572
|
192 |
-
msgid "Enter a template name for reference"
|
193 |
-
msgstr ""
|
194 |
-
|
195 |
-
#: woocommerce-ac.php:1577
|
196 |
-
msgid "Send From This Name:"
|
197 |
-
msgstr ""
|
198 |
-
|
199 |
-
#: woocommerce-ac.php:1588
|
200 |
-
msgid "Enter the name that should appear in the email sent"
|
201 |
-
msgstr ""
|
202 |
-
|
203 |
-
#: woocommerce-ac.php:1594
|
204 |
-
msgid "Subject:"
|
205 |
-
msgstr ""
|
206 |
-
|
207 |
-
#: woocommerce-ac.php:1605
|
208 |
-
msgid "Enter the subject that should appear in the email sent"
|
209 |
-
msgstr ""
|
210 |
-
|
211 |
-
#: woocommerce-ac.php:1611
|
212 |
-
msgid "Email Body:"
|
213 |
-
msgstr ""
|
214 |
-
|
215 |
-
#: woocommerce-ac.php:1627
|
216 |
-
msgid "Message to be sent in the reminder email."
|
217 |
-
msgstr ""
|
218 |
-
|
219 |
-
#: woocommerce-ac.php:1634
|
220 |
-
msgid "Send this email:"
|
221 |
-
msgstr ""
|
222 |
-
|
223 |
-
#: woocommerce-ac.php:1686
|
224 |
-
msgid "after cart is abandoned."
|
225 |
-
msgstr ""
|
226 |
-
|
227 |
-
#: woocommerce-ac.php:1693
|
228 |
-
msgid "Send a test email to:"
|
229 |
-
msgstr ""
|
230 |
-
|
231 |
-
#: woocommerce-ac.php:1699
|
232 |
-
msgid "Enter the email id to which the test email needs to be sent."
|
233 |
-
msgstr ""
|
234 |
-
|
235 |
-
#: woocommerce-ac.php:1835 send_email.php:109
|
236 |
-
msgid "Your Shopping Cart"
|
237 |
-
msgstr ""
|
238 |
-
|
239 |
-
#: woocommerce-ac.php:1838 send_email.php:112
|
240 |
-
msgid "Item"
|
241 |
-
msgstr ""
|
242 |
-
|
243 |
-
#: woocommerce-ac.php:1839 send_email.php:113
|
244 |
-
msgid "Name"
|
245 |
-
msgstr ""
|
246 |
-
|
247 |
-
#: woocommerce-ac.php:1840 send_email.php:114
|
248 |
-
msgid "Quantity"
|
249 |
-
msgstr ""
|
250 |
-
|
251 |
-
#: woocommerce-ac.php:1841 send_email.php:115
|
252 |
-
msgid "Price"
|
253 |
-
msgstr ""
|
254 |
-
|
255 |
-
#: woocommerce-ac.php:1842 send_email.php:116
|
256 |
-
msgid "Line Subtotal"
|
257 |
-
msgstr ""
|
258 |
-
|
259 |
-
#: woocommerce-ac.php:1846
|
260 |
-
msgid "Men\\'\\s Formal Shoes"
|
261 |
-
msgstr ""
|
262 |
-
|
263 |
-
#: woocommerce-ac.php:1853
|
264 |
-
msgid "Woman\\'\\s Hand Bags"
|
265 |
-
msgstr ""
|
266 |
-
|
267 |
-
#: woocommerce-ac.php:1862 send_email.php:160
|
268 |
-
msgid "Cart Total:"
|
269 |
-
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pagination.class.php
DELETED
@@ -1,204 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class pagination{
|
3 |
-
/*
|
4 |
-
Script Name: *Digg Style Paginator Class
|
5 |
-
Script URI: http://www.mis-algoritmos.com/2007/05/27/digg-style-pagination-class/
|
6 |
-
Description: Class in PHP that allows to use a pagination like a digg or sabrosus style.
|
7 |
-
Script Version: 0.4
|
8 |
-
Author: Victor De la Rocha
|
9 |
-
Author URI: http://www.mis-algoritmos.com
|
10 |
-
*/
|
11 |
-
/*Default values*/
|
12 |
-
var $total_pages = -1;//items
|
13 |
-
var $limit = null;
|
14 |
-
var $target = "";
|
15 |
-
var $page = 1;
|
16 |
-
var $adjacents = 2;
|
17 |
-
var $showCounter = false;
|
18 |
-
var $className = "pagination";
|
19 |
-
var $parameterName = "page";
|
20 |
-
var $urlF = false;//urlFriendly
|
21 |
-
|
22 |
-
/*Buttons next and previous*/
|
23 |
-
var $nextT = "Next";
|
24 |
-
var $nextI = "»"; //►
|
25 |
-
var $prevT = "Previous";
|
26 |
-
var $prevI = "«"; //◄
|
27 |
-
|
28 |
-
/*****/
|
29 |
-
var $calculate = false;
|
30 |
-
|
31 |
-
#Total items
|
32 |
-
function items($value){$this->total_pages = (int) $value;}
|
33 |
-
|
34 |
-
#how many items to show per page
|
35 |
-
function limit($value){$this->limit = (int) $value;}
|
36 |
-
|
37 |
-
#Page to sent the page value
|
38 |
-
function target($value){$this->target = $value;}
|
39 |
-
|
40 |
-
#Current page
|
41 |
-
function currentPage($value){$this->page = (int) $value;}
|
42 |
-
|
43 |
-
#How many adjacent pages should be shown on each side of the current page?
|
44 |
-
function adjacents($value){$this->adjacents = (int) $value;}
|
45 |
-
|
46 |
-
#show counter?
|
47 |
-
function showCounter($value=""){$this->showCounter=($value===true)?true:false;}
|
48 |
-
|
49 |
-
#to change the class name of the pagination div
|
50 |
-
function changeClass($value=""){$this->className=$value;}
|
51 |
-
|
52 |
-
function nextLabel($value){$this->nextT = $value;}
|
53 |
-
function nextIcon($value){$this->nextI = $value;}
|
54 |
-
function prevLabel($value){$this->prevT = $value;}
|
55 |
-
function prevIcon($value){$this->prevI = $value;}
|
56 |
-
|
57 |
-
#to change the class name of the pagination div
|
58 |
-
function parameterName($value=""){$this->parameterName=$value;}
|
59 |
-
|
60 |
-
#to change urlFriendly
|
61 |
-
function urlFriendly($value="%"){
|
62 |
-
if(eregi('^ *$',$value)){
|
63 |
-
$this->urlF=false;
|
64 |
-
return false;
|
65 |
-
}
|
66 |
-
$this->urlF=$value;
|
67 |
-
}
|
68 |
-
|
69 |
-
var $pagination;
|
70 |
-
|
71 |
-
function pagination(){}
|
72 |
-
function show(){
|
73 |
-
if(!$this->calculate)
|
74 |
-
if($this->calculate())
|
75 |
-
echo "<div class=\"$this->className\">$this->pagination</div>\n";
|
76 |
-
}
|
77 |
-
function getOutput(){
|
78 |
-
if(!$this->calculate)
|
79 |
-
if($this->calculate())
|
80 |
-
return "<div class=\"$this->className\">$this->pagination</div>\n";
|
81 |
-
}
|
82 |
-
function get_pagenum_link($id){
|
83 |
-
if(strpos($this->target,'?')===false)
|
84 |
-
if($this->urlF)
|
85 |
-
return str_replace($this->urlF,$id,$this->target);
|
86 |
-
else
|
87 |
-
return "$this->target?$this->parameterName=$id";
|
88 |
-
else
|
89 |
-
return "$this->target&$this->parameterName=$id";
|
90 |
-
}
|
91 |
-
|
92 |
-
function calculate(){
|
93 |
-
$this->pagination = "";
|
94 |
-
$this->calculate == true;
|
95 |
-
$error = false;
|
96 |
-
if($this->urlF and $this->urlF != '%' and strpos($this->target,$this->urlF)===false){
|
97 |
-
//Es necesario especificar el comodin para sustituir
|
98 |
-
echo "Especificaste un wildcard para sustituir, pero no existe en el target<br />";
|
99 |
-
$error = true;
|
100 |
-
}elseif($this->urlF and $this->urlF == '%' and strpos($this->target,$this->urlF)===false){
|
101 |
-
echo "Es necesario especificar en el target el comodin % para sustituir el n�mero de p�gina<br />";
|
102 |
-
$error = true;
|
103 |
-
}
|
104 |
-
|
105 |
-
if($this->total_pages < 0){
|
106 |
-
echo "It is necessary to specify the <strong>number of pages</strong> (\$class->items(1000))<br />";
|
107 |
-
$error = true;
|
108 |
-
}
|
109 |
-
if($this->limit == null){
|
110 |
-
echo "It is necessary to specify the <strong>limit of items</strong> to show per page (\$class->limit(10))<br />";
|
111 |
-
$error = true;
|
112 |
-
}
|
113 |
-
if($error)return false;
|
114 |
-
|
115 |
-
$n = trim($this->nextT.' '.$this->nextI);
|
116 |
-
$p = trim($this->prevI.' '.$this->prevT);
|
117 |
-
|
118 |
-
/* Setup vars for query. */
|
119 |
-
if($this->page)
|
120 |
-
$start = ($this->page - 1) * $this->limit; //first item to display on this page
|
121 |
-
else
|
122 |
-
$start = 0; //if no page var is given, set start to 0
|
123 |
-
|
124 |
-
/* Setup page vars for display. */
|
125 |
-
$prev = $this->page - 1; //previous page is page - 1
|
126 |
-
$next = $this->page + 1; //next page is page + 1
|
127 |
-
$lastpage = ceil($this->total_pages/$this->limit); //lastpage is = total pages / items per page, rounded up.
|
128 |
-
$lpm1 = $lastpage - 1; //last page minus 1
|
129 |
-
|
130 |
-
/*
|
131 |
-
Now we apply our rules and draw the pagination object.
|
132 |
-
We're actually saving the code to a variable in case we want to draw it more than once.
|
133 |
-
*/
|
134 |
-
|
135 |
-
if($lastpage > 1){
|
136 |
-
if($this->page){
|
137 |
-
//anterior button
|
138 |
-
if($this->page > 1)
|
139 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($prev)."\" class=\"prev\">$p</a>";
|
140 |
-
else
|
141 |
-
$this->pagination .= "<span class=\"disabled\">$p</span>";
|
142 |
-
}
|
143 |
-
//pages
|
144 |
-
if ($lastpage < 7 + ($this->adjacents * 2)){//not enough pages to bother breaking it up
|
145 |
-
for ($counter = 1; $counter <= $lastpage; $counter++){
|
146 |
-
if ($counter == $this->page)
|
147 |
-
$this->pagination .= "<span class=\"current\">$counter</span>";
|
148 |
-
else
|
149 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
|
150 |
-
}
|
151 |
-
}
|
152 |
-
elseif($lastpage > 5 + ($this->adjacents * 2)){//enough pages to hide some
|
153 |
-
//close to beginning; only hide later pages
|
154 |
-
if($this->page < 1 + ($this->adjacents * 2)){
|
155 |
-
for ($counter = 1; $counter < 4 + ($this->adjacents * 2); $counter++){
|
156 |
-
if ($counter == $this->page)
|
157 |
-
$this->pagination .= "<span class=\"current\">$counter</span>";
|
158 |
-
else
|
159 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
|
160 |
-
}
|
161 |
-
$this->pagination .= "...";
|
162 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($lpm1)."\">$lpm1</a>";
|
163 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($lastpage)."\">$lastpage</a>";
|
164 |
-
}
|
165 |
-
//in middle; hide some front and some back
|
166 |
-
elseif($lastpage - ($this->adjacents * 2) > $this->page && $this->page > ($this->adjacents * 2)){
|
167 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link(1)."\">1</a>";
|
168 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link(2)."\">2</a>";
|
169 |
-
$this->pagination .= "...";
|
170 |
-
for ($counter = $this->page - $this->adjacents; $counter <= $this->page + $this->adjacents; $counter++)
|
171 |
-
if ($counter == $this->page)
|
172 |
-
$this->pagination .= "<span class=\"current\">$counter</span>";
|
173 |
-
else
|
174 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
|
175 |
-
$this->pagination .= "...";
|
176 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($lpm1)."\">$lpm1</a>";
|
177 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($lastpage)."\">$lastpage</a>";
|
178 |
-
}
|
179 |
-
//close to end; only hide early pages
|
180 |
-
else{
|
181 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link(1)."\">1</a>";
|
182 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link(2)."\">2</a>";
|
183 |
-
$this->pagination .= "...";
|
184 |
-
for ($counter = $lastpage - (2 + ($this->adjacents * 2)); $counter <= $lastpage; $counter++)
|
185 |
-
if ($counter == $this->page)
|
186 |
-
$this->pagination .= "<span class=\"current\">$counter</span>";
|
187 |
-
else
|
188 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($counter)."\">$counter</a>";
|
189 |
-
}
|
190 |
-
}
|
191 |
-
if($this->page){
|
192 |
-
//siguiente button
|
193 |
-
if ($this->page < $counter - 1)
|
194 |
-
$this->pagination .= "<a href=\"".$this->get_pagenum_link($next)."\" class=\"next\">$n</a>";
|
195 |
-
else
|
196 |
-
$this->pagination .= "<span class=\"displaying-num\">$n</span>";
|
197 |
-
if($this->showCounter)$this->pagination = "<span class=\"displaying-num\">($this->total_pages Items)</span>".$this->pagination;
|
198 |
-
}
|
199 |
-
}
|
200 |
-
|
201 |
-
return true;
|
202 |
-
}
|
203 |
-
}
|
204 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readme.txt
CHANGED
@@ -1,196 +1,249 @@
|
|
1 |
-
===
|
2 |
-
Contributors: ashokrane, pinal.shah,
|
3 |
-
Tags: abandon cart, shopping cart abandonment
|
4 |
-
Requires at least: 1.3
|
5 |
-
Tested up to: 4.
|
6 |
-
Stable tag: trunk
|
7 |
-
License: GPLv2 or later
|
8 |
-
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
-
Donate link: http://www.tychesoftwares.com/
|
10 |
-
|
11 |
-
This easy-to-use plugin
|
12 |
-
|
13 |
-
== Description ==
|
14 |
-
|
15 |
-
Abandoned Cart plugin works in the background, sending email notifications to your customers, reminding them about their abandoned orders.
|
16 |
-
|
17 |
-
The Abandoned Cart plugin allows you to recover orders that were just a step away from closing. It enables you to create automatic & well-timed email reminders to be sent to your customers who have added your products to their cart, but did not complete the order. As a result, with this plugin you will start recovering at least 30% or more of your lost sales. Why let this 30% revenue go unclaimed?
|
18 |
-
|
19 |
-
Abandoned Cart Lite plugin enables to do the following things:
|
20 |
-
<ol>
|
21 |
-
<li>Recover their abandoned carts in a single click</li>
|
22 |
-
<li>Identify the Abandoned Orders information, including the products that were abandoned</li>
|
23 |
-
<li>The plugin now captures abandoned guest carts. A guest user's cart will be captured on the Checkout page, if it is abandoned after entering the email address.</li>
|
24 |
-
<li>Track abandoned orders value v/s recovered orders value</li>
|
25 |
-
<li>Admin is notified by email when an order is recovered</li>
|
26 |
-
<li>Works off-the-shelf as it comes with 1 default email template</li>
|
27 |
-
<li>Create unlimited email templates to be sent at intervals that you set - Intervals start from 1 hour after cart is abandoned</li>
|
28 |
-
<li>Add custom variables like Customer First Name, Customer Last name, Customer full name, Cart Link & Product Cart Information in the email template</li>
|
29 |
-
<li>Copy HTML from anywhere & create templates using the powerful Rich Text Editor</li>
|
30 |
-
<li>Automatically stops email notifications when a customer makes a purchase or uses the cart recovery link</li>
|
31 |
-
</ol>
|
32 |
-
|
33 |
-
Abandoned Cart PRO plugin enables to do the following additional things:
|
34 |
-
<ol>
|
35 |
-
<li>Works off-the-shelf as it comes with 3 default email templates</li>
|
36 |
-
<li>Offer incentives to customers to return and complete their checkout with discounts and coupons</li>
|
37 |
-
<li>Add custom variables like Customer Name, Product Information, Coupons, etc. in the email template</li>
|
38 |
-
<li>Embed
|
39 |
-
<li>Track whether expired coupons are causing cart abandonment</li>
|
40 |
-
<li>Track emails sent, emails opened, links clicked for each template/email</li>
|
41 |
-
<li>Product report allows you to see which products are being abandoned & which are being recovered the most</li>
|
42 |
-
<li>Create unlimited email templates to be sent at intervals that you set - Intervals start from 1 minute after cart is abandoned</li>
|
43 |
-
</ol>
|
44 |
-
|
45 |
-
**Pro Version:**
|
46 |
-
|
47 |
-
**[
|
48 |
-
|
49 |
-
|
50 |
-
**Email Sending Setup:**
|
51 |
-
|
52 |
-
From version 1.3, it is not mandatory to set a cron job via CPanel for the abandoned cart email notifications to be sent. We are now using WP-Cron that sends the emails automatically whenever a page is requested.
|
53 |
-
|
54 |
-
Abandoned Cart Plugin relies on a function called WP-Cron, and this function only runs when there is a page requested. So, if there are no visits to your website, then the scheduled jobs are not run. Generally this method of sending the abandoned cart notification emails is reliable. However, if you are not very confident about the traffic volume of your website, then you can set a manual cron job via Cpanel or any other control panel that your host provides.
|
55 |
-
|
56 |
-
== Installation ==
|
57 |
-
|
58 |
-
1. Ensure you have latest version of
|
59 |
-
2. Unzip and upload contents of the plugin to your /wp-content/plugins/ directory
|
60 |
-
3. Activate the plugin through the 'Plugins' menu in WordPress
|
61 |
-
4. The plugin will start working as per the settings entered.
|
62 |
-
|
63 |
-
|
64 |
-
== Frequently Asked Questions ==
|
65 |
-
|
66 |
-
= Can the plugin track carts abandoned by guest users? =
|
67 |
-
|
68 |
-
Currently there is no provision for tracking guest carts. This is planned in a future release.
|
69 |
-
|
70 |
-
UPDATE: This feature has been released in version 2.2.
|
71 |
-
|
72 |
-
= Why are abandoned cart notification emails not getting sent? =
|
73 |
-
|
74 |
-
Please ensure you have followed the instructions in "Email Sending Setup" right above this FAQ. Additionally, if you have the PRO version, please verify that you have selected "Enable abandoned cart notifications" option in Settings. With this option turned off, the abandoned carts are recorded, but emails are not sent.
|
75 |
-
|
76 |
-
= Where can I find the documentation on how to setup the plugin? =
|
77 |
-
|
78 |
-
The documentation can be found **[here](https://www.tychesoftwares.com/woocommerce-abandon-cart-plugin-documentation/ "WooCommerce Abandoned Cart Pro")**. The Lite version is a subset of the Pro version, so the same documentation can be used to refer for the Lite version of the plugin.
|
79 |
-
|
80 |
-
== Screenshots ==
|
81 |
-
|
82 |
-
1. Lists all Abandoned Orders.
|
83 |
-
|
84 |
-
2. Lists all email templates.
|
85 |
-
|
86 |
-
3. Abandoned Cart Settings.
|
87 |
-
|
88 |
-
4. Lists Recovered Orders.
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
*
|
97 |
-
|
98 |
-
*
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
*
|
103 |
-
|
104 |
-
*
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
* New
|
109 |
-
|
110 |
-
*
|
111 |
-
|
112 |
-
*
|
113 |
-
|
114 |
-
* If the
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
*
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
*
|
127 |
-
|
128 |
-
*
|
129 |
-
|
130 |
-
*
|
131 |
-
|
132 |
-
*
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
*
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
*
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
* The plugin now
|
148 |
-
|
149 |
-
*
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
*
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
*
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
*
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
*
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
*
|
181 |
-
*
|
182 |
-
|
183 |
-
|
184 |
-
*
|
185 |
-
|
186 |
-
|
187 |
-
*
|
188 |
-
*
|
189 |
-
*
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
*
|
194 |
-
|
195 |
-
=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
* Initial release.
|
1 |
+
=== Abandoned Cart Lite for WooCommerce ===
|
2 |
+
Contributors: ashokrane, pinal.shah, bhavik.kiri, chetnapatel
|
3 |
+
Tags: abandon cart, shopping cart abandonment, sales recovery
|
4 |
+
Requires at least: 1.3
|
5 |
+
Tested up to: 4.5.3
|
6 |
+
Stable tag: trunk
|
7 |
+
License: GPLv2 or later
|
8 |
+
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
9 |
+
Donate link: http://www.tychesoftwares.com/
|
10 |
+
|
11 |
+
This easy-to-use plugin allows WooCommerce store owners to recover sales that are lost to abandoned shopping carts by customers.
|
12 |
+
|
13 |
+
== Description ==
|
14 |
+
|
15 |
+
Abandoned Cart plugin works in the background, sending email notifications to your guests customers & logged-in customers, reminding them about their abandoned orders.
|
16 |
+
|
17 |
+
The Abandoned Cart plugin allows you to recover orders that were just a step away from closing. It enables you to create automatic & well-timed email reminders to be sent to your customers who have added your products to their cart, but did not complete the order. As a result, with this plugin you will start recovering at least 30% or more of your lost sales. Why let this 30% revenue go unclaimed?
|
18 |
+
|
19 |
+
Abandoned Cart Lite plugin enables to do the following things:
|
20 |
+
<ol>
|
21 |
+
<li>Recover their abandoned carts in a single click</li>
|
22 |
+
<li>Identify the Abandoned Orders information, including the products that were abandoned</li>
|
23 |
+
<li>The plugin now captures abandoned guest carts. A guest user's cart will be captured on the Checkout page, if it is abandoned after entering the email address.</li>
|
24 |
+
<li>Track abandoned orders value v/s recovered orders value</li>
|
25 |
+
<li>Admin is notified by email when an order is recovered</li>
|
26 |
+
<li>Works off-the-shelf as it comes with 1 default email template</li>
|
27 |
+
<li>Create unlimited email templates to be sent at intervals that you set - Intervals start from 1 hour after cart is abandoned</li>
|
28 |
+
<li>Add custom variables like Customer First Name, Customer Last name, Customer full name, Cart Link & Product Cart Information in the email template</li>
|
29 |
+
<li>Copy HTML from anywhere & create templates using the powerful Rich Text Editor</li>
|
30 |
+
<li>Automatically stops email notifications when a customer makes a purchase or uses the cart recovery link</li>
|
31 |
+
</ol>
|
32 |
+
|
33 |
+
Abandoned Cart PRO plugin enables to do the following additional things:
|
34 |
+
<ol>
|
35 |
+
<li>Works off-the-shelf as it comes with 3 default email templates</li>
|
36 |
+
<li>Offer incentives to customers to return and complete their checkout with discounts and coupons</li>
|
37 |
+
<li>Add custom variables like Customer Name, Product Information, Coupons, etc. in the email template</li>
|
38 |
+
<li>Embed WooCommerce coupons & also generate unique coupons in the emails being sent to customers</li>
|
39 |
+
<li>Track whether expired coupons are causing cart abandonment</li>
|
40 |
+
<li>Track emails sent, emails opened, links clicked for each template/email</li>
|
41 |
+
<li>Product report allows you to see which products are being abandoned & which are being recovered the most</li>
|
42 |
+
<li>Create unlimited email templates to be sent at intervals that you set - Intervals start from 1 minute after cart is abandoned</li>
|
43 |
+
</ol>
|
44 |
+
|
45 |
+
**Pro Version:**
|
46 |
+
|
47 |
+
**[Abandoned Cart Pro for WooCommerce 3.4](http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro "Abandoned Cart Pro for WooCommerce")** - The PRO version allows you to track products in abandoned carts, create unlimited email templates, track coupons, keep a track of sent emails & much more.
|
48 |
+
|
49 |
+
|
50 |
+
**Email Sending Setup:**
|
51 |
+
|
52 |
+
From version 1.3, it is not mandatory to set a cron job via CPanel for the abandoned cart email notifications to be sent. We are now using WP-Cron that sends the emails automatically whenever a page is requested.
|
53 |
+
|
54 |
+
Abandoned Cart Plugin relies on a function called WP-Cron, and this function only runs when there is a page requested. So, if there are no visits to your website, then the scheduled jobs are not run. Generally this method of sending the abandoned cart notification emails is reliable. However, if you are not very confident about the traffic volume of your website, then you can set a manual cron job via Cpanel or any other control panel that your host provides.
|
55 |
+
|
56 |
+
== Installation ==
|
57 |
+
|
58 |
+
1. Ensure you have latest version of WooCommerce plugin installed
|
59 |
+
2. Unzip and upload contents of the plugin to your /wp-content/plugins/ directory
|
60 |
+
3. Activate the plugin through the 'Plugins' menu in WordPress
|
61 |
+
4. The plugin will start working as per the settings entered.
|
62 |
+
|
63 |
+
|
64 |
+
== Frequently Asked Questions ==
|
65 |
+
|
66 |
+
= Can the plugin track carts abandoned by guest users? =
|
67 |
+
|
68 |
+
Currently there is no provision for tracking guest carts. This is planned in a future release.
|
69 |
+
|
70 |
+
UPDATE: This feature has been released in version 2.2.
|
71 |
+
|
72 |
+
= Why are abandoned cart notification emails not getting sent? =
|
73 |
+
|
74 |
+
Please ensure you have followed the instructions in "Email Sending Setup" right above this FAQ. Additionally, if you have the PRO version, please verify that you have selected "Enable abandoned cart notifications" option in Settings. With this option turned off, the abandoned carts are recorded, but emails are not sent.
|
75 |
+
|
76 |
+
= Where can I find the documentation on how to setup the plugin? =
|
77 |
+
|
78 |
+
The documentation can be found **[here](https://www.tychesoftwares.com/woocommerce-abandon-cart-plugin-documentation/ "WooCommerce Abandoned Cart Pro")**. The Lite version is a subset of the Pro version, so the same documentation can be used to refer for the Lite version of the plugin.
|
79 |
+
|
80 |
+
== Screenshots ==
|
81 |
+
|
82 |
+
1. Lists all Abandoned Orders.
|
83 |
+
|
84 |
+
2. Lists all email templates.
|
85 |
+
|
86 |
+
3. Abandoned Cart Settings.
|
87 |
+
|
88 |
+
4. Lists Recovered Orders.
|
89 |
+
|
90 |
+
5. Product Report Tab.
|
91 |
+
|
92 |
+
== Changelog ==
|
93 |
+
|
94 |
+
= 3.0 =
|
95 |
+
|
96 |
+
* Enhancements - In this version, the code has been refined throughout the plugin & the folder structure has also been modified.
|
97 |
+
|
98 |
+
* Enhancements - Earlier rounding off of the decimal values was hardcoded in the plugin. Now, it will round the decimal values based on the WooCommerce setting named �Number of Decimals� which is located at WooCommerce -> Settings menu.
|
99 |
+
|
100 |
+
* Bugs Fixed - When setting "Email admin On Order Recovery" is enabled & order is recovered from the abandoned cart reminder notifications using "Cash On Delivery" payment gateway. Then the order is not considered as recovered & the order was not displayed in the "Recovered Orders" tab. This has been fixed.
|
101 |
+
|
102 |
+
* Bugs Fixed - Earlier the abandoned cart reminder emails & abandoned orders details page was not displaying the selected attributes for the variable products. This has been fixed.
|
103 |
+
|
104 |
+
* Bugs Fixed - The "Abandoned Date" column of the abandoned orders tab was not considering the time for sorting. This has been fixed.
|
105 |
+
|
106 |
+
= 2.9 =
|
107 |
+
|
108 |
+
* New Feature - New merge tag {{cart.unsubscribe}} has been added for email templates. This merge tag allows user to stop receiving further abandoned cart reminder email notifications. This merge tag has been added to comply with email sending laws in different countries.
|
109 |
+
|
110 |
+
* Bugs Fixed - Earlier if any user came from abandoned cart reminder email and place the order using PayPal payment gateway and do not reach the order received page. Then plugin was not considering that order as a recovered order. From now onwards if the user came from the abandoned cart reminder email and place the order using PayPal and does not reach the order received the page. Then plugin will consider that cart as a recovered order.
|
111 |
+
|
112 |
+
* Bugs Fixed - When the cart is abandoned as a guest & product have the special character in the attributes name, then it was displaying a blank row with only a checkbox on the Abandoned Orders tab. This has been fixed.
|
113 |
+
|
114 |
+
* Tweak - If the order is recovered from the abandoned cart reminder email then it will add a note "This order was abandoned & subsequently recovered." for the order.
|
115 |
+
|
116 |
+
= 2.8 =
|
117 |
+
|
118 |
+
* We have changed the encryption for the links that are sent in the Abandoned cart email notifications. Earlier we were using the mcrypt library for encoding the data. If mcrypt library was not installed on the server, then abandoned cart email notifications were not sent. Now we have used different functions for encoding the string. We have used microtime function & a security key. Using this security key, and after applying an algorithm on it, we generate the encoded string.
|
119 |
+
|
120 |
+
* The session now starts only on required pages of the store. Earlier it was started globally. This will help to improve the site performance.
|
121 |
+
|
122 |
+
* If billing email address of the logged-in user is not set then it was showing blank space on the abandoned orders list. This has been fixed. Now it will show the email address which was used while registering to the store.
|
123 |
+
|
124 |
+
* Earlier if email body was blank and we send the test email then blank email was sent. This has been fixed. Now if email body is blank then test email will not be sent.
|
125 |
+
|
126 |
+
* Tweak - Earlier we were populating the guest cart information by looping into the global WooCommerce cart. Now we are not looping & instead using the WooCommerce session object itself.
|
127 |
+
|
128 |
+
* Tweak - Earlier if the 'wp-content' directory has been renamed, then wp-load.php file was not included and abandoned cart reminder email was not sent. Now, we have changed the way of including the wp-load.php file for sending the abandoned cart reminder notifications.
|
129 |
+
|
130 |
+
* Tweak - Earlier when {{products.cart}} merge tag is used in abandoned cart email template, then on click of the product name and product image, it was redirecting to the product page. Now it will redirect the user to the cart page.
|
131 |
+
|
132 |
+
* Tweak - We are now rounding off the prices with the 'round' function.
|
133 |
+
|
134 |
+
= 2.7 =
|
135 |
+
|
136 |
+
* New setting named as "Email Template Header Text" is added in Add / Edit template page. It will allow to change the header text of the email which have WooCommerce template style setting enabled for the template.
|
137 |
+
|
138 |
+
* From this version, the email sending process will run every 15 minutes instead of every 5 minutes. This will result in improved overall performance of the website.
|
139 |
+
|
140 |
+
* When Lite version of the plugin is activated on the site then it was not allowing to activate the PRO version of the plugin. This has been fixed.
|
141 |
+
|
142 |
+
* When templates are created / updated and if it has the same duration as one of the existing templates, then new template was not saved. This has been fixed.
|
143 |
+
|
144 |
+
|
145 |
+
= 2.6 =
|
146 |
+
|
147 |
+
* The plugin is now using the TinyMCE editor available in WordPress core for the email body content. The external TinyMCE library is removed from the plugin.
|
148 |
+
|
149 |
+
* The plugin is made compatible with Huge IT Image Gallery plugin. The test email was not sent to the user when Huge IT Image Gallery plugin was activated.
|
150 |
+
|
151 |
+
* The Product Report tab has been redesigned to look consistent with the WordPress style.
|
152 |
+
|
153 |
+
= 2.5.2 =
|
154 |
+
|
155 |
+
* Abandoned Orders tab has been redesigned with the WordPress WP list tables. "Action" column has been removed. The "Delete" link has been added in the abandoned orders tab. It is capable of deleting the abandoned orders when hovering the abandoned order in the list. It is also capable of deleting abandoned orders in bulk from the "Abandoned orders" tab.
|
156 |
+
|
157 |
+
* Email Templates tab has been re-designed to be consistent with the WordPress styling. It is now capable of deleting email templates in bulk. Action column in the Email templates tab has been removed. User can Edit & Delete template using hover affect on the template. This update allows you to activate / deactivate email template from the "Email Templates" page itself without having to edit the template & set it as "Active" by checking the checkbox.
|
158 |
+
|
159 |
+
* Recover Orders tab has been re-designed to be consistent with the WordPress style tables. "View Details" column in the Recovered Orders tab has been removed. User can view Details of the recovered cart using the link 'View Details' on the hover affect on 'User name' column.
|
160 |
+
|
161 |
+
* New setting named as "Send From This Email Address:" is added in Add / Edit template page. It will allow to change the From Email address of abandoned cart notification.
|
162 |
+
|
163 |
+
* New setting named as "Send Reply Emails to:" is added in Add / Edit template page. It will allow the user to change the Reply to email address of the abandoned cart notification.
|
164 |
+
|
165 |
+
* If the "Wp-Content" folder name is changed using iThemes Security (formerly Better WP Security) plugin then abandoned cart email notifications were not sent. This has been fixed.
|
166 |
+
|
167 |
+
* If the cart has been empty and we have tried to recover the order via email then it was displaying wrong Cart Recovery date. It has been fixed.
|
168 |
+
|
169 |
+
* In some cases, when cart or checkout link was clicked from the abandoned cart email notification, it was displaying "Link Expired" in the browser. This has been fixed.
|
170 |
+
|
171 |
+
* If the user has emptied their cart before the abandoned cut-off time is reached, for such carts the record in the DB will become blank. Such cart records were displayed in the abandoned orders list. This has been fixed.
|
172 |
+
|
173 |
+
= 2.5.1 =
|
174 |
+
* Some warnings were displayed on Email Templates tab. These have been fixed.
|
175 |
+
|
176 |
+
= 2.5 =
|
177 |
+
|
178 |
+
* The Settings page for the plugin has been redone. We are now using the WordPress Settings API for all the options on that page.
|
179 |
+
* When the plugin is installed & activated for the first time, 1 default email template will also be created. The template will be inactive when the plugin is activated.
|
180 |
+
* A new setting is added on the Add/Edit Template page named as "Active". If this setting is checked, only then the abandoned cart reminder email will be sent to the customers. If this setting is unchecked, then the email template won't be sent to the customers, but still you can keep it in the plugin. By default, this is unchecked.
|
181 |
+
* A new setting is added on the Add/Edit Template page named as "Use WooCommerce Template Style". If this setting is checked then abandoned cart reminder email will use the WooCommerce style (header, footer, background, etc.) for the notifications. If it is not checked then the regular email will be sent to the customer as per the formatting that is set in the template editor.
|
182 |
+
For existing users, this setting will remain unchecked. For new users of the plugin, the setting will be enabled for the existing default email template that is provided with the plugin.
|
183 |
+
* Abandoned cart email notification will be sent to the client's billing address entered on checkout instead of on the email address added by the user while registering to the website. This applies only for logged in users.
|
184 |
+
* New shortcode "{{cart.abandoned_date}}" has been introduced in this version. It will display the date and time when the cart was abandoned in the abandoned cart email notification.
|
185 |
+
* When a customer places an order within the abandoned cart cut off time, then the order received page was displaying a warning. This has been fixed.
|
186 |
+
* Abandoned Orders tab was not sorting according to the "Date" column. Same way, Recovered Orders tab was not sorting according to "Created On" & "Recovered Date" column. This has been fixed.
|
187 |
+
* Some warnings were displayed on the Abandoned Orders, Recovered Orders and Product Report tab. These have been fixed.
|
188 |
+
* The 'mailto' link was not working on the Abandoned Order details page. This has been fixed.
|
189 |
+
* Tweak - Removed the background white color for the add / edit template page.
|
190 |
+
* Tweak - Abandoned Orders tab will display the user's billing address using which the cart was abandoned. This applies only for logged in users.
|
191 |
+
|
192 |
+
= 2.4 =
|
193 |
+
* Abandon Cart record was not being deleted for users, when they do not reach the order received page but the payment for the order is already done. Also user was receiving the abandoned cart notification for such orders. This has been fixed.
|
194 |
+
|
195 |
+
= 2.3 =
|
196 |
+
* A new setting has been added "Email admin on order recovery". It will send an email to the admin's email address when an abandoned cart is recovered by the customer. This will work only for registered users.
|
197 |
+
* A new tab "Product Report" has been added. It will list the product name, number of times product has been abandoned and the number of times product has been recovered.
|
198 |
+
|
199 |
+
= 2.2 =
|
200 |
+
* The plugin now captures abandoned guest carts. A guest user's cart will be captured on the Checkout page, if it is abandoned after entering the email address.
|
201 |
+
* A new shortcode "{{cart.link}}" is added, which will include the cart URL of your shop.
|
202 |
+
* Fixed some warnings being displayed in the Settings tab.
|
203 |
+
|
204 |
+
= 2.1 =
|
205 |
+
* From this version, you can view the abandoned order details, which includes product details, billing & shipping address, under the Abandoned Orders tab.
|
206 |
+
|
207 |
+
= 2.0.1 =
|
208 |
+
* Applied fix for warning displayed on the abandoned orders page.
|
209 |
+
|
210 |
+
= 2.0 =
|
211 |
+
* The image link was coming broken while creating or editing the template if the image is present on the same server. This is fixed now.
|
212 |
+
* Added translations file for Hebrew which was contributed by a user.
|
213 |
+
|
214 |
+
= 1.9 =
|
215 |
+
* Fixed security issues pointed out by Wordpress.org review team.
|
216 |
+
|
217 |
+
= 1.8 =
|
218 |
+
* The strings for the products table, added using the shortcode {{products.cart}} in email templates have been added to the .pot, .po and .mo files of the plugin. Now the cart data will be translated to the respective language in the reminder emails as well as the test emails.
|
219 |
+
|
220 |
+
= 1.7 =
|
221 |
+
* Merge fields like {{products.cart}}, {{customer.firstname}}, etc. will be replaced with dummy data in the test emails that are sent from the template add / edit page. This ensures that you get a very close approximation of the actual email that will be delivered to your customers.
|
222 |
+
* Product image size in the abandon cart notification emails is set to a fixed height & width now.
|
223 |
+
* On WordPress Multisite, incorrect table prefix was used due to which the plugin was not functioning correctly on multisite installs. This is fixed now.
|
224 |
+
|
225 |
+
= 1.6 =
|
226 |
+
* We have included .po, .pot and .mo files in the plugin. The plugin strings can now be translated to any language using these files.
|
227 |
+
|
228 |
+
= 1.5 =
|
229 |
+
* A shortcode {{products.cart}} can now be added in the abandoned cart notification emails. It will add the product information in the email like Product image, Product name, Quantity, Price & Total. The shortcode needs to be added from the AC menu from the template editor.
|
230 |
+
* The default value of the field "Cart abandoned cut-off time" in Settings tab was blank when the plugin is installed. This is now set to 60 minutes upon plugin activation.
|
231 |
+
|
232 |
+
= 1.4 =
|
233 |
+
* The abandoned cart emails were being sent multiple times for a single email template due to a bug. This is fixed.
|
234 |
+
* The plugin will now work on WordPress Multisite too.
|
235 |
+
|
236 |
+
= 1.3 =
|
237 |
+
* The abandoned cart email notifications are now sent out automatically without the necessity of having to set up a cron job manually.
|
238 |
+
|
239 |
+
= 1.2 =
|
240 |
+
* The test emails were not getting sent.
|
241 |
+
* Warnings fixed for some of the plugin setting pages.
|
242 |
+
* The image urls in the email were coming broken, this is fixed.
|
243 |
+
|
244 |
+
= 1.1 =
|
245 |
+
* Compatibility with WooCommerce 2.x versions
|
246 |
+
* Fixed 404 errors with images & other files
|
247 |
+
|
248 |
+
= 1.0 =
|
249 |
* Initial release.
|
screenshot-1.png
CHANGED
Binary file
|
screenshot-2.png
CHANGED
Binary file
|
screenshot-3.png
CHANGED
Binary file
|
screenshot-4.png
CHANGED
Binary file
|
screenshot-5.png
ADDED
Binary file
|
views/wacp-email-template-preview.php
DELETED
@@ -1,52 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin View: Abadoned Cart reminder Email Template Preview
|
4 |
-
*/
|
5 |
-
|
6 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
-
exit; // Exit if accessed directly
|
8 |
-
}
|
9 |
-
|
10 |
-
?>
|
11 |
-
<html>
|
12 |
-
<head>
|
13 |
-
<title>My document title</title>
|
14 |
-
</head>
|
15 |
-
<body>
|
16 |
-
|
17 |
-
<p align="center"> Hello John Carter, </p>
|
18 |
-
<p> </p>
|
19 |
-
<p align="center"> We're following up with you, because we noticed that on 12-12-2015 you attempted to purchase the following products on <?php echo get_option( 'blogname' );?>. </p>
|
20 |
-
<p> </p>
|
21 |
-
<p>
|
22 |
-
|
23 |
-
<table border="0" cellspacing="5" align="center"><caption><b>Cart Details</b></caption>
|
24 |
-
<tbody>
|
25 |
-
<tr>
|
26 |
-
<th></th>
|
27 |
-
<th>Product</th>
|
28 |
-
<th>Price</th>
|
29 |
-
<th>Quantity</th>
|
30 |
-
<th>Total</th>
|
31 |
-
</tr>
|
32 |
-
<tr style="background-color:#f4f5f4;">
|
33 |
-
<td><img src = "<?php echo plugins_url();?>/woocommerce-abandoned-cart/images/spectre.jpg" height="40px" width="40px"></td><td>Spectre</td><td>$150</td><td>2</td><td>$300</td>
|
34 |
-
</tr>
|
35 |
-
<tr>
|
36 |
-
<td> </td>
|
37 |
-
<td> </td>
|
38 |
-
<td> </td>
|
39 |
-
<th>Cart Total:</th>
|
40 |
-
<td>$300</td>
|
41 |
-
</tr></tbody></table> </p>
|
42 |
-
<p> </p>
|
43 |
-
<p align="center"> If you had any purchase troubles, could you please Contact to share them? </p>
|
44 |
-
<p> </p>
|
45 |
-
<p align="center"> Otherwise, how about giving us another chance? Shop <a href="<?php echo get_option( 'siteurl' );?>"><?php echo get_option( 'blogname' );?></a>. </p>
|
46 |
-
<hr></hr>
|
47 |
-
<p align="center"> You may <a href="<?php echo get_option( 'siteurl' );?>">unsubscribe</a> to stop receiving these emails. </p>
|
48 |
-
<p> </p>
|
49 |
-
<p align="center"> <a href="<?php echo get_option( 'siteurl' );?>"><?php echo get_option( 'blogname' );?></a> appreciates your business. </p>
|
50 |
-
|
51 |
-
</body>
|
52 |
-
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/wacp-wc-email-template-preview.php
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Admin View: Abadoned Cart reminder Email Template Preview
|
4 |
-
*/
|
5 |
-
|
6 |
-
if ( ! defined( 'ABSPATH' ) ) {
|
7 |
-
exit; // Exit if accessed directly
|
8 |
-
}
|
9 |
-
|
10 |
-
?>
|
11 |
-
<body>
|
12 |
-
|
13 |
-
<p > Hello John Carter, </p>
|
14 |
-
<p> </p>
|
15 |
-
<p > We're following up with you, because we noticed that on 12-12-2015 you attempted to purchase the following products on <?php echo get_option( 'blogname' );?>. </p>
|
16 |
-
<p> </p>
|
17 |
-
<p>
|
18 |
-
|
19 |
-
<table border="0" cellspacing="5" align="center"><caption><b>Cart Details</b></caption>
|
20 |
-
<tbody>
|
21 |
-
<tr>
|
22 |
-
<th></th>
|
23 |
-
<th>Product</th>
|
24 |
-
<th>Price</th>
|
25 |
-
<th>Quantity</th>
|
26 |
-
<th>Total</th>
|
27 |
-
</tr>
|
28 |
-
<tr style="background-color:#f4f5f4;">
|
29 |
-
<td><img src = "<?php echo plugins_url();?>/woocommerce-abandoned-cart/images/spectre.jpg" height="40px" width="40px"></td><td>Spectre</td><td>$150</td><td>2</td><td>$300</td>
|
30 |
-
</tr>
|
31 |
-
<tr>
|
32 |
-
<td> </td>
|
33 |
-
<td> </td>
|
34 |
-
<td> </td>
|
35 |
-
<th>Cart Total:</th>
|
36 |
-
<td>$300</td>
|
37 |
-
</tr></tbody></table> </p>
|
38 |
-
<p> </p>
|
39 |
-
<p > If you had any purchase troubles, could you please Contact to share them? </p>
|
40 |
-
<p> </p>
|
41 |
-
<p > Otherwise, how about giving us another chance? Shop <a href="<?php echo get_option( 'siteurl' );?>"><?php echo get_option( 'blogname' );?></a>. </p>
|
42 |
-
<hr></hr>
|
43 |
-
<p > You may <a href="<?php echo get_option( 'siteurl' );?>">unsubscribe</a> to stop receiving these emails. </p>
|
44 |
-
<p> </p>
|
45 |
-
<p > <a href="<?php echo get_option( 'siteurl' );?>"><?php echo get_option( 'blogname' );?></a> appreciates your business. </p>
|
46 |
-
|
47 |
-
</body>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
views/wcal-email-template-preview.php
ADDED
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin View: Abandoned Cart reminder Email Template Preview
|
4 |
+
*/
|
5 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
6 |
+
exit; // Exit if accessed directly
|
7 |
+
}
|
8 |
+
?>
|
9 |
+
<html>
|
10 |
+
<head>
|
11 |
+
<title>My document title</title>
|
12 |
+
</head>
|
13 |
+
<body>
|
14 |
+
<p align="center"> Hello John Carter, </p>
|
15 |
+
<p> </p>
|
16 |
+
<p align="center"> We're following up with you, because we noticed that on 12-12-2015 you attempted to purchase the following products on <?php echo get_option( 'blogname' );?>. </p>
|
17 |
+
<p> </p>
|
18 |
+
<p>
|
19 |
+
<table border="0" cellspacing="5" align="center"><caption><b>Cart Details</b></caption>
|
20 |
+
<tbody>
|
21 |
+
<tr>
|
22 |
+
<th></th>
|
23 |
+
<th>Product</th>
|
24 |
+
<th>Price</th>
|
25 |
+
<th>Quantity</th>
|
26 |
+
<th>Total</th>
|
27 |
+
</tr>
|
28 |
+
<tr style="background-color:#f4f5f4;">
|
29 |
+
<td><img src = "<?php echo plugins_url();?>/woocommerce-abandoned-cart/assets/images/spectre.jpg" height="40px" width="40px"></td><td>Spectre</td><td>$150</td><td>2</td><td>$300</td>
|
30 |
+
</tr>
|
31 |
+
<tr>
|
32 |
+
<td> </td>
|
33 |
+
<td> </td>
|
34 |
+
<td> </td>
|
35 |
+
<th>Cart Total:</th>
|
36 |
+
<td>$300</td>
|
37 |
+
</tr>
|
38 |
+
</tbody>
|
39 |
+
</table>
|
40 |
+
</p>
|
41 |
+
<p> </p>
|
42 |
+
<p align="center"> If you had any purchase troubles, could you please Contact to share them? </p>
|
43 |
+
<p> </p>
|
44 |
+
<p align="center"> Otherwise, how about giving us another chance? Shop <a href="<?php echo get_option( 'siteurl' );?>"><?php echo get_option( 'blogname' );?></a>. </p>
|
45 |
+
<hr></hr>
|
46 |
+
<p align="center"> You may <a href="<?php echo get_option( 'siteurl' );?>">unsubscribe</a> to stop receiving these emails. </p>
|
47 |
+
<p> </p>
|
48 |
+
<p align="center"> <a href="<?php echo get_option( 'siteurl' );?>"><?php echo get_option( 'blogname' );?></a> appreciates your business. </p>
|
49 |
+
</body>
|
50 |
+
</html>
|
views/wcal-wc-email-template-preview.php
ADDED
@@ -0,0 +1,45 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin View: Abandoned Cart reminder Email Template Preview
|
4 |
+
*/
|
5 |
+
if( ! defined( 'ABSPATH' ) ) {
|
6 |
+
exit; // Exit if accessed directly
|
7 |
+
}
|
8 |
+
?>
|
9 |
+
<body>
|
10 |
+
<p> Hello John Carter, </p>
|
11 |
+
<p> </p>
|
12 |
+
<p> We're following up with you, because we noticed that on 12-12-2015 you attempted to purchase the following products on <?php echo get_option( 'blogname' );?>. </p>
|
13 |
+
<p> </p>
|
14 |
+
<p>
|
15 |
+
<table border="0" cellspacing="5" align="center"><caption><b>Cart Details</b></caption>
|
16 |
+
<tbody>
|
17 |
+
<tr>
|
18 |
+
<th></th>
|
19 |
+
<th>Product</th>
|
20 |
+
<th>Price</th>
|
21 |
+
<th>Quantity</th>
|
22 |
+
<th>Total</th>
|
23 |
+
</tr>
|
24 |
+
<tr style="background-color:#f4f5f4;">
|
25 |
+
<td><img src = "<?php echo plugins_url();?>/woocommerce-abandoned-cart/assets/images/spectre.jpg" height="40px" width="40px"></td><td>Spectre</td><td>$150</td><td>2</td><td>$300</td>
|
26 |
+
</tr>
|
27 |
+
<tr>
|
28 |
+
<td> </td>
|
29 |
+
<td> </td>
|
30 |
+
<td> </td>
|
31 |
+
<th>Cart Total:</th>
|
32 |
+
<td>$300</td>
|
33 |
+
</tr>
|
34 |
+
</tbody>
|
35 |
+
</table>
|
36 |
+
</p>
|
37 |
+
<p> </p>
|
38 |
+
<p> If you had any purchase troubles, could you please Contact to share them? </p>
|
39 |
+
<p> </p>
|
40 |
+
<p> Otherwise, how about giving us another chance? Shop <a href="<?php echo get_option( 'siteurl' );?>"><?php echo get_option( 'blogname' );?></a>. </p>
|
41 |
+
<hr></hr>
|
42 |
+
<p> You may <a href="<?php echo get_option( 'siteurl' );?>">unsubscribe</a> to stop receiving these emails. </p>
|
43 |
+
<p> </p>
|
44 |
+
<p> <a href="<?php echo get_option( 'siteurl' );?>"><?php echo get_option( 'blogname' );?></a> appreciates your business. </p>
|
45 |
+
</body>
|
woo-includes/class-wc-dependencies.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* WC Dependency Checker
|
4 |
-
*
|
5 |
-
* Checks if WooCommerce is enabled
|
6 |
-
*/
|
7 |
-
class WC_Dependencies {
|
8 |
-
|
9 |
-
private static $active_plugins;
|
10 |
-
|
11 |
-
function init() {
|
12 |
-
|
13 |
-
self::$active_plugins = (array) get_option( 'active_plugins', array() );
|
14 |
-
|
15 |
-
if ( is_multisite() )
|
16 |
-
self::$active_plugins = array_merge( self::$active_plugins, get_site_option( 'active_sitewide_plugins', array() ) );
|
17 |
-
}
|
18 |
-
|
19 |
-
function woocommerce_active_check() {
|
20 |
-
|
21 |
-
if ( ! self::$active_plugins ) self::init();
|
22 |
-
|
23 |
-
return in_array( 'woocommerce/woocommerce.php', self::$active_plugins ) || array_key_exists( 'woocommerce/woocommerce.php', self::$active_plugins );
|
24 |
-
|
25 |
-
}
|
26 |
-
|
27 |
-
}
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
woo-includes/woo-functions.php
DELETED
@@ -1,97 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Functions used by plugins
|
4 |
-
*/
|
5 |
-
if ( ! class_exists( 'WC_Dependencies' ) )
|
6 |
-
require_once 'class-wc-dependencies.php';
|
7 |
-
|
8 |
-
/**
|
9 |
-
* WC Detection
|
10 |
-
*/
|
11 |
-
if ( ! function_exists( 'is_woocommerce_active' ) ) {
|
12 |
-
function is_woocommerce_active() {
|
13 |
-
return WC_Dependencies::woocommerce_active_check();
|
14 |
-
}
|
15 |
-
}
|
16 |
-
|
17 |
-
/**
|
18 |
-
* Queue updates for the WooUpdater
|
19 |
-
*/
|
20 |
-
if ( ! function_exists( 'woothemes_queue_update' ) ) {
|
21 |
-
function woothemes_queue_update( $file, $file_id, $product_id ) {
|
22 |
-
global $woothemes_queued_updates;
|
23 |
-
|
24 |
-
if ( ! isset( $woothemes_queued_updates ) )
|
25 |
-
$woothemes_queued_updates = array();
|
26 |
-
|
27 |
-
$plugin = new stdClass();
|
28 |
-
$plugin->file = $file;
|
29 |
-
$plugin->file_id = $file_id;
|
30 |
-
$plugin->product_id = $product_id;
|
31 |
-
|
32 |
-
$woothemes_queued_updates[] = $plugin;
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* Load installer for the WooThemes Updater.
|
38 |
-
* @return $api Object
|
39 |
-
*/
|
40 |
-
if ( ! class_exists( 'WooThemes_Updater' ) && ! function_exists( 'woothemes_updater_install' ) ) {
|
41 |
-
function woothemes_updater_install( $api, $action, $args ) {
|
42 |
-
$download_url = 'http://woodojo.s3.amazonaws.com/downloads/woothemes-updater/woothemes-updater.zip';
|
43 |
-
|
44 |
-
if ( 'plugin_information' != $action ||
|
45 |
-
false !== $api ||
|
46 |
-
! isset( $args->slug ) ||
|
47 |
-
'woothemes-updater' != $args->slug
|
48 |
-
) return $api;
|
49 |
-
|
50 |
-
$api = new stdClass();
|
51 |
-
$api->name = 'WooThemes Updater';
|
52 |
-
$api->version = '1.0.0';
|
53 |
-
$api->download_link = esc_url( $download_url );
|
54 |
-
return $api;
|
55 |
-
}
|
56 |
-
|
57 |
-
add_filter( 'plugins_api', 'woothemes_updater_install', 10, 3 );
|
58 |
-
}
|
59 |
-
|
60 |
-
/**
|
61 |
-
* WooUpdater Installation Prompts
|
62 |
-
*/
|
63 |
-
if ( ! class_exists( 'WooThemes_Updater' ) && ! function_exists( 'woothemes_updater_notice' ) ) {
|
64 |
-
|
65 |
-
/**
|
66 |
-
* Display a notice if the "WooThemes Updater" plugin hasn't been installed.
|
67 |
-
* @return void
|
68 |
-
*/
|
69 |
-
function woothemes_updater_notice() {
|
70 |
-
$active_plugins = apply_filters( 'active_plugins', get_option('active_plugins' ) );
|
71 |
-
if ( in_array( 'woothemes-updater/woothemes-updater.php', $active_plugins ) ) return;
|
72 |
-
|
73 |
-
$slug = 'woothemes-updater';
|
74 |
-
$install_url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $slug ), 'install-plugin_' . $slug );
|
75 |
-
$activate_url = 'plugins.php?action=activate&plugin=' . urlencode( 'woothemes-updater/woothemes-updater.php' ) . '&plugin_status=all&paged=1&s&_wpnonce=' . urlencode( wp_create_nonce( 'activate-plugin_woothemes-updater/woothemes-updater.php' ) );
|
76 |
-
|
77 |
-
$message = '<a href="' . esc_url( $install_url ) . '">Install the WooThemes Updater plugin</a> to get updates for your WooThemes plugins.';
|
78 |
-
$is_downloaded = false;
|
79 |
-
$plugins = array_keys( get_plugins() );
|
80 |
-
foreach ( $plugins as $plugin ) {
|
81 |
-
if ( strpos( $plugin, 'woothemes-updater.php' ) !== false ) {
|
82 |
-
$is_downloaded = true;
|
83 |
-
$message = '<a href="' . esc_url( admin_url( $activate_url ) ) . '">Activate the WooThemes Updater plugin</a> to get updates for your WooThemes plugins.';
|
84 |
-
}
|
85 |
-
}
|
86 |
-
echo '<div class="updated fade"><p>' . $message . '</p></div>' . "\n";
|
87 |
-
}
|
88 |
-
|
89 |
-
add_action( 'admin_notices', 'woothemes_updater_notice' );
|
90 |
-
}
|
91 |
-
|
92 |
-
/**
|
93 |
-
* Prevent conflicts with older versions
|
94 |
-
*/
|
95 |
-
if ( ! class_exists( 'WooThemes_Plugin_Updater' ) ) {
|
96 |
-
class WooThemes_Plugin_Updater { function init() {} }
|
97 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
woocommerce-ac.php
CHANGED
@@ -1,2713 +1,2887 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
Plugin Name:
|
4 |
-
Plugin URI: http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro
|
5 |
-
Description: This plugin captures abandoned carts by logged-in users & emails them about it. <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the PRO Version.</a></strong>
|
6 |
-
Version:
|
7 |
-
Author: Tyche Softwares
|
8 |
-
Author URI: http://www.tychesoftwares.com/
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
require_once( "
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
$schedules['
|
27 |
-
'interval' =>
|
28 |
-
'display' => __( 'Once Every
|
29 |
-
);
|
30 |
-
return $schedules;
|
31 |
-
}
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
function
|
41 |
-
//require_once( ABSPATH.'wp-content/plugins/woocommerce-abandoned-cart/cron/send_email.php' );
|
42 |
-
$plugin_dir_path = plugin_dir_path( __FILE__ );
|
43 |
-
require_once( $plugin_dir_path . 'cron/
|
44 |
-
}
|
45 |
-
|
46 |
-
function
|
47 |
-
|
48 |
-
|
49 |
-
$
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
$
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
$
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
$
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
$
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
$
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
$
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
$
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
$
|
101 |
-
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
102 |
-
$wpdb->get_results( $
|
103 |
-
|
104 |
-
$
|
105 |
-
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
106 |
-
$wpdb->get_results( $
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
|
1247 |
-
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
|
1818 |
-
|
1819 |
-
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
|
2068 |
-
|
2069 |
-
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
</div>
|
2105 |
-
|
2106 |
-
<
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
2140 |
-
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
|
2244 |
-
|
2245 |
-
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
|
2310 |
-
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
|
2346 |
-
|
2347 |
-
|
2348 |
-
|
2349 |
-
|
2350 |
-
|
2351 |
-
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
2358 |
-
|
2359 |
-
|
2360 |
-
|
2361 |
-
|
2362 |
-
|
2363 |
-
|
2364 |
-
|
2365 |
-
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
-
|
2370 |
-
|
2371 |
-
|
2372 |
-
|
2373 |
-
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
|
2379 |
-
|
2380 |
-
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
2386 |
-
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
|
2392 |
-
|
2393 |
-
|
2394 |
-
|
2395 |
-
|
2396 |
-
|
2397 |
-
|
2398 |
-
|
2399 |
-
|
2400 |
-
|
2401 |
-
|
2402 |
-
|
2403 |
-
|
2404 |
-
|
2405 |
-
|
2406 |
-
|
2407 |
-
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
|
2423 |
-
|
2424 |
-
|
2425 |
-
|
2426 |
-
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
2430 |
-
|
2431 |
-
|
2432 |
-
|
2433 |
-
|
2434 |
-
|
2435 |
-
|
2436 |
-
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
|
2444 |
-
|
2445 |
-
|
2446 |
-
|
2447 |
-
|
2448 |
-
|
2449 |
-
|
2450 |
-
|
2451 |
-
|
2452 |
-
|
2453 |
-
|
2454 |
-
|
2455 |
-
|
2456 |
-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
2465 |
-
|
2466 |
-
|
2467 |
-
|
2468 |
-
|
2469 |
-
|
2470 |
-
|
2471 |
-
|
2472 |
-
|
2473 |
-
|
2474 |
-
|
2475 |
-
|
2476 |
-
|
2477 |
-
|
2478 |
-
|
2479 |
-
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
|
2484 |
-
|
2485 |
-
|
2486 |
-
|
2487 |
-
|
2488 |
-
|
2489 |
-
|
2490 |
-
|
2491 |
-
|
2492 |
-
|
2493 |
-
|
2494 |
-
|
2495 |
-
|
2496 |
-
|
2497 |
-
|
2498 |
-
|
2499 |
-
|
2500 |
-
|
2501 |
-
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
|
2506 |
-
|
2507 |
-
|
2508 |
-
|
2509 |
-
|
2510 |
-
|
2511 |
-
|
2512 |
-
|
2513 |
-
|
2514 |
-
|
2515 |
-
|
2516 |
-
|
2517 |
-
|
2518 |
-
|
2519 |
-
|
2520 |
-
|
2521 |
-
|
2522 |
-
|
2523 |
-
|
2524 |
-
|
2525 |
-
|
2526 |
-
|
2527 |
-
|
2528 |
-
|
2529 |
-
|
2530 |
-
|
2531 |
-
|
2532 |
-
|
2533 |
-
|
2534 |
-
|
2535 |
-
|
2536 |
-
|
2537 |
-
|
2538 |
-
|
2539 |
-
|
2540 |
-
|
2541 |
-
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
|
2546 |
-
|
2547 |
-
|
2548 |
-
|
2549 |
-
|
2550 |
-
|
2551 |
-
|
2552 |
-
|
2553 |
-
|
2554 |
-
|
2555 |
-
|
2556 |
-
|
2557 |
-
|
2558 |
-
|
2559 |
-
|
2560 |
-
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
-
|
2567 |
-
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
2571 |
-
|
2572 |
-
|
2573 |
-
|
2574 |
-
|
2575 |
-
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
2579 |
-
|
2580 |
-
|
2581 |
-
|
2582 |
-
|
2583 |
-
|
2584 |
-
|
2585 |
-
|
2586 |
-
|
2587 |
-
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
|
2600 |
-
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
2611 |
-
|
2612 |
-
|
2613 |
-
|
2614 |
-
|
2615 |
-
|
2616 |
-
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
|
2630 |
-
|
2631 |
-
|
2632 |
-
|
2633 |
-
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
2639 |
-
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
|
2646 |
-
|
2647 |
-
|
2648 |
-
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
2671 |
-
|
2672 |
-
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
|
2677 |
-
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
|
2686 |
-
|
2687 |
-
|
2688 |
-
|
2689 |
-
|
2690 |
-
|
2691 |
-
|
2692 |
-
|
2693 |
-
|
2694 |
-
|
2695 |
-
|
2696 |
-
|
2697 |
-
|
2698 |
-
|
2699 |
-
|
2700 |
-
|
2701 |
-
|
2702 |
-
|
2703 |
-
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
|
2709 |
-
|
2710 |
-
|
2711 |
-
|
2712 |
-
|
2713 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/*
|
3 |
+
Plugin Name: Abandoned Cart Lite for WooCommerce
|
4 |
+
Plugin URI: http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro
|
5 |
+
Description: This plugin captures abandoned carts by logged-in users & emails them about it. <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the PRO Version.</a></strong>
|
6 |
+
Version: 3.4
|
7 |
+
Author: Tyche Softwares
|
8 |
+
Author URI: http://www.tychesoftwares.com/
|
9 |
+
Text Domain: woocommerce-ac
|
10 |
+
Domain Path: /i18n/languages/
|
11 |
+
*/
|
12 |
+
|
13 |
+
// Deletion Settings
|
14 |
+
register_uninstall_hook( __FILE__, 'woocommerce_ac_delete_lite' );
|
15 |
+
|
16 |
+
require_once( "includes/wcal_class-guest.php" );
|
17 |
+
require_once( "includes/wcal_default-settings.php" );
|
18 |
+
require_once( "includes/wcal_actions.php" );
|
19 |
+
require_once( "includes/classes/class-wcal-aes.php" );
|
20 |
+
require_once( "includes/classes/class-wcal-aes-counter.php" );
|
21 |
+
|
22 |
+
// Add a new interval of 15 minutes
|
23 |
+
add_filter( 'cron_schedules', 'wcal_add_cron_schedule' );
|
24 |
+
|
25 |
+
function wcal_add_cron_schedule( $schedules ) {
|
26 |
+
$schedules['15_minutes_lite'] = array(
|
27 |
+
'interval' => 900, // 15 minutes in seconds
|
28 |
+
'display' => __( 'Once Every Fifteen Minutes' ),
|
29 |
+
);
|
30 |
+
return $schedules;
|
31 |
+
}
|
32 |
+
// Schedule an action if it's not already scheduled
|
33 |
+
if ( ! wp_next_scheduled( 'woocommerce_ac_send_email_action' ) ) {
|
34 |
+
wp_schedule_event( time(), '15_minutes_lite', 'woocommerce_ac_send_email_action' );
|
35 |
+
}
|
36 |
+
|
37 |
+
// Hook into that action that'll fire every 15 minutes
|
38 |
+
add_action( 'woocommerce_ac_send_email_action', 'wcal_send_email_cron' );
|
39 |
+
|
40 |
+
function wcal_send_email_cron() {
|
41 |
+
//require_once( ABSPATH.'wp-content/plugins/woocommerce-abandoned-cart/cron/send_email.php' );
|
42 |
+
$plugin_dir_path = plugin_dir_path( __FILE__ );
|
43 |
+
require_once( $plugin_dir_path . 'cron/wcal_send_email.php' );
|
44 |
+
}
|
45 |
+
|
46 |
+
function woocommerce_ac_delete_lite() {
|
47 |
+
global $wpdb;
|
48 |
+
$table_name_ac_abandoned_cart_history = $wpdb->prefix . "ac_abandoned_cart_history_lite";
|
49 |
+
$sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_abandoned_cart_history ;
|
50 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
51 |
+
$wpdb->get_results( $sql_ac_abandoned_cart_history );
|
52 |
+
|
53 |
+
$table_name_ac_email_templates = $wpdb->prefix . "ac_email_templates_lite";
|
54 |
+
$sql_ac_email_templates = "DROP TABLE " . $table_name_ac_email_templates ;
|
55 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
56 |
+
$wpdb->get_results( $sql_ac_email_templates );
|
57 |
+
|
58 |
+
$table_name_ac_sent_history = $wpdb->prefix . "ac_sent_history_lite";
|
59 |
+
$sql_ac_sent_history = "DROP TABLE " . $table_name_ac_sent_history ;
|
60 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
61 |
+
$wpdb->get_results( $sql_ac_sent_history );
|
62 |
+
|
63 |
+
$table_name_ac_guest_abandoned_cart_history = $wpdb->prefix . "ac_guest_abandoned_cart_history_lite";
|
64 |
+
$sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_guest_abandoned_cart_history ;
|
65 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
66 |
+
$wpdb->get_results( $sql_ac_abandoned_cart_history );
|
67 |
+
|
68 |
+
$sql_table_user_meta_cart = "DELETE FROM `" . $wpdb->prefix . "usermeta` WHERE meta_key = '_woocommerce_persistent_cart'";
|
69 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
70 |
+
$wpdb->get_results( $sql_table_user_meta_cart );
|
71 |
+
|
72 |
+
$sql_table_user_meta_cart_modified = "DELETE FROM `" . $wpdb->prefix . "usermeta` WHERE meta_key = '_woocommerce_ac_modified_cart'";
|
73 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
74 |
+
$wpdb->get_results( $sql_table_user_meta_cart_modified );
|
75 |
+
|
76 |
+
$query = "SELECT blog_id FROM `".$wpdb->prefix."blogs`";
|
77 |
+
$results = $wpdb->get_results( $query );
|
78 |
+
|
79 |
+
foreach( $results as $key => $value ) {
|
80 |
+
$table_name_ac_abandoned_cart_history = $wpdb->prefix .$value->blog_id."_"."ac_abandoned_cart_history_lite";
|
81 |
+
$sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_abandoned_cart_history ;
|
82 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
83 |
+
$wpdb->get_results( $sql_ac_abandoned_cart_history );
|
84 |
+
|
85 |
+
$table_name_ac_email_templates = $wpdb->prefix .$value->blog_id."_"."ac_email_templates_lite";
|
86 |
+
$sql_ac_email_templates = "DROP TABLE " . $table_name_ac_email_templates ;
|
87 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
88 |
+
$wpdb->get_results( $sql_ac_email_templates );
|
89 |
+
|
90 |
+
$table_name_ac_sent_history = $wpdb->prefix .$value->blog_id."_"."ac_sent_history_lite";
|
91 |
+
$sql_ac_sent_history = "DROP TABLE " . $table_name_ac_sent_history ;
|
92 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
93 |
+
$wpdb->get_results( $sql_ac_sent_history );
|
94 |
+
|
95 |
+
$table_name_ac_guest_abandoned_cart_history = $wpdb->prefix . "ac_guest_abandoned_cart_history_lite";
|
96 |
+
$sql_ac_abandoned_cart_history = "DROP TABLE " . $table_name_ac_guest_abandoned_cart_history ;
|
97 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
98 |
+
$wpdb->get_results( $sql_ac_abandoned_cart_history );
|
99 |
+
|
100 |
+
$sql_table_user_meta_cart = "DELETE FROM `" . $wpdb->prefix.$value->blog_id."_"."usermeta` WHERE meta_key = '_woocommerce_persistent_cart'";
|
101 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
102 |
+
$wpdb->get_results( $sql_table_user_meta_cart );
|
103 |
+
|
104 |
+
$sql_table_user_meta_cart_modified = "DELETE FROM `" . $wpdb->prefix.$value->blog_id."_"."usermeta` WHERE meta_key = '_woocommerce_ac_modified_cart'";
|
105 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
106 |
+
$wpdb->get_results( $sql_table_user_meta_cart_modified );
|
107 |
+
}
|
108 |
+
delete_option( 'woocommerce_ac_email_body' );
|
109 |
+
delete_option( 'ac_lite_cart_abandoned_time' );
|
110 |
+
delete_option( 'ac_lite_email_admin_on_recovery' );
|
111 |
+
delete_option( 'ac_lite_settings_status' );
|
112 |
+
delete_option( 'woocommerce_ac_default_templates_installed' );
|
113 |
+
delete_option( 'wcal_security_key' );
|
114 |
+
}
|
115 |
+
/**
|
116 |
+
* woocommerce_abandon_cart_lite class
|
117 |
+
**/
|
118 |
+
if( !class_exists( 'woocommerce_abandon_cart_lite' ) ) {
|
119 |
+
|
120 |
+
class woocommerce_abandon_cart_lite {
|
121 |
+
var $one_hour;
|
122 |
+
var $three_hours;
|
123 |
+
var $six_hours;
|
124 |
+
var $twelve_hours;
|
125 |
+
var $one_day;
|
126 |
+
var $one_week;
|
127 |
+
var $duration_range_select = array();
|
128 |
+
var $start_end_dates = array();
|
129 |
+
|
130 |
+
public function __construct() {
|
131 |
+
$this->one_hour = 60 * 60;
|
132 |
+
$this->three_hours = 3 * $this->one_hour;
|
133 |
+
$this->six_hours = 6 * $this->one_hour;
|
134 |
+
$this->twelve_hours = 12 * $this->one_hour;
|
135 |
+
$this->one_day = 24 * $this->one_hour;
|
136 |
+
$this->one_week = 7 * $this->one_day;
|
137 |
+
$this->duration_range_select = array( 'yesterday' => 'Yesterday',
|
138 |
+
'today' => 'Today',
|
139 |
+
'last_seven' => 'Last 7 days',
|
140 |
+
'last_fifteen' => 'Last 15 days',
|
141 |
+
'last_thirty' => 'Last 30 days',
|
142 |
+
'last_ninety' => 'Last 90 days',
|
143 |
+
'last_year_days' => 'Last 365'
|
144 |
+
);
|
145 |
+
|
146 |
+
$this->start_end_dates = array( 'yesterday' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 24*60*60 ) ),
|
147 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) - 7*24*60*60 ) ) ),
|
148 |
+
'today' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ),
|
149 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
150 |
+
'last_seven' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 7*24*60*60 ) ),
|
151 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
152 |
+
'last_fifteen' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 15*24*60*60 ) ),
|
153 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
154 |
+
'last_thirty' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 30*24*60*60 ) ),
|
155 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
156 |
+
'last_ninety' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 90*24*60*60 ) ),
|
157 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) ),
|
158 |
+
'last_year_days' => array( 'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 365*24*60*60 ) ),
|
159 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ) )
|
160 |
+
);
|
161 |
+
|
162 |
+
// Initialize settings
|
163 |
+
register_activation_hook ( __FILE__, array( &$this, 'wcal_activate' ) );
|
164 |
+
|
165 |
+
// WordPress Administration Menu
|
166 |
+
add_action ( 'admin_menu', array( &$this, 'wcal_admin_menu' ) );
|
167 |
+
|
168 |
+
// Actions to be done on cart update
|
169 |
+
add_action ( 'woocommerce_cart_updated', array( &$this, 'wcal_store_cart_timestamp' ) );
|
170 |
+
|
171 |
+
// delete added temp fields after order is placed
|
172 |
+
add_filter ( 'woocommerce_order_details_after_order_table', array( &$this, 'wcal_action_after_delivery_session' ) );
|
173 |
+
|
174 |
+
add_action ( 'admin_init', array( &$this, 'wcal_action_admin_init' ) );
|
175 |
+
|
176 |
+
// Update the options as per settings API
|
177 |
+
add_action ( 'admin_init', array( &$this, 'wcal_update_db_check' ) );
|
178 |
+
|
179 |
+
// Wordpress settings API
|
180 |
+
add_action( 'admin_init', array( &$this, 'wcal_initialize_plugin_options' ) );
|
181 |
+
|
182 |
+
// Language Translation
|
183 |
+
add_action ( 'init', array( &$this, 'wcal_update_po_file' ) );
|
184 |
+
|
185 |
+
// track links
|
186 |
+
add_filter( 'template_include', array( &$this, 'wcal_email_track_links' ), 99, 1 );
|
187 |
+
|
188 |
+
//It will used to unsubcribe the emails.
|
189 |
+
add_action( 'template_include', array( &$this, 'wcal_email_unsubscribe'),99, 1 );
|
190 |
+
|
191 |
+
add_action ( 'admin_enqueue_scripts', array( &$this, 'wcal_enqueue_scripts_js' ) );
|
192 |
+
add_action ( 'admin_enqueue_scripts', array( &$this, 'wcal_enqueue_scripts_css' ) );
|
193 |
+
|
194 |
+
if ( is_admin() ) {
|
195 |
+
// Load "admin-only" scripts here
|
196 |
+
add_action ( 'admin_head', array( &$this, 'wcal_action_send_preview' ) );
|
197 |
+
add_action ( 'wp_ajax_wcal_preview_email_sent', array( &$this, 'wcal_preview_email_sent' ) );
|
198 |
+
}
|
199 |
+
|
200 |
+
// Send Email on order recovery
|
201 |
+
add_action( 'woocommerce_order_status_pending_to_processing_notification', array( &$this, 'wcal_email_admin_recovery' ) );
|
202 |
+
add_action( 'woocommerce_order_status_pending_to_completed_notification', array( &$this, 'wcal_email_admin_recovery' ) );
|
203 |
+
add_action( 'woocommerce_order_status_pending_to_on-hold_notification', array( &$this, 'wcal_email_admin_recovery' ) );
|
204 |
+
add_action( 'woocommerce_order_status_failed_to_processing_notification', array( &$this, 'wcal_email_admin_recovery' ) );
|
205 |
+
add_action( 'woocommerce_order_status_failed_to_completed_notification', array( &$this, 'wcal_email_admin_recovery' ) );
|
206 |
+
|
207 |
+
add_action('woocommerce_order_status_changed', array( &$this, 'wcal_email_admin_recovery_for_paypal' ), 10, 3);
|
208 |
+
|
209 |
+
add_action( 'admin_init', array( $this, 'wcal_preview_emails' ) );
|
210 |
+
add_action( 'init', array( $this, 'wcal_app_output_buffer') );
|
211 |
+
add_action( 'admin_init', array( &$this, 'wcal_check_pro_activated' ) );
|
212 |
+
|
213 |
+
add_action( 'woocommerce_checkout_order_processed', array( &$this, 'wcal_order_placed' ), 10 , 1 );
|
214 |
+
|
215 |
+
add_filter( 'woocommerce_payment_complete_order_status', array( &$this , 'wcal_order_complete_action' ), 10 , 2 );
|
216 |
+
}
|
217 |
+
|
218 |
+
public static function wcal_order_placed( $order_id ) {
|
219 |
+
if( session_id() === '' ) {
|
220 |
+
//session has not started
|
221 |
+
session_start();
|
222 |
+
}
|
223 |
+
|
224 |
+
if ( isset( $_SESSION['email_sent_id'] ) && $_SESSION['email_sent_id'] !='' ) {
|
225 |
+
global $woocommerce, $wpdb;
|
226 |
+
$email_sent_id = $_SESSION['email_sent_id'];
|
227 |
+
$get_ac_id_query = "SELECT abandoned_order_id FROM `" . $wpdb->prefix."ac_sent_history_lite` WHERE id = %d";
|
228 |
+
$get_ac_id_results = $wpdb->get_results( $wpdb->prepare( $get_ac_id_query, $email_sent_id ) );
|
229 |
+
$abandoned_order_id = $get_ac_id_results[0]->abandoned_order_id;
|
230 |
+
|
231 |
+
update_post_meta( $order_id , 'wcal_recover_order_placed', $abandoned_order_id );
|
232 |
+
update_post_meta( $order_id , 'wcal_recover_order_placed_sent_id', $email_sent_id );
|
233 |
+
} else if ( isset( $_SESSION['abandoned_cart_id_lite'] ) && $_SESSION['abandoned_cart_id_lite'] !='' ) {
|
234 |
+
global $woocommerce, $wpdb;
|
235 |
+
$results_sent = array();
|
236 |
+
$abandoned_cart_id = $_SESSION['abandoned_cart_id_lite'];
|
237 |
+
$get_email_sent_for_abandoned_id = "SELECT * FROM `" . $wpdb->prefix . "ac_sent_history_lite` WHERE abandoned_order_id = %d ";
|
238 |
+
$results_sent = $wpdb->get_results ( $wpdb->prepare( $get_email_sent_for_abandoned_id, $abandoned_cart_id ) );
|
239 |
+
if ( empty( $results_sent ) && count( $results_sent ) == 0 ) {
|
240 |
+
/*
|
241 |
+
* If logeged in user place the order once it isdisplyed under the abandoned orders tab.
|
242 |
+
* But the email has been not sent to the user. And order is placed successfuly
|
243 |
+
* Then We are deleteing those order. But for those orders Recovered email has been set to the Admin.
|
244 |
+
* Below code ensure that admin recovery email will not be sent for those orders.
|
245 |
+
*/
|
246 |
+
$get_user_id_of_abandoned_cart = "SELECT * FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE id = %d ";
|
247 |
+
$get_results_of_user_id = $wpdb->get_results ( $wpdb->prepare( $get_user_id_of_abandoned_cart, $abandoned_cart_id ) );
|
248 |
+
$user_id = $get_results_of_user_id[0]->user_id;
|
249 |
+
delete_user_meta( $user_id, '_woocommerce_ac_modified_cart' );
|
250 |
+
/*
|
251 |
+
* It will delete the order from history table if the order is placed before any email sent to the user.
|
252 |
+
*
|
253 |
+
*/
|
254 |
+
$table_name = $wpdb->prefix . 'ac_abandoned_cart_history_lite';
|
255 |
+
$wpdb->delete( $table_name , array( 'id' => $abandoned_cart_id ) );
|
256 |
+
} else {
|
257 |
+
$email_sent_id = $results_sent[0]->id;
|
258 |
+
update_post_meta( $order_id , 'wcal_recover_order_placed', $abandoned_cart_id );
|
259 |
+
update_post_meta( $order_id , 'wcal_recover_order_placed_sent_id', $email_sent_id );
|
260 |
+
}
|
261 |
+
}
|
262 |
+
}
|
263 |
+
|
264 |
+
public function wcal_order_complete_action( $order_status, $order_id ) {
|
265 |
+
if ( 'failed' != $order_status ) {
|
266 |
+
global $woocommerce, $wpdb;
|
267 |
+
$order = new WC_Order( $order_id );
|
268 |
+
$get_abandoned_id_of_order = '';
|
269 |
+
$get_sent_email_id_of_order = '';
|
270 |
+
$get_abandoned_id_of_order = get_post_meta( $order_id, 'wcal_recover_order_placed', true );
|
271 |
+
|
272 |
+
if ( isset( $get_abandoned_id_of_order ) && $get_abandoned_id_of_order != '' ){
|
273 |
+
$get_abandoned_id_of_order = get_post_meta( $order_id, 'wcal_recover_order_placed', true );
|
274 |
+
$get_sent_email_id_of_order = get_post_meta( $order_id, 'wcal_recover_order_placed_sent_id', true );
|
275 |
+
|
276 |
+
$query_order = "UPDATE `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` SET recovered_cart= '" . $order_id . "', cart_ignored = '1'
|
277 |
+
WHERE id = '".$get_abandoned_id_of_order."' ";
|
278 |
+
$wpdb->query( $query_order );
|
279 |
+
|
280 |
+
$order->add_order_note( __( 'This order was abandoned & subsequently recovered.', 'woocommerce-ac' ) );
|
281 |
+
|
282 |
+
delete_post_meta( $order_id, 'wcal_recover_order_placed', $get_abandoned_id_of_order );
|
283 |
+
delete_post_meta( $order_id, 'wcal_recover_order_placed_sent_id', $get_sent_email_id_of_order );
|
284 |
+
delete_post_meta( $order_id, 'wcap_recovered_email_sent', 'yes' );
|
285 |
+
}
|
286 |
+
}
|
287 |
+
return $order_status;
|
288 |
+
}
|
289 |
+
|
290 |
+
/**
|
291 |
+
* Check If Pro is activated along with Lite version.
|
292 |
+
*/
|
293 |
+
public static function wcal_check_pro_activated() {
|
294 |
+
if( is_plugin_active( 'woocommerce-abandon-cart-pro/woocommerce-ac.php' ) && class_exists( 'woocommerce_abandon_cart' ) ) {
|
295 |
+
add_action( 'admin_notices', array( 'woocommerce_abandon_cart_lite', 'wcal_check_pro_notice' ) );
|
296 |
+
}
|
297 |
+
}
|
298 |
+
|
299 |
+
/**
|
300 |
+
* Display a notice in the admin Plugins page if the LITE version is
|
301 |
+
* activated with PRO version is activated.
|
302 |
+
*/
|
303 |
+
public static function wcal_check_pro_notice() {
|
304 |
+
$class = 'notice notice-error is-dismissible';
|
305 |
+
$message = __( 'The Lite & Pro version of Abandoned Cart plugin for WooCommerce (from Tyche Softwares) are active on your website. <br> In this case, the abandoned carts will be captured in both plugins & email reminders will also be sent from both plugins. <br> It is recommended that you deactivate the Lite version & keep the Pro version active.', 'woocommerce-ac' );
|
306 |
+
printf( '<div class="%1$s"><p>%2$s</p></div>', $class, $message );
|
307 |
+
}
|
308 |
+
|
309 |
+
/*-----------------------------------------------------------------------------------*/
|
310 |
+
/* Class Functions */
|
311 |
+
/*-----------------------------------------------------------------------------------*/
|
312 |
+
/**
|
313 |
+
* Preview email template
|
314 |
+
*
|
315 |
+
* @return string
|
316 |
+
*/
|
317 |
+
public function wcal_preview_emails() {
|
318 |
+
global $woocommerce;
|
319 |
+
if( isset( $_GET['wcal_preview_woocommerce_mail'] ) ) {
|
320 |
+
if( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-ac') ) {
|
321 |
+
die( 'Security check' );
|
322 |
+
}
|
323 |
+
$message = '';
|
324 |
+
// create a new email
|
325 |
+
if( $woocommerce->version < '2.3' ) {
|
326 |
+
global $email_heading;
|
327 |
+
ob_start();
|
328 |
+
|
329 |
+
include( 'views/wcal-wc-email-template-preview.php' );
|
330 |
+
$mailer = WC()->mailer();
|
331 |
+
$message = ob_get_clean();
|
332 |
+
$email_heading = __( 'HTML Email Template', 'woocommerce' );
|
333 |
+
$message = $mailer->wrap_message( $email_heading, $message );
|
334 |
+
} else {
|
335 |
+
// load the mailer class
|
336 |
+
$mailer = WC()->mailer();
|
337 |
+
// get the preview email subject
|
338 |
+
$email_heading = __( 'Abandoned cart Email Template', 'woocommerce-ac' );
|
339 |
+
// get the preview email content
|
340 |
+
ob_start();
|
341 |
+
include( 'views/wcal-wc-email-template-preview.php' );
|
342 |
+
$message = ob_get_clean();
|
343 |
+
// create a new email
|
344 |
+
$email = new WC_Email();
|
345 |
+
// wrap the content with the email template and then add styles
|
346 |
+
$message = $email->style_inline( $mailer->wrap_message( $email_heading, $message ) );
|
347 |
+
}
|
348 |
+
echo $message;
|
349 |
+
exit;
|
350 |
+
}
|
351 |
+
|
352 |
+
if ( isset( $_GET['wcal_preview_mail'] ) ) {
|
353 |
+
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-ac') ) {
|
354 |
+
die( 'Security check' );
|
355 |
+
}
|
356 |
+
// get the preview email content
|
357 |
+
ob_start();
|
358 |
+
include( 'views/wcal-email-template-preview.php' );
|
359 |
+
$message = ob_get_clean();
|
360 |
+
// print the preview email
|
361 |
+
echo $message;
|
362 |
+
exit;
|
363 |
+
}
|
364 |
+
}
|
365 |
+
// Language Translation
|
366 |
+
function wcal_update_po_file() {
|
367 |
+
$domain = 'woocommerce-ac';
|
368 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
369 |
+
if ( $loaded = load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '-' . $locale . '.mo' ) ) {
|
370 |
+
return $loaded;
|
371 |
+
} else {
|
372 |
+
load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/i18n/languages/' );
|
373 |
+
}
|
374 |
+
}
|
375 |
+
|
376 |
+
/*-----------------------------------------------------------------------------------*/
|
377 |
+
/* Class Functions */
|
378 |
+
/*-----------------------------------------------------------------------------------*/
|
379 |
+
function wcal_activate() {
|
380 |
+
global $wpdb;
|
381 |
+
$wcap_collate = '';
|
382 |
+
if ( $wpdb->has_cap( 'collation' ) ) {
|
383 |
+
$wcap_collate = $wpdb->get_charset_collate();
|
384 |
+
}
|
385 |
+
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
386 |
+
$sql = "CREATE TABLE IF NOT EXISTS $table_name (
|
387 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
388 |
+
`subject` text COLLATE utf8_unicode_ci NOT NULL,
|
389 |
+
`body` mediumtext COLLATE utf8_unicode_ci NOT NULL,
|
390 |
+
`is_active` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
|
391 |
+
`frequency` int(11) NOT NULL,
|
392 |
+
`day_or_hour` enum('Days','Hours') COLLATE utf8_unicode_ci NOT NULL,
|
393 |
+
`template_name` text COLLATE utf8_unicode_ci NOT NULL,
|
394 |
+
`from_name` text COLLATE utf8_unicode_ci NOT NULL,
|
395 |
+
PRIMARY KEY (`id`)
|
396 |
+
) $wcap_collate AUTO_INCREMENT=1 ";
|
397 |
+
|
398 |
+
require_once ( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
399 |
+
dbDelta( $sql );
|
400 |
+
|
401 |
+
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
402 |
+
$check_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'is_wc_template' ";
|
403 |
+
$results = $wpdb->get_results( $check_template_table_query );
|
404 |
+
|
405 |
+
if ( count( $results ) == 0 ) {
|
406 |
+
$alter_template_table_query = "ALTER TABLE $table_name
|
407 |
+
ADD COLUMN `is_wc_template` enum('0','1') COLLATE utf8_unicode_ci NOT NULL AFTER `from_name`,
|
408 |
+
ADD COLUMN `default_template` int(11) NOT NULL AFTER `is_wc_template`";
|
409 |
+
|
410 |
+
$wpdb->get_results( $alter_template_table_query );
|
411 |
+
}
|
412 |
+
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
413 |
+
$check_email_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'reply_email' ";
|
414 |
+
$results_email = $wpdb->get_results( $check_email_template_table_query );
|
415 |
+
|
416 |
+
if ( count( $results_email ) == 0 ) {
|
417 |
+
$alter_email_template_table_query = "ALTER TABLE $table_name
|
418 |
+
ADD COLUMN `reply_email` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `default_template`,
|
419 |
+
ADD COLUMN `from_email` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `reply_email`";
|
420 |
+
$wpdb->get_results( $alter_email_template_table_query );
|
421 |
+
}
|
422 |
+
|
423 |
+
$sent_table_name = $wpdb->prefix . "ac_sent_history_lite";
|
424 |
+
|
425 |
+
$sql_query = "CREATE TABLE IF NOT EXISTS $sent_table_name (
|
426 |
+
`id` int(11) NOT NULL auto_increment,
|
427 |
+
`template_id` varchar(40) collate utf8_unicode_ci NOT NULL,
|
428 |
+
`abandoned_order_id` int(11) NOT NULL,
|
429 |
+
`sent_time` datetime NOT NULL,
|
430 |
+
`sent_email_id` text COLLATE utf8_unicode_ci NOT NULL,
|
431 |
+
PRIMARY KEY (`id`)
|
432 |
+
) $wcap_collate AUTO_INCREMENT=1 ";
|
433 |
+
|
434 |
+
require_once ( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
435 |
+
dbDelta ( $sql_query );
|
436 |
+
|
437 |
+
$ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history_lite";
|
438 |
+
|
439 |
+
$history_query = "CREATE TABLE IF NOT EXISTS $ac_history_table_name (
|
440 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
441 |
+
`user_id` int(11) NOT NULL,
|
442 |
+
`abandoned_cart_info` text COLLATE utf8_unicode_ci NOT NULL,
|
443 |
+
`abandoned_cart_time` int(11) NOT NULL,
|
444 |
+
`cart_ignored` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
|
445 |
+
`recovered_cart` int(11) NOT NULL,
|
446 |
+
PRIMARY KEY (`id`)
|
447 |
+
) $wcap_collate";
|
448 |
+
|
449 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
450 |
+
dbDelta( $history_query );
|
451 |
+
|
452 |
+
// Default templates: function call to create default templates.
|
453 |
+
$check_table_empty = $wpdb->get_var( "SELECT COUNT(*) FROM `" . $wpdb->prefix . "ac_email_templates_lite`" );
|
454 |
+
|
455 |
+
if( !get_option( 'woocommerce_ac_default_templates_installed' ) ) {
|
456 |
+
if( 0 == $check_table_empty ) {
|
457 |
+
$default_template = new wcal_default_template_settings;
|
458 |
+
$default_template->wcal_create_default_templates();
|
459 |
+
update_option( 'woocommerce_ac_default_templates_installed', "yes" );
|
460 |
+
}
|
461 |
+
}
|
462 |
+
}
|
463 |
+
|
464 |
+
/***************************************************************
|
465 |
+
* WP Settings API
|
466 |
+
**************************************************************/
|
467 |
+
function wcal_initialize_plugin_options() {
|
468 |
+
// First, we register a section. This is necessary since all future options must belong to a
|
469 |
+
add_settings_section(
|
470 |
+
'ac_lite_general_settings_section', // ID used to identify this section and with which to register options
|
471 |
+
__( 'Settings', 'woocommerce-ac' ), // Title to be displayed on the administration page
|
472 |
+
array($this, 'ac_lite_general_options_callback' ), // Callback used to render the description of the section
|
473 |
+
'woocommerce_ac_page' // Page on which to add this section of options
|
474 |
+
);
|
475 |
+
|
476 |
+
add_settings_field(
|
477 |
+
'ac_lite_cart_abandoned_time',
|
478 |
+
__( 'Cart abandoned cut-off time', 'woocommerce-ac' ),
|
479 |
+
array( $this, 'ac_lite_cart_abandoned_time_callback' ),
|
480 |
+
'woocommerce_ac_page',
|
481 |
+
'ac_lite_general_settings_section',
|
482 |
+
array( __( 'Consider cart abandoned after X minutes of item being added to cart & order not placed.', 'woocommerce-ac' ) )
|
483 |
+
);
|
484 |
+
|
485 |
+
add_settings_field(
|
486 |
+
'ac_lite_email_admin_on_recovery',
|
487 |
+
__( 'Email admin On Order Recovery', 'woocommerce-ac' ),
|
488 |
+
array( $this, 'ac_lite_email_admin_on_recovery' ),
|
489 |
+
'woocommerce_ac_page',
|
490 |
+
'ac_lite_general_settings_section',
|
491 |
+
array( __( 'Sends email to Admin if an Abandoned Cart Order is recovered.', 'woocommerce-ac' ) )
|
492 |
+
);
|
493 |
+
|
494 |
+
// Finally, we register the fields with WordPress
|
495 |
+
register_setting(
|
496 |
+
'woocommerce_ac_settings',
|
497 |
+
'ac_lite_cart_abandoned_time',
|
498 |
+
array ( $this, 'ac_lite_cart_time_validation' )
|
499 |
+
);
|
500 |
+
|
501 |
+
register_setting(
|
502 |
+
'woocommerce_ac_settings',
|
503 |
+
'ac_lite_email_admin_on_recovery'
|
504 |
+
);
|
505 |
+
}
|
506 |
+
|
507 |
+
/***************************************************************
|
508 |
+
* WP Settings API callback for section
|
509 |
+
**************************************************************/
|
510 |
+
function ac_lite_general_options_callback() {
|
511 |
+
|
512 |
+
}
|
513 |
+
|
514 |
+
/***************************************************************
|
515 |
+
* WP Settings API callback for cart time field
|
516 |
+
**************************************************************/
|
517 |
+
function ac_lite_cart_abandoned_time_callback( $args ) {
|
518 |
+
// First, we read the option
|
519 |
+
$cart_abandoned_time = get_option( 'ac_lite_cart_abandoned_time' );
|
520 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
521 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
522 |
+
printf(
|
523 |
+
'<input type="text" id="ac_lite_cart_abandoned_time" name="ac_lite_cart_abandoned_time" value="%s" />',
|
524 |
+
isset( $cart_abandoned_time ) ? esc_attr( $cart_abandoned_time ) : ''
|
525 |
+
);
|
526 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
527 |
+
$html = '<label for="ac_lite_cart_abandoned_time"> ' . $args[0] . '</label>';
|
528 |
+
echo $html;
|
529 |
+
}
|
530 |
+
|
531 |
+
/***************************************************************
|
532 |
+
* WP Settings API cart time field validation
|
533 |
+
**************************************************************/
|
534 |
+
function ac_lite_cart_time_validation( $input ) {
|
535 |
+
$output = '';
|
536 |
+
if ( $input != '' && ( is_numeric( $input) && $input > 0 ) ) {
|
537 |
+
$output = stripslashes( $input) ;
|
538 |
+
} else {
|
539 |
+
add_settings_error( 'ac_lite_cart_abandoned_time', 'error found', __( 'Abandoned cart cut off time should be numeric and has to be greater than 0.', 'woocommerce-ac' ) );
|
540 |
+
}
|
541 |
+
return $output;
|
542 |
+
}
|
543 |
+
|
544 |
+
/***************************************************************
|
545 |
+
* WP Settings API callback for email admin on cart recovery field
|
546 |
+
**************************************************************/
|
547 |
+
function ac_lite_email_admin_on_recovery( $args ) {
|
548 |
+
// First, we read the option
|
549 |
+
$email_admin_on_recovery = get_option( 'ac_lite_email_admin_on_recovery' );
|
550 |
+
|
551 |
+
// This condition added to avoid the notie displyed while Check box is unchecked.
|
552 |
+
if( isset( $email_admin_on_recovery ) && $email_admin_on_recovery == '' ) {
|
553 |
+
$email_admin_on_recovery = 'off';
|
554 |
+
}
|
555 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
556 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
557 |
+
$html='';
|
558 |
+
printf(
|
559 |
+
'<input type="checkbox" id="ac_lite_email_admin_on_recovery" name="ac_lite_email_admin_on_recovery" value="on"
|
560 |
+
' . checked('on', $email_admin_on_recovery, false).' />'
|
561 |
+
);
|
562 |
+
|
563 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
564 |
+
$html .= '<label for="ac_lite_email_admin_on_recovery"> ' . $args[0] . '</label>';
|
565 |
+
echo $html;
|
566 |
+
}
|
567 |
+
|
568 |
+
/**************************************************
|
569 |
+
* This function is run when the plugin is upgraded
|
570 |
+
*************************************************/
|
571 |
+
function wcal_update_db_check() {
|
572 |
+
global $wpdb;
|
573 |
+
$wcap_collate = '';
|
574 |
+
if ( $wpdb->has_cap( 'collation' ) ) {
|
575 |
+
$wcap_collate = $wpdb->get_charset_collate();
|
576 |
+
}
|
577 |
+
if( get_option( 'ac_lite_delete_alter_table_queries' ) != 'yes' ) {
|
578 |
+
update_option( 'ac_lite_alter_table_queries', '' );
|
579 |
+
update_option( 'ac_lite_delete_alter_table_queries', 'yes' );
|
580 |
+
}
|
581 |
+
if( get_option( 'ac_lite_alter_table_queries' ) != 'yes' ) {
|
582 |
+
if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_email_templates'" ) === $wpdb->prefix . 'ac_email_templates' ) {
|
583 |
+
$old_table_name = $wpdb->prefix . "ac_email_templates";
|
584 |
+
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
585 |
+
|
586 |
+
$alter_ac_email_table_query = "ALTER TABLE $old_table_name
|
587 |
+
RENAME TO $table_name";
|
588 |
+
$wpdb->get_results ( $alter_ac_email_table_query );
|
589 |
+
}
|
590 |
+
|
591 |
+
if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_sent_history'" ) === $wpdb->prefix . 'ac_sent_history' ) {
|
592 |
+
$old_sent_table_name = $wpdb->prefix . "ac_sent_history";
|
593 |
+
$sent_table_name = $wpdb->prefix . "ac_sent_history_lite";
|
594 |
+
$alter_ac_sent_history_table_query = "ALTER TABLE $old_sent_table_name
|
595 |
+
RENAME TO $sent_table_name";
|
596 |
+
$wpdb->get_results ( $alter_ac_sent_history_table_query );
|
597 |
+
}
|
598 |
+
|
599 |
+
if( $wpdb->get_var( "SHOW TABLES LIKE '" . $wpdb->prefix . "ac_abandoned_cart_history'" ) === $wpdb->prefix . 'ac_abandoned_cart_history' ) {
|
600 |
+
$old_ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history";
|
601 |
+
$ac_history_table_name = $wpdb->prefix . "ac_abandoned_cart_history_lite";
|
602 |
+
|
603 |
+
$alter_ac_abandoned_cart_history_table_query = "ALTER TABLE $old_ac_history_table_name
|
604 |
+
RENAME TO $ac_history_table_name";
|
605 |
+
$wpdb->get_results ( $alter_ac_abandoned_cart_history_table_query );
|
606 |
+
}
|
607 |
+
update_option( 'ac_lite_alter_table_queries', 'yes' );
|
608 |
+
}
|
609 |
+
|
610 |
+
$ac_history_table_name = $wpdb->prefix."ac_abandoned_cart_history_lite";
|
611 |
+
$check_table_query = "SHOW COLUMNS FROM $ac_history_table_name LIKE 'user_type'";
|
612 |
+
$results = $wpdb->get_results( $check_table_query );
|
613 |
+
|
614 |
+
if ( count( $results ) == 0 ) {
|
615 |
+
$alter_table_query = "ALTER TABLE $ac_history_table_name ADD `user_type` text AFTER `recovered_cart`";
|
616 |
+
$wpdb->get_results( $alter_table_query );
|
617 |
+
}
|
618 |
+
|
619 |
+
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
620 |
+
$check_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'is_wc_template' ";
|
621 |
+
$results = $wpdb->get_results( $check_template_table_query );
|
622 |
+
|
623 |
+
if ( count( $results ) == 0 ) {
|
624 |
+
$alter_template_table_query = "ALTER TABLE $table_name
|
625 |
+
ADD COLUMN `is_wc_template` enum('0','1') COLLATE utf8_unicode_ci NOT NULL AFTER `from_name`,
|
626 |
+
ADD COLUMN `default_template` int(11) NOT NULL AFTER `is_wc_template`";
|
627 |
+
$wpdb->get_results( $alter_template_table_query );
|
628 |
+
}
|
629 |
+
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
630 |
+
$check_email_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'reply_email' ";
|
631 |
+
$results_email = $wpdb->get_results( $check_email_template_table_query );
|
632 |
+
|
633 |
+
if ( count( $results_email ) == 0 ) {
|
634 |
+
$alter_email_template_table_query = "ALTER TABLE $table_name
|
635 |
+
ADD COLUMN `reply_email` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `default_template`,
|
636 |
+
ADD COLUMN `from_email` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `reply_email`";
|
637 |
+
$wpdb->get_results( $alter_email_template_table_query );
|
638 |
+
}
|
639 |
+
|
640 |
+
$table_name = $wpdb->prefix . "ac_email_templates_lite";
|
641 |
+
$check_email_template_table_query = "SHOW COLUMNS FROM $table_name LIKE 'wc_email_header' ";
|
642 |
+
$results_email = $wpdb->get_results( $check_email_template_table_query );
|
643 |
+
|
644 |
+
if ( count( $results_email ) == 0 ) {
|
645 |
+
$alter_email_template_table_query = "ALTER TABLE $table_name
|
646 |
+
ADD COLUMN `wc_email_header` varchar(50) COLLATE utf8_unicode_ci NOT NULL AFTER `from_email`";
|
647 |
+
$wpdb->get_results( $alter_email_template_table_query );
|
648 |
+
}
|
649 |
+
|
650 |
+
$guest_table = $wpdb->prefix."ac_guest_abandoned_cart_history_lite" ;
|
651 |
+
$query_guest_table = "SHOW TABLES LIKE '$guest_table' ";
|
652 |
+
$result_guest_table = $wpdb->get_results( $query_guest_table );
|
653 |
+
|
654 |
+
if ( count( $result_guest_table ) == 0 ) {
|
655 |
+
|
656 |
+
$ac_guest_history_table_name = $wpdb->prefix . "ac_guest_abandoned_cart_history_lite";
|
657 |
+
$ac_guest_history_query = "CREATE TABLE IF NOT EXISTS $ac_guest_history_table_name (
|
658 |
+
`id` int(15) NOT NULL AUTO_INCREMENT,
|
659 |
+
`billing_first_name` text,
|
660 |
+
`billing_last_name` text,
|
661 |
+
`billing_company_name` text,
|
662 |
+
`billing_address_1` text,
|
663 |
+
`billing_address_2` text,
|
664 |
+
`billing_city` text,
|
665 |
+
`billing_county` text,
|
666 |
+
`billing_zipcode` text,
|
667 |
+
`email_id` text,
|
668 |
+
`phone` text,
|
669 |
+
`ship_to_billing` text,
|
670 |
+
`order_notes` text,
|
671 |
+
`shipping_first_name` text,
|
672 |
+
`shipping_last_name` text,
|
673 |
+
`shipping_company_name` text,
|
674 |
+
`shipping_address_1` text,
|
675 |
+
`shipping_address_2` text,
|
676 |
+
`shipping_city` text,
|
677 |
+
`shipping_county` text,
|
678 |
+
`shipping_zipcode` double,
|
679 |
+
`shipping_charges` double,
|
680 |
+
PRIMARY KEY (`id`)
|
681 |
+
) $wcap_collate AUTO_INCREMENT=63000000";
|
682 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
|
683 |
+
$wpdb->query( $ac_guest_history_query );
|
684 |
+
}
|
685 |
+
//get the option, if it is not set to individual then convert to individual records and delete the base record
|
686 |
+
$ac_settings = get_option( 'ac_lite_settings_status' );
|
687 |
+
if ( $ac_settings != 'INDIVIDUAL' ) {
|
688 |
+
//fetch the existing settings and save them as inidividual to be used for the settings API
|
689 |
+
$woocommerce_ac_settings = json_decode( get_option( 'woocommerce_ac_settings' ) );
|
690 |
+
if( isset( $woocommerce_ac_settings[0]->cart_time ) ) {
|
691 |
+
add_option( 'ac_lite_cart_abandoned_time', $woocommerce_ac_settings[0]->cart_time );
|
692 |
+
} else {
|
693 |
+
add_option( 'ac_lite_cart_abandoned_time', '60' );
|
694 |
+
}
|
695 |
+
|
696 |
+
if( isset( $woocommerce_ac_settings[0]->email_admin ) ) {
|
697 |
+
add_option( 'ac_lite_email_admin_on_recovery', $woocommerce_ac_settings[0]->email_admin );
|
698 |
+
} else {
|
699 |
+
add_option( 'ac_lite_email_admin_on_recovery', "" );
|
700 |
+
}
|
701 |
+
update_option( 'ac_lite_settings_status', 'INDIVIDUAL' );
|
702 |
+
//Delete the main settings record
|
703 |
+
delete_option( 'woocommerce_ac_settings' );
|
704 |
+
}
|
705 |
+
if ( !get_option( 'wcal_security_key' ) ){
|
706 |
+
update_option( 'wcal_security_key', 'qJB0rGtIn5UB1xG03efyCp' );
|
707 |
+
}
|
708 |
+
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_abandoned_cart_history_lite';" ) ) {
|
709 |
+
if ( ! $wpdb->get_var( "SHOW COLUMNS FROM `{$wpdb->prefix}ac_abandoned_cart_history_lite` LIKE 'unsubscribe_link';" ) ) {
|
710 |
+
$wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_abandoned_cart_history_lite ADD `unsubscribe_link` enum('0','1') COLLATE utf8_unicode_ci NOT NULL AFTER `user_type`;" );
|
711 |
+
}
|
712 |
+
}
|
713 |
+
/*
|
714 |
+
* This is used to prevent guest users wrong Id. If guest users id is less then 63000000 then this code will ensure that we will change the id of guest tables so it wont affect on the next guest users.
|
715 |
+
*/
|
716 |
+
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}ac_guest_abandoned_cart_history_lite';" ) && 'yes' != get_option( 'wcal_guest_user_id_altered' ) ) {
|
717 |
+
$last_id = $wpdb->get_var( "SELECT max(id) FROM `{$wpdb->prefix}ac_guest_abandoned_cart_history_lite`;" );
|
718 |
+
if ( NULL != $last_id && $last_id <= 63000000 ) {
|
719 |
+
$wpdb->query( "ALTER TABLE {$wpdb->prefix}ac_guest_abandoned_cart_history_lite AUTO_INCREMENT = 63000000;" );
|
720 |
+
update_option ( 'wcal_guest_user_id_altered', 'yes' );
|
721 |
+
}
|
722 |
+
}
|
723 |
+
}
|
724 |
+
|
725 |
+
/******
|
726 |
+
* Send email to admin when cart is recovered only via PayPal.
|
727 |
+
* @since 2.9 version
|
728 |
+
*/
|
729 |
+
public static function wcal_email_admin_recovery_for_paypal ( $order_id, $old, $new_status ) {
|
730 |
+
if ( 'pending' == $old && 'processing' == $new_status ) {
|
731 |
+
$user_id = get_current_user_id();
|
732 |
+
$ac_email_admin_recovery = get_option( 'ac_lite_email_admin_on_recovery' );
|
733 |
+
$order = new WC_Order( $order_id );
|
734 |
+
$user_id = $order->user_id;
|
735 |
+
|
736 |
+
if( $ac_email_admin_recovery == 'on' ) {
|
737 |
+
$recovered_email_sent = get_post_meta( $order_id, 'wcap_recovered_email_sent', true );
|
738 |
+
$check_abandoned_cart = get_user_meta( $user_id, '_woocommerce_ac_modified_cart', true );
|
739 |
+
$created_via = get_post_meta ( $order_id, '_created_via', true );
|
740 |
+
|
741 |
+
// mention here why are we comparing both "yes" and "no" values
|
742 |
+
if ( 'checkout' == $created_via && 'yes' != $recovered_email_sent && ( $check_abandoned_cart == md5( "yes" ) || $check_abandoned_cart == md5( "no" ) ) ) { // indicates cart is abandoned
|
743 |
+
$order = new WC_Order( $order_id );
|
744 |
+
$email_heading = __( 'New Customer Order - Recovered', 'woocommerce' );
|
745 |
+
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
746 |
+
$email_subject = "New Customer Order - Recovered";
|
747 |
+
$user_email = get_option( 'admin_email' );
|
748 |
+
$headers[] = "From: Admin <".$user_email.">";
|
749 |
+
$headers[] = "Content-Type: text/html";
|
750 |
+
// Buffer
|
751 |
+
ob_start();
|
752 |
+
// Get mail template
|
753 |
+
woocommerce_get_template( 'emails/admin-new-order.php', array(
|
754 |
+
'order' => $order,
|
755 |
+
'email_heading' => $email_heading,
|
756 |
+
'sent_to_admin' => false,
|
757 |
+
'plain_text' => false,
|
758 |
+
'email' => true
|
759 |
+
)
|
760 |
+
);
|
761 |
+
// Get contents
|
762 |
+
$email_body = ob_get_clean();
|
763 |
+
woocommerce_mail( $user_email, $email_subject, $email_body, $headers );
|
764 |
+
update_post_meta( $order_id, 'wcap_recovered_email_sent', 'yes' );
|
765 |
+
}
|
766 |
+
}
|
767 |
+
}
|
768 |
+
}
|
769 |
+
|
770 |
+
/******
|
771 |
+
* Send email to admin when cart is recovered via any other payment gateway other than PayPal.
|
772 |
+
* @since 2.3 version
|
773 |
+
*/
|
774 |
+
function wcal_email_admin_recovery ( $order_id ) {
|
775 |
+
$user_id = get_current_user_id();
|
776 |
+
$ac_email_admin_recovery = get_option( 'ac_lite_email_admin_on_recovery' );
|
777 |
+
if( $ac_email_admin_recovery == 'on' ) {
|
778 |
+
$order = new WC_Order( $order_id );
|
779 |
+
$user_id = $order->user_id;
|
780 |
+
$recovered_email_sent = get_post_meta( $order_id, 'wcap_recovered_email_sent', true );
|
781 |
+
$check_abandoned_cart = get_user_meta( $user_id, '_woocommerce_ac_modified_cart', true );
|
782 |
+
$created_via = get_post_meta( $order_id, '_created_via', true );
|
783 |
+
if ( 'checkout' == $created_via && 'yes' != $recovered_email_sent && ( $check_abandoned_cart == md5( "yes" ) || $check_abandoned_cart == md5( "no" ) ) ) { // indicates cart is abandoned
|
784 |
+
$email_heading = __( 'New Customer Order - Recovered', 'woocommerce-ac' );
|
785 |
+
$blogname = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES );
|
786 |
+
$email_subject = "New Customer Order - Recovered";
|
787 |
+
$user_email = get_option( 'admin_email' );
|
788 |
+
$headers[] = "From: Admin <".$user_email.">";
|
789 |
+
$headers[] = "Content-Type: text/html";
|
790 |
+
// Buffer
|
791 |
+
ob_start();
|
792 |
+
// Get mail template
|
793 |
+
woocommerce_get_template( 'emails/admin-new-order.php', array(
|
794 |
+
'order' => $order,
|
795 |
+
'email_heading' => $email_heading,
|
796 |
+
'sent_to_admin' => false,
|
797 |
+
'plain_text' => false,
|
798 |
+
'email' => true
|
799 |
+
) );
|
800 |
+
// Get contents
|
801 |
+
$email_body = ob_get_clean();
|
802 |
+
woocommerce_mail( $user_email, $email_subject, $email_body, $headers );
|
803 |
+
|
804 |
+
update_post_meta( $order_id, 'wcap_recovered_email_sent', 'yes' );
|
805 |
+
}
|
806 |
+
}
|
807 |
+
}
|
808 |
+
|
809 |
+
// Add a submenu page.
|
810 |
+
function wcal_admin_menu() {
|
811 |
+
$page = add_submenu_page ( 'woocommerce', __( 'Abandoned Carts', 'woocommerce-ac' ), __( 'Abandoned Carts', 'woocommerce-ac' ), 'manage_woocommerce', 'woocommerce_ac_page', array( &$this, 'wcal_menu_page' ) );
|
812 |
+
}
|
813 |
+
|
814 |
+
// Capture the cart and insert the information of the cart into DataBase
|
815 |
+
function wcal_store_cart_timestamp() {
|
816 |
+
|
817 |
+
if( session_id() === '' ){
|
818 |
+
//session has not started
|
819 |
+
session_start();
|
820 |
+
}
|
821 |
+
global $wpdb,$woocommerce;
|
822 |
+
$current_time = current_time( 'timestamp' );
|
823 |
+
$cut_off_time = get_option( 'ac_lite_cart_abandoned_time' );
|
824 |
+
$cart_ignored = 0;
|
825 |
+
$recovered_cart = 0;
|
826 |
+
if( isset( $cut_off_time ) ) {
|
827 |
+
$cart_cut_off_time = $cut_off_time * 60;
|
828 |
+
} else {
|
829 |
+
$cart_cut_off_time = 60 * 60;
|
830 |
+
}
|
831 |
+
$compare_time = $current_time - $cart_cut_off_time;
|
832 |
+
|
833 |
+
if ( is_user_logged_in() ) {
|
834 |
+
$user_id = get_current_user_id();
|
835 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
836 |
+
WHERE user_id = %d
|
837 |
+
AND cart_ignored = %s
|
838 |
+
AND recovered_cart = %d ";
|
839 |
+
$results = $wpdb->get_results($wpdb->prepare( $query, $user_id, $cart_ignored, $recovered_cart ) );
|
840 |
+
|
841 |
+
if ( count($results) == 0 ) {
|
842 |
+
$cart_info = json_encode( get_user_meta( $user_id, '_woocommerce_persistent_cart', true ) );
|
843 |
+
$user_type = "REGISTERED";
|
844 |
+
$insert_query = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
845 |
+
( user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored, user_type )
|
846 |
+
VALUES ( %d, %s, %d, %s, %s )";
|
847 |
+
$wpdb->query( $wpdb->prepare( $insert_query, $user_id, $cart_info,$current_time, $cart_ignored, $user_type ) );
|
848 |
+
|
849 |
+
$abandoned_cart_id = $wpdb->insert_id;
|
850 |
+
$_SESSION['abandoned_cart_id_lite'] = $abandoned_cart_id;
|
851 |
+
} elseif ( isset( $results[0]->abandoned_cart_time ) && $compare_time > $results[0]->abandoned_cart_time ) {
|
852 |
+
$updated_cart_info = json_encode( get_user_meta( $user_id, '_woocommerce_persistent_cart', true ) );
|
853 |
+
|
854 |
+
if ( ! $this->wcal_compare_carts( $user_id, $results[0]->abandoned_cart_info ) ) {
|
855 |
+
$updated_cart_ignored = 1;
|
856 |
+
$query_ignored = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
857 |
+
SET cart_ignored = %s
|
858 |
+
WHERE user_id = %d ";
|
859 |
+
$wpdb->query( $wpdb->prepare( $query_ignored, $updated_cart_ignored, $user_id ) );
|
860 |
+
|
861 |
+
$user_type = "REGISTERED";
|
862 |
+
$query_update = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
863 |
+
(user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored, user_type)
|
864 |
+
VALUES (%d, %s, %d, %s, %s)";
|
865 |
+
$wpdb->query( $wpdb->prepare( $query_update, $user_id, $updated_cart_info, $current_time, $cart_ignored, $user_type ) );
|
866 |
+
|
867 |
+
update_user_meta ( $user_id, '_woocommerce_ac_modified_cart', md5( "yes" ) );
|
868 |
+
|
869 |
+
$abandoned_cart_id = $wpdb->insert_id;
|
870 |
+
$_SESSION['abandoned_cart_id_lite'] = $abandoned_cart_id;
|
871 |
+
} else {
|
872 |
+
update_user_meta ( $user_id, '_woocommerce_ac_modified_cart', md5( "no" ) );
|
873 |
+
}
|
874 |
+
} else {
|
875 |
+
$updated_cart_info = json_encode( get_user_meta( $user_id, '_woocommerce_persistent_cart', true ) );
|
876 |
+
|
877 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
878 |
+
SET abandoned_cart_info = %s,
|
879 |
+
abandoned_cart_time = %d
|
880 |
+
WHERE user_id = %d
|
881 |
+
AND cart_ignored = %s ";
|
882 |
+
$wpdb->query( $wpdb->prepare( $query_update, $updated_cart_info, $current_time, $user_id, $cart_ignored ) );
|
883 |
+
|
884 |
+
$query_update = "SELECT * FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_id ='" . $user_id . "' AND cart_ignored='0' ";
|
885 |
+
$get_abandoned_record = $wpdb->get_results( $query_update );
|
886 |
+
$abandoned_cart_id = $get_abandoned_record[0]->id;
|
887 |
+
|
888 |
+
$_SESSION['abandoned_cart_id_lite'] = $abandoned_cart_id;
|
889 |
+
}
|
890 |
+
} else {
|
891 |
+
//start here guest user
|
892 |
+
if ( isset( $_SESSION['user_id'] ) ) {
|
893 |
+
$user_id = $_SESSION['user_id'];
|
894 |
+
} else {
|
895 |
+
$user_id = "";
|
896 |
+
}
|
897 |
+
|
898 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE user_id = %d AND cart_ignored = '0' AND recovered_cart = '0'";
|
899 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $user_id ) );
|
900 |
+
$cart = array();
|
901 |
+
|
902 |
+
if ( function_exists('WC') ) {
|
903 |
+
$cart['cart'] = WC()->session->cart;
|
904 |
+
} else {
|
905 |
+
$cart['cart'] = $woocommerce->session->cart;
|
906 |
+
}
|
907 |
+
|
908 |
+
$updated_cart_info = json_encode($cart);
|
909 |
+
$updated_cart_info = addslashes ( $updated_cart_info );
|
910 |
+
|
911 |
+
if ( $results ) {
|
912 |
+
if ( $compare_time > $results[0]->abandoned_cart_time ) {
|
913 |
+
if ( ! $this->wcal_compare_only_guest_carts( $updated_cart_info, $results[0]->abandoned_cart_info ) ) {
|
914 |
+
|
915 |
+
$query_ignored = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
916 |
+
SET cart_ignored = '1'
|
917 |
+
WHERE user_id ='".$user_id."'";
|
918 |
+
$wpdb->query( $query_ignored );
|
919 |
+
$user_type = 'GUEST';
|
920 |
+
$query_update = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
921 |
+
(user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored, user_type)
|
922 |
+
VALUES (%d, %s, %d, %s, %s)";
|
923 |
+
$wpdb->query( $wpdb->prepare( $query_update, $user_id, $updated_cart_info, $current_time, $cart_ignored, $user_type ) );
|
924 |
+
update_user_meta( $user_id, '_woocommerce_ac_modified_cart', md5("yes") );
|
925 |
+
} else {
|
926 |
+
update_user_meta( $user_id, '_woocommerce_ac_modified_cart', md5("no") );
|
927 |
+
}
|
928 |
+
} else {
|
929 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
930 |
+
SET abandoned_cart_info = '".$updated_cart_info."', abandoned_cart_time = '".$current_time."'
|
931 |
+
WHERE user_id='".$user_id."' AND cart_ignored='0' ";
|
932 |
+
$wpdb->query( $query_update );
|
933 |
+
}
|
934 |
+
}
|
935 |
+
}
|
936 |
+
}
|
937 |
+
|
938 |
+
// Decrypt Function
|
939 |
+
function wcal_decrypt_validate( $validate ) {
|
940 |
+
$cryptKey = get_option( 'wcal_security_key' );
|
941 |
+
$validate_decoded = rtrim( mcrypt_decrypt( MCRYPT_RIJNDAEL_256, md5( $cryptKey ), base64_decode( $validate ), MCRYPT_MODE_CBC, md5( md5( $cryptKey ) ) ), "\0");
|
942 |
+
return( $validate_decoded );
|
943 |
+
}
|
944 |
+
|
945 |
+
function wcal_email_unsubscribe( $args ) {
|
946 |
+
global $wpdb;
|
947 |
+
|
948 |
+
if ( isset( $_GET['wcal_track_unsubscribe'] ) && $_GET['wcal_track_unsubscribe'] == 'wcal_unsubscribe' ) {
|
949 |
+
$encoded_email_id = rawurldecode( $_GET['validate'] );
|
950 |
+
$validate_email_id_string = str_replace( " " , "+", $encoded_email_id);
|
951 |
+
$validate_email_address_string = '';
|
952 |
+
$validate_email_id_decode = 0;
|
953 |
+
if( isset( $_GET['track_email_id'] ) ) {
|
954 |
+
$encoded_email_address = rawurldecode( $_GET['track_email_id'] );
|
955 |
+
$validate_email_address_string = str_replace( " " , "+", $encoded_email_address );
|
956 |
+
if( isset( $validate_email_id_string ) ) {
|
957 |
+
if( function_exists( "mcrypt_encrypt" ) ) {
|
958 |
+
$validate_email_id_decode = $this->wcal_decrypt_validate( $validate_email_id_string );
|
959 |
+
} else {
|
960 |
+
$validate_email_id_decode = base64_decode( $validate_email_id_string );
|
961 |
+
}
|
962 |
+
}
|
963 |
+
$validate_email_address_string = $validate_email_address_string;
|
964 |
+
}
|
965 |
+
if( !preg_match('/^[1-9][0-9]*$/', $validate_email_id_decode ) ) { // This will decrypt more security
|
966 |
+
$cryptKey = get_option( 'wcal_security_key' );
|
967 |
+
$validate_email_id_decode = Wcal_Aes_Ctr::decrypt( $validate_email_id_string, $cryptKey, 256 );
|
968 |
+
}
|
969 |
+
$query_id = "SELECT * FROM `" . $wpdb->prefix . "ac_sent_history_lite` WHERE id = %d ";
|
970 |
+
$results_sent = $wpdb->get_results ( $wpdb->prepare( $query_id, $validate_email_id_decode ) );
|
971 |
+
$email_address = '';
|
972 |
+
if( isset( $results_sent[0] ) ) {
|
973 |
+
$email_address = $results_sent[0]->sent_email_id;
|
974 |
+
}
|
975 |
+
if( $validate_email_address_string == hash( 'sha256', $email_address ) ) {
|
976 |
+
$email_sent_id = $validate_email_id_decode;
|
977 |
+
$get_ac_id_query = "SELECT abandoned_order_id FROM `" . $wpdb->prefix . "ac_sent_history_lite` WHERE id = %d";
|
978 |
+
$get_ac_id_results = $wpdb->get_results( $wpdb->prepare( $get_ac_id_query , $email_sent_id ) );
|
979 |
+
$user_id = 0;
|
980 |
+
if( isset( $get_ac_id_results[0] ) ) {
|
981 |
+
$get_user_id_query = "SELECT user_id FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE id = %d";
|
982 |
+
$get_user_results = $wpdb->get_results( $wpdb->prepare( $get_user_id_query , $get_ac_id_results[0]->abandoned_order_id ) );
|
983 |
+
}
|
984 |
+
if( isset( $get_user_results[0] ) ) {
|
985 |
+
$user_id = $get_user_results[0]->user_id;
|
986 |
+
}
|
987 |
+
|
988 |
+
$unsubscribe_query = "UPDATE `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
989 |
+
SET unsubscribe_link = '1'
|
990 |
+
WHERE user_id= %d AND cart_ignored='0' ";
|
991 |
+
$wpdb->query( $wpdb->prepare( $unsubscribe_query , $user_id ) );
|
992 |
+
echo "Unsubscribed Successfully";
|
993 |
+
sleep( 2 );
|
994 |
+
$url = get_option( 'siteurl' );
|
995 |
+
?>
|
996 |
+
<script>
|
997 |
+
location.href = "<?php echo $url; ?>";
|
998 |
+
</script>
|
999 |
+
<?php
|
1000 |
+
}
|
1001 |
+
} else {
|
1002 |
+
return $args;
|
1003 |
+
}
|
1004 |
+
}
|
1005 |
+
|
1006 |
+
// It will track the URL of cart link from email
|
1007 |
+
function wcal_email_track_links( $template ) {
|
1008 |
+
global $woocommerce;
|
1009 |
+
$track_link = '';
|
1010 |
+
|
1011 |
+
if ( isset( $_GET['wcal_action'] ) ) {
|
1012 |
+
$track_link = $_GET['wcal_action'];
|
1013 |
+
}
|
1014 |
+
if ( $track_link == 'track_links' ) {
|
1015 |
+
if( session_id() === '' ) {
|
1016 |
+
//session has not started
|
1017 |
+
session_start();
|
1018 |
+
}
|
1019 |
+
global $wpdb;
|
1020 |
+
$validate_server_string = rawurldecode( $_GET ['validate'] );
|
1021 |
+
$validate_server_string = str_replace( " " , "+", $validate_server_string );
|
1022 |
+
$validate_encoded_string = $validate_server_string;
|
1023 |
+
$link_decode_test = base64_decode( $validate_encoded_string );
|
1024 |
+
// it will check if any old email have open the link
|
1025 |
+
if ( preg_match( '/&url=/', $link_decode_test ) ) {
|
1026 |
+
$link_decode = $link_decode_test;
|
1027 |
+
} else {
|
1028 |
+
if( function_exists( "mcrypt_encrypt" ) ) {
|
1029 |
+
$link_decode = $this->wcal_decrypt_validate( $validate_encoded_string );
|
1030 |
+
} else {
|
1031 |
+
$link_decode = base64_decode( $validate_encoded_string );
|
1032 |
+
}
|
1033 |
+
}
|
1034 |
+
if ( !preg_match( '/&url=/', $link_decode ) ) { // This will decrypt more security
|
1035 |
+
$cryptKey = get_option( 'wcal_security_key' );
|
1036 |
+
$link_decode = Wcal_Aes_Ctr::decrypt( $validate_encoded_string, $cryptKey, 256 );
|
1037 |
+
}
|
1038 |
+
$sent_email_id_pos = strpos( $link_decode, '&' );
|
1039 |
+
$email_sent_id = substr( $link_decode , 0, $sent_email_id_pos );
|
1040 |
+
$_SESSION['email_sent_id'] = $email_sent_id;
|
1041 |
+
$url_pos = strpos( $link_decode, '=' );
|
1042 |
+
$url_pos = $url_pos + 1;
|
1043 |
+
$url = substr( $link_decode, $url_pos );
|
1044 |
+
$get_ac_id_query = "SELECT abandoned_order_id FROM `".$wpdb->prefix."ac_sent_history_lite` WHERE id = %d";
|
1045 |
+
$get_ac_id_results = $wpdb->get_results( $wpdb->prepare( $get_ac_id_query, $email_sent_id ) );
|
1046 |
+
$get_user_id_query = "SELECT user_id FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE id = %d";
|
1047 |
+
$get_user_results = $wpdb->get_results( $wpdb->prepare( $get_user_id_query, $get_ac_id_results[0]->abandoned_order_id ) );
|
1048 |
+
$user_id = 0;
|
1049 |
+
if ( isset( $get_user_results ) && count( $get_user_results ) > 0 ) {
|
1050 |
+
$user_id = $get_user_results[0]->user_id;
|
1051 |
+
}
|
1052 |
+
if ( $user_id == 0 ) {
|
1053 |
+
echo "Link expired";
|
1054 |
+
exit;
|
1055 |
+
}
|
1056 |
+
$user = wp_set_current_user( $user_id );
|
1057 |
+
if ( $user_id >= "63000000" ) {
|
1058 |
+
$query_guest = "SELECT * from `". $wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE id = %d";
|
1059 |
+
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $user_id ) );
|
1060 |
+
$query_cart = "SELECT recovered_cart FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE user_id = %d";
|
1061 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query_cart, $user_id ) );
|
1062 |
+
if ( $results_guest && $results[0]->recovered_cart == '0' ) {
|
1063 |
+
$_SESSION['guest_first_name'] = $results_guest[0]->billing_first_name;
|
1064 |
+
$_SESSION['guest_last_name'] = $results_guest[0]->billing_last_name;
|
1065 |
+
$_SESSION['guest_email'] = $results_guest[0]->email_id;
|
1066 |
+
$_SESSION['user_id'] = $user_id;
|
1067 |
+
} else {
|
1068 |
+
wp_redirect( get_permalink( woocommerce_get_page_id( 'shop' ) ) );
|
1069 |
+
}
|
1070 |
+
}
|
1071 |
+
|
1072 |
+
if ( $user_id < "63000000" ) {
|
1073 |
+
$user_login = $user->data->user_login;
|
1074 |
+
wp_set_auth_cookie( $user_id );
|
1075 |
+
$my_temp = woocommerce_load_persistent_cart( $user_login, $user );
|
1076 |
+
do_action( 'wp_login', $user_login, $user );
|
1077 |
+
if ( isset( $sign_in ) && is_wp_error( $sign_in ) ) {
|
1078 |
+
echo $sign_in->get_error_message();
|
1079 |
+
exit;
|
1080 |
+
}
|
1081 |
+
} else
|
1082 |
+
$my_temp = $this->wcal_load_guest_persistent_cart( $user_id );
|
1083 |
+
|
1084 |
+
if ( $email_sent_id > 0 && is_numeric( $email_sent_id ) ) {
|
1085 |
+
header( "Location: $url" );
|
1086 |
+
}
|
1087 |
+
} else
|
1088 |
+
return $template;
|
1089 |
+
}
|
1090 |
+
|
1091 |
+
// load the information of the guest user
|
1092 |
+
function wcal_load_guest_persistent_cart() {
|
1093 |
+
global $woocommerce;
|
1094 |
+
$saved_cart = json_decode( get_user_meta( $_SESSION['user_id'], '_woocommerce_persistent_cart',true ), true );
|
1095 |
+
$c = array();
|
1096 |
+
$cart_contents_total = $cart_contents_weight = $cart_contents_count = $cart_contents_tax = $total = $subtotal = $subtotal_ex_tax = $tax_total = 0;
|
1097 |
+
|
1098 |
+
foreach ( $saved_cart as $key => $value ) {
|
1099 |
+
foreach ( $value as $a => $b ) {
|
1100 |
+
$c['product_id'] = $b['product_id'];
|
1101 |
+
$c['variation_id'] = $b['variation_id'];
|
1102 |
+
$c['variation'] = $b['variation'];
|
1103 |
+
$c['quantity'] = $b['quantity'];
|
1104 |
+
$product_id = $b['product_id'];
|
1105 |
+
$c['data'] = get_product($product_id);
|
1106 |
+
$c['line_total'] = $b['line_total'];
|
1107 |
+
$c['line_tax'] = $cart_contents_tax;
|
1108 |
+
$c['line_subtotal'] = $b['line_subtotal'];
|
1109 |
+
$c['line_subtotal_tax'] = $cart_contents_tax;
|
1110 |
+
$value_new[ $a ] = $c;
|
1111 |
+
$cart_contents_total = $b['line_subtotal'] + $cart_contents_total;
|
1112 |
+
$cart_contents_count = $cart_contents_count + $b['quantity'];
|
1113 |
+
$total = $total + $b['line_total'];
|
1114 |
+
$subtotal = $subtotal + $b['line_subtotal'];
|
1115 |
+
$subtotal_ex_tax = $subtotal_ex_tax + $b['line_subtotal'];
|
1116 |
+
}
|
1117 |
+
$saved_cart_data[ $key ] = $value_new;
|
1118 |
+
$woocommerce_cart_hash = $a;
|
1119 |
+
}
|
1120 |
+
|
1121 |
+
if( $saved_cart ) {
|
1122 |
+
if ( empty( $woocommerce->session->cart ) || ! is_array( $woocommerce->session->cart ) || sizeof( $woocommerce->session->cart ) == 0 ) {
|
1123 |
+
$woocommerce->session->cart = $saved_cart['cart'];
|
1124 |
+
$woocommerce->session->cart_contents_total = $cart_contents_total;
|
1125 |
+
$woocommerce->session->cart_contents_weight = $cart_contents_weight;
|
1126 |
+
$woocommerce->session->cart_contents_count = $cart_contents_count;
|
1127 |
+
$woocommerce->session->cart_contents_tax = $cart_contents_tax;
|
1128 |
+
$woocommerce->session->total = $total;
|
1129 |
+
$woocommerce->session->subtotal = $subtotal;
|
1130 |
+
$woocommerce->session->subtotal_ex_tax = $subtotal_ex_tax;
|
1131 |
+
$woocommerce->session->tax_total = $tax_total;
|
1132 |
+
$woocommerce->session->shipping_taxes = array();
|
1133 |
+
$woocommerce->session->taxes = array();
|
1134 |
+
$woocommerce->session->ac_customer = array();
|
1135 |
+
$woocommerce->cart->cart_contents = $saved_cart_data['cart'];
|
1136 |
+
$woocommerce->cart->cart_contents_total = $cart_contents_total;
|
1137 |
+
$woocommerce->cart->cart_contents_weight = $cart_contents_weight;
|
1138 |
+
$woocommerce->cart->cart_contents_count = $cart_contents_count;
|
1139 |
+
$woocommerce->cart->cart_contents_tax = $cart_contents_tax;
|
1140 |
+
$woocommerce->cart->total = $total;
|
1141 |
+
$woocommerce->cart->subtotal = $subtotal;
|
1142 |
+
$woocommerce->cart->subtotal_ex_tax = $subtotal_ex_tax;
|
1143 |
+
$woocommerce->cart->tax_total = $tax_total;
|
1144 |
+
}
|
1145 |
+
}
|
1146 |
+
}
|
1147 |
+
|
1148 |
+
function wcal_compare_only_guest_carts( $new_cart, $last_abandoned_cart ) {
|
1149 |
+
$current_woo_cart = array();
|
1150 |
+
$current_woo_cart = json_decode( stripslashes( $new_cart ), true );
|
1151 |
+
$abandoned_cart_arr = array();
|
1152 |
+
$abandoned_cart_arr = json_decode( $last_abandoned_cart, true );
|
1153 |
+
$temp_variable = "";
|
1154 |
+
|
1155 |
+
if ( count( $current_woo_cart['cart'] ) >= count( $abandoned_cart_arr['cart'] ) ) {
|
1156 |
+
//do nothing
|
1157 |
+
} else {
|
1158 |
+
$temp_variable = $current_woo_cart;
|
1159 |
+
$current_woo_cart = $abandoned_cart_arr;
|
1160 |
+
$abandoned_cart_arr = $temp_variable;
|
1161 |
+
}
|
1162 |
+
if ( is_array( $current_woo_cart ) || is_object( $current_woo_cart ) ) {
|
1163 |
+
foreach( $current_woo_cart as $key => $value ) {
|
1164 |
+
foreach( $value as $item_key => $item_value ) {
|
1165 |
+
$current_cart_product_id = $item_value['product_id'];
|
1166 |
+
$current_cart_variation_id = $item_value['variation_id'];
|
1167 |
+
$current_cart_quantity = $item_value['quantity'];
|
1168 |
+
|
1169 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['product_id'] ) ){
|
1170 |
+
$abandoned_cart_product_id = $abandoned_cart_arr[$key][$item_key]['product_id'];
|
1171 |
+
} else {
|
1172 |
+
$abandoned_cart_product_id = "";
|
1173 |
+
}
|
1174 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['variation_id'] ) ) {
|
1175 |
+
$abandoned_cart_variation_id = $abandoned_cart_arr[$key][$item_key]['variation_id'];
|
1176 |
+
} else {
|
1177 |
+
$abandoned_cart_variation_id = "";
|
1178 |
+
}
|
1179 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['quantity'] ) ) {
|
1180 |
+
$abandoned_cart_quantity = $abandoned_cart_arr[$key][$item_key]['quantity'];
|
1181 |
+
} else {
|
1182 |
+
$abandoned_cart_quantity = "";
|
1183 |
+
}
|
1184 |
+
if ( ( $current_cart_product_id != $abandoned_cart_product_id ) ||
|
1185 |
+
( $current_cart_variation_id != $abandoned_cart_variation_id ) ||
|
1186 |
+
( $current_cart_quantity != $abandoned_cart_quantity ) ) {
|
1187 |
+
return false;
|
1188 |
+
}
|
1189 |
+
}
|
1190 |
+
}
|
1191 |
+
}
|
1192 |
+
return true;
|
1193 |
+
}
|
1194 |
+
|
1195 |
+
// Compare the existing cart with new cart
|
1196 |
+
function wcal_compare_carts( $user_id, $last_abandoned_cart ) {
|
1197 |
+
$current_woo_cart = get_user_meta( $user_id, '_woocommerce_persistent_cart', true );
|
1198 |
+
$abandoned_cart_arr = json_decode( $last_abandoned_cart, true );
|
1199 |
+
$temp_variable = "";
|
1200 |
+
if ( count( $current_woo_cart['cart'] ) >= count( $abandoned_cart_arr['cart'] ) ) {
|
1201 |
+
//do nothing
|
1202 |
+
} else {
|
1203 |
+
$temp_variable = $current_woo_cart;
|
1204 |
+
$current_woo_cart = $abandoned_cart_arr;
|
1205 |
+
$abandoned_cart_arr = $temp_variable;
|
1206 |
+
}
|
1207 |
+
foreach ( $current_woo_cart as $key => $value ) {
|
1208 |
+
|
1209 |
+
foreach ( $value as $item_key => $item_value ) {
|
1210 |
+
$current_cart_product_id = $item_value['product_id'];
|
1211 |
+
$current_cart_variation_id = $item_value['variation_id'];
|
1212 |
+
$current_cart_quantity = $item_value['quantity'];
|
1213 |
+
|
1214 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['product_id'] ) ) {
|
1215 |
+
$abandoned_cart_product_id = $abandoned_cart_arr[$key][$item_key]['product_id'];
|
1216 |
+
} else {
|
1217 |
+
$abandoned_cart_product_id = "";
|
1218 |
+
}
|
1219 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['variation_id'] ) ) {
|
1220 |
+
$abandoned_cart_variation_id = $abandoned_cart_arr[$key][$item_key]['variation_id'];
|
1221 |
+
} else {
|
1222 |
+
$abandoned_cart_variation_id = "";
|
1223 |
+
}
|
1224 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['quantity'] ) ) {
|
1225 |
+
$abandoned_cart_quantity = $abandoned_cart_arr[$key][$item_key]['quantity'];
|
1226 |
+
} else {
|
1227 |
+
$abandoned_cart_quantity = "";
|
1228 |
+
}
|
1229 |
+
if ( ( $current_cart_product_id != $abandoned_cart_product_id ) ||
|
1230 |
+
( $current_cart_variation_id != $abandoned_cart_variation_id ) ||
|
1231 |
+
( $current_cart_quantity != $abandoned_cart_quantity ) )
|
1232 |
+
{
|
1233 |
+
return false;
|
1234 |
+
}
|
1235 |
+
}
|
1236 |
+
}
|
1237 |
+
return true;
|
1238 |
+
}
|
1239 |
+
|
1240 |
+
// function is call when order is recovered
|
1241 |
+
function wcal_action_after_delivery_session( $order ) {
|
1242 |
+
|
1243 |
+
if( session_id() === '' ){
|
1244 |
+
//session has not started
|
1245 |
+
session_start();
|
1246 |
+
}
|
1247 |
+
global $wpdb;
|
1248 |
+
$order_id = $order->id;
|
1249 |
+
$get_abandoned_id_of_order = '';
|
1250 |
+
$get_sent_email_id_of_order = '';
|
1251 |
+
$get_abandoned_id_of_order = get_post_meta( $order_id, 'wcal_recover_order_placed', true );
|
1252 |
+
if( isset( $get_abandoned_id_of_order ) && $get_abandoned_id_of_order != '' ){
|
1253 |
+
$get_abandoned_id_of_order = get_post_meta( $order_id, 'wcal_recover_order_placed', true );
|
1254 |
+
$get_sent_email_id_of_order = get_post_meta( $order_id, 'wcal_recover_order_placed_sent_id', true );
|
1255 |
+
|
1256 |
+
$query_order = "UPDATE `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` SET recovered_cart= '" . $order_id . "', cart_ignored = '1'
|
1257 |
+
WHERE id = '".$get_abandoned_id_of_order."' ";
|
1258 |
+
$wpdb->query( $query_order );
|
1259 |
+
|
1260 |
+
$order->add_order_note( __( 'This order was abandoned & subsequently recovered.', 'woocommerce-ac' ) );
|
1261 |
+
|
1262 |
+
delete_post_meta( $order_id, 'wcal_recover_order_placed', $get_abandoned_id_of_order );
|
1263 |
+
delete_post_meta( $order_id , 'wcal_recover_order_placed_sent_id', $get_sent_email_id_of_order );
|
1264 |
+
}
|
1265 |
+
$user_id = get_current_user_id();
|
1266 |
+
$sent_email = '';
|
1267 |
+
if( isset( $_SESSION['email_sent_id'] ) ){
|
1268 |
+
$sent_email = $_SESSION['email_sent_id'];
|
1269 |
+
}
|
1270 |
+
if( $user_id == "" ) {
|
1271 |
+
$user_id = $_SESSION['user_id'];
|
1272 |
+
// Set the session variables to blanks
|
1273 |
+
$_SESSION['guest_first_name'] = $_SESSION['guest_last_name'] = $_SESSION['guest_email'] = $_SESSION['user_id'] = "";
|
1274 |
+
}
|
1275 |
+
delete_user_meta( $user_id, '_woocommerce_ac_persistent_cart_time' );
|
1276 |
+
delete_user_meta( $user_id, '_woocommerce_ac_persistent_cart_temp_time' );
|
1277 |
+
// get all latest abandoned carts that were modified
|
1278 |
+
$cart_ignored = 0;
|
1279 |
+
$recovered_cart = 0;
|
1280 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
1281 |
+
WHERE user_id = %d
|
1282 |
+
AND cart_ignored = %s
|
1283 |
+
AND recovered_cart = %d
|
1284 |
+
ORDER BY id DESC
|
1285 |
+
LIMIT 1";
|
1286 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $user_id, $cart_ignored, $recovered_cart ) );
|
1287 |
+
if ( count( $results ) > 0 ) {
|
1288 |
+
if ( get_user_meta( $user_id, '_woocommerce_ac_modified_cart', true ) == md5( "yes" ) ||
|
1289 |
+
get_user_meta( $user_id, '_woocommerce_ac_modified_cart', true ) == md5( "no" ) ) {
|
1290 |
+
|
1291 |
+
$order_id = $order->id;
|
1292 |
+
$updated_cart_ignored = 1;
|
1293 |
+
$query_order = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
1294 |
+
SET recovered_cart = %d,
|
1295 |
+
cart_ignored = %s
|
1296 |
+
WHERE id = %d ";
|
1297 |
+
$wpdb->query( $wpdb->prepare( $query_order, $order_id, $updated_cart_ignored, $results[0]->id ) );
|
1298 |
+
delete_user_meta( $user_id, '_woocommerce_ac_modified_cart' );
|
1299 |
+
delete_post_meta( $order_id, 'wcap_recovered_email_sent', 'yes' );
|
1300 |
+
} else {
|
1301 |
+
$delete_query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
1302 |
+
WHERE id= %d ";
|
1303 |
+
$wpdb->query( $wpdb->prepare( $delete_query, $results[0]->id ) );
|
1304 |
+
}
|
1305 |
+
} else {
|
1306 |
+
$email_id = $order->billing_email;
|
1307 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE email_id = %s";
|
1308 |
+
$results_id = $wpdb->get_results( $wpdb->prepare( $query, $email_id ) );
|
1309 |
+
|
1310 |
+
if ( $results_id ) {
|
1311 |
+
$record_status = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
1312 |
+
WHERE user_id = %d AND recovered_cart = '0'";
|
1313 |
+
$results_status = $wpdb->get_results( $wpdb->prepare( $record_status, $results_id[0]->id ) );
|
1314 |
+
|
1315 |
+
if ( $results_status ) {
|
1316 |
+
if ( get_user_meta( $results_id[0]->id, '_woocommerce_ac_modified_cart', true ) == md5("yes") ||
|
1317 |
+
get_user_meta( $results_id[0]->id, '_woocommerce_ac_modified_cart', true ) == md5("no") ) {
|
1318 |
+
|
1319 |
+
$order_id = $order->id;
|
1320 |
+
$query_order = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
1321 |
+
SET recovered_cart= '".$order_id."', cart_ignored = '1'
|
1322 |
+
WHERE id='".$results_status[0]->id."' ";
|
1323 |
+
$wpdb->query( $query_order );
|
1324 |
+
delete_user_meta( $results_id[0]->id, '_woocommerce_ac_modified_cart' );
|
1325 |
+
delete_post_meta( $order_id, 'wcap_recovered_email_sent', 'yes' );
|
1326 |
+
} else {
|
1327 |
+
$delete_guest = "DELETE FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE id = '".$results_id[0]->id."'";
|
1328 |
+
$wpdb->query( $delete_guest );
|
1329 |
+
|
1330 |
+
$delete_query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE user_id='".$results_id[0]->id."' ";
|
1331 |
+
$wpdb->query( $delete_query );
|
1332 |
+
}
|
1333 |
+
}
|
1334 |
+
}
|
1335 |
+
}
|
1336 |
+
}
|
1337 |
+
|
1338 |
+
function wcal_action_admin_init() {
|
1339 |
+
global $typenow;
|
1340 |
+
// only hook up these filters if we're in the admin panel and the current user has permission
|
1341 |
+
// to edit posts and pages
|
1342 |
+
if ( !current_user_can( 'edit_posts' ) && !current_user_can( 'edit_pages' ) ) {
|
1343 |
+
return;
|
1344 |
+
}
|
1345 |
+
if ( !isset( $_GET['page'] ) || $_GET['page'] != "woocommerce_ac_page" ) {
|
1346 |
+
return;
|
1347 |
+
}
|
1348 |
+
if ( get_user_option( 'rich_editing' ) == 'true' ) {
|
1349 |
+
remove_filter( 'the_excerpt', 'wpautop' );
|
1350 |
+
add_filter( 'tiny_mce_before_init', array( &$this, 'wcal_format_tiny_MCE' ) );
|
1351 |
+
add_filter( 'mce_buttons', array( &$this, 'wcal_filter_mce_button' ) );
|
1352 |
+
add_filter( 'mce_external_plugins', array( &$this, 'wcal_filter_mce_plugin' ) );
|
1353 |
+
}
|
1354 |
+
if ( isset( $_GET['page'] ) && 'woocommerce_ac_page' == $_GET['page'] ) {
|
1355 |
+
if( session_id() === '' ){
|
1356 |
+
//session has not started
|
1357 |
+
session_start();
|
1358 |
+
}
|
1359 |
+
}
|
1360 |
+
}
|
1361 |
+
|
1362 |
+
function wcal_filter_mce_button( $buttons ) {
|
1363 |
+
// add a separation before our button, here our button's id is "mygallery_button"
|
1364 |
+
array_push( $buttons, 'abandoncart', '|' );
|
1365 |
+
return $buttons;
|
1366 |
+
}
|
1367 |
+
|
1368 |
+
function wcal_filter_mce_plugin( $plugins ) {
|
1369 |
+
// this plugin file will work the magic of our button
|
1370 |
+
$plugins['abandoncart'] = plugin_dir_url( __FILE__ ) . 'assets/js/abandoncart_plugin_button.js';
|
1371 |
+
return $plugins;
|
1372 |
+
}
|
1373 |
+
|
1374 |
+
function wcal_display_tabs() {
|
1375 |
+
|
1376 |
+
if ( isset( $_GET['action'] ) ) {
|
1377 |
+
$action = $_GET['action'];
|
1378 |
+
} else {
|
1379 |
+
$action = "";
|
1380 |
+
$active_listcart = "";
|
1381 |
+
$active_emailtemplates = "";
|
1382 |
+
$active_settings = "";
|
1383 |
+
$active_stats = "";
|
1384 |
+
}
|
1385 |
+
if ( ( $action == 'listcart' || $action == 'orderdetails' ) || $action == '' ) {
|
1386 |
+
$active_listcart = "nav-tab-active";
|
1387 |
+
}
|
1388 |
+
if ( $action == 'emailtemplates' ) {
|
1389 |
+
$active_emailtemplates = "nav-tab-active";
|
1390 |
+
}
|
1391 |
+
if ( $action == 'emailsettings' ) {
|
1392 |
+
$active_settings = "nav-tab-active";
|
1393 |
+
}
|
1394 |
+
if ( $action == 'stats' ) {
|
1395 |
+
$active_stats = "nav-tab-active";
|
1396 |
+
}
|
1397 |
+
if ( $action == 'report' ) {
|
1398 |
+
$active_report = "nav-tab-active";
|
1399 |
+
}
|
1400 |
+
?>
|
1401 |
+
<div style="background-image: url('<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/assets/images/ac_tab_icon.png') !important;" class="icon32"><br>
|
1402 |
+
</div>
|
1403 |
+
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
1404 |
+
<a href="admin.php?page=woocommerce_ac_page&action=listcart" class="nav-tab <?php if (isset($active_listcart)) echo $active_listcart; ?>"> <?php _e( 'Abandoned Orders', 'woocommerce-ac' );?> </a>
|
1405 |
+
<a href="admin.php?page=woocommerce_ac_page&action=emailtemplates" class="nav-tab <?php if (isset($active_emailtemplates)) echo $active_emailtemplates; ?>"> <?php _e( 'Email Templates', 'woocommerce-ac' );?> </a>
|
1406 |
+
<a href="admin.php?page=woocommerce_ac_page&action=emailsettings" class="nav-tab <?php if (isset($active_settings)) echo $active_settings; ?>"> <?php _e( 'Settings', 'woocommerce-ac' );?> </a>
|
1407 |
+
<a href="admin.php?page=woocommerce_ac_page&action=stats" class="nav-tab <?php if (isset($active_stats)) echo $active_stats; ?>"> <?php _e( 'Recovered Orders', 'woocommerce-ac' );?> </a>
|
1408 |
+
<a href="admin.php?page=woocommerce_ac_page&action=report" class="nav-tab <?php if( isset( $active_report ) ) echo $active_report; ?>"> <?php _e( 'Product Report', 'woocommerce-ac' );?> </a>
|
1409 |
+
</h2>
|
1410 |
+
<?php
|
1411 |
+
}
|
1412 |
+
|
1413 |
+
function wcal_enqueue_scripts_js( $hook ) {
|
1414 |
+
|
1415 |
+
if ( $hook != 'woocommerce_page_woocommerce_ac_page' ) {
|
1416 |
+
return;
|
1417 |
+
} else {
|
1418 |
+
wp_enqueue_script( 'jquery' );
|
1419 |
+
wp_enqueue_script(
|
1420 |
+
'jquery-ui-min',
|
1421 |
+
'//ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js',
|
1422 |
+
'',
|
1423 |
+
'',
|
1424 |
+
false
|
1425 |
+
);
|
1426 |
+
wp_enqueue_script( 'jquery-ui-datepicker' );
|
1427 |
+
|
1428 |
+
wp_enqueue_script(
|
1429 |
+
'jquery-tip',
|
1430 |
+
plugins_url( '/assets/js/jquery.tipTip.minified.js', __FILE__ ),
|
1431 |
+
'',
|
1432 |
+
'',
|
1433 |
+
false
|
1434 |
+
);
|
1435 |
+
wp_register_script( 'woocommerce_admin', plugins_url() . '/woocommerce/assets/js/admin/woocommerce_admin.js', array( 'jquery', 'jquery-ui-widget', 'jquery-ui-core' ) );
|
1436 |
+
wp_enqueue_script( 'woocommerce_admin' );
|
1437 |
+
?>
|
1438 |
+
<script type="text/javascript" >
|
1439 |
+
function wcal_activate_email_template( template_id, active_state ) {
|
1440 |
+
location.href = 'admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=activate_template&id='+template_id+'&active_state='+active_state ;
|
1441 |
+
}
|
1442 |
+
</script>
|
1443 |
+
<?php
|
1444 |
+
$js_src = includes_url('js/tinymce/') . 'tinymce.min.js';
|
1445 |
+
wp_enqueue_script( 'tinyMce_ac',$js_src );
|
1446 |
+
wp_enqueue_script( 'ac_email_variables', plugins_url() . '/woocommerce-abandoned-cart/assets/js/abandoncart_plugin_button.js' );
|
1447 |
+
}
|
1448 |
+
}
|
1449 |
+
|
1450 |
+
function wcal_format_tiny_MCE( $in ) {
|
1451 |
+
$in['force_root_block'] = false;
|
1452 |
+
$in['valid_children'] = '+body[style]';
|
1453 |
+
$in['remove_linebreaks'] = false;
|
1454 |
+
$in['gecko_spellcheck'] = false;
|
1455 |
+
$in['keep_styles'] = true;
|
1456 |
+
$in['accessibility_focus'] = true;
|
1457 |
+
$in['tabfocus_elements'] = 'major-publishing-actions';
|
1458 |
+
$in['media_strict'] = false;
|
1459 |
+
$in['paste_remove_styles'] = false;
|
1460 |
+
$in['paste_remove_spans'] = false;
|
1461 |
+
$in['paste_strip_class_attributes'] = 'none';
|
1462 |
+
$in['paste_text_use_dialog'] = true;
|
1463 |
+
$in['wpeditimage_disable_captions'] = true;
|
1464 |
+
$in['wpautop'] = false;
|
1465 |
+
$in['apply_source_formatting'] = true;
|
1466 |
+
$in['cleanup'] = true;
|
1467 |
+
$in['convert_newlines_to_brs'] = FALSE;
|
1468 |
+
$in['fullpage_default_xml_pi'] = false;
|
1469 |
+
$in['convert_urls'] = false;
|
1470 |
+
// Do not remove redundant BR tags
|
1471 |
+
$in['remove_redundant_brs'] = false;
|
1472 |
+
return $in;
|
1473 |
+
}
|
1474 |
+
|
1475 |
+
function wcal_enqueue_scripts_css( $hook ) {
|
1476 |
+
if ( $hook != 'woocommerce_page_woocommerce_ac_page' ) {
|
1477 |
+
return;
|
1478 |
+
} else {
|
1479 |
+
wp_enqueue_style( 'jquery-ui', "//ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" , '', '', false );
|
1480 |
+
wp_enqueue_style( 'woocommerce_admin_styles', plugins_url() . '/woocommerce/assets/css/admin.css' );
|
1481 |
+
wp_enqueue_style( 'jquery-ui-style', '//ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css' );
|
1482 |
+
wp_enqueue_style( 'abandoned-orders-list', plugins_url() . '/woocommerce-abandoned-cart/assets/css/view.abandoned.orders.style.css' );
|
1483 |
+
|
1484 |
+
}
|
1485 |
+
}
|
1486 |
+
//bulk action
|
1487 |
+
// to over come the wp redirect warning while deleting
|
1488 |
+
function wcal_app_output_buffer() {
|
1489 |
+
ob_start();
|
1490 |
+
}
|
1491 |
+
|
1492 |
+
/**
|
1493 |
+
* Abandon Cart Settings Page
|
1494 |
+
*/
|
1495 |
+
function wcal_menu_page() {
|
1496 |
+
|
1497 |
+
if ( is_user_logged_in() ) {
|
1498 |
+
global $wpdb;
|
1499 |
+
// Check the user capabilities
|
1500 |
+
if ( !current_user_can( 'manage_woocommerce' ) ) {
|
1501 |
+
wp_die( __( 'You do not have sufficient permissions to access this page.', 'woocommerce-ac' ) );
|
1502 |
+
}
|
1503 |
+
?>
|
1504 |
+
<div class="wrap">
|
1505 |
+
<h2><?php _e( 'WooCommerce - Abandon Cart Lite', 'woocommerce-ac' ); ?></h2>
|
1506 |
+
<?php
|
1507 |
+
|
1508 |
+
if ( isset( $_GET['action'] ) ) {
|
1509 |
+
$action = $_GET['action'];
|
1510 |
+
} else {
|
1511 |
+
$action = "";
|
1512 |
+
}
|
1513 |
+
if ( isset( $_GET['mode'] ) ) {
|
1514 |
+
$mode = $_GET['mode'];
|
1515 |
+
} else {
|
1516 |
+
$mode = "";
|
1517 |
+
}
|
1518 |
+
$this->wcal_display_tabs();
|
1519 |
+
|
1520 |
+
/**
|
1521 |
+
* When we delete the item from the below drop down it is registred in action 2
|
1522 |
+
*/
|
1523 |
+
if ( isset( $_GET['action2'] ) ) {
|
1524 |
+
$action_two = $_GET['action2'];
|
1525 |
+
} else {
|
1526 |
+
$action_two = "";
|
1527 |
+
}
|
1528 |
+
// Detect when a bulk action is being triggered on abandoned orders page.
|
1529 |
+
if( 'wcal_delete' === $action || 'wcal_delete' === $action_two ) {
|
1530 |
+
$ids = isset( $_GET['abandoned_order_id'] ) ? $_GET['abandoned_order_id'] : false;
|
1531 |
+
if ( ! is_array( $ids ) ) {
|
1532 |
+
$ids = array( $ids );
|
1533 |
+
}
|
1534 |
+
foreach ( $ids as $id ) {
|
1535 |
+
$class = new wcal_delete_bulk_action_handler();
|
1536 |
+
$class->wcal_delete_bulk_action_handler_function( $id );
|
1537 |
+
}
|
1538 |
+
}
|
1539 |
+
//Detect when a bulk action is being triggered on temnplates page.
|
1540 |
+
if( 'wcal_delete_template' === $action || 'wcal_delete_template' === $action_two ) {
|
1541 |
+
$ids = isset( $_GET['template_id'] ) ? $_GET['template_id'] : false;
|
1542 |
+
if ( ! is_array( $ids ) ) {
|
1543 |
+
$ids = array( $ids );
|
1544 |
+
}
|
1545 |
+
foreach ( $ids as $id ) {
|
1546 |
+
$class = new wcal_delete_bulk_action_handler();
|
1547 |
+
$class->wcal_delete_template_bulk_action_handler_function( $id );
|
1548 |
+
}
|
1549 |
+
}
|
1550 |
+
|
1551 |
+
if ( isset( $_GET['wcal_deleted'] ) && 'YES' == $_GET['wcal_deleted'] ) { ?>
|
1552 |
+
<div id="message" class="updated fade">
|
1553 |
+
<p><strong><?php _e( 'The Abandoned cart has been successfully deleted.', 'woocommerce-ac' ); ?></strong></p>
|
1554 |
+
</div>
|
1555 |
+
<?php }
|
1556 |
+
if ( isset( $_GET ['wcal_template_deleted'] ) && 'YES' == $_GET['wcal_template_deleted'] ) { ?>
|
1557 |
+
<div id="message" class="updated fade">
|
1558 |
+
<p><strong><?php _e( 'The Template has been successfully deleted.', 'woocommerce-ac' ); ?></strong></p>
|
1559 |
+
</div>
|
1560 |
+
<?php }
|
1561 |
+
if ( $action == 'emailsettings' ) {
|
1562 |
+
// Save the field values
|
1563 |
+
?>
|
1564 |
+
<p><?php _e( 'Change settings for sending email notifications to Customers after X minute.', 'woocommerce-ac' ); ?></p>
|
1565 |
+
<div id="content">
|
1566 |
+
<form method="post" action="options.php">
|
1567 |
+
<?php settings_fields( 'woocommerce_ac_settings' ); ?>
|
1568 |
+
<?php do_settings_sections( 'woocommerce_ac_page' ); ?>
|
1569 |
+
<?php settings_errors(); ?>
|
1570 |
+
<?php submit_button(); ?>
|
1571 |
+
|
1572 |
+
</form>
|
1573 |
+
</div>
|
1574 |
+
<?php
|
1575 |
+
} elseif ( $action == 'listcart' || '' == $action || '-1' == $action || '-1' == $action_two ) {
|
1576 |
+
?>
|
1577 |
+
<p> <?php _e( 'The list below shows all Abandoned Carts which have remained in cart for a time higher than the "Cart abandoned cut-off time" setting.', 'woocommerce-ac' );?> </p>
|
1578 |
+
<?php
|
1579 |
+
global $wpdb;
|
1580 |
+
|
1581 |
+
include_once( 'includes/classes/class-wcal-abandoned-orders-table.php' );
|
1582 |
+
$wcal_abandoned_order_list = new WCAL_Abandoned_Orders_Table();
|
1583 |
+
$wcal_abandoned_order_list->wcal_abandoned_order_prepare_items();
|
1584 |
+
?>
|
1585 |
+
<div class="wrap">
|
1586 |
+
<form id="wcal-abandoned-orders" method="get" >
|
1587 |
+
<input type="hidden" name="page" value="woocommerce_ac_page" />
|
1588 |
+
<input type="hidden" name="action" value="listcart" />
|
1589 |
+
<?php $wcal_abandoned_order_list->display(); ?>
|
1590 |
+
</form>
|
1591 |
+
</div>
|
1592 |
+
<?php
|
1593 |
+
} elseif ( $action == 'emailtemplates' && ( $mode != 'edittemplate' && $mode != 'addnewtemplate' ) ) {
|
1594 |
+
?>
|
1595 |
+
<p> <?php _e( 'Add email templates at different intervals to maximize the possibility of recovering your abandoned carts.', 'woocommerce-ac' );?> </p>
|
1596 |
+
<?php
|
1597 |
+
// Save the field values
|
1598 |
+
$insert_template_successfuly = $update_template_successfuly = '';
|
1599 |
+
if( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' ) {
|
1600 |
+
$active_post = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
1601 |
+
$is_wc_template = ( empty( $_POST['is_wc_template'] ) ) ? '0' : '1';
|
1602 |
+
if ( $active_post == 1 ) {
|
1603 |
+
$is_active = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
1604 |
+
$email_frequency = trim( $_POST['email_frequency'] );
|
1605 |
+
$day_or_hour = trim( $_POST['day_or_hour'] );
|
1606 |
+
|
1607 |
+
$check_query = "SELECT * FROM `".$wpdb->prefix."ac_email_templates_lite`
|
1608 |
+
WHERE is_active = %s
|
1609 |
+
AND frequency = %d
|
1610 |
+
AND day_or_hour = %s ";
|
1611 |
+
$check_results = $wpdb->get_results( $wpdb->prepare( $check_query, $is_active, $email_frequency, $day_or_hour ) );
|
1612 |
+
$default_value = 0 ;
|
1613 |
+
|
1614 |
+
if ( count( $check_results ) == 0 ) {
|
1615 |
+
$active_post = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
1616 |
+
$woocommerce_ac_email_subject = trim( $_POST['woocommerce_ac_email_subject'] );
|
1617 |
+
$woocommerce_ac_email_body = trim( $_POST['woocommerce_ac_email_body'] );
|
1618 |
+
$woocommerce_ac_template_name = trim( $_POST['woocommerce_ac_template_name'] );
|
1619 |
+
$woocommerce_ac_from_name = trim( $_POST['woocommerce_ac_from_name'] );
|
1620 |
+
$woocommerce_ac_email_reply = trim( $_POST['woocommerce_ac_email_reply'] );
|
1621 |
+
$woocommerce_ac_email_from = trim( $_POST['woocommerce_ac_email_from'] );
|
1622 |
+
$woocommerce_ac_email_header = trim( $_POST['wcal_wc_email_header'] );
|
1623 |
+
$query = "INSERT INTO `".$wpdb->prefix."ac_email_templates_lite`
|
1624 |
+
(subject, body, is_active, frequency, day_or_hour, template_name, from_name, is_wc_template, default_template, reply_email, from_email, wc_email_header )
|
1625 |
+
VALUES ( %s, %s, %s, %d, %s, %s, %s, %s, %d, %s, %s, %s )"; //It is fix
|
1626 |
+
|
1627 |
+
$insert_template_successfuly = $wpdb->query( $wpdb->prepare( $query,
|
1628 |
+
$woocommerce_ac_email_subject,
|
1629 |
+
$woocommerce_ac_email_body,
|
1630 |
+
$active_post,
|
1631 |
+
$email_frequency,
|
1632 |
+
$day_or_hour,
|
1633 |
+
$woocommerce_ac_template_name,
|
1634 |
+
$woocommerce_ac_from_name,
|
1635 |
+
$is_wc_template,
|
1636 |
+
$default_value,
|
1637 |
+
$woocommerce_ac_email_reply,
|
1638 |
+
$woocommerce_ac_email_from,
|
1639 |
+
$woocommerce_ac_email_header)
|
1640 |
+
);
|
1641 |
+
} else {
|
1642 |
+
$update_is_active = 0;
|
1643 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1644 |
+
SET
|
1645 |
+
is_active = %s
|
1646 |
+
WHERE frequency = %d
|
1647 |
+
AND day_or_hour = %s ";
|
1648 |
+
$update_template_successfuly = $wpdb->query($wpdb->prepare( $query_update, $update_is_active, $email_frequency, $day_or_hour ) );
|
1649 |
+
|
1650 |
+
$woocommerce_ac_email_subject = trim( $_POST['woocommerce_ac_email_subject'] );
|
1651 |
+
$woocommerce_ac_email_body = trim( $_POST['woocommerce_ac_email_body'] );
|
1652 |
+
$woocommerce_ac_template_name = trim( $_POST['woocommerce_ac_template_name'] );
|
1653 |
+
$woocommerce_ac_from_name = trim( $_POST['woocommerce_ac_from_name'] );
|
1654 |
+
$woocommerce_ac_email_from = trim( $_POST['woocommerce_ac_email_from'] );
|
1655 |
+
$woocommerce_ac_email_reply = trim( $_POST['woocommerce_ac_email_reply'] );
|
1656 |
+
$woocommerce_ac_email_header = trim( $_POST['wcal_wc_email_header'] );
|
1657 |
+
$query_insert_new = "INSERT INTO `".$wpdb->prefix."ac_email_templates_lite`
|
1658 |
+
(subject, body, is_active, frequency, day_or_hour, template_name, from_name, is_wc_template, default_template, reply_email, from_email, wc_email_header )
|
1659 |
+
VALUES ( %s, %s, %s, %d, %s, %s, %s, %s, %d, %s, %s, %s )";
|
1660 |
+
|
1661 |
+
$insert_template_successfuly = $wpdb->query( $wpdb->prepare( $query_insert_new,
|
1662 |
+
$woocommerce_ac_email_subject,
|
1663 |
+
$woocommerce_ac_email_body,
|
1664 |
+
$active_post,
|
1665 |
+
$email_frequency,
|
1666 |
+
$day_or_hour,
|
1667 |
+
$woocommerce_ac_template_name,
|
1668 |
+
$woocommerce_ac_from_name,
|
1669 |
+
$is_wc_template,
|
1670 |
+
$default_value,
|
1671 |
+
$woocommerce_ac_email_reply,
|
1672 |
+
$woocommerce_ac_email_from,
|
1673 |
+
$woocommerce_ac_email_header )
|
1674 |
+
);
|
1675 |
+
}
|
1676 |
+
} else {
|
1677 |
+
$woocommerce_ac_email_subject = trim( $_POST['woocommerce_ac_email_subject'] );
|
1678 |
+
$woocommerce_ac_email_body = trim( $_POST['woocommerce_ac_email_body'] );
|
1679 |
+
$woocommerce_ac_template_name = trim( $_POST['woocommerce_ac_template_name'] );
|
1680 |
+
$woocommerce_ac_from_name = trim( $_POST['woocommerce_ac_from_name'] );
|
1681 |
+
$woocommerce_ac_email_reply = trim( $_POST['woocommerce_ac_email_reply'] );
|
1682 |
+
$woocommerce_ac_email_from = trim( $_POST['woocommerce_ac_email_from'] );
|
1683 |
+
$woocommerce_ac_email_header = trim( $_POST['wcal_wc_email_header'] );
|
1684 |
+
$active_post = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
1685 |
+
$email_frequency = trim( $_POST['email_frequency'] );
|
1686 |
+
$day_or_hour = trim( $_POST['day_or_hour'] );
|
1687 |
+
$is_wc_template = ( empty( $_POST['is_wc_template'] ) ) ? '0' : '1';
|
1688 |
+
$default_value = 0 ;
|
1689 |
+
|
1690 |
+
$query = "INSERT INTO `".$wpdb->prefix."ac_email_templates_lite`
|
1691 |
+
(subject, body, is_active, frequency, day_or_hour, template_name, from_name, is_wc_template, default_template, reply_email, from_email, wc_email_header )
|
1692 |
+
VALUES ( %s, %s, %s, %d, %s, %s, %s, %s, %d, %s, %s, %s )";
|
1693 |
+
|
1694 |
+
$insert_template_successfuly = $wpdb->query( $wpdb->prepare( $query,
|
1695 |
+
$woocommerce_ac_email_subject,
|
1696 |
+
$woocommerce_ac_email_body,
|
1697 |
+
$active_post,
|
1698 |
+
$email_frequency,
|
1699 |
+
$day_or_hour,
|
1700 |
+
$woocommerce_ac_template_name,
|
1701 |
+
$woocommerce_ac_from_name,
|
1702 |
+
$is_wc_template,
|
1703 |
+
$default_value,
|
1704 |
+
$woocommerce_ac_email_reply,
|
1705 |
+
$woocommerce_ac_email_from,
|
1706 |
+
$woocommerce_ac_email_header )
|
1707 |
+
);
|
1708 |
+
}
|
1709 |
+
}
|
1710 |
+
|
1711 |
+
if( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'update' ) {
|
1712 |
+
$active = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
1713 |
+
$is_wc_template = ( empty( $_POST['is_wc_template'] ) ) ? '0' : '1';
|
1714 |
+
|
1715 |
+
if ( $active == 1 ) {
|
1716 |
+
$is_active = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
1717 |
+
$email_frequency = trim( $_POST['email_frequency'] );
|
1718 |
+
$day_or_hour = trim( $_POST['day_or_hour'] );
|
1719 |
+
$check_query = "SELECT * FROM `".$wpdb->prefix."ac_email_templates_lite`
|
1720 |
+
WHERE is_active= %s
|
1721 |
+
AND frequency = %d
|
1722 |
+
AND day_or_hour= %s ";
|
1723 |
+
$check_results = $wpdb->get_results( $wpdb->prepare( $check_query, $is_active, $email_frequency, $day_or_hour ) );
|
1724 |
+
$default_value = '';
|
1725 |
+
|
1726 |
+
foreach( $check_results as $result_key => $result_value ) {
|
1727 |
+
$default_value = ( empty( $result_value->default_template ) ) ? 0 : $result_value->default_template;
|
1728 |
+
}
|
1729 |
+
|
1730 |
+
if( count( $check_results ) == 0 ) {
|
1731 |
+
$woocommerce_ac_email_subject = trim( $_POST['woocommerce_ac_email_subject'] );
|
1732 |
+
$woocommerce_ac_email_body = trim( $_POST['woocommerce_ac_email_body'] );
|
1733 |
+
$woocommerce_ac_template_name = trim( $_POST['woocommerce_ac_template_name'] );
|
1734 |
+
$woocommerce_ac_from_name = trim( $_POST['woocommerce_ac_from_name'] );
|
1735 |
+
$woocommerce_ac_email_from = trim( $_POST['woocommerce_ac_email_from'] );
|
1736 |
+
$woocommerce_ac_email_reply = trim( $_POST['woocommerce_ac_email_reply'] );
|
1737 |
+
$woocommerce_ac_email_header = trim( $_POST['wcal_wc_email_header'] );
|
1738 |
+
$id = trim( $_POST['id'] );
|
1739 |
+
|
1740 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1741 |
+
SET
|
1742 |
+
subject = %s,
|
1743 |
+
body = %s,
|
1744 |
+
is_active = %s,
|
1745 |
+
frequency = %d,
|
1746 |
+
day_or_hour = %s,
|
1747 |
+
template_name = %s,
|
1748 |
+
from_name = %s,
|
1749 |
+
is_wc_template = %s,
|
1750 |
+
default_template = %d,
|
1751 |
+
reply_email = %s,
|
1752 |
+
from_email = %s,
|
1753 |
+
wc_email_header = %s
|
1754 |
+
WHERE id = %d ";
|
1755 |
+
$update_template_successfuly = $wpdb->query($wpdb->prepare( $query_update,
|
1756 |
+
$woocommerce_ac_email_subject,
|
1757 |
+
$woocommerce_ac_email_body,
|
1758 |
+
$active,
|
1759 |
+
$email_frequency,
|
1760 |
+
$day_or_hour,
|
1761 |
+
$woocommerce_ac_template_name,
|
1762 |
+
$woocommerce_ac_from_name,
|
1763 |
+
$is_wc_template,
|
1764 |
+
$default_value,
|
1765 |
+
$woocommerce_ac_email_from,
|
1766 |
+
$woocommerce_ac_email_reply,
|
1767 |
+
$woocommerce_ac_email_header,
|
1768 |
+
$id )
|
1769 |
+
|
1770 |
+
);
|
1771 |
+
} else {
|
1772 |
+
$updated_is_active = 0;
|
1773 |
+
$query_update_new = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1774 |
+
SET is_active = %s
|
1775 |
+
WHERE frequency = %d
|
1776 |
+
AND day_or_hour = %s ";
|
1777 |
+
$update_template_successfuly = $wpdb->query( $wpdb->prepare( $query_update_new, $updated_is_active, $email_frequency, $day_or_hour ) );
|
1778 |
+
$woocommerce_ac_email_subject = trim( $_POST['woocommerce_ac_email_subject'] );
|
1779 |
+
$woocommerce_ac_email_body = trim( $_POST['woocommerce_ac_email_body'] );
|
1780 |
+
$woocommerce_ac_template_name = trim( $_POST['woocommerce_ac_template_name'] );
|
1781 |
+
$woocommerce_ac_from_name = trim( $_POST['woocommerce_ac_from_name'] );
|
1782 |
+
$woocommerce_ac_email_from = trim( $_POST['woocommerce_ac_email_from'] );
|
1783 |
+
$woocommerce_ac_email_reply = trim( $_POST['woocommerce_ac_email_reply'] );
|
1784 |
+
$woocommerce_ac_email_header = trim( $_POST['wcal_wc_email_header'] );
|
1785 |
+
$id = trim( $_POST['id'] );
|
1786 |
+
|
1787 |
+
$query_update_latest = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1788 |
+
SET
|
1789 |
+
subject = %s,
|
1790 |
+
body = %s,
|
1791 |
+
is_active = %s,
|
1792 |
+
frequency = %d,
|
1793 |
+
day_or_hour = %s,
|
1794 |
+
template_name = %s,
|
1795 |
+
from_name = %s,
|
1796 |
+
is_wc_template = %s,
|
1797 |
+
default_template = %d,
|
1798 |
+
reply_email = %s,
|
1799 |
+
from_email = %s,
|
1800 |
+
wc_email_header = %s
|
1801 |
+
WHERE id = %d ";
|
1802 |
+
$update_template_successfuly = $wpdb->query($wpdb->prepare( $query_update_latest,
|
1803 |
+
$woocommerce_ac_email_subject,
|
1804 |
+
$woocommerce_ac_email_body,
|
1805 |
+
$active,
|
1806 |
+
$email_frequency,
|
1807 |
+
$day_or_hour,
|
1808 |
+
$woocommerce_ac_template_name,
|
1809 |
+
$woocommerce_ac_from_name,
|
1810 |
+
$is_wc_template,
|
1811 |
+
$default_value,
|
1812 |
+
$woocommerce_ac_email_reply,
|
1813 |
+
$woocommerce_ac_email_from,
|
1814 |
+
$woocommerce_ac_email_header,
|
1815 |
+
$id )
|
1816 |
+
|
1817 |
+
);
|
1818 |
+
}
|
1819 |
+
} else {
|
1820 |
+
$updated_is_active = '0';
|
1821 |
+
$is_active = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
1822 |
+
$email_frequency = trim( $_POST['email_frequency'] );
|
1823 |
+
$day_or_hour = trim( $_POST['day_or_hour'] );
|
1824 |
+
$is_wc_template = ( empty( $_POST['is_wc_template'] ) ) ? '0' : '1';
|
1825 |
+
|
1826 |
+
$query_update_new = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1827 |
+
SET is_active = %s
|
1828 |
+
WHERE frequency = %d
|
1829 |
+
AND day_or_hour = %s ";
|
1830 |
+
$wpdb->query( $wpdb->prepare( $query_update_new, $updated_is_active, $email_frequency, $day_or_hour ) );
|
1831 |
+
|
1832 |
+
$woocommerce_ac_email_subject = trim( $_POST['woocommerce_ac_email_subject'] );
|
1833 |
+
$woocommerce_ac_email_body = trim( $_POST['woocommerce_ac_email_body'] );
|
1834 |
+
$woocommerce_ac_template_name = trim( $_POST['woocommerce_ac_template_name'] );
|
1835 |
+
$woocommerce_ac_from_name = trim( $_POST['woocommerce_ac_from_name'] );
|
1836 |
+
$woocommerce_ac_email_from = trim( $_POST['woocommerce_ac_email_from'] );
|
1837 |
+
$woocommerce_ac_email_reply = trim( $_POST['woocommerce_ac_email_reply'] );
|
1838 |
+
$woocommerce_ac_email_header = trim( $_POST['wcal_wc_email_header'] );
|
1839 |
+
$id = trim( $_POST['id'] );
|
1840 |
+
$check_query = "SELECT * FROM `".$wpdb->prefix."ac_email_templates_lite`
|
1841 |
+
WHERE is_active= %s
|
1842 |
+
AND frequency = %d
|
1843 |
+
AND day_or_hour= %s ";
|
1844 |
+
$check_results = $wpdb->get_results( $wpdb->prepare( $check_query, $is_active, $email_frequency, $day_or_hour ) );
|
1845 |
+
$default_value = '';
|
1846 |
+
|
1847 |
+
foreach( $check_results as $result_key => $result_value ) {
|
1848 |
+
$default_value = ( empty( $result_value->default_template ) ) ? 0 : $result_value->default_template;
|
1849 |
+
}
|
1850 |
+
|
1851 |
+
$query_update_latest = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
1852 |
+
SET
|
1853 |
+
subject = %s,
|
1854 |
+
body = %s,
|
1855 |
+
is_active = %s,
|
1856 |
+
frequency = %d,
|
1857 |
+
day_or_hour = %s,
|
1858 |
+
template_name = %s,
|
1859 |
+
from_name = %s,
|
1860 |
+
is_wc_template = %s,
|
1861 |
+
default_template = %d,
|
1862 |
+
reply_email = %s,
|
1863 |
+
from_email = %s,
|
1864 |
+
wc_email_header = %s
|
1865 |
+
WHERE id = %d ";
|
1866 |
+
|
1867 |
+
$update_template_successfuly = $wpdb->query( $wpdb->prepare( $query_update_latest,
|
1868 |
+
$woocommerce_ac_email_subject,
|
1869 |
+
$woocommerce_ac_email_body,
|
1870 |
+
$is_active,
|
1871 |
+
$email_frequency,
|
1872 |
+
$day_or_hour,
|
1873 |
+
$woocommerce_ac_template_name,
|
1874 |
+
$woocommerce_ac_from_name,
|
1875 |
+
$is_wc_template,
|
1876 |
+
$default_value,
|
1877 |
+
$woocommerce_ac_email_reply,
|
1878 |
+
$woocommerce_ac_email_from,
|
1879 |
+
$woocommerce_ac_email_header,
|
1880 |
+
$id )
|
1881 |
+
);
|
1882 |
+
}
|
1883 |
+
}
|
1884 |
+
|
1885 |
+
if ( $action == 'emailtemplates' && $mode == 'removetemplate' ) {
|
1886 |
+
$id_remove = $_GET['id'];
|
1887 |
+
$query_remove = "DELETE FROM `".$wpdb->prefix."ac_email_templates_lite` WHERE id= %d ";
|
1888 |
+
$wpdb->query( $wpdb->prepare( $query_remove, $id_remove ) );
|
1889 |
+
}
|
1890 |
+
|
1891 |
+
if ( $action == 'emailtemplates' && $mode == 'activate_template' ) {
|
1892 |
+
$template_id = $_GET['id'];
|
1893 |
+
$current_template_status = $_GET['active_state'];
|
1894 |
+
|
1895 |
+
if( "1" == $current_template_status ) {
|
1896 |
+
$active = "0";
|
1897 |
+
} else {
|
1898 |
+
$active = "1";
|
1899 |
+
}
|
1900 |
+
$query_update = "UPDATE `" . $wpdb->prefix . "ac_email_templates_lite`
|
1901 |
+
SET
|
1902 |
+
is_active = '" . $active . "'
|
1903 |
+
WHERE id = '" . $template_id . "' ";
|
1904 |
+
$wpdb->query( $query_update );
|
1905 |
+
|
1906 |
+
wp_safe_redirect( admin_url( '/admin.php?page=woocommerce_ac_page&action=emailtemplates' ) );
|
1907 |
+
}
|
1908 |
+
|
1909 |
+
if( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' && ( isset( $insert_template_successfuly ) && $insert_template_successfuly != '' ) ) { ?>
|
1910 |
+
<div id="message" class="updated fade"><p><strong><?php _e( 'The Email Template has been successfully added.', 'woocommerce-ac' ); ?></strong></p></div>
|
1911 |
+
<?php } else if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'save' && ( isset( $insert_template_successfuly ) && $insert_template_successfuly == '' ) ) {
|
1912 |
+
?>
|
1913 |
+
<div id="message" class="error fade"><p><strong><?php _e( ' There was a problem adding the email template. Please contact the plugin author via <a href= "https://wordpress.org/support/plugin/woocommerce-abandoned-cart">support forum</a>.', 'woocommerce-ac' ); ?></strong></p></div>
|
1914 |
+
<?php
|
1915 |
+
}
|
1916 |
+
|
1917 |
+
if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'update' && isset($update_template_successfuly) && $update_template_successfuly >= 0 ) { ?>
|
1918 |
+
<div id="message" class="updated fade"><p><strong><?php _e( 'The Email Template has been successfully updated.', 'woocommerce-ac' ); ?></strong></p></div>
|
1919 |
+
<?php } else if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'update' && isset($update_template_successfuly) && $update_template_successfuly === false ){
|
1920 |
+
?>
|
1921 |
+
<div id="message" class="error fade"><p><strong><?php _e( ' There was a problem updating the email template. Please contact the plugin author via <a href= "https://wordpress.org/support/plugin/woocommerce-abandoned-cart">support forum</a>.', 'woocommerce-ac' ); ?></strong></p></div>
|
1922 |
+
<?php
|
1923 |
+
}
|
1924 |
+
?>
|
1925 |
+
<div class="tablenav">
|
1926 |
+
<p style="float:left;">
|
1927 |
+
<a cursor: pointer; href="<?php echo "admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=addnewtemplate"; ?>" class="button-secondary"><?php _e( 'Add New Template', 'woocommerce-ac' ); ?></a>
|
1928 |
+
</p>
|
1929 |
+
|
1930 |
+
<?php
|
1931 |
+
/* From here you can do whatever you want with the data from the $result link. */
|
1932 |
+
include_once('includes/classes/class-wcal-templates-table.php');
|
1933 |
+
$wcal_template_list = new WCAL_Templates_Table();
|
1934 |
+
$wcal_template_list->wcal_templates_prepare_items();
|
1935 |
+
?>
|
1936 |
+
<div class="wrap">
|
1937 |
+
<form id="wcal-abandoned-templates" method="get" >
|
1938 |
+
<input type="hidden" name="page" value="woocommerce_ac_page" />
|
1939 |
+
<input type="hidden" name="action" value="emailtemplates" />
|
1940 |
+
<?php $wcal_template_list->display(); ?>
|
1941 |
+
</form>
|
1942 |
+
</div>
|
1943 |
+
</div>
|
1944 |
+
<?php
|
1945 |
+
} elseif ($action == 'stats' || $action == '') {
|
1946 |
+
?>
|
1947 |
+
<p>
|
1948 |
+
<script language='javascript'>
|
1949 |
+
jQuery( document ).ready( function()
|
1950 |
+
{
|
1951 |
+
jQuery( '#duration_select' ).change( function()
|
1952 |
+
{
|
1953 |
+
var group_name = jQuery( '#duration_select' ).val();
|
1954 |
+
var today = new Date();
|
1955 |
+
var start_date = "";
|
1956 |
+
var end_date = "";
|
1957 |
+
if ( group_name == "yesterday" )
|
1958 |
+
{
|
1959 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 1 );
|
1960 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 1 );
|
1961 |
+
}
|
1962 |
+
else if ( group_name == "today")
|
1963 |
+
{
|
1964 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1965 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1966 |
+
}
|
1967 |
+
else if ( group_name == "last_seven" )
|
1968 |
+
{
|
1969 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 7 );
|
1970 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1971 |
+
}
|
1972 |
+
else if ( group_name == "last_fifteen" )
|
1973 |
+
{
|
1974 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 15 );
|
1975 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1976 |
+
}
|
1977 |
+
else if ( group_name == "last_thirty" )
|
1978 |
+
{
|
1979 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 30 );
|
1980 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1981 |
+
}
|
1982 |
+
else if ( group_name == "last_ninety" )
|
1983 |
+
{
|
1984 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 90 );
|
1985 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1986 |
+
}
|
1987 |
+
else if ( group_name == "last_year_days" )
|
1988 |
+
{
|
1989 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 365 );
|
1990 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
1991 |
+
}
|
1992 |
+
|
1993 |
+
var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
1994 |
+
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
1995 |
+
|
1996 |
+
var start_date_value = start_date.getDate() + " " + monthNames[start_date.getMonth()] + " " + start_date.getFullYear();
|
1997 |
+
var end_date_value = end_date.getDate() + " " + monthNames[end_date.getMonth()] + " " + end_date.getFullYear();
|
1998 |
+
|
1999 |
+
jQuery( '#start_date' ).val( start_date_value );
|
2000 |
+
jQuery( '#end_date' ).val( end_date_value );
|
2001 |
+
|
2002 |
+
});
|
2003 |
+
});
|
2004 |
+
</script>
|
2005 |
+
<?php
|
2006 |
+
|
2007 |
+
if ( isset( $_POST['duration_select'] ) ){
|
2008 |
+
$duration_range = $_POST['duration_select'];
|
2009 |
+
} else {
|
2010 |
+
$duration_range = "";
|
2011 |
+
}
|
2012 |
+
if ( $duration_range == "" ) {
|
2013 |
+
if ( isset( $_GET['duration_select'] ) ){
|
2014 |
+
$duration_range = $_GET['duration_select'];
|
2015 |
+
}
|
2016 |
+
}
|
2017 |
+
if ($duration_range == "") $duration_range = "last_seven";
|
2018 |
+
|
2019 |
+
_e( 'The Report below shows how many Abandoned Carts we were able to recover for you by sending automatic emails to encourage shoppers.', 'woocommerce-ac');
|
2020 |
+
?>
|
2021 |
+
<div id="recovered_stats" class="postbox" style="display:block">
|
2022 |
+
<div class="inside">
|
2023 |
+
<form method="post" action="admin.php?page=woocommerce_ac_page&action=stats" id="ac_stats">
|
2024 |
+
<select id="duration_select" name="duration_select" >
|
2025 |
+
<?php
|
2026 |
+
foreach ( $this->duration_range_select as $key => $value ) {
|
2027 |
+
$sel = "";
|
2028 |
+
if ($key == $duration_range) {
|
2029 |
+
$sel = " selected ";
|
2030 |
+
}
|
2031 |
+
echo"<option value='$key' $sel> $value </option>";
|
2032 |
+
}
|
2033 |
+
$date_sett = $this->start_end_dates[ $duration_range ];
|
2034 |
+
?>
|
2035 |
+
</select>
|
2036 |
+
<script type="text/javascript">
|
2037 |
+
jQuery( document ).ready( function()
|
2038 |
+
{
|
2039 |
+
var formats = ["d.m.y", "d M yy","MM d, yy"];
|
2040 |
+
jQuery( "#start_date" ).datepicker( { dateFormat: formats[1] } );
|
2041 |
+
});
|
2042 |
+
|
2043 |
+
jQuery( document ).ready( function()
|
2044 |
+
{
|
2045 |
+
var formats = ["d.m.y", "d M yy","MM d, yy"];
|
2046 |
+
jQuery( "#end_date" ).datepicker( { dateFormat: formats[1] } );
|
2047 |
+
});
|
2048 |
+
</script>
|
2049 |
+
<?php
|
2050 |
+
include_once('includes/classes/class-wcal-recover-orders-table.php');
|
2051 |
+
$wcal_recover_orders_list = new WCAL_Recover_Orders_Table();
|
2052 |
+
$wcal_recover_orders_list->wcal_recovered_orders_prepare_items();
|
2053 |
+
|
2054 |
+
if ( isset( $_POST['start_date'] ) ) $start_date_range = $_POST['start_date'];
|
2055 |
+
else $start_date_range = "";
|
2056 |
+
|
2057 |
+
if ( $start_date_range == "" ) {
|
2058 |
+
$start_date_range = $date_sett['start_date'];
|
2059 |
+
}
|
2060 |
+
|
2061 |
+
if ( isset( $_POST['end_date'] ) ) $end_date_range = $_POST['end_date'];
|
2062 |
+
else $end_date_range = "";
|
2063 |
+
|
2064 |
+
if ( $end_date_range == "" ) {
|
2065 |
+
$end_date_range = $date_sett['end_date'];
|
2066 |
+
}
|
2067 |
+
?>
|
2068 |
+
<label class="start_label" for="start_day"> <?php _e( 'Start Date:', 'woocommerce-ac' ); ?> </label>
|
2069 |
+
<input type="text" id="start_date" name="start_date" readonly="readonly" value="<?php echo $start_date_range; ?>"/>
|
2070 |
+
<label class="end_label" for="end_day"> <?php _e( 'End Date:', 'woocommerce-ac' ); ?> </label>
|
2071 |
+
<input type="text" id="end_date" name="end_date" readonly="readonly" value="<?php echo $end_date_range; ?>"/>
|
2072 |
+
<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( 'Go', 'woocommerce-ac' ); ?>" />
|
2073 |
+
</form>
|
2074 |
+
</div>
|
2075 |
+
</div>
|
2076 |
+
<div id="recovered_stats" class="postbox" style="display:block">
|
2077 |
+
<div class="inside" >
|
2078 |
+
<p style="font-size: 15px"><?php _e( 'During the selected range ', 'woocommerce-ac' ); ?>
|
2079 |
+
<strong>
|
2080 |
+
<?php $count = $wcal_recover_orders_list->total_abandoned_cart_count;
|
2081 |
+
echo $count; ?>
|
2082 |
+
</strong>
|
2083 |
+
<?php _e( 'carts totaling', 'woocommerce-ac' ); ?>
|
2084 |
+
<strong>
|
2085 |
+
<?php $total_of_all_order = $wcal_recover_orders_list->total_order_amount;
|
2086 |
+
|
2087 |
+
echo $total_of_all_order; ?>
|
2088 |
+
</strong>
|
2089 |
+
<?php _e( ' were abandoned. We were able to recover', 'woocommerce-ac' ); ?>
|
2090 |
+
<strong>
|
2091 |
+
<?php
|
2092 |
+
$recovered_item = $wcal_recover_orders_list->recovered_item;
|
2093 |
+
|
2094 |
+
echo $recovered_item; ?>
|
2095 |
+
</strong>
|
2096 |
+
<?php _e( ' of them, which led to an extra', 'woocommerce-ac' ); ?>
|
2097 |
+
<strong>
|
2098 |
+
<?php
|
2099 |
+
$recovered_total = $wcal_recover_orders_list->total_recover_amount;
|
2100 |
+
echo wc_price( $recovered_total ); ?>
|
2101 |
+
</strong>
|
2102 |
+
</p>
|
2103 |
+
</div>
|
2104 |
+
</div>
|
2105 |
+
<div class="wrap">
|
2106 |
+
<form id="wcal-recover-orders" method="get" >
|
2107 |
+
<input type="hidden" name="page" value="woocommerce_ac_page" />
|
2108 |
+
<input type="hidden" name="action" value="stats" />
|
2109 |
+
<?php $wcal_recover_orders_list->display(); ?>
|
2110 |
+
</form>
|
2111 |
+
</div>
|
2112 |
+
<?php
|
2113 |
+
} elseif ( $action == 'orderdetails' ) {
|
2114 |
+
$ac_order_id = $_GET['id'];
|
2115 |
+
?>
|
2116 |
+
<p> </p>
|
2117 |
+
<div id="ac_order_details" class="postbox" style="display:block">
|
2118 |
+
<h3> <p> <?php _e( "Abandoned Order #$ac_order_id Details", "woocommerce-ac" ); ?> </p> </h3>
|
2119 |
+
<div class="inside">
|
2120 |
+
<table cellpadding="0" cellspacing="0" class="wp-list-table widefat fixed posts">
|
2121 |
+
<tr>
|
2122 |
+
<th> <?php _e( 'Item', 'woocommerce-ac' ); ?> </th>
|
2123 |
+
<th> <?php _e( 'Name', 'woocommerce-ac' ); ?> </th>
|
2124 |
+
<th> <?php _e( 'Quantity', 'woocommerce-ac' ); ?> </th>
|
2125 |
+
<th> <?php _e( 'Line Subtotal', 'woocommerce-ac' ); ?> </th>
|
2126 |
+
<th> <?php _e( 'Line Total', 'woocommerce-ac' ); ?> </th>
|
2127 |
+
</tr>
|
2128 |
+
<?php
|
2129 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE id = %d ";
|
2130 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query,$_GET['id'] ) );
|
2131 |
+
|
2132 |
+
$shipping_charges = 0;
|
2133 |
+
$currency_symbol = get_woocommerce_currency_symbol();
|
2134 |
+
$number_decimal = wc_get_price_decimals();
|
2135 |
+
if ( $results[0]->user_type == "GUEST" ) {
|
2136 |
+
$query_guest = "SELECT * FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE id = %d";
|
2137 |
+
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $results[0]->user_id ) );
|
2138 |
+
$user_email = $results_guest[0]->email_id;
|
2139 |
+
$user_first_name = $results_guest[0]->billing_first_name;
|
2140 |
+
$user_last_name = $results_guest[0]->billing_last_name;
|
2141 |
+
$user_billing_postcode = $results_guest[0]->billing_zipcode;
|
2142 |
+
$user_shipping_postcode = $results_guest[0]->shipping_zipcode;
|
2143 |
+
$shipping_charges = $results_guest[0]->shipping_charges;
|
2144 |
+
$user_billing_company = $user_billing_address_1 = $user_billing_address_2 = $user_billing_city = $user_billing_state = $user_billing_country = $user_billing_phone = "";
|
2145 |
+
$user_shipping_company = $user_shipping_address_1 = $user_shipping_address_2 = $user_shipping_city = $user_shipping_state = $user_shipping_country = "";
|
2146 |
+
} else {
|
2147 |
+
$user_id = $results[0]->user_id;
|
2148 |
+
if ( isset( $results[0]->user_login ) ) {
|
2149 |
+
$user_login = $results[0]->user_login;
|
2150 |
+
}
|
2151 |
+
$user_email = get_user_meta( $results[0]->user_id, 'billing_email', true );
|
2152 |
+
if( "" == $user_email ) {
|
2153 |
+
$user_data = get_userdata( $results[0]->user_id );
|
2154 |
+
$user_email = $user_data->user_email;
|
2155 |
+
}
|
2156 |
+
|
2157 |
+
$user_first_name = "";
|
2158 |
+
$user_first_name_temp = get_user_meta( $user_id, 'billing_first_name', true );
|
2159 |
+
if( isset( $user_first_name_temp ) && "" == $user_first_name_temp ) {
|
2160 |
+
$user_data = get_userdata( $user_id );
|
2161 |
+
$user_first_name = $user_data->first_name;
|
2162 |
+
} else {
|
2163 |
+
$user_first_name = $user_first_name_temp;
|
2164 |
+
}
|
2165 |
+
$user_last_name = "";
|
2166 |
+
$user_last_name_temp = get_user_meta( $user_id, 'billing_last_name', true );
|
2167 |
+
if( isset( $user_last_name_temp ) && "" == $user_last_name_temp ) {
|
2168 |
+
$user_data = get_userdata( $user_id );
|
2169 |
+
$user_last_name = $user_data->last_name;
|
2170 |
+
} else {
|
2171 |
+
$user_last_name = $user_last_name_temp;
|
2172 |
+
}
|
2173 |
+
$user_billing_first_name = get_user_meta( $results[0]->user_id, 'billing_first_name' );
|
2174 |
+
$user_billing_last_name = get_user_meta( $results[0]->user_id, 'billing_last_name' );
|
2175 |
+
$user_billing_company_temp = get_user_meta( $results[0]->user_id, 'billing_company' );
|
2176 |
+
if ( isset( $user_billing_company_temp[0] ) ) {
|
2177 |
+
$user_billing_company = $user_billing_company_temp[0];
|
2178 |
+
} else {
|
2179 |
+
$user_billing_company = "";
|
2180 |
+
}
|
2181 |
+
$user_billing_address_1_temp = get_user_meta( $results[0]->user_id, 'billing_address_1' );
|
2182 |
+
if ( isset( $user_billing_address_1_temp[0] ) ) {
|
2183 |
+
$user_billing_address_1 = $user_billing_address_1_temp[0];
|
2184 |
+
} else {
|
2185 |
+
$user_billing_address_1 = "";
|
2186 |
+
}
|
2187 |
+
$user_billing_address_2_temp = get_user_meta( $results[0]->user_id, 'billing_address_2' );
|
2188 |
+
if ( isset( $user_billing_address_2_temp[0] ) ) {
|
2189 |
+
$user_billing_address_2 = $user_billing_address_2_temp[0];
|
2190 |
+
} else {
|
2191 |
+
$user_billing_address_2 = "";
|
2192 |
+
}
|
2193 |
+
$user_billing_city_temp = get_user_meta( $results[0]->user_id, 'billing_city' );
|
2194 |
+
if ( isset( $user_billing_city_temp[0] ) ) {
|
2195 |
+
$user_billing_city = $user_billing_city_temp[0];
|
2196 |
+
} else {
|
2197 |
+
$user_billing_city = "";
|
2198 |
+
}
|
2199 |
+
$user_billing_postcode_temp = get_user_meta( $results[0]->user_id, 'billing_postcode' );
|
2200 |
+
if ( isset( $user_billing_postcode_temp[0] ) ) {
|
2201 |
+
$user_billing_postcode = $user_billing_postcode_temp[0];
|
2202 |
+
} else {
|
2203 |
+
$user_billing_postcode = "";
|
2204 |
+
}
|
2205 |
+
$user_billing_state_temp = get_user_meta( $results[0]->user_id, 'billing_state' );
|
2206 |
+
if ( isset( $user_billing_state_temp[0] ) ) {
|
2207 |
+
$user_billing_state = $user_billing_state_temp[0];
|
2208 |
+
} else {
|
2209 |
+
$user_billing_state = "";
|
2210 |
+
}
|
2211 |
+
$user_billing_country_temp = get_user_meta( $results[0]->user_id, 'billing_country' );
|
2212 |
+
if ( isset( $user_billing_country_temp[0] ) ) {
|
2213 |
+
$user_billing_country = $user_billing_country_temp[0];
|
2214 |
+
} else {
|
2215 |
+
$user_billing_country = "";
|
2216 |
+
}
|
2217 |
+
$user_billing_phone_temp = get_user_meta( $results[0]->user_id, 'billing_phone' );
|
2218 |
+
if ( isset( $user_billing_phone_temp[0] ) ) {
|
2219 |
+
$user_billing_phone = $user_billing_phone_temp[0];
|
2220 |
+
} else {
|
2221 |
+
$user_billing_phone = "";
|
2222 |
+
}
|
2223 |
+
$user_shipping_first_name = get_user_meta( $results[0]->user_id, 'shipping_first_name' );
|
2224 |
+
$user_shipping_last_name = get_user_meta( $results[0]->user_id, 'shipping_last_name' );
|
2225 |
+
$user_shipping_company_temp = get_user_meta( $results[0]->user_id, 'shipping_company' );
|
2226 |
+
if ( isset( $user_shipping_company_temp[0] ) ) {
|
2227 |
+
$user_shipping_company = $user_shipping_company_temp[0];
|
2228 |
+
} else {
|
2229 |
+
$user_shipping_company = "";
|
2230 |
+
}
|
2231 |
+
$user_shipping_address_1_temp = get_user_meta( $results[0]->user_id, 'shipping_address_1' );
|
2232 |
+
if ( isset( $user_shipping_address_1_temp[0] ) ) {
|
2233 |
+
$user_shipping_address_1 = $user_shipping_address_1_temp[0];
|
2234 |
+
} else {
|
2235 |
+
$user_shipping_address_1 = "";
|
2236 |
+
}
|
2237 |
+
$user_shipping_address_2_temp = get_user_meta( $results[0]->user_id, 'shipping_address_2' );
|
2238 |
+
if ( isset( $user_shipping_address_2_temp[0] ) ) {
|
2239 |
+
$user_shipping_address_2 = $user_shipping_address_2_temp[0];
|
2240 |
+
} else {
|
2241 |
+
$user_shipping_address_2 = "";
|
2242 |
+
}
|
2243 |
+
$user_shipping_city_temp = get_user_meta( $results[0]->user_id, 'shipping_city' );
|
2244 |
+
if ( isset( $user_shipping_city_temp[0] ) ) {
|
2245 |
+
$user_shipping_city = $user_shipping_city_temp[0];
|
2246 |
+
} else {
|
2247 |
+
$user_shipping_city = "";
|
2248 |
+
}
|
2249 |
+
$user_shipping_postcode_temp = get_user_meta( $results[0]->user_id, 'shipping_postcode' );
|
2250 |
+
if ( isset( $user_shipping_postcode_temp[0] ) ) {
|
2251 |
+
$user_shipping_postcode = $user_shipping_postcode_temp[0];
|
2252 |
+
} else {
|
2253 |
+
$user_shipping_postcode = "";
|
2254 |
+
}
|
2255 |
+
$user_shipping_state_temp = get_user_meta( $results[0]->user_id, 'shipping_state' );
|
2256 |
+
if ( isset( $user_shipping_state_temp[0] ) ) {
|
2257 |
+
$user_shipping_state = $user_shipping_state_temp[0];
|
2258 |
+
} else {
|
2259 |
+
$user_shipping_state = "";
|
2260 |
+
}
|
2261 |
+
$user_shipping_country_temp = get_user_meta( $results[0]->user_id, 'shipping_country' );
|
2262 |
+
if ( isset( $user_shipping_country_temp[0] ) ) {
|
2263 |
+
$user_shipping_country = $user_shipping_country_temp[0];
|
2264 |
+
} else {
|
2265 |
+
$user_shipping_country = "";
|
2266 |
+
}
|
2267 |
+
}
|
2268 |
+
$cart_details = array();
|
2269 |
+
$cart_info = json_decode( $results[0]->abandoned_cart_info );
|
2270 |
+
$cart_details = (array) $cart_info->cart;
|
2271 |
+
$item_subtotal = $item_total = 0;
|
2272 |
+
|
2273 |
+
if ( is_array ( $cart_details ) && count( $cart_details ) > 0 ) {
|
2274 |
+
foreach ( $cart_details as $k => $v ) {
|
2275 |
+
$quantity_total = $v->quantity;
|
2276 |
+
$product_id = $v->product_id;
|
2277 |
+
$prod_name = get_post($product_id);
|
2278 |
+
$product_name = $prod_name->post_title;
|
2279 |
+
if ( isset( $v->variation_id ) && '' != $v->variation_id ){
|
2280 |
+
$variation_id = $v->variation_id;
|
2281 |
+
$variation = wc_get_product( $variation_id );
|
2282 |
+
$name = $variation->get_formatted_name() ;
|
2283 |
+
$explode_all = explode ( "–", $name );
|
2284 |
+
$pro_name_variation = array_slice( $explode_all, 1, -1 );
|
2285 |
+
$product_name_with_variable = '';
|
2286 |
+
$explode_many_varaition = array();
|
2287 |
+
foreach ( $pro_name_variation as $pro_name_variation_key => $pro_name_variation_value ){
|
2288 |
+
$explode_many_varaition = explode ( ",", $pro_name_variation_value );
|
2289 |
+
if ( !empty( $explode_many_varaition ) ) {
|
2290 |
+
foreach( $explode_many_varaition as $explode_many_varaition_key => $explode_many_varaition_value ){
|
2291 |
+
$product_name_with_variable = $product_name_with_variable . "<br>". html_entity_decode ( $explode_many_varaition_value );
|
2292 |
+
}
|
2293 |
+
} else {
|
2294 |
+
$product_name_with_variable = $product_name_with_variable . "<br>". html_entity_decode ( $explode_many_varaition_value );
|
2295 |
+
}
|
2296 |
+
}
|
2297 |
+
$product_name = $product_name_with_variable;
|
2298 |
+
}
|
2299 |
+
// Item subtotal is calculated as product total including taxes
|
2300 |
+
if ( $v->line_subtotal_tax != 0 && $v->line_subtotal_tax > 0 ) {
|
2301 |
+
$item_subtotal = $item_subtotal + $v->line_total + $v->line_subtotal_tax;
|
2302 |
+
} else {
|
2303 |
+
$item_subtotal = $item_subtotal + $v->line_total;
|
2304 |
+
}
|
2305 |
+
// Line total
|
2306 |
+
$item_total = $item_subtotal;
|
2307 |
+
$item_subtotal = $item_subtotal / $quantity_total;
|
2308 |
+
$item_total = wc_price( $item_total );
|
2309 |
+
$item_subtotal = wc_price( $item_subtotal );
|
2310 |
+
$product = get_product( $product_id );
|
2311 |
+
$prod_image = $product->get_image();
|
2312 |
+
?>
|
2313 |
+
<tr>
|
2314 |
+
<td> <?php echo $prod_image; ?></td>
|
2315 |
+
<td> <?php echo $product_name; ?></td>
|
2316 |
+
<td> <?php echo $quantity_total; ?></td>
|
2317 |
+
<td> <?php echo $item_subtotal; ?></td>
|
2318 |
+
<td> <?php echo $item_total; ?></td>
|
2319 |
+
</tr>
|
2320 |
+
<?php
|
2321 |
+
$item_subtotal = $item_total = 0;
|
2322 |
+
}
|
2323 |
+
}
|
2324 |
+
?>
|
2325 |
+
</table>
|
2326 |
+
</div>
|
2327 |
+
</div>
|
2328 |
+
<div id="ac_order_customer_details" class="postbox" style="display:block">
|
2329 |
+
<h3> <p> <?php _e( 'Customer Details' , 'woocommerce-ac' ); ?> </p> </h3>
|
2330 |
+
<div class="inside" style="height: 300px;" >
|
2331 |
+
<div id="order_data" class="panel">
|
2332 |
+
<div style="width:50%;float:left">
|
2333 |
+
<h3> <p> <?php _e( 'Billing Details' , 'woocommerce-ac' ); ?> </p> </h3>
|
2334 |
+
<p> <strong> <?php _e( 'Name:' , 'woocommerce-ac' ); ?> </strong>
|
2335 |
+
<?php echo $user_first_name." ".$user_last_name;?>
|
2336 |
+
</p>
|
2337 |
+
<p> <strong> <?php _e( 'Address:' , 'woocommerce-ac' ); ?> </strong>
|
2338 |
+
<?php echo $user_billing_company."</br>".
|
2339 |
+
$user_billing_address_1."</br>".
|
2340 |
+
$user_billing_address_2."</br>".
|
2341 |
+
$user_billing_city."</br>".
|
2342 |
+
$user_billing_postcode."</br>".
|
2343 |
+
$user_billing_state."</br>".
|
2344 |
+
$user_billing_country."</br>";
|
2345 |
+
?>
|
2346 |
+
</p>
|
2347 |
+
<p> <strong> <?php _e( 'Email:', 'woocommerce-ac' ); ?> </strong>
|
2348 |
+
<?php $user_mail_to = "mailto:".$user_email; ?>
|
2349 |
+
<a href=<?php echo $user_mail_to;?>><?php echo $user_email;?> </a>
|
2350 |
+
</p>
|
2351 |
+
<p> <strong> <?php _e( 'Phone:', 'woocommerce-ac' ); ?> </strong>
|
2352 |
+
<?php echo $user_billing_phone;?>
|
2353 |
+
</p>
|
2354 |
+
</div>
|
2355 |
+
<div style="width:50%;float:right">
|
2356 |
+
<h3> <p> <?php _e( 'Shipping Details', 'woocommerce-ac' ); ?> </p> </h3>
|
2357 |
+
<p> <strong> <?php _e( 'Address:', 'woocommerce-ac' ); ?> </strong>
|
2358 |
+
<?php
|
2359 |
+
if ( $user_shipping_company == '' &&
|
2360 |
+
$user_shipping_address_1 == '' &&
|
2361 |
+
$user_shipping_address_2 == '' &&
|
2362 |
+
$user_shipping_city == '' &&
|
2363 |
+
$user_shipping_postcode == '' &&
|
2364 |
+
$user_shipping_state == '' &&
|
2365 |
+
$user_shipping_country == '') {
|
2366 |
+
echo "Shipping Address same as Billing Address";
|
2367 |
+
} else { ?>
|
2368 |
+
<?php echo $user_shipping_company."</br>".
|
2369 |
+
$user_shipping_address_1."</br>".
|
2370 |
+
$user_shipping_address_2."</br>".
|
2371 |
+
$user_shipping_city."</br>".
|
2372 |
+
$user_shipping_postcode."</br>".
|
2373 |
+
$user_shipping_state."</br>".
|
2374 |
+
$user_shipping_country."</br>";
|
2375 |
+
?>
|
2376 |
+
<br><br>
|
2377 |
+
<strong> Shipping Charges: </strong>
|
2378 |
+
<?php if ( $shipping_charges != 0 ) echo $currency_symbol . $shipping_charges;?>
|
2379 |
+
</p>
|
2380 |
+
<?php }?>
|
2381 |
+
</div>
|
2382 |
+
</div>
|
2383 |
+
</div>
|
2384 |
+
</div>
|
2385 |
+
<?php } elseif ( $action == 'report' ) {
|
2386 |
+
include_once('includes/classes/class-wcal-product-report-table.php');
|
2387 |
+
$wcal_product_report_list = new WCAL_Product_Report_Table();
|
2388 |
+
$wcal_product_report_list->wcal_product_report_prepare_items();
|
2389 |
+
?>
|
2390 |
+
<div class="wrap">
|
2391 |
+
<form id="wcal-sent-emails" method="get" >
|
2392 |
+
<input type="hidden" name="page" value="woocommerce_ac_page" />
|
2393 |
+
<input type="hidden" name="action" value="report" />
|
2394 |
+
<?php $wcal_product_report_list->display(); ?>
|
2395 |
+
</form>
|
2396 |
+
</div>
|
2397 |
+
<?php }
|
2398 |
+
}
|
2399 |
+
echo( "</table>" );
|
2400 |
+
|
2401 |
+
if ( isset( $_GET['action'] ) ) {
|
2402 |
+
$action = $_GET['action'];
|
2403 |
+
}
|
2404 |
+
if ( isset( $_GET['mode'] ) ){
|
2405 |
+
$mode = $_GET['mode'];
|
2406 |
+
}
|
2407 |
+
if ( $action == 'emailtemplates' && ( $mode == 'addnewtemplate' || $mode == 'edittemplate' ) ) {
|
2408 |
+
if ( $mode=='edittemplate' ) {
|
2409 |
+
$edit_id = $_GET['id'];
|
2410 |
+
$query = "SELECT wpet . * FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet WHERE id = %d ";
|
2411 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $edit_id ) );
|
2412 |
+
}
|
2413 |
+
$active_post = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
2414 |
+
?>
|
2415 |
+
<div id="content">
|
2416 |
+
<form method="post" action="admin.php?page=woocommerce_ac_page&action=emailtemplates" id="ac_settings">
|
2417 |
+
<input type="hidden" name="mode" value="<?php echo $mode;?>" />
|
2418 |
+
<?php
|
2419 |
+
$id_by = "";
|
2420 |
+
if ( isset( $_GET['id'] ) ) {
|
2421 |
+
$id_by = $_GET['id'];
|
2422 |
+
}
|
2423 |
+
?>
|
2424 |
+
<input type="hidden" name="id" value="<?php echo $id_by ;?>" />
|
2425 |
+
<?php
|
2426 |
+
$button_mode = "save";
|
2427 |
+
$display_message = "Add Email Template";
|
2428 |
+
if ( $mode == 'edittemplate' ) {
|
2429 |
+
$button_mode = "update";
|
2430 |
+
$display_message = "Edit Email Template";
|
2431 |
+
}
|
2432 |
+
print'<input type="hidden" name="ac_settings_frm" value="'.$button_mode.'">';?>
|
2433 |
+
<div id="poststuff">
|
2434 |
+
<div> <!-- <div class="postbox" > -->
|
2435 |
+
<h3 class="hndle"><?php _e( $display_message, 'woocommerce-ac' ); ?></h3>
|
2436 |
+
<div>
|
2437 |
+
<table class="form-table" id="addedit_template">
|
2438 |
+
<tr>
|
2439 |
+
<th>
|
2440 |
+
<label for="woocommerce_ac_template_name"><b><?php _e( 'Template Name:', 'woocommerce-ac');?></b></label>
|
2441 |
+
</th>
|
2442 |
+
<td>
|
2443 |
+
<?php
|
2444 |
+
$template_name = "";
|
2445 |
+
if( $mode == 'edittemplate' ) {
|
2446 |
+
$template_name = $results[0]->template_name;
|
2447 |
+
}
|
2448 |
+
print'<input type="text" name="woocommerce_ac_template_name" id="woocommerce_ac_template_name" class="regular-text" value="'.$template_name.'">';?>
|
2449 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter a template name for reference', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
2450 |
+
</td>
|
2451 |
+
</tr>
|
2452 |
+
|
2453 |
+
<tr>
|
2454 |
+
<th>
|
2455 |
+
<label for="woocommerce_ac_from_name"><b><?php _e( 'Send From This Name:', 'woocommerce-ac' ); ?></b></label>
|
2456 |
+
</th>
|
2457 |
+
<td>
|
2458 |
+
<?php
|
2459 |
+
$from_name = "Admin";
|
2460 |
+
if ( $mode == 'edittemplate' ) {
|
2461 |
+
$from_name=$results[0]->from_name;
|
2462 |
+
}
|
2463 |
+
print'<input type="text" name="woocommerce_ac_from_name" id="woocommerce_ac_from_name" class="regular-text" value="'.$from_name.'">';?>
|
2464 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter the name that should appear in the email sent', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
2465 |
+
</td>
|
2466 |
+
</tr>
|
2467 |
+
|
2468 |
+
<tr>
|
2469 |
+
<th>
|
2470 |
+
<label for="woocommerce_ac_email_from"><b><?php _e( 'Send From This Email Address:', 'woocommerce-ac' ); ?></b></label>
|
2471 |
+
</th>
|
2472 |
+
<td>
|
2473 |
+
<?php
|
2474 |
+
$from_edit = get_option( 'admin_email' );
|
2475 |
+
if ( $mode == 'edittemplate' && $results[0]->from_email != '') { // this is the fix
|
2476 |
+
$from_edit = $results[0]->from_email;
|
2477 |
+
}
|
2478 |
+
print'<input type="text" name="woocommerce_ac_email_from" id="woocommerce_ac_email_from" class="regular-text" value="' . $from_edit . '">'; ?>
|
2479 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e( 'Which email address should be shown in the "From Email" field for this email?', 'woocommerce' ) ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
2480 |
+
</td>
|
2481 |
+
</tr>
|
2482 |
+
|
2483 |
+
<tr>
|
2484 |
+
<th>
|
2485 |
+
<label for="woocommerce_ac_email_reply"><b><?php _e( 'Send Reply Emails to:', 'woocommerce-ac' ); ?></b></label>
|
2486 |
+
</th>
|
2487 |
+
<td>
|
2488 |
+
<?php
|
2489 |
+
$reply_edit = get_option( 'admin_email' );
|
2490 |
+
if ( $mode == 'edittemplate' && $results[0]->reply_email != '' ) { // this is the fix
|
2491 |
+
$reply_edit = $results[0]->reply_email;
|
2492 |
+
}
|
2493 |
+
print'<input type="text" name="woocommerce_ac_email_reply" id="woocommerce_ac_email_reply" class="regular-text" value="' . $reply_edit . '">'; ?>
|
2494 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e( 'When a contact receives your email and clicks reply, which email address should that reply be sent to?', 'woocommerce' ) ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
2495 |
+
</td>
|
2496 |
+
</tr>
|
2497 |
+
|
2498 |
+
<tr>
|
2499 |
+
<th>
|
2500 |
+
<label for="woocommerce_ac_email_subject"><b><?php _e( 'Subject:', 'woocommerce-ac' ); ?></b></label>
|
2501 |
+
</th>
|
2502 |
+
<td>
|
2503 |
+
<?php
|
2504 |
+
$subject_edit = "";
|
2505 |
+
if ( $mode == 'edittemplate' ) {
|
2506 |
+
$subject_edit= stripslashes ( $results[0]->subject );
|
2507 |
+
}
|
2508 |
+
print'<input type="text" name="woocommerce_ac_email_subject" id="woocommerce_ac_email_subject" class="regular-text" value="'.$subject_edit.'">';?>
|
2509 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter the subject that should appear in the email sent', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
2510 |
+
</td>
|
2511 |
+
</tr>
|
2512 |
+
|
2513 |
+
<tr>
|
2514 |
+
<th>
|
2515 |
+
<label for="woocommerce_ac_email_body"><b><?php _e( 'Email Body:', 'woocommerce-ac' ); ?></b></label>
|
2516 |
+
</th>
|
2517 |
+
<td>
|
2518 |
+
<?php
|
2519 |
+
$initial_data = "";
|
2520 |
+
if ( $mode == 'edittemplate' ) {
|
2521 |
+
$initial_data = stripslashes( $results[0]->body );
|
2522 |
+
}
|
2523 |
+
|
2524 |
+
$initial_data = str_replace ( "My document title", "", $initial_data );
|
2525 |
+
wp_editor(
|
2526 |
+
$initial_data,
|
2527 |
+
'woocommerce_ac_email_body',
|
2528 |
+
array(
|
2529 |
+
'media_buttons' => true,
|
2530 |
+
'textarea_rows' => 15,
|
2531 |
+
'tabindex' => 4,
|
2532 |
+
'tinymce' => array(
|
2533 |
+
'theme_advanced_buttons1' => 'bold,italic,underline,|,bullist,numlist,blockquote,|,link,unlink,|,spellchecker,fullscreen,|,formatselect,styleselect'
|
2534 |
+
),
|
2535 |
+
)
|
2536 |
+
);
|
2537 |
+
|
2538 |
+
?>
|
2539 |
+
<?php echo stripslashes( get_option( 'woocommerce_ac_email_body' ) ); ?>
|
2540 |
+
<span class="description"><?php
|
2541 |
+
echo __( 'Message to be sent in the reminder email.', 'woocommerce-ac' );
|
2542 |
+
?></span>
|
2543 |
+
</td>
|
2544 |
+
</tr>
|
2545 |
+
|
2546 |
+
<tr>
|
2547 |
+
<th>
|
2548 |
+
<label for="is_wc_template"><b><?php _e( 'Use WooCommerce Template Style:', 'woocommerce-ac' ); ?></b></label>
|
2549 |
+
</th>
|
2550 |
+
<td>
|
2551 |
+
<?php
|
2552 |
+
$is_wc_template = "";
|
2553 |
+
if ( $mode == 'edittemplate' ) {
|
2554 |
+
$use_wc_template = $results[0]->is_wc_template;
|
2555 |
+
|
2556 |
+
if ( $use_wc_template == '1' ) {
|
2557 |
+
$is_wc_template = "checked";
|
2558 |
+
} else {
|
2559 |
+
$is_wc_template = "";
|
2560 |
+
}
|
2561 |
+
}
|
2562 |
+
print'<input type="checkbox" name="is_wc_template" id="is_wc_template" ' . $is_wc_template . '> </input>'; ?>
|
2563 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e( 'Use WooCommerce default style template for abandoned cart reminder emails.', 'woocommerce' ) ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" /> <a target = '_blank' href= <?php echo wp_nonce_url( admin_url( '?wcal_preview_woocommerce_mail=true' ), 'woocommerce-ac' ) ; ?> >
|
2564 |
+
Click here to preview </a>how the email template will look with WooCommerce Template Style enabled. Alternatively, if this is unchecked, the template will appear as <a target = '_blank' href=<?php echo wp_nonce_url( admin_url( '?wcal_preview_mail=true' ), 'woocommerce-ac' ) ; ?>>shown here</a>. <br> <strong>Note: </strong>When this setting is enabled, then "Send From This Name:" & "Send From This Email Address:" will be overwritten with WooCommerce -> Settings -> Email -> Email Sender Options.
|
2565 |
+
</td>
|
2566 |
+
</tr>
|
2567 |
+
|
2568 |
+
<tr>
|
2569 |
+
<th>
|
2570 |
+
<label for="wcal_wc_email_header"><b><?php _e( 'Email Template Header Text: ', 'woocommerce-ac' ); ?></b></label>
|
2571 |
+
</th>
|
2572 |
+
<td>
|
2573 |
+
|
2574 |
+
<?php
|
2575 |
+
|
2576 |
+
$wcal_wc_email_header = "";
|
2577 |
+
if ( $mode == 'edittemplate' ) {
|
2578 |
+
$wcal_wc_email_header = $results[0]->wc_email_header;
|
2579 |
+
}
|
2580 |
+
if ( $wcal_wc_email_header == "" ) {
|
2581 |
+
$wcal_wc_email_header = "Abandoned cart reminder";
|
2582 |
+
}
|
2583 |
+
print'<input type="text" name="wcal_wc_email_header" id="wcal_wc_email_header" class="regular-text" value="' . $wcal_wc_email_header . '">'; ?>
|
2584 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e( 'Enter the header which will appear in the abandoned WooCommerce email sent. This is only applicable when only used when "Use WooCommerce Template Style:" is checked.', 'woocommerce-ac' ) ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
2585 |
+
</td>
|
2586 |
+
</tr>
|
2587 |
+
|
2588 |
+
<tr>
|
2589 |
+
<th>
|
2590 |
+
<label for="is_active"><b><?php _e( 'Active:', 'woocommerce-ac' ); ?></b></label>
|
2591 |
+
</th>
|
2592 |
+
<td>
|
2593 |
+
<?php
|
2594 |
+
$is_active_edit="";
|
2595 |
+
if ( $mode == 'edittemplate' ) {
|
2596 |
+
$active_edit = $results[0]->is_active;
|
2597 |
+
if ( $active_edit == '1' ) {
|
2598 |
+
$is_active_edit = "checked";
|
2599 |
+
} else {
|
2600 |
+
$is_active_edit = "";
|
2601 |
+
}
|
2602 |
+
}
|
2603 |
+
if ( $mode == 'copytemplate' ) {
|
2604 |
+
$active_edit = $results_copy[0]->is_active;
|
2605 |
+
if( $active_edit == '1' ) {
|
2606 |
+
$is_active_edit = "checked";
|
2607 |
+
} else {
|
2608 |
+
$is_active_edit = "";
|
2609 |
+
}
|
2610 |
+
}
|
2611 |
+
print'<input type="checkbox" name="is_active" id="is_active" ' . $is_active_edit . '> </input>'; ?>
|
2612 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e( 'The email template will be sent to customers only if the "Active" checkbox is enabled. Leave this unchecked if you want to add the email template but not send it to customers.', 'woocommerce' ) ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" /></p>
|
2613 |
+
</td>
|
2614 |
+
</tr>
|
2615 |
+
|
2616 |
+
<tr>
|
2617 |
+
<th>
|
2618 |
+
<label for="woocommerce_ac_email_frequency"><b><?php _e( 'Send this email:', 'woocommerce-ac' ); ?></b></label>
|
2619 |
+
</th>
|
2620 |
+
<td>
|
2621 |
+
<select name="email_frequency" id="email_frequency">
|
2622 |
+
<?php
|
2623 |
+
$frequency_edit = "";
|
2624 |
+
if( $mode == 'edittemplate' ) {
|
2625 |
+
$frequency_edit = $results[0]->frequency;
|
2626 |
+
}
|
2627 |
+
for ( $i = 1; $i < 4; $i++ ) {
|
2628 |
+
printf( "<option %s value='%s'>%s</option>\n",
|
2629 |
+
selected( $i, $frequency_edit, false ),
|
2630 |
+
esc_attr( $i ),
|
2631 |
+
$i
|
2632 |
+
);
|
2633 |
+
}
|
2634 |
+
?>
|
2635 |
+
</select>
|
2636 |
+
|
2637 |
+
<select name="day_or_hour" id="day_or_hour">
|
2638 |
+
<?php
|
2639 |
+
$days_or_hours_edit = "";
|
2640 |
+
if ( $mode == 'edittemplate')
|
2641 |
+
{
|
2642 |
+
$days_or_hours_edit = $results[0]->day_or_hour;
|
2643 |
+
}
|
2644 |
+
$days_or_hours = array(
|
2645 |
+
'Days' => 'Day(s)',
|
2646 |
+
'Hours' => 'Hour(s)'
|
2647 |
+
);
|
2648 |
+
foreach( $days_or_hours as $k => $v )
|
2649 |
+
{
|
2650 |
+
printf( "<option %s value='%s'>%s</option>\n",
|
2651 |
+
selected( $k, $days_or_hours_edit, false ),
|
2652 |
+
esc_attr( $k ),
|
2653 |
+
$v
|
2654 |
+
);
|
2655 |
+
}
|
2656 |
+
?>
|
2657 |
+
</select>
|
2658 |
+
<span class="description">
|
2659 |
+
<?php echo __( 'after cart is abandoned.', 'woocommerce-ac' ); ?>
|
2660 |
+
</span>
|
2661 |
+
</td>
|
2662 |
+
</tr>
|
2663 |
+
|
2664 |
+
<tr>
|
2665 |
+
<th>
|
2666 |
+
<label for="woocommerce_ac_email_preview"><b><?php _e( 'Send a test email to:', 'woocommerce-ac' ); ?></b></label>
|
2667 |
+
</th>
|
2668 |
+
<td>
|
2669 |
+
<input type="text" id="send_test_email" name="send_test_email" class="regular-text" >
|
2670 |
+
<input type="button" value="Send a test email" id="preview_email" onclick="javascript:void(0);">
|
2671 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter the email id to which the test email needs to be sent.', 'woocommerce-ac') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
2672 |
+
<div id="preview_email_sent_msg" style="display:none;"></div>
|
2673 |
+
</td>
|
2674 |
+
</tr>
|
2675 |
+
</table>
|
2676 |
+
</div>
|
2677 |
+
</div>
|
2678 |
+
</div>
|
2679 |
+
<p class="submit">
|
2680 |
+
<?php
|
2681 |
+
$button_value = "Save Changes";
|
2682 |
+
if ( $mode == 'edittemplate' )
|
2683 |
+
{
|
2684 |
+
$button_value = "Update Changes";
|
2685 |
+
}?>
|
2686 |
+
<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( $button_value, 'woocommerce-ac' ); ?>" />
|
2687 |
+
</p>
|
2688 |
+
</form>
|
2689 |
+
</div>
|
2690 |
+
<?php
|
2691 |
+
}
|
2692 |
+
}
|
2693 |
+
|
2694 |
+
function bubble_sort_function( $unsort_array, $order ) {
|
2695 |
+
$temp = array();
|
2696 |
+
foreach ( $unsort_array as $key => $value )
|
2697 |
+
$temp[ $key ] = $value; //concatenate something unique to make sure two equal weights don't overwrite each other
|
2698 |
+
asort( $temp, SORT_NUMERIC ); // or ksort($temp, SORT_NATURAL); see paragraph above to understand why
|
2699 |
+
|
2700 |
+
if( $order == 'desc' ) {
|
2701 |
+
$array = array_reverse( $temp, true );
|
2702 |
+
} else if( $order == 'asc' ) {
|
2703 |
+
$array = $temp;
|
2704 |
+
}
|
2705 |
+
unset( $temp );
|
2706 |
+
return $array;
|
2707 |
+
}
|
2708 |
+
|
2709 |
+
function wcal_action_send_preview() {
|
2710 |
+
?>
|
2711 |
+
<script type="text/javascript" >
|
2712 |
+
jQuery( document ).ready( function( $ )
|
2713 |
+
{
|
2714 |
+
$( "table#addedit_template input#preview_email" ).click( function()
|
2715 |
+
{
|
2716 |
+
var email_body = '';
|
2717 |
+
if ( jQuery("#wp-woocommerce_ac_email_body-wrap").hasClass( "tmce-active" ) ) {
|
2718 |
+
email_body = tinyMCE.get('woocommerce_ac_email_body').getContent();
|
2719 |
+
} else {
|
2720 |
+
email_body = jQuery('#woocommerce_ac_email_body').val();
|
2721 |
+
}
|
2722 |
+
var from_name_preview = $( '#woocommerce_ac_from_name' ).val();
|
2723 |
+
var reply_name_preview = $( '#woocommerce_ac_email_reply' ).val();
|
2724 |
+
var from_email_preview = $( '#woocommerce_ac_email_from' ).val();
|
2725 |
+
var subject_email_preview = $( '#woocommerce_ac_email_subject' ).val();
|
2726 |
+
var body_email_preview = email_body;
|
2727 |
+
var send_email_id = $( '#send_test_email' ).val();
|
2728 |
+
var is_wc_template = document.getElementById( "is_wc_template" ).checked;
|
2729 |
+
var wc_template_header = $( '#wcal_wc_email_header' ).val() != '' ? $( '#wcal_wc_email_header' ).val() : 'Abandoned cart reminder';
|
2730 |
+
var data = {
|
2731 |
+
from_name_preview : from_name_preview,
|
2732 |
+
reply_name_preview : reply_name_preview,
|
2733 |
+
from_email_preview : from_email_preview,
|
2734 |
+
subject_email_preview: subject_email_preview,
|
2735 |
+
body_email_preview : body_email_preview,
|
2736 |
+
send_email_id : send_email_id,
|
2737 |
+
is_wc_template : is_wc_template,
|
2738 |
+
wc_template_header : wc_template_header,
|
2739 |
+
action : 'wcal_preview_email_sent'
|
2740 |
+
};
|
2741 |
+
|
2742 |
+
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
|
2743 |
+
$.post( ajaxurl, data, function( response )
|
2744 |
+
{
|
2745 |
+
if ( 'not sent' == response ) {
|
2746 |
+
$( "#preview_email_sent_msg" ).html( "Test email is not sent as the Email body is empty." );
|
2747 |
+
$( "#preview_email_sent_msg" ).fadeIn();
|
2748 |
+
setTimeout( function(){$( "#preview_email_sent_msg" ).fadeOut();}, 4000 );
|
2749 |
+
} else {
|
2750 |
+
$( "#preview_email_sent_msg" ).html( "<img src='<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/assets/images/check.jpg'> Email has been sent successfully." );
|
2751 |
+
$( "#preview_email_sent_msg" ).fadeIn();
|
2752 |
+
setTimeout( function(){$( "#preview_email_sent_msg" ).fadeOut();}, 3000 );
|
2753 |
+
}
|
2754 |
+
//alert('Got this from the server: ' + response);
|
2755 |
+
});
|
2756 |
+
});
|
2757 |
+
});
|
2758 |
+
</script>
|
2759 |
+
<?php
|
2760 |
+
}
|
2761 |
+
// Send Test Email
|
2762 |
+
function wcal_preview_email_sent() {
|
2763 |
+
if ( '' != $_POST['body_email_preview'] ) {
|
2764 |
+
$from_email_name = $_POST['from_name_preview'];
|
2765 |
+
$reply_name_preview = $_POST['reply_name_preview'];
|
2766 |
+
$from_email_preview = $_POST['from_email_preview'];
|
2767 |
+
$subject_email_preview = stripslashes ( $_POST['subject_email_preview'] );
|
2768 |
+
$body_email_preview = $_POST['body_email_preview'];
|
2769 |
+
$is_wc_template = $_POST['is_wc_template'];
|
2770 |
+
$wc_template_header = stripslashes( $_POST['wc_template_header'] );
|
2771 |
+
$body_email_preview = str_replace( '{{customer.firstname}}', 'John', $body_email_preview );
|
2772 |
+
$body_email_preview = str_replace( '{{customer.lastname}}', 'Doe', $body_email_preview );
|
2773 |
+
$body_email_preview = str_replace( '{{customer.fullname}}', 'John'." ".'Doe', $body_email_preview );
|
2774 |
+
$current_time_stamp = current_time( 'timestamp' );
|
2775 |
+
$test_date = date( 'd M, Y h:i A', $current_time_stamp );
|
2776 |
+
$body_email_preview = str_replace( '{{cart.abandoned_date}}', $test_date, $body_email_preview );
|
2777 |
+
$cart_url = wc_get_page_permalink( 'cart' );
|
2778 |
+
$body_email_preview = str_replace( '{{cart.link}}', $cart_url, $body_email_preview );
|
2779 |
+
$body_email_preview = str_replace( '{{cart.unsubscribe}}', '<a href=#>unsubscribe</a>', $body_email_preview );
|
2780 |
+
if ( class_exists( 'WP_Better_Emails' ) ) {
|
2781 |
+
$headers = "From: " . $from_email_name . " <" . $from_email_preview . ">" . "\r\n";
|
2782 |
+
$headers .= "Content-Type: text/plain" . "\r\n";
|
2783 |
+
$headers .= "Reply-To: " . $reply_name_preview . " " . "\r\n";
|
2784 |
+
$var = '<table width = 100%>
|
2785 |
+
<tr> <td colspan="5"> <h3>'.__( "Your Shopping Cart", "woocommerce-ac" ).'</h3> </td></tr>
|
2786 |
+
<tr align="center">
|
2787 |
+
<th>'.__( "Item", "woocommerce-ac" ).'</th>
|
2788 |
+
<th>'.__( "Name", "woocommerce-ac" ).'</th>
|
2789 |
+
<th>'.__( "Quantity", "woocommerce-ac" ).'</th>
|
2790 |
+
<th>'.__( "Price", "woocommerce-ac" ).'</th>
|
2791 |
+
<th>'.__( "Line Subtotal", "woocommerce-ac" ).'</th>
|
2792 |
+
</tr>
|
2793 |
+
<tr align="center">
|
2794 |
+
<td><img class="demo_img" width="42" height="42" src="'.plugins_url().'/woocommerce-abandoned-cart/assets/images/shoes.jpg"/></td>
|
2795 |
+
<td>'.__( "Men\'\s Formal Shoes", "woocommerce-ac" ).'</td>
|
2796 |
+
<td>1</td>
|
2797 |
+
<td>$100</td>
|
2798 |
+
<td>$100</td>
|
2799 |
+
</tr>
|
2800 |
+
<tr align="center">
|
2801 |
+
<td><img class="demo_img" width="42" height="42" src="'.plugins_url().'/woocommerce-abandoned-cart/assets/images/handbag.jpg"/></td>
|
2802 |
+
<td>'.__( "Woman\'\s Hand Bags", "woocommerce-ac" ).'</td>
|
2803 |
+
<td>1</td>
|
2804 |
+
<td>$100</td>
|
2805 |
+
<td>$100</td>
|
2806 |
+
</tr>
|
2807 |
+
<tr align="center">
|
2808 |
+
<td></td>
|
2809 |
+
<td></td>
|
2810 |
+
<td></td>
|
2811 |
+
<td>'.__( "Cart Total:", "woocommerce-ac" ).'</td>
|
2812 |
+
<td>$200</td>
|
2813 |
+
</tr>
|
2814 |
+
</table>';
|
2815 |
+
} else {
|
2816 |
+
$headers = "From: " . $from_email_name . " <" . $from_email_preview . ">" . "\r\n";
|
2817 |
+
$headers .= "Content-Type: text/html" . "\r\n";
|
2818 |
+
$headers .= "Reply-To: " . $reply_name_preview . " " . "\r\n";
|
2819 |
+
$var = '<h3>'.__( "Your Shopping Cart", "woocommerce-ac" ).'</h3>
|
2820 |
+
<table border="0" cellpadding="10" cellspacing="0" class="templateDataTable">
|
2821 |
+
<tr align="center">
|
2822 |
+
<th>'.__( "Item", "woocommerce-ac" ).'</th>
|
2823 |
+
<th>'.__( "Name", "woocommerce-ac" ).'</th>
|
2824 |
+
<th>'.__( "Quantity", "woocommerce-ac" ).'</th>
|
2825 |
+
<th>'.__( "Price", "woocommerce-ac" ).'</th>
|
2826 |
+
<th>'.__( "Line Subtotal", "woocommerce-ac" ).'</th>
|
2827 |
+
</tr>
|
2828 |
+
<tr align="center">
|
2829 |
+
<td><img class="demo_img" width="42" height="42" src="'.plugins_url().'/woocommerce-abandoned-cart/assets/images/shoes.jpg"/></td>
|
2830 |
+
<td>'.__( "Men\'\s Formal Shoes", "woocommerce-ac" ).'</td>
|
2831 |
+
<td>1</td>
|
2832 |
+
<td>$100</td>
|
2833 |
+
<td>$100</td>
|
2834 |
+
</tr>
|
2835 |
+
<tr align="center">
|
2836 |
+
<td><img class="demo_img" width="42" height="42" src="'.plugins_url().'/woocommerce-abandoned-cart/assets/images/handbag.jpg"/></td>
|
2837 |
+
<td>'.__( "Woman\'\s Hand Bags", "woocommerce-ac" ).'</td>
|
2838 |
+
<td>1</td>
|
2839 |
+
<td>$100</td>
|
2840 |
+
<td>$100</td>
|
2841 |
+
</tr>
|
2842 |
+
<tr align="center">
|
2843 |
+
<td></td>
|
2844 |
+
<td></td>
|
2845 |
+
<td></td>
|
2846 |
+
<td>'.__( "Cart Total:", "woocommerce-ac" ).'</td>
|
2847 |
+
<td>$200</td>
|
2848 |
+
</tr>
|
2849 |
+
</table>';
|
2850 |
+
}
|
2851 |
+
$body_email_preview = str_replace( '{{products.cart}}', $var, $body_email_preview );
|
2852 |
+
if ( isset( $_POST['send_email_id'] ) ) {
|
2853 |
+
$to_email_preview = $_POST['send_email_id'];
|
2854 |
+
} else {
|
2855 |
+
$to_email_preview = "";
|
2856 |
+
}
|
2857 |
+
$user_email_from = get_option( 'admin_email' );
|
2858 |
+
$body_email_final_preview = stripslashes( $body_email_preview );
|
2859 |
+
|
2860 |
+
if ( isset( $is_wc_template ) && "true" == $is_wc_template ) {
|
2861 |
+
ob_start();
|
2862 |
+
// Get email heading
|
2863 |
+
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $wc_template_header ) );
|
2864 |
+
$email_body_template_header = ob_get_clean();
|
2865 |
+
|
2866 |
+
ob_start();
|
2867 |
+
wc_get_template( 'emails/email-footer.php' );
|
2868 |
+
$email_body_template_footer = ob_get_clean();
|
2869 |
+
|
2870 |
+
$final_email_body = $email_body_template_header . $body_email_final_preview . $email_body_template_footer;
|
2871 |
+
|
2872 |
+
wc_mail( $to_email_preview, $subject_email_preview, $final_email_body , $headers );
|
2873 |
+
}
|
2874 |
+
else {
|
2875 |
+
wp_mail( $to_email_preview, $subject_email_preview, stripslashes( $body_email_preview ), $headers );
|
2876 |
+
}
|
2877 |
+
echo "email sent";
|
2878 |
+
die();
|
2879 |
+
} else {
|
2880 |
+
echo "not sent";
|
2881 |
+
die();
|
2882 |
+
}
|
2883 |
+
}
|
2884 |
+
}
|
2885 |
+
}
|
2886 |
+
$woocommerce_abandon_cart = new woocommerce_abandon_cart_lite();
|
2887 |
+
?>
|
woocommerce_guest_ac.class.php
DELETED
@@ -1,208 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/* Woocommerce Abandoned Cart Plugin Addon - Saves guest cart information
|
3 |
-
*
|
4 |
-
*/
|
5 |
-
{
|
6 |
-
/**
|
7 |
-
* Localisation
|
8 |
-
**/
|
9 |
-
|
10 |
-
/**
|
11 |
-
* woocommerce_abandon_cart class
|
12 |
-
**/
|
13 |
-
if ( ! class_exists( 'woocommerce_guest_ac' ) ) {
|
14 |
-
|
15 |
-
class woocommerce_guest_ac {
|
16 |
-
var $a;
|
17 |
-
public function __construct() {
|
18 |
-
add_action( 'woocommerce_after_checkout_billing_form', 'user_side_js' );
|
19 |
-
add_action( 'init','load_ac_ajax' );
|
20 |
-
add_filter( 'woocommerce_checkout_fields', 'guest_checkout_fields' );
|
21 |
-
}
|
22 |
-
}
|
23 |
-
|
24 |
-
/*-----------------------------------------------------------------------------------*/
|
25 |
-
/* Class Functions */
|
26 |
-
/*-----------------------------------------------------------------------------------*/
|
27 |
-
function load_ac_ajax() {
|
28 |
-
|
29 |
-
if ( ! is_user_logged_in() ) {
|
30 |
-
add_action( 'wp_ajax_nopriv_save_data', 'save_data' );
|
31 |
-
} else {
|
32 |
-
add_action( 'wp_ajax_save_data', 'save_data' );
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
function user_side_js() {
|
37 |
-
?>
|
38 |
-
<script type="text/javascript">
|
39 |
-
jQuery( 'input#billing_email' ).on( 'change', function() {
|
40 |
-
var data = {
|
41 |
-
billing_first_name : jQuery('#billing_first_name').val(),
|
42 |
-
billing_last_name : jQuery('#billing_last_name').val(),
|
43 |
-
billing_company : jQuery('#billing_company').val(),
|
44 |
-
billing_address_1 : jQuery('#billing_address_1').val(),
|
45 |
-
billing_address_2 : jQuery('#billing_address_2').val(),
|
46 |
-
billing_city : jQuery('#billing_city').val(),
|
47 |
-
billing_state : jQuery('#billing_state').val(),
|
48 |
-
billing_postcode : jQuery('#billing_postcode').val(),
|
49 |
-
billing_country : jQuery('#billing_country').val(),
|
50 |
-
billing_phone : jQuery('#billing_phone').val(),
|
51 |
-
billing_email : jQuery('#billing_email').val(),
|
52 |
-
order_notes : jQuery('#order_comments').val(),
|
53 |
-
shipping_first_name : jQuery('#shipping_first_name').val(),
|
54 |
-
shipping_last_name : jQuery('#shipping_last_name').val(),
|
55 |
-
shipping_company : jQuery('#shipping_company').val(),
|
56 |
-
shipping_address_1 : jQuery('#shipping_address_1').val(),
|
57 |
-
shipping_address_2 : jQuery('#shipping_address_2').val(),
|
58 |
-
shipping_city : jQuery('#shipping_city').val(),
|
59 |
-
shipping_state : jQuery('#shipping_state').val(),
|
60 |
-
shipping_postcode : jQuery('#shipping_postcode').val(),
|
61 |
-
shipping_country : jQuery('#shipping_country').val(),
|
62 |
-
ship_to_billing : jQuery('#shiptobilling-checkbox').val(),
|
63 |
-
action: 'save_data'
|
64 |
-
};
|
65 |
-
jQuery.post( "<?php echo get_home_url();?>/wp-admin/admin-ajax.php", data, function(response) {
|
66 |
-
});
|
67 |
-
});
|
68 |
-
</script>
|
69 |
-
<?php
|
70 |
-
}
|
71 |
-
|
72 |
-
function save_data() {
|
73 |
-
|
74 |
-
if ( ! is_user_logged_in() ) {
|
75 |
-
global $wpdb, $woocommerce;
|
76 |
-
|
77 |
-
$_SESSION['billing_first_name'] = $_POST['billing_first_name'];
|
78 |
-
$_SESSION['billing_last_name'] = $_POST['billing_last_name'];
|
79 |
-
$_SESSION['billing_company'] = $_POST['billing_company'];
|
80 |
-
$_SESSION['billing_address_1'] = $_POST['billing_address_1'];
|
81 |
-
$_SESSION['billing_address_2'] = $_POST['billing_address_2'];
|
82 |
-
$_SESSION['billing_city'] = $_POST['billing_city'];
|
83 |
-
$_SESSION['billing_state'] = $_POST['billing_state'];
|
84 |
-
$_SESSION['billing_postcode'] = $_POST['billing_postcode'];
|
85 |
-
$_SESSION['billing_country'] = $_POST['billing_country'];
|
86 |
-
$_SESSION['billing_email'] = $_POST['billing_email'];
|
87 |
-
$_SESSION['billing_phone'] = $_POST['billing_phone'];
|
88 |
-
$_SESSION['order_notes'] = $_POST['order_notes'];
|
89 |
-
$_SESSION['ship_to_billing'] = $_POST['ship_to_billing'];
|
90 |
-
$_SESSION['shipping_first_name'] = $_POST['shipping_first_name'];
|
91 |
-
$_SESSION['shipping_last_name'] = $_POST['shipping_last_name'];
|
92 |
-
$_SESSION['shipping_company'] = $_POST['shipping_company'];
|
93 |
-
$_SESSION['shipping_address_1'] = $_POST['shipping_address_1'];
|
94 |
-
$_SESSION['shipping_address_2'] = $_POST['shipping_address_2'];
|
95 |
-
$_SESSION['shipping_city'] = $_POST['shipping_city'];
|
96 |
-
$_SESSION['shipping_state'] = $_POST['shipping_state'];
|
97 |
-
$_SESSION['shipping_postcode'] = $_POST['shipping_postcode'];
|
98 |
-
$_SESSION['shipping_country'] = $_POST['shipping_country'];
|
99 |
-
|
100 |
-
// If a record is present in the guest cart history table for the same email id, then delete the previous records
|
101 |
-
$query_guest = "SELECT id FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE email_id = %s";
|
102 |
-
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $_SESSION['billing_email'] ) );
|
103 |
-
|
104 |
-
if ( $results_guest ) {
|
105 |
-
|
106 |
-
foreach ( $results_guest as $key => $value ) {
|
107 |
-
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
108 |
-
WHERE user_id = %d AND recovered_cart = '0'" ;
|
109 |
-
$result = $wpdb->get_results( $wpdb->prepare( $query, $value->id ) );
|
110 |
-
|
111 |
-
if ( $result ) {
|
112 |
-
$delete_sent_email = "DELETE FROM `".$wpdb->prefix."ac_sent_history` WHERE abandoned_order_id = '".$result[0]->id."'";
|
113 |
-
$wpdb->query( $delete_sent_email );
|
114 |
-
$delete_query = "DELETE FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE user_id = '".$value->id."'";
|
115 |
-
$wpdb->query( $delete_query );
|
116 |
-
}
|
117 |
-
$guest_delete = "DELETE FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE id = '".$value->id."'";
|
118 |
-
$wpdb->query( $guest_delete );
|
119 |
-
}
|
120 |
-
}
|
121 |
-
|
122 |
-
// Insert record in guest table
|
123 |
-
if ( isset( $_SESSION['billing_first_name'] ) ) $billing_first_name = $_SESSION['billing_first_name'];
|
124 |
-
else $billing_first_name = '';
|
125 |
-
|
126 |
-
if ( isset( $_SESSION['billing_last_name'] ) ) $billing_last_name = $_SESSION['billing_last_name'];
|
127 |
-
else $billing_last_name = '';
|
128 |
-
|
129 |
-
$shipping_zipcode = $billing_zipcode = '';
|
130 |
-
|
131 |
-
if ( isset( $_SESSION['shipping_postcode'] ) && $_SESSION['shipping_postcode'] != "" ) $shipping_zipcode = $_SESSION['shipping_postcode'];
|
132 |
-
else $shipping_zipcode = $billing_zipcode = $_SESSION['billing_postcode'];
|
133 |
-
$shipping_charges = $woocommerce->cart->shipping_total;
|
134 |
-
$insert_guest = "INSERT INTO `".$wpdb->prefix . "ac_guest_abandoned_cart_history_lite`( billing_first_name, billing_last_name, email_id, billing_zipcode, shipping_zipcode, shipping_charges )
|
135 |
-
VALUES ( '".$billing_first_name."', '".$billing_last_name."', '".$_SESSION['billing_email']."', '".$billing_zipcode."', '".$shipping_zipcode."', '".$shipping_charges."' )";
|
136 |
-
$wpdb->query( $insert_guest );
|
137 |
-
|
138 |
-
//Insert record in abandoned cart table for the guest user
|
139 |
-
$user_id = $wpdb->insert_id;
|
140 |
-
$_SESSION['user_id'] = $user_id;
|
141 |
-
$current_time = current_time('timestamp');
|
142 |
-
$cut_off_time = get_option('ac_cart_abandoned_time');
|
143 |
-
$cart_cut_off_time = $cut_off_time * 60;
|
144 |
-
$compare_time = $current_time - $cart_cut_off_time;
|
145 |
-
|
146 |
-
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE user_id = %d AND cart_ignored = '0' AND recovered_cart = '0' AND user_type = 'GUEST'";
|
147 |
-
$results = $wpdb->get_results( $wpdb->prepare( $query, $user_id ) );
|
148 |
-
$cart = array();
|
149 |
-
|
150 |
-
foreach ( $woocommerce->cart->cart_contents as $cart_id => $value ) {
|
151 |
-
$cart['cart'][$cart_id] = array();
|
152 |
-
foreach ( $value as $k=>$v ) {
|
153 |
-
$cart['cart'][$cart_id][$k] = $v;
|
154 |
-
if ( $k == "quantity" ) {
|
155 |
-
$product = get_product( $cart['cart'][$cart_id]['product_id'] );
|
156 |
-
$product_type = $product->product_type;
|
157 |
-
|
158 |
-
if ( $product_type == "variable" ) {
|
159 |
-
if(is_plugin_active('woocommerce-dynamic-pricing/woocommerce-dynamic-pricing.php')) {
|
160 |
-
$price = floatval( preg_replace( '#[^\d.]#', '', $woocommerce->cart->total ) );
|
161 |
-
} else {
|
162 |
-
$price = get_post_meta( $cart['cart'][$cart_id]['variation_id'], '_price', true);
|
163 |
-
}
|
164 |
-
} else {
|
165 |
-
if(is_plugin_active('woocommerce-dynamic-pricing/woocommerce-dynamic-pricing.php')) {
|
166 |
-
$price = floatval( preg_replace( '#[^\d.]#', '', $woocommerce->cart->total ) );
|
167 |
-
} else {
|
168 |
-
$price = get_post_meta( $cart['cart'][$cart_id]['product_id'], '_price', true);
|
169 |
-
}
|
170 |
-
}
|
171 |
-
if(is_plugin_active('woocommerce-dynamic-pricing/woocommerce-dynamic-pricing.php')) {
|
172 |
-
$cart['cart'][$cart_id]['line_total'] = $price;
|
173 |
-
}else {
|
174 |
-
$cart['cart'][$cart_id]['line_total'] = $cart['cart'][$cart_id]['quantity'] * $price;
|
175 |
-
}
|
176 |
-
$cart['cart'][$cart_id]['line_tax'] = '0';
|
177 |
-
$cart['cart'][$cart_id]['line_subtotal'] = $cart['cart'][$cart_id]['line_total'];
|
178 |
-
$cart['cart'][$cart_id]['line_subtotal_tax'] = $cart['cart'][$cart_id]['line_tax'];
|
179 |
-
break;
|
180 |
-
}
|
181 |
-
}
|
182 |
-
}
|
183 |
-
|
184 |
-
if ( count( $results ) == 0 ) {
|
185 |
-
$cart_info = json_encode( $cart );
|
186 |
-
$insert_query = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`( user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored, recovered_cart, user_type )
|
187 |
-
VALUES ( '".$user_id."', '".$cart_info."', '".$current_time."', '0', '0', 'GUEST' )";
|
188 |
-
$wpdb->query( $insert_query );
|
189 |
-
$insert_persistent_cart = "INSERT INTO `".$wpdb->prefix."usermeta`( user_id, meta_key, meta_value )
|
190 |
-
VALUES ( '".$user_id."', '_woocommerce_persistent_cart', '".$cart_info."' )";
|
191 |
-
$wpdb->query( $insert_persistent_cart );
|
192 |
-
}
|
193 |
-
}
|
194 |
-
}
|
195 |
-
|
196 |
-
function guest_checkout_fields( $fields ) {
|
197 |
-
|
198 |
-
if ( isset( $_SESSION['guest_first_name']) && $_SESSION['guest_first_name'] != "" ) $_POST['billing_first_name'] = $_SESSION['guest_first_name'];
|
199 |
-
|
200 |
-
if ( isset( $_SESSION['guest_last_name']) && $_SESSION['guest_last_name'] != "" ) $_POST['billing_last_name'] = $_SESSION['guest_last_name'];
|
201 |
-
|
202 |
-
if ( isset( $_SESSION['guest_email']) && $_SESSION['guest_email'] != "" ) $_POST['billing_email'] = $_SESSION['guest_email'];
|
203 |
-
return $fields;
|
204 |
-
}
|
205 |
-
}
|
206 |
-
$woocommerce_guest_ac = new woocommerce_guest_ac();
|
207 |
-
}
|
208 |
-
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|