Version Description
(10.02.2020) =
- Tweak - Bots and Crawlers used to log lot of Abandoned Carts. We have now prevented logging such carts and now only genuine carts will be tracked.
Download this release
Release Info
| Developer | Dhruvin |
| Plugin | |
| Version | 5.7.1 |
| Comparing to | |
| See all releases | |
Code changes from version 5.7 to 5.7.1
- class-wcal-update.php +2 -2
- readme.txt +4 -0
- woocommerce-ac.php +3262 -3201
class-wcal-update.php
CHANGED
|
@@ -79,7 +79,7 @@ if ( ! class_exists( 'Wcal_Update' ) ) {
|
|
| 79 |
$wcal_previous_version = get_option( 'wcal_previous_version' );
|
| 80 |
|
| 81 |
if ( wcal_common::wcal_get_version() !== $wcal_previous_version ) {
|
| 82 |
-
update_option( 'wcal_previous_version', '5.7' );
|
| 83 |
}
|
| 84 |
} else { // multi site - child sites.
|
| 85 |
$wcal_guest_user_id_altered = get_blog_option( $blog_id, 'wcal_guest_user_id_altered' );
|
|
@@ -92,7 +92,7 @@ if ( ! class_exists( 'Wcal_Update' ) ) {
|
|
| 92 |
$wcal_previous_version = get_blog_option( $blog_id, 'wcal_previous_version' );
|
| 93 |
|
| 94 |
if ( wcal_common::wcal_get_version() !== $wcal_previous_version ) {
|
| 95 |
-
update_blog_option( $blog_id, 'wcal_previous_version', '5.7' );
|
| 96 |
}
|
| 97 |
}
|
| 98 |
|
| 79 |
$wcal_previous_version = get_option( 'wcal_previous_version' );
|
| 80 |
|
| 81 |
if ( wcal_common::wcal_get_version() !== $wcal_previous_version ) {
|
| 82 |
+
update_option( 'wcal_previous_version', '5.7.1' );
|
| 83 |
}
|
| 84 |
} else { // multi site - child sites.
|
| 85 |
$wcal_guest_user_id_altered = get_blog_option( $blog_id, 'wcal_guest_user_id_altered' );
|
| 92 |
$wcal_previous_version = get_blog_option( $blog_id, 'wcal_previous_version' );
|
| 93 |
|
| 94 |
if ( wcal_common::wcal_get_version() !== $wcal_previous_version ) {
|
| 95 |
+
update_blog_option( $blog_id, 'wcal_previous_version', '5.7.1' );
|
| 96 |
}
|
| 97 |
}
|
| 98 |
|
readme.txt
CHANGED
|
@@ -220,6 +220,10 @@ The admin can use the merge code `{{cart.unsubscribe}}' in the email templates.
|
|
| 220 |
6. Product Report Tab.
|
| 221 |
|
| 222 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
| 223 |
= 5.7 (29.01.2020) =
|
| 224 |
|
| 225 |
* Enhancement - Updated the plugin to use the Action Scheduler Library instead of WP Cron to send reminders.
|
| 220 |
6. Product Report Tab.
|
| 221 |
|
| 222 |
== Changelog ==
|
| 223 |
+
= 5.7.1 (10.02.2020) =
|
| 224 |
+
|
| 225 |
+
* Tweak - Bots and Crawlers used to log lot of Abandoned Carts. We have now prevented logging such carts and now only genuine carts will be tracked.
|
| 226 |
+
|
| 227 |
= 5.7 (29.01.2020) =
|
| 228 |
|
| 229 |
* Enhancement - Updated the plugin to use the Action Scheduler Library instead of WP Cron to send reminders.
|
woocommerce-ac.php
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
* Description: This plugin captures abandoned carts by logged-in users & emails them about it.
|
| 6 |
* <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the
|
| 7 |
* PRO Version.</a></strong>
|
| 8 |
-
* Version: 5.7
|
| 9 |
* Author: Tyche Softwares
|
| 10 |
* Author URI: http://www.tychesoftwares.com/
|
| 11 |
* Text Domain: woocommerce-abandoned-cart
|
|
@@ -18,14 +18,14 @@
|
|
| 18 |
*/
|
| 19 |
|
| 20 |
require_once( 'class-wcal-update.php' );
|
| 21 |
-
require_once(
|
| 22 |
-
require_once(
|
| 23 |
-
require_once(
|
| 24 |
-
require_once(
|
| 25 |
-
require_once(
|
| 26 |
-
require_once(
|
| 27 |
-
|
| 28 |
-
require_once(
|
| 29 |
require_once( 'includes/wcal_data_tracking_message.php' );
|
| 30 |
require_once( 'includes/admin/wcal_privacy_erase.php' );
|
| 31 |
require_once( 'includes/admin/wcal_privacy_export.php' );
|
|
@@ -37,3216 +37,3277 @@ require_once( 'includes/admin/wcap_add_cart_popup_modal.php' );
|
|
| 37 |
|
| 38 |
/**
|
| 39 |
* Schedule an action to delete old carts once a day
|
|
|
|
| 40 |
* @since 5.1
|
| 41 |
* @package Abandoned-Cart-Lite-for-WooCommerce/Cron
|
| 42 |
*/
|
| 43 |
-
if( ! wp_next_scheduled( 'wcal_clear_carts' ) ) {
|
| 44 |
-
|
| 45 |
}
|
| 46 |
|
| 47 |
/**
|
| 48 |
-
*
|
| 49 |
-
|
| 50 |
if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
|
| 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 |
if ( ! defined( 'WCAL_PLUGIN_VERSION' ) ) {
|
| 79 |
-
define( 'WCAL_PLUGIN_VERSION', '5.7' );
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 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 |
//delete abandoned order after X number of days
|
| 153 |
if ( class_exists( 'Wcal_Delete_Handler' ) ) {
|
| 154 |
add_action( 'wcal_clear_carts', array( 'Wcal_Delete_Handler', 'wcal_delete_abandoned_carts_after_x_days' ) );
|
| 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 |
break;
|
| 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 |
wp_enqueue_style( 'jquery-ui-style', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/jquery-ui-smoothness.css' );
|
| 1820 |
wp_enqueue_style( 'wcal-reports', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/wcal_reports.min.css' );
|
| 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 |
-
|
| 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 |
-
|
| 2714 |
-
|
| 2715 |
-
|
| 2716 |
-
|
| 2717 |
-
|
| 2718 |
-
|
| 2719 |
-
|
| 2720 |
-
|
| 2721 |
-
|
| 2722 |
-
|
| 2723 |
-
|
| 2724 |
-
|
| 2725 |
-
|
| 2726 |
-
|
| 2727 |
-
|
| 2728 |
-
|
| 2729 |
-
|
| 2730 |
-
|
| 2731 |
-
|
| 2732 |
-
|
| 2733 |
-
|
| 2734 |
-
|
| 2735 |
-
|
| 2736 |
-
|
| 2737 |
-
|
| 2738 |
-
|
| 2739 |
-
|
| 2740 |
-
|
| 2741 |
-
|
| 2742 |
-
|
| 2743 |
-
|
| 2744 |
-
|
| 2745 |
-
|
| 2746 |
-
|
| 2747 |
-
|
| 2748 |
-
|
| 2749 |
-
|
| 2750 |
-
|
| 2751 |
-
|
| 2752 |
-
|
| 2753 |
-
|
| 2754 |
-
|
| 2755 |
-
|
| 2756 |
-
|
| 2757 |
-
|
| 2758 |
-
|
| 2759 |
-
|
| 2760 |
-
|
| 2761 |
-
|
| 2762 |
-
|
| 2763 |
-
|
| 2764 |
-
|
| 2765 |
-
|
| 2766 |
-
|
| 2767 |
-
|
| 2768 |
-
|
| 2769 |
-
|
| 2770 |
-
|
| 2771 |
-
|
| 2772 |
-
|
| 2773 |
-
|
| 2774 |
-
|
| 2775 |
-
|
| 2776 |
-
|
| 2777 |
-
|
| 2778 |
-
|
| 2779 |
-
|
| 2780 |
-
|
| 2781 |
-
|
| 2782 |
-
|
| 2783 |
-
|
| 2784 |
-
|
| 2785 |
-
|
| 2786 |
-
|
| 2787 |
-
|
| 2788 |
-
|
| 2789 |
-
|
| 2790 |
-
|
| 2791 |
-
|
| 2792 |
-
|
| 2793 |
-
|
| 2794 |
-
|
| 2795 |
-
|
| 2796 |
-
|
| 2797 |
-
|
| 2798 |
-
|
| 2799 |
-
|
| 2800 |
-
|
| 2801 |
-
|
| 2802 |
-
|
| 2803 |
-
|
| 2804 |
-
|
| 2805 |
-
|
| 2806 |
-
|
| 2807 |
-
|
| 2808 |
-
|
| 2809 |
-
|
| 2810 |
-
|
| 2811 |
-
|
| 2812 |
-
|
| 2813 |
-
|
| 2814 |
-
|
| 2815 |
-
|
| 2816 |
-
|
| 2817 |
-
|
| 2818 |
-
|
| 2819 |
-
|
| 2820 |
-
|
| 2821 |
-
|
| 2822 |
-
|
| 2823 |
-
|
| 2824 |
-
|
| 2825 |
-
|
| 2826 |
-
|
| 2827 |
-
|
| 2828 |
-
|
| 2829 |
-
|
| 2830 |
-
|
| 2831 |
-
|
| 2832 |
-
|
| 2833 |
-
|
| 2834 |
-
|
| 2835 |
-
|
| 2836 |
-
|
| 2837 |
-
|
| 2838 |
-
|
| 2839 |
-
|
| 2840 |
-
|
| 2841 |
-
|
| 2842 |
-
|
| 2843 |
-
|
| 2844 |
-
|
| 2845 |
-
|
| 2846 |
-
|
| 2847 |
-
|
| 2848 |
-
|
| 2849 |
-
|
| 2850 |
-
|
| 2851 |
-
|
| 2852 |
-
|
| 2853 |
-
|
| 2854 |
-
|
| 2855 |
-
|
| 2856 |
-
|
| 2857 |
-
|
| 2858 |
-
|
| 2859 |
-
|
| 2860 |
-
|
| 2861 |
-
|
| 2862 |
-
|
| 2863 |
-
|
| 2864 |
-
|
| 2865 |
-
|
| 2866 |
-
|
| 2867 |
-
|
| 2868 |
-
|
| 2869 |
-
|
| 2870 |
-
|
| 2871 |
-
|
| 2872 |
-
|
| 2873 |
-
|
| 2874 |
-
|
| 2875 |
-
|
| 2876 |
-
|
| 2877 |
-
|
| 2878 |
-
|
| 2879 |
-
|
| 2880 |
-
|
| 2881 |
-
|
| 2882 |
-
|
| 2883 |
-
|
| 2884 |
-
|
| 2885 |
-
|
| 2886 |
-
|
| 2887 |
-
|
| 2888 |
-
|
| 2889 |
-
|
| 2890 |
-
|
| 2891 |
-
|
| 2892 |
-
|
| 2893 |
-
|
| 2894 |
-
|
| 2895 |
-
|
| 2896 |
-
|
| 2897 |
-
|
| 2898 |
-
|
| 2899 |
-
|
| 2900 |
-
|
| 2901 |
-
|
| 2902 |
-
|
| 2903 |
-
|
| 2904 |
-
|
| 2905 |
-
|
| 2906 |
-
|
| 2907 |
-
|
| 2908 |
-
|
| 2909 |
-
|
| 2910 |
-
|
| 2911 |
-
|
| 2912 |
-
|
| 2913 |
-
|
| 2914 |
-
|
| 2915 |
-
|
| 2916 |
-
|
| 2917 |
-
|
| 2918 |
-
|
| 2919 |
-
|
| 2920 |
-
|
| 2921 |
-
|
| 2922 |
-
|
| 2923 |
-
|
| 2924 |
-
|
| 2925 |
-
|
| 2926 |
-
|
| 2927 |
-
|
| 2928 |
-
|
| 2929 |
-
|
| 2930 |
-
|
| 2931 |
-
|
| 2932 |
-
|
| 2933 |
-
|
| 2934 |
-
|
| 2935 |
-
|
| 2936 |
-
|
| 2937 |
-
|
| 2938 |
-
|
| 2939 |
-
|
| 2940 |
-
|
| 2941 |
-
|
| 2942 |
-
|
| 2943 |
-
|
| 2944 |
-
|
| 2945 |
-
|
| 2946 |
-
|
| 2947 |
-
|
| 2948 |
-
|
| 2949 |
-
|
| 2950 |
-
|
| 2951 |
-
|
| 2952 |
-
|
| 2953 |
-
|
| 2954 |
-
|
| 2955 |
-
|
| 2956 |
-
|
| 2957 |
-
|
| 2958 |
-
|
| 2959 |
-
|
| 2960 |
-
|
| 2961 |
-
|
| 2962 |
-
|
| 2963 |
-
|
| 2964 |
-
|
| 2965 |
-
|
| 2966 |
-
|
| 2967 |
-
|
| 2968 |
-
|
| 2969 |
-
|
| 2970 |
-
|
| 2971 |
-
|
| 2972 |
-
|
| 2973 |
-
|
| 2974 |
-
|
| 2975 |
-
|
| 2976 |
-
|
| 2977 |
-
|
| 2978 |
-
|
| 2979 |
-
|
| 2980 |
-
|
| 2981 |
-
|
| 2982 |
-
|
| 2983 |
-
|
| 2984 |
-
|
| 2985 |
-
|
| 2986 |
-
|
| 2987 |
-
|
| 2988 |
-
|
| 2989 |
-
|
| 2990 |
-
|
| 2991 |
-
|
| 2992 |
-
|
| 2993 |
-
|
| 2994 |
-
|
| 2995 |
-
|
| 2996 |
-
|
| 2997 |
-
|
| 2998 |
-
|
| 2999 |
-
|
| 3000 |
-
|
| 3001 |
-
|
| 3002 |
-
|
| 3003 |
-
|
| 3004 |
-
|
| 3005 |
-
|
| 3006 |
-
|
| 3007 |
-
|
| 3008 |
-
|
| 3009 |
-
|
| 3010 |
-
|
| 3011 |
-
|
| 3012 |
-
|
| 3013 |
-
|
| 3014 |
-
|
| 3015 |
-
|
| 3016 |
-
|
| 3017 |
-
|
| 3018 |
-
|
| 3019 |
-
|
| 3020 |
-
|
| 3021 |
-
|
| 3022 |
-
|
| 3023 |
-
|
| 3024 |
-
|
| 3025 |
-
|
| 3026 |
-
|
| 3027 |
-
|
| 3028 |
-
|
| 3029 |
-
|
| 3030 |
-
|
| 3031 |
-
|
| 3032 |
-
|
| 3033 |
-
|
| 3034 |
-
|
| 3035 |
-
|
| 3036 |
-
|
| 3037 |
-
|
| 3038 |
-
|
| 3039 |
-
|
| 3040 |
-
|
| 3041 |
-
|
| 3042 |
-
|
| 3043 |
-
|
| 3044 |
-
|
| 3045 |
-
|
| 3046 |
-
|
| 3047 |
-
|
| 3048 |
-
|
| 3049 |
-
|
| 3050 |
-
|
| 3051 |
-
|
| 3052 |
-
|
| 3053 |
-
|
| 3054 |
-
|
| 3055 |
-
|
| 3056 |
-
|
| 3057 |
-
|
| 3058 |
-
|
| 3059 |
-
|
| 3060 |
-
|
| 3061 |
-
|
| 3062 |
-
|
| 3063 |
-
|
| 3064 |
-
|
| 3065 |
-
|
| 3066 |
-
|
| 3067 |
-
|
| 3068 |
-
|
| 3069 |
-
|
| 3070 |
-
|
| 3071 |
-
|
| 3072 |
-
|
| 3073 |
-
|
| 3074 |
-
|
| 3075 |
-
|
| 3076 |
-
|
| 3077 |
-
|
| 3078 |
-
|
| 3079 |
-
|
| 3080 |
-
|
| 3081 |
-
|
| 3082 |
-
|
| 3083 |
-
|
| 3084 |
-
|
| 3085 |
-
|
| 3086 |
-
|
| 3087 |
-
|
| 3088 |
-
|
| 3089 |
-
|
| 3090 |
-
|
| 3091 |
-
|
| 3092 |
-
|
| 3093 |
-
|
| 3094 |
-
|
| 3095 |
-
|
| 3096 |
-
|
| 3097 |
-
|
| 3098 |
-
|
| 3099 |
-
|
| 3100 |
-
|
| 3101 |
-
|
| 3102 |
-
|
| 3103 |
-
|
| 3104 |
-
|
| 3105 |
-
|
| 3106 |
-
|
| 3107 |
-
|
| 3108 |
-
|
| 3109 |
-
|
| 3110 |
-
|
| 3111 |
-
|
| 3112 |
-
|
| 3113 |
-
|
| 3114 |
-
|
| 3115 |
-
|
| 3116 |
-
|
| 3117 |
-
|
| 3118 |
-
|
| 3119 |
-
|
| 3120 |
-
|
| 3121 |
-
|
| 3122 |
-
|
| 3123 |
-
|
| 3124 |
-
|
| 3125 |
-
|
| 3126 |
-
|
| 3127 |
-
|
| 3128 |
-
|
| 3129 |
-
|
| 3130 |
-
|
| 3131 |
-
|
| 3132 |
-
|
| 3133 |
-
|
| 3134 |
-
|
| 3135 |
-
|
| 3136 |
-
|
| 3137 |
-
|
| 3138 |
-
|
| 3139 |
-
|
| 3140 |
-
|
| 3141 |
-
|
| 3142 |
-
|
| 3143 |
-
|
| 3144 |
-
|
| 3145 |
-
|
| 3146 |
-
|
| 3147 |
-
|
| 3148 |
-
|
| 3149 |
-
|
| 3150 |
-
|
| 3151 |
-
|
| 3152 |
-
|
| 3153 |
-
|
| 3154 |
-
|
| 3155 |
-
|
| 3156 |
-
|
| 3157 |
-
|
| 3158 |
-
|
| 3159 |
-
|
| 3160 |
-
|
| 3161 |
-
|
| 3162 |
-
|
| 3163 |
-
|
| 3164 |
-
|
| 3165 |
-
|
| 3166 |
-
|
| 3167 |
-
|
| 3168 |
-
|
| 3169 |
-
|
| 3170 |
-
|
| 3171 |
-
|
| 3172 |
-
|
| 3173 |
-
|
| 3174 |
-
|
| 3175 |
-
|
| 3176 |
-
|
| 3177 |
-
|
| 3178 |
-
|
| 3179 |
-
|
| 3180 |
-
|
| 3181 |
-
|
| 3182 |
-
|
| 3183 |
-
|
| 3184 |
-
|
| 3185 |
-
|
| 3186 |
-
|
| 3187 |
-
|
| 3188 |
-
|
| 3189 |
-
|
| 3190 |
-
|
| 3191 |
-
|
| 3192 |
-
|
| 3193 |
-
|
| 3194 |
-
|
| 3195 |
-
|
| 3196 |
-
|
| 3197 |
-
|
| 3198 |
-
|
| 3199 |
-
|
| 3200 |
-
|
| 3201 |
-
|
| 3202 |
-
|
| 3203 |
-
|
| 3204 |
-
|
| 3205 |
-
|
| 3206 |
-
|
| 3207 |
-
|
| 3208 |
-
|
| 3209 |
-
|
| 3210 |
-
|
| 3211 |
-
|
| 3212 |
-
|
| 3213 |
-
|
| 3214 |
-
|
| 3215 |
-
|
| 3216 |
-
|
| 3217 |
-
|
| 3218 |
-
|
| 3219 |
-
|
| 3220 |
-
|
| 3221 |
-
|
| 3222 |
-
|
| 3223 |
-
|
| 3224 |
-
|
| 3225 |
-
|
| 3226 |
-
|
| 3227 |
-
|
| 3228 |
-
|
| 3229 |
-
|
| 3230 |
-
|
| 3231 |
-
|
| 3232 |
-
|
| 3233 |
-
|
| 3234 |
-
|
| 3235 |
-
|
| 3236 |
-
|
| 3237 |
-
|
| 3238 |
-
|
| 3239 |
-
|
| 3240 |
-
|
| 3241 |
-
|
| 3242 |
-
|
| 3243 |
-
|
| 3244 |
-
|
| 3245 |
-
|
| 3246 |
-
|
| 3247 |
-
|
| 3248 |
-
|
| 3249 |
-
|
| 3250 |
}
|
| 3251 |
$woocommerce_abandon_cart = new woocommerce_abandon_cart_lite();
|
| 3252 |
?>
|
| 5 |
* Description: This plugin captures abandoned carts by logged-in users & emails them about it.
|
| 6 |
* <strong><a href="http://www.tychesoftwares.com/store/premium-plugins/woocommerce-abandoned-cart-pro">Click here to get the
|
| 7 |
* PRO Version.</a></strong>
|
| 8 |
+
* Version: 5.7.1
|
| 9 |
* Author: Tyche Softwares
|
| 10 |
* Author URI: http://www.tychesoftwares.com/
|
| 11 |
* Text Domain: woocommerce-abandoned-cart
|
| 18 |
*/
|
| 19 |
|
| 20 |
require_once( 'class-wcal-update.php' );
|
| 21 |
+
require_once( 'includes/wcal_class-guest.php' );
|
| 22 |
+
require_once( 'includes/class-wcal-default-template-settings.php' );
|
| 23 |
+
require_once( 'includes/class-wcal-delete-handler.php' );
|
| 24 |
+
require_once( 'includes/classes/class-wcal-aes.php' );
|
| 25 |
+
require_once( 'includes/classes/class-wcal-aes-counter.php' );
|
| 26 |
+
require_once( 'includes/wcal-common.php' );
|
| 27 |
+
|
| 28 |
+
require_once( 'includes/class-wcal-admin-notice.php' );
|
| 29 |
require_once( 'includes/wcal_data_tracking_message.php' );
|
| 30 |
require_once( 'includes/admin/wcal_privacy_erase.php' );
|
| 31 |
require_once( 'includes/admin/wcal_privacy_export.php' );
|
| 37 |
|
| 38 |
/**
|
| 39 |
* Schedule an action to delete old carts once a day
|
| 40 |
+
*
|
| 41 |
* @since 5.1
|
| 42 |
* @package Abandoned-Cart-Lite-for-WooCommerce/Cron
|
| 43 |
*/
|
| 44 |
+
if ( ! wp_next_scheduled( 'wcal_clear_carts' ) ) {
|
| 45 |
+
wp_schedule_event( time(), 'daily', 'wcal_clear_carts' );
|
| 46 |
}
|
| 47 |
|
| 48 |
/**
|
| 49 |
+
* Main class
|
| 50 |
+
*/
|
| 51 |
if ( ! class_exists( 'woocommerce_abandon_cart_lite' ) ) {
|
| 52 |
|
| 53 |
|
| 54 |
+
/**
|
| 55 |
+
* It will add the hooks, filters, menu and the variables and all the necessary actions for the plguins which will be used
|
| 56 |
+
* all over the plugin.
|
| 57 |
+
*
|
| 58 |
+
* @since 1.0
|
| 59 |
+
* @package Abandoned-Cart-Lite-for-WooCommerce/Core
|
| 60 |
+
*/
|
| 61 |
+
class woocommerce_abandon_cart_lite {
|
| 62 |
+
var $one_hour;
|
| 63 |
+
var $three_hours;
|
| 64 |
+
var $six_hours;
|
| 65 |
+
var $twelve_hours;
|
| 66 |
+
var $one_day;
|
| 67 |
+
var $one_week;
|
| 68 |
+
var $duration_range_select = array();
|
| 69 |
+
var $start_end_dates = array();
|
| 70 |
+
/**
|
| 71 |
+
* The constructor will add the hooks, filters and the variable which will be used all over the plugin.
|
| 72 |
+
*
|
| 73 |
+
* @since 1.0
|
| 74 |
+
*/
|
| 75 |
+
public function __construct() {
|
| 76 |
+
if ( !defined( 'WCAL_PLUGIN_URL' ) ) {
|
| 77 |
+
define( 'WCAL_PLUGIN_URL', untrailingslashit( plugins_url( '/', __FILE__ ) ) );
|
| 78 |
+
}
|
| 79 |
|
| 80 |
if ( ! defined( 'WCAL_PLUGIN_VERSION' ) ) {
|
| 81 |
+
define( 'WCAL_PLUGIN_VERSION', '5.7.1' );
|
| 82 |
+
}
|
| 83 |
+
$this->one_hour = 60 * 60;
|
| 84 |
+
$this->three_hours = 3 * $this->one_hour;
|
| 85 |
+
$this->six_hours = 6 * $this->one_hour;
|
| 86 |
+
$this->twelve_hours = 12 * $this->one_hour;
|
| 87 |
+
$this->one_day = 24 * $this->one_hour;
|
| 88 |
+
$this->one_week = 7 * $this->one_day;
|
| 89 |
+
$this->duration_range_select = array(
|
| 90 |
+
'yesterday' => 'Yesterday',
|
| 91 |
+
'today' => 'Today',
|
| 92 |
+
'last_seven' => 'Last 7 days',
|
| 93 |
+
'last_fifteen' => 'Last 15 days',
|
| 94 |
+
'last_thirty' => 'Last 30 days',
|
| 95 |
+
'last_ninety' => 'Last 90 days',
|
| 96 |
+
'last_year_days' => 'Last 365'
|
| 97 |
+
);
|
| 98 |
+
|
| 99 |
+
$this->start_end_dates = array(
|
| 100 |
+
'yesterday' => array(
|
| 101 |
+
'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 24 * 60 * 60 ) ),
|
| 102 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) - 7 * 24 * 60 * 60 ) ),
|
| 103 |
+
),
|
| 104 |
+
'today' => array(
|
| 105 |
+
'start_date' => date( "d M Y", ( current_time( 'timestamp' ) ) ),
|
| 106 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) )
|
| 107 |
+
),
|
| 108 |
+
'last_seven' => array(
|
| 109 |
+
'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 7*24*60*60 ) ),
|
| 110 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) )
|
| 111 |
+
),
|
| 112 |
+
'last_fifteen' => array(
|
| 113 |
+
'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 15*24*60*60 ) ),
|
| 114 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) )
|
| 115 |
+
),
|
| 116 |
+
'last_thirty' => array(
|
| 117 |
+
'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 30*24*60*60 ) ),
|
| 118 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) )
|
| 119 |
+
),
|
| 120 |
+
'last_ninety' => array(
|
| 121 |
+
'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 90*24*60*60 ) ),
|
| 122 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) )
|
| 123 |
+
),
|
| 124 |
+
'last_year_days' => array(
|
| 125 |
+
'start_date' => date( "d M Y", ( current_time( 'timestamp' ) - 365*24*60*60 ) ),
|
| 126 |
+
'end_date' => date( "d M Y", ( current_time( 'timestamp' ) ) )
|
| 127 |
+
),
|
| 128 |
+
);
|
| 129 |
+
|
| 130 |
+
// Initialize settings.
|
| 131 |
+
register_activation_hook( __FILE__, array( &$this, 'wcal_activate' ) );
|
| 132 |
+
|
| 133 |
+
// Action Scheduler for Cron.
|
| 134 |
+
require_once( 'includes/libraries/action-scheduler/action-scheduler.php' );
|
| 135 |
+
add_action( 'init', array( &$this, 'wcal_add_scheduled_action' ) );
|
| 136 |
+
require_once( 'cron/wcal_send_email.php' );
|
| 137 |
+
require_once( 'includes/wcal_process_base.php' );
|
| 138 |
+
|
| 139 |
+
// WordPress Administration Menu.
|
| 140 |
+
add_action( 'admin_menu', array( &$this, 'wcal_admin_menu' ) );
|
| 141 |
+
|
| 142 |
+
// Actions to be done on cart update.
|
| 143 |
+
add_action( 'woocommerce_add_to_cart', array( &$this, 'wcal_store_cart_timestamp' ), PHP_INT_MAX );
|
| 144 |
+
add_action( 'woocommerce_cart_item_removed', array( &$this, 'wcal_store_cart_timestamp' ), PHP_INT_MAX );
|
| 145 |
+
add_action( 'woocommerce_cart_item_restored', array( &$this, 'wcal_store_cart_timestamp' ), PHP_INT_MAX );
|
| 146 |
+
add_action( 'woocommerce_after_cart_item_quantity_update', array( &$this, 'wcal_store_cart_timestamp' ), PHP_INT_MAX );
|
| 147 |
+
add_action( 'woocommerce_calculate_totals', array( &$this, 'wcal_store_cart_timestamp' ), PHP_INT_MAX );
|
| 148 |
+
|
| 149 |
+
add_filter( 'wcal_block_crawlers', array( &$this, 'wcal_detect_crawlers' ), 10, 1 );
|
| 150 |
+
|
| 151 |
+
add_action( 'admin_init', array( &$this, 'wcal_action_admin_init' ) );
|
| 152 |
+
|
| 153 |
+
// Update the options as per settings API.
|
| 154 |
+
add_action( 'admin_init', array( 'Wcal_Update', 'wcal_update_db_check' ) );
|
| 155 |
+
|
| 156 |
+
// Wordpress settings API
|
| 157 |
+
add_action( 'admin_init', array( &$this, 'wcal_initialize_plugin_options' ) );
|
| 158 |
+
|
| 159 |
+
// Language Translation
|
| 160 |
+
add_action ( 'init', array( &$this, 'wcal_update_po_file' ) );
|
| 161 |
+
|
| 162 |
+
add_action ( 'init', array ( &$this, 'wcal_add_component_file') );
|
| 163 |
+
|
| 164 |
+
// track links
|
| 165 |
+
add_filter( 'template_include', array( &$this, 'wcal_email_track_links' ), 99, 1 );
|
| 166 |
+
|
| 167 |
+
//It will used to unsubcribe the emails.
|
| 168 |
+
add_action( 'template_include', array( &$this, 'wcal_email_unsubscribe'),99, 1 );
|
| 169 |
+
|
| 170 |
+
add_action ( 'admin_enqueue_scripts', array( &$this, 'wcal_enqueue_scripts_js' ) );
|
| 171 |
+
add_action ( 'admin_enqueue_scripts', array( &$this, 'wcal_enqueue_scripts_css' ) );
|
| 172 |
//delete abandoned order after X number of days
|
| 173 |
if ( class_exists( 'Wcal_Delete_Handler' ) ) {
|
| 174 |
add_action( 'wcal_clear_carts', array( 'Wcal_Delete_Handler', 'wcal_delete_abandoned_carts_after_x_days' ) );
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
if ( is_admin() ) {
|
| 178 |
+
// Load "admin-only" scripts here.
|
| 179 |
+
add_action( 'admin_head', array( &$this, 'wcal_action_send_preview' ) );
|
| 180 |
+
add_action( 'wp_ajax_wcal_preview_email_sent', array( &$this, 'wcal_preview_email_sent' ) );
|
| 181 |
+
add_action( 'wp_ajax_wcal_toggle_template_status', array( &$this, 'wcal_toggle_template_status' ) );
|
| 182 |
+
add_action( 'wp_ajax_wcal_abandoned_cart_info', array( &$this, 'wcal_abandoned_cart_info' ) );
|
| 183 |
+
add_action( 'wp_ajax_wcal_dismiss_admin_notice', array( &$this, 'wcal_dismiss_admin_notice' ) );
|
| 184 |
+
|
| 185 |
+
add_filter( 'ts_tracker_data', array( 'wcal_common', 'ts_add_plugin_tracking_data' ), 10, 1 );
|
| 186 |
+
add_filter( 'ts_tracker_opt_out_data', array( 'wcal_common', 'ts_get_data_for_opt_out' ), 10, 1 );
|
| 187 |
+
add_filter( 'ts_deativate_plugin_questions', array( &$this, 'wcal_deactivate_add_questions' ), 10, 1 );
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
// Plugin Settings link in WP->Plugins page
|
| 191 |
+
$plugin = plugin_basename( __FILE__ );
|
| 192 |
+
add_action( "plugin_action_links_$plugin", array( &$this, 'wcal_settings_link' ) );
|
| 193 |
+
|
| 194 |
+
add_action( 'admin_init', array( $this, 'wcal_preview_emails' ) );
|
| 195 |
+
add_action( 'init', array( $this, 'wcal_app_output_buffer') );
|
| 196 |
+
|
| 197 |
+
add_filter( 'admin_footer_text', array( $this, 'wcal_admin_footer_text' ), 1 );
|
| 198 |
+
|
| 199 |
+
add_action( 'admin_notices', array( 'Wcal_Admin_Notice', 'wcal_show_db_update_notice' ) );
|
| 200 |
+
|
| 201 |
+
include_once 'includes/frontend/wcal_frontend.php';
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
/**
|
| 205 |
+
* Add Recurring Scheduled Action.
|
| 206 |
+
*/
|
| 207 |
+
public static function wcal_add_scheduled_action() {
|
| 208 |
+
if ( false === as_next_scheduled_action( 'woocommerce_ac_send_email_action' ) ) {
|
| 209 |
+
wp_clear_scheduled_hook( 'woocommerce_ac_send_email_action' ); // Remove the cron job is present.
|
| 210 |
+
as_schedule_recurring_action( time(), 900, 'woocommerce_ac_send_email_action' ); // Schedule recurring action.
|
| 211 |
+
}
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
/**
|
| 215 |
+
* Add Settings link to WP->Plugins page
|
| 216 |
+
* @since 5.3.0
|
| 217 |
+
*/
|
| 218 |
+
public static function wcal_settings_link( $links ) {
|
| 219 |
+
$settings_link = '<a href="admin.php?page=woocommerce_ac_page&action=emailsettings">' . __( 'Settings', 'woocommerce-abandoned-cart' ) . '</a>';
|
| 220 |
+
array_push( $links, $settings_link );
|
| 221 |
+
return $links;
|
| 222 |
+
}
|
| 223 |
+
|
| 224 |
+
/**
|
| 225 |
+
* It will load the boilerplate components file. In this file we have included all boilerplate files.
|
| 226 |
+
* We need to inlcude this file after the init hook.
|
| 227 |
+
* @hook init
|
| 228 |
+
*/
|
| 229 |
+
public static function wcal_add_component_file () {
|
| 230 |
+
if ( is_admin() ) {
|
| 231 |
+
require_once( 'includes/wcal_all_component.php' );
|
| 232 |
+
|
| 233 |
+
}
|
| 234 |
+
}
|
| 235 |
+
/**
|
| 236 |
+
* It will add the Questions while admin deactivate the plugin.
|
| 237 |
+
* @hook ts_deativate_plugin_questions
|
| 238 |
+
* @param array $wcal_add_questions Blank array
|
| 239 |
+
* @return array $wcal_add_questions List of all questions.
|
| 240 |
+
*/
|
| 241 |
+
public static function wcal_deactivate_add_questions ( $wcal_add_questions ) {
|
| 242 |
+
|
| 243 |
+
$wcal_add_questions = array(
|
| 244 |
+
0 => array(
|
| 245 |
+
'id' => 4,
|
| 246 |
+
'text' => __( "Emails are not being sent to customers.", "woocommerce-abandoned-cart" ),
|
| 247 |
+
'input_type' => '',
|
| 248 |
+
'input_placeholder' => ''
|
| 249 |
+
),
|
| 250 |
+
1 => array(
|
| 251 |
+
'id' => 5,
|
| 252 |
+
'text' => __( "Capturing of cart and other information was not satisfactory.", "woocommerce-abandoned-cart" ),
|
| 253 |
+
'input_type' => '',
|
| 254 |
+
'input_placeholder' => ''
|
| 255 |
+
),
|
| 256 |
+
2 => array(
|
| 257 |
+
'id' => 6,
|
| 258 |
+
'text' => __( "I cannot see abandoned cart reminder emails records.", "woocommerce-abandoned-cart" ),
|
| 259 |
+
'input_type' => '',
|
| 260 |
+
'input_placeholder' => ''
|
| 261 |
+
),
|
| 262 |
+
3 => array(
|
| 263 |
+
'id' => 7,
|
| 264 |
+
'text' => __( "I want to upgrade the plugin to the PRO version.", "woocommerce-abandoned-cart" ),
|
| 265 |
+
'input_type' => '',
|
| 266 |
+
'input_placeholder' => ''
|
| 267 |
+
)
|
| 268 |
+
|
| 269 |
+
);
|
| 270 |
+
return $wcal_add_questions;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
/**
|
| 274 |
+
* It will ganerate the preview email template.
|
| 275 |
+
* @hook admin_init
|
| 276 |
+
* @globals mixed $woocommerce
|
| 277 |
+
* @since 2.5
|
| 278 |
+
*/
|
| 279 |
+
public function wcal_preview_emails() {
|
| 280 |
+
global $woocommerce;
|
| 281 |
+
if ( isset( $_GET['wcal_preview_woocommerce_mail'] ) ) {
|
| 282 |
+
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-abandoned-cart' ) ) {
|
| 283 |
+
die( 'Security check' );
|
| 284 |
+
}
|
| 285 |
+
$message = '';
|
| 286 |
+
// create a new email
|
| 287 |
+
if ( $woocommerce->version < '2.3' ) {
|
| 288 |
+
global $email_heading;
|
| 289 |
+
ob_start();
|
| 290 |
+
|
| 291 |
+
include( 'views/wcal-wc-email-template-preview.php' );
|
| 292 |
+
$mailer = WC()->mailer();
|
| 293 |
+
$message = ob_get_clean();
|
| 294 |
+
$email_heading = __( 'HTML Email Template', 'woocommerce-abandoned-cart' );
|
| 295 |
+
$message = $mailer->wrap_message( $email_heading, $message );
|
| 296 |
+
} else {
|
| 297 |
+
// load the mailer class
|
| 298 |
+
$mailer = WC()->mailer();
|
| 299 |
+
// get the preview email subject
|
| 300 |
+
$email_heading = __( 'Abandoned cart Email Template', 'woocommerce-abandoned-cart' );
|
| 301 |
+
// get the preview email content
|
| 302 |
+
ob_start();
|
| 303 |
+
include( 'views/wcal-wc-email-template-preview.php' );
|
| 304 |
+
$message = ob_get_clean();
|
| 305 |
+
// create a new email
|
| 306 |
+
$email = new WC_Email();
|
| 307 |
+
// wrap the content with the email template and then add styles
|
| 308 |
+
$message = $email->style_inline( $mailer->wrap_message( $email_heading, $message ) );
|
| 309 |
+
}
|
| 310 |
+
echo $message;
|
| 311 |
+
exit;
|
| 312 |
+
}
|
| 313 |
+
|
| 314 |
+
if ( isset( $_GET['wcal_preview_mail'] ) ) {
|
| 315 |
+
if ( ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-abandoned-cart' ) ) {
|
| 316 |
+
die( 'Security check' );
|
| 317 |
+
}
|
| 318 |
+
// get the preview email content
|
| 319 |
+
ob_start();
|
| 320 |
+
include( 'views/wcal-email-template-preview.php' );
|
| 321 |
+
$message = ob_get_clean();
|
| 322 |
+
// print the preview email
|
| 323 |
+
echo $message;
|
| 324 |
+
exit;
|
| 325 |
+
}
|
| 326 |
+
}
|
| 327 |
+
|
| 328 |
+
/**
|
| 329 |
+
* In this version we have allowed customer to transalte the plugin string using .po and .pot file.
|
| 330 |
+
* @hook init
|
| 331 |
+
* @return $loaded
|
| 332 |
+
* @since 1.6
|
| 333 |
+
*/
|
| 334 |
+
function wcal_update_po_file() {
|
| 335 |
+
/*
|
| 336 |
+
* Due to the introduction of language packs through translate.wordpress.org, loading our textdomain is complex.
|
| 337 |
+
*
|
| 338 |
+
* In v4.7, our textdomain changed from "woocommerce-ac" to "woocommerce-abandoned-cart".
|
| 339 |
+
*/
|
| 340 |
+
$domain = 'woocommerce-abandoned-cart';
|
| 341 |
+
$locale = apply_filters( 'plugin_locale', get_locale(), $domain );
|
| 342 |
+
if ( $loaded = load_textdomain( $domain, trailingslashit( WP_LANG_DIR ) . $domain . '-' . $locale . '.mo' ) ) {
|
| 343 |
+
return $loaded;
|
| 344 |
+
} else {
|
| 345 |
+
load_plugin_textdomain( $domain, FALSE, basename( dirname( __FILE__ ) ) . '/i18n/languages/' );
|
| 346 |
+
}
|
| 347 |
+
}
|
| 348 |
+
|
| 349 |
+
/**
|
| 350 |
+
* It will create the plugin tables & the options reqired for plugin.
|
| 351 |
+
* @hook register_activation_hook
|
| 352 |
+
* @globals mixed $wpdb
|
| 353 |
+
* @since 1.0
|
| 354 |
+
*/
|
| 355 |
+
public static function wcal_activate() {
|
| 356 |
+
|
| 357 |
+
// check whether its a multi site install or a single site install
|
| 358 |
+
if ( is_multisite() ) {
|
| 359 |
+
|
| 360 |
+
$blog_list = get_sites();
|
| 361 |
+
foreach ( $blog_list as $blog_list_key => $blog_list_value ) {
|
| 362 |
+
if ( $blog_list_value->blog_id > 1 ) { // child sites
|
| 363 |
+
$blog_id = $blog_list_value->blog_id;
|
| 364 |
+
self::wcal_process_activate( $blog_id );
|
| 365 |
+
} else { // parent site
|
| 366 |
+
self::wcal_process_activate();
|
| 367 |
+
}
|
| 368 |
+
}
|
| 369 |
+
} else { // single site
|
| 370 |
+
self::wcal_process_activate();
|
| 371 |
+
}
|
| 372 |
+
}
|
| 373 |
+
|
| 374 |
+
/**
|
| 375 |
+
* Activation code: Create tables, default settings etc.
|
| 376 |
+
*
|
| 377 |
+
* @param int $blog_id - Greater than 0 for subsites in a multisite install, 0 for single sites.
|
| 378 |
+
*/
|
| 379 |
+
public static function wcal_process_activate( $blog_id = 0 ) {
|
| 380 |
+
global $wpdb;
|
| 381 |
+
|
| 382 |
+
$db_prefix = ( $blog_id === 0 ) ? $wpdb->prefix : $wpdb->prefix . $blog_id . "_";
|
| 383 |
+
|
| 384 |
+
$wcap_collate = '';
|
| 385 |
+
if ( $wpdb->has_cap( 'collation' ) ) {
|
| 386 |
+
$wcap_collate = $wpdb->get_charset_collate();
|
| 387 |
+
}
|
| 388 |
+
$table_name = $db_prefix . "ac_email_templates_lite";
|
| 389 |
+
$sql = "CREATE TABLE IF NOT EXISTS $table_name (
|
| 390 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
| 391 |
+
`subject` text NOT NULL,
|
| 392 |
+
`body` mediumtext NOT NULL,
|
| 393 |
+
`is_active` enum('0','1') NOT NULL,
|
| 394 |
+
`frequency` int(11) NOT NULL,
|
| 395 |
+
`day_or_hour` enum('Days','Hours') NOT NULL,
|
| 396 |
+
`template_name` text NOT NULL,
|
| 397 |
+
`is_wc_template` enum('0','1') NOT NULL,
|
| 398 |
+
`default_template` int(11) NOT NULL,
|
| 399 |
+
`wc_email_header` varchar(50) NOT NULL,
|
| 400 |
+
PRIMARY KEY (`id`)
|
| 401 |
+
) $wcap_collate AUTO_INCREMENT=1 ";
|
| 402 |
+
|
| 403 |
+
require_once ( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
| 404 |
+
dbDelta( $sql );
|
| 405 |
+
|
| 406 |
+
$sent_table_name = $db_prefix . "ac_sent_history_lite";
|
| 407 |
+
|
| 408 |
+
$sql_query = "CREATE TABLE IF NOT EXISTS $sent_table_name (
|
| 409 |
+
`id` int(11) NOT NULL auto_increment,
|
| 410 |
+
`template_id` varchar(40) collate utf8_unicode_ci NOT NULL,
|
| 411 |
+
`abandoned_order_id` int(11) NOT NULL,
|
| 412 |
+
`sent_time` datetime NOT NULL,
|
| 413 |
+
`sent_email_id` text COLLATE utf8_unicode_ci NOT NULL,
|
| 414 |
+
PRIMARY KEY (`id`)
|
| 415 |
+
) $wcap_collate AUTO_INCREMENT=1 ";
|
| 416 |
+
|
| 417 |
+
require_once ( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
| 418 |
+
dbDelta ( $sql_query );
|
| 419 |
+
|
| 420 |
+
$ac_history_table_name = $db_prefix . "ac_abandoned_cart_history_lite";
|
| 421 |
+
|
| 422 |
+
$history_query = "CREATE TABLE IF NOT EXISTS $ac_history_table_name (
|
| 423 |
+
`id` int(11) NOT NULL AUTO_INCREMENT,
|
| 424 |
+
`user_id` int(11) NOT NULL,
|
| 425 |
+
`abandoned_cart_info` text COLLATE utf8_unicode_ci NOT NULL,
|
| 426 |
+
`abandoned_cart_time` int(11) NOT NULL,
|
| 427 |
+
`cart_ignored` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
|
| 428 |
+
`recovered_cart` int(11) NOT NULL,
|
| 429 |
+
`user_type` text,
|
| 430 |
+
`unsubscribe_link` enum('0','1') COLLATE utf8_unicode_ci NOT NULL,
|
| 431 |
+
`session_id` varchar(50) COLLATE utf8_unicode_ci NOT NULL,
|
| 432 |
+
PRIMARY KEY (`id`)
|
| 433 |
+
) $wcap_collate";
|
| 434 |
+
|
| 435 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
|
| 436 |
+
dbDelta( $history_query );
|
| 437 |
+
|
| 438 |
+
$guest_table = $db_prefix."ac_guest_abandoned_cart_history_lite" ;
|
| 439 |
+
$query_guest_table = "SHOW TABLES LIKE '$guest_table' ";
|
| 440 |
+
$result_guest_table = $wpdb->get_results( $query_guest_table );
|
| 441 |
+
|
| 442 |
+
if ( 0 == count( $result_guest_table ) ) {
|
| 443 |
+
$ac_guest_history_table_name = $db_prefix . "ac_guest_abandoned_cart_history_lite";
|
| 444 |
+
$ac_guest_history_query = "CREATE TABLE IF NOT EXISTS $ac_guest_history_table_name (
|
| 445 |
+
`id` int(15) NOT NULL AUTO_INCREMENT,
|
| 446 |
+
`billing_first_name` text,
|
| 447 |
+
`billing_last_name` text,
|
| 448 |
+
`billing_company_name` text,
|
| 449 |
+
`billing_address_1` text,
|
| 450 |
+
`billing_address_2` text,
|
| 451 |
+
`billing_city` text,
|
| 452 |
+
`billing_county` text,
|
| 453 |
+
`billing_zipcode` text,
|
| 454 |
+
`email_id` text,
|
| 455 |
+
`phone` text,
|
| 456 |
+
`ship_to_billing` text,
|
| 457 |
+
`order_notes` text,
|
| 458 |
+
`shipping_first_name` text,
|
| 459 |
+
`shipping_last_name` text,
|
| 460 |
+
`shipping_company_name` text,
|
| 461 |
+
`shipping_address_1` text,
|
| 462 |
+
`shipping_address_2` text,
|
| 463 |
+
`shipping_city` text,
|
| 464 |
+
`shipping_county` text,
|
| 465 |
+
`shipping_zipcode` double,
|
| 466 |
+
`shipping_charges` double,
|
| 467 |
+
PRIMARY KEY (`id`)
|
| 468 |
+
) $wcap_collate AUTO_INCREMENT=63000000";
|
| 469 |
+
require_once( ABSPATH . 'wp-admin/includes/upgrade.php');
|
| 470 |
+
$wpdb->query( $ac_guest_history_query );
|
| 471 |
+
}
|
| 472 |
+
|
| 473 |
+
// Default templates: function call to create default templates.
|
| 474 |
+
$check_table_empty = $wpdb->get_var( "SELECT COUNT(*) FROM `" . $db_prefix . "ac_email_templates_lite`" );
|
| 475 |
+
|
| 476 |
+
/**
|
| 477 |
+
* This is add for thos user who Install the plguin first time.
|
| 478 |
+
* So for them this option will be cheked.
|
| 479 |
+
*/
|
| 480 |
+
if( 0 === $blog_id ) {
|
| 481 |
+
if ( ! get_option( 'wcal_new_default_templates' ) ) {
|
| 482 |
+
if ( 0 == $check_table_empty ) {
|
| 483 |
+
$default_template = new Wcal_Default_Template_Settings;
|
| 484 |
+
$default_template->wcal_create_default_templates( $db_prefix, $blog_id );
|
| 485 |
+
}
|
| 486 |
+
}
|
| 487 |
+
|
| 488 |
+
if ( ! get_option( 'ac_lite_track_guest_cart_from_cart_page' ) ) {
|
| 489 |
+
add_option( 'ac_lite_track_guest_cart_from_cart_page', 'on' );
|
| 490 |
+
}
|
| 491 |
+
if ( ! get_option( 'wcal_from_name' ) ) {
|
| 492 |
+
add_option( 'wcal_from_name', 'Admin' );
|
| 493 |
+
}
|
| 494 |
+
$wcal_get_admin_email = get_option( 'admin_email' );
|
| 495 |
+
if ( ! get_option( 'wcal_from_email' ) ) {
|
| 496 |
+
add_option( 'wcal_from_email', $wcal_get_admin_email );
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
if ( ! get_option( 'wcal_reply_email' ) ) {
|
| 500 |
+
add_option( 'wcal_reply_email', $wcal_get_admin_email );
|
| 501 |
+
}
|
| 502 |
+
} else {
|
| 503 |
+
if ( ! get_blog_option( $blog_id, 'wcal_new_default_templates' ) ) {
|
| 504 |
+
if ( 0 == $check_table_empty ) {
|
| 505 |
+
$default_template = new Wcal_Default_Template_Settings();
|
| 506 |
+
$default_template->wcal_create_default_templates( $db_prefix, $blog_id );
|
| 507 |
+
}
|
| 508 |
+
}
|
| 509 |
+
|
| 510 |
+
if ( ! get_blog_option( $blog_id, 'ac_lite_track_guest_cart_from_cart_page' ) ) {
|
| 511 |
+
add_blog_option( $blog_id, 'ac_lite_track_guest_cart_from_cart_page', 'on' );
|
| 512 |
+
}
|
| 513 |
+
if ( ! get_blog_option( $blog_id, 'wcal_from_name' ) ) {
|
| 514 |
+
add_blog_option( $blog_id, 'wcal_from_name', 'Admin' );
|
| 515 |
+
}
|
| 516 |
+
$wcal_get_admin_email = get_option( 'admin_email' );
|
| 517 |
+
if ( ! get_blog_option( $blog_id, 'wcal_from_email' ) ) {
|
| 518 |
+
add_blog_option( $blog_id, 'wcal_from_email', $wcal_get_admin_email );
|
| 519 |
+
}
|
| 520 |
+
|
| 521 |
+
if ( ! get_blog_option( $blog_id, 'wcal_reply_email' ) ) {
|
| 522 |
+
add_blog_option( $blog_id, 'wcal_reply_email', $wcal_get_admin_email );
|
| 523 |
+
}
|
| 524 |
+
}
|
| 525 |
+
do_action( 'wcal_activate' );
|
| 526 |
+
}
|
| 527 |
+
|
| 528 |
+
/**
|
| 529 |
+
* It will add the section, field, & registres the plugin fields using Settings API.
|
| 530 |
+
* @hook admin_init
|
| 531 |
+
* @since 2.5
|
| 532 |
+
*/
|
| 533 |
+
function wcal_initialize_plugin_options() {
|
| 534 |
+
|
| 535 |
+
// First, we register a section. This is necessary since all future options must belong to a
|
| 536 |
+
add_settings_section(
|
| 537 |
+
'ac_lite_general_settings_section', // ID used to identify this section and with which to register options
|
| 538 |
+
__( 'Settings', 'woocommerce-abandoned-cart' ), // Title to be displayed on the administration page
|
| 539 |
+
array( $this, 'ac_lite_general_options_callback' ), // Callback used to render the description of the section
|
| 540 |
+
'woocommerce_ac_page' // Page on which to add this section of options
|
| 541 |
+
);
|
| 542 |
+
|
| 543 |
+
add_settings_field(
|
| 544 |
+
'wcal_enable_cart_emails',
|
| 545 |
+
__( 'Enable abandoned cart emails', 'woocommerce-abandoned-cart' ),
|
| 546 |
+
array( $this, 'wcal_enable_cart_emails_callback' ),
|
| 547 |
+
'woocommerce_ac_page',
|
| 548 |
+
'ac_lite_general_settings_section',
|
| 549 |
+
array( __( "Yes, enable the abandoned cart emails.", 'woocommerce-abandoned-cart' ) )
|
| 550 |
+
);
|
| 551 |
+
|
| 552 |
+
add_settings_field(
|
| 553 |
+
'ac_lite_cart_abandoned_time',
|
| 554 |
+
__( 'Cart abandoned cut-off time', 'woocommerce-abandoned-cart' ),
|
| 555 |
+
array( $this, 'ac_lite_cart_abandoned_time_callback' ),
|
| 556 |
+
'woocommerce_ac_page',
|
| 557 |
+
'ac_lite_general_settings_section',
|
| 558 |
+
array( __( 'Consider cart abandoned after X minutes of item being added to cart & order not placed.', 'woocommerce-abandoned-cart' ) )
|
| 559 |
+
);
|
| 560 |
+
|
| 561 |
+
add_settings_field(
|
| 562 |
+
'ac_lite_delete_abandoned_order_days',
|
| 563 |
+
__( 'Automatically Delete Abandoned Orders after X days', 'woocommerce-abandoned-cart' ),
|
| 564 |
+
array( $this, 'wcal_delete_abandoned_orders_days_callback' ),
|
| 565 |
+
'woocommerce_ac_page',
|
| 566 |
+
'ac_lite_general_settings_section',
|
| 567 |
+
array( __( 'Automatically delete abandoned cart orders after X days.', 'woocommerce-abandoned-cart' ) )
|
| 568 |
+
);
|
| 569 |
+
|
| 570 |
+
|
| 571 |
+
add_settings_field(
|
| 572 |
+
'ac_lite_email_admin_on_recovery',
|
| 573 |
+
__( 'Email admin On Order Recovery', 'woocommerce-abandoned-cart' ),
|
| 574 |
+
array( $this, 'ac_lite_email_admin_on_recovery' ),
|
| 575 |
+
'woocommerce_ac_page',
|
| 576 |
+
'ac_lite_general_settings_section',
|
| 577 |
+
array( __( 'Sends email to Admin if an Abandoned Cart Order is recovered.', 'woocommerce-abandoned-cart' ) )
|
| 578 |
+
);
|
| 579 |
+
|
| 580 |
+
|
| 581 |
+
add_settings_field(
|
| 582 |
+
'ac_lite_track_guest_cart_from_cart_page',
|
| 583 |
+
__( 'Start tracking from Cart Page', 'woocommerce-abandoned-cart' ),
|
| 584 |
+
array( $this, 'wcal_track_guest_cart_from_cart_page_callback' ),
|
| 585 |
+
'woocommerce_ac_page',
|
| 586 |
+
'ac_lite_general_settings_section',
|
| 587 |
+
array( __( 'Enable tracking of abandoned products & carts even if customer does not visit the checkout page or does not enter any details on the checkout page like Name or Email. Tracking will begin as soon as a visitor adds a product to their cart and visits the cart page.', 'woocommerce-abandoned-cart' ) )
|
| 588 |
+
);
|
| 589 |
+
|
| 590 |
+
add_settings_field(
|
| 591 |
+
'wcal_guest_cart_capture_msg',
|
| 592 |
+
__( 'Message to be displayed for Guest users when tracking their carts', 'woocommerce-abandoned-cart' ),
|
| 593 |
+
array( $this, 'wcal_guest_cart_capture_msg_callback' ),
|
| 594 |
+
'woocommerce_ac_page',
|
| 595 |
+
'ac_lite_general_settings_section',
|
| 596 |
+
array( __( '<br>In compliance with GDPR, add a message on the Checkout page to inform Guest users of how their data is being used.<br><i>For example: Your email address will help us support your shopping experience throughout the site. Please check our Privacy Policy to see how we use your personal data.</i>', 'woocommerce-abandoned-cart' ) )
|
| 597 |
+
);
|
| 598 |
+
|
| 599 |
+
add_settings_field(
|
| 600 |
+
'wcal_logged_cart_capture_msg',
|
| 601 |
+
__( 'Message to be displayed for registered users when tracking their carts.', 'woocommerce-abandoned-cart' ),
|
| 602 |
+
array( $this, 'wcal_logged_cart_capture_msg_callback' ),
|
| 603 |
+
'woocommerce_ac_page',
|
| 604 |
+
'ac_lite_general_settings_section',
|
| 605 |
+
array( __( '<br>In compliance with GDPR, add a message on the Shop & Product pages to inform Registered users of how their data is being used.<br><i>For example: Please check our Privacy Policy to see how we use your personal data.</i>', 'woocommerce-abandoned-cart' ) )
|
| 606 |
+
);
|
| 607 |
+
|
| 608 |
+
add_settings_field(
|
| 609 |
+
'wcal_gdpr_allow_opt_out',
|
| 610 |
+
__( 'Allow the visitor to opt out of cart tracking.', 'woocommerce-abandoned-cart' ),
|
| 611 |
+
array( $this, 'wcal_gdpr_allow_opt_out_callback' ),
|
| 612 |
+
'woocommerce_ac_page',
|
| 613 |
+
'ac_lite_general_settings_section',
|
| 614 |
+
array( __( '<br>In compliance with GDPR, allow the site visitor (guests & registered users) to opt out from cart tracking. This message will be displayed in conjunction with the GDPR message above.</i>', 'woocommerce-abandoned-cart' ) )
|
| 615 |
+
);
|
| 616 |
+
|
| 617 |
+
add_settings_field(
|
| 618 |
+
'wcal_gdpr_opt_out_message',
|
| 619 |
+
__( 'Message to be displayed when the user chooses to opt out of cart tracking.', 'woocommerce-abandoned-cart' ),
|
| 620 |
+
array( $this, 'wcal_gdpr_opt_out_msg_callback' ),
|
| 621 |
+
'woocommerce_ac_page',
|
| 622 |
+
'ac_lite_general_settings_section',
|
| 623 |
+
array( __( '<br>Message to be displayed when the user chooses to opt out of cart tracking.</i>', 'woocommerce-abandoned-cart' ) )
|
| 624 |
+
);
|
| 625 |
+
|
| 626 |
+
/**
|
| 627 |
+
* New section for the Adding the abandoned cart setting.
|
| 628 |
+
* @since 4.7
|
| 629 |
+
*/
|
| 630 |
+
|
| 631 |
+
add_settings_section(
|
| 632 |
+
'ac_email_settings_section', // ID used to identify this section and with which to register options
|
| 633 |
+
__( 'Settings for abandoned cart recovery emails', 'woocommerce-abandoned-cart' ), // Title to be displayed on the administration page
|
| 634 |
+
array( $this, 'wcal_email_callback' ), // Callback used to render the description of the section
|
| 635 |
+
'woocommerce_ac_email_page' // Page on which to add this section of options
|
| 636 |
+
);
|
| 637 |
+
|
| 638 |
+
add_settings_field(
|
| 639 |
+
'wcal_from_name',
|
| 640 |
+
__( '"From" Name', 'woocommerce-abandoned-cart' ),
|
| 641 |
+
array( $this, 'wcal_from_name_callback' ),
|
| 642 |
+
'woocommerce_ac_email_page',
|
| 643 |
+
'ac_email_settings_section',
|
| 644 |
+
array( 'Enter the name that should appear in the email sent.', 'woocommerce-abandoned-cart' )
|
| 645 |
+
);
|
| 646 |
+
|
| 647 |
+
add_settings_field(
|
| 648 |
+
'wcal_from_email',
|
| 649 |
+
__( '"From" Address', 'woocommerce-abandoned-cart' ),
|
| 650 |
+
array( $this, 'wcal_from_email_callback' ),
|
| 651 |
+
'woocommerce_ac_email_page',
|
| 652 |
+
'ac_email_settings_section',
|
| 653 |
+
array( 'Email address from which the reminder emails should be sent.', 'woocommerce-abandoned-cart' )
|
| 654 |
+
);
|
| 655 |
+
|
| 656 |
+
add_settings_field(
|
| 657 |
+
'wcal_reply_email',
|
| 658 |
+
__( 'Send Reply Emails to', 'woocommerce-abandoned-cart' ),
|
| 659 |
+
array( $this, 'wcal_reply_email_callback' ),
|
| 660 |
+
'woocommerce_ac_email_page',
|
| 661 |
+
'ac_email_settings_section',
|
| 662 |
+
array( 'When a contact receives your email and clicks reply, which email address should that reply be sent to?', 'woocommerce-abandoned-cart' )
|
| 663 |
+
);
|
| 664 |
+
|
| 665 |
+
// Finally, we register the fields with WordPress
|
| 666 |
+
register_setting(
|
| 667 |
+
'woocommerce_ac_settings',
|
| 668 |
+
'wcal_enable_cart_emails'
|
| 669 |
+
);
|
| 670 |
+
|
| 671 |
+
register_setting(
|
| 672 |
+
'woocommerce_ac_settings',
|
| 673 |
+
'ac_lite_cart_abandoned_time',
|
| 674 |
+
array ( $this, 'ac_lite_cart_time_validation' )
|
| 675 |
+
);
|
| 676 |
+
|
| 677 |
+
register_setting(
|
| 678 |
+
'woocommerce_ac_settings',
|
| 679 |
+
'ac_lite_delete_abandoned_order_days',
|
| 680 |
+
array ( $this, 'wcal_delete_days_validation' )
|
| 681 |
+
);
|
| 682 |
+
|
| 683 |
+
register_setting(
|
| 684 |
+
'woocommerce_ac_settings',
|
| 685 |
+
'ac_lite_email_admin_on_recovery'
|
| 686 |
+
);
|
| 687 |
+
|
| 688 |
+
register_setting(
|
| 689 |
+
'woocommerce_ac_settings',
|
| 690 |
+
'ac_lite_track_guest_cart_from_cart_page'
|
| 691 |
+
);
|
| 692 |
+
|
| 693 |
+
register_setting(
|
| 694 |
+
'woocommerce_ac_settings',
|
| 695 |
+
'wcal_guest_cart_capture_msg'
|
| 696 |
+
);
|
| 697 |
+
|
| 698 |
+
register_setting(
|
| 699 |
+
'woocommerce_ac_settings',
|
| 700 |
+
'wcal_logged_cart_capture_msg'
|
| 701 |
+
);
|
| 702 |
+
|
| 703 |
+
register_setting(
|
| 704 |
+
'woocommerce_ac_settings',
|
| 705 |
+
'wcal_gdpr_allow_opt_out'
|
| 706 |
+
);
|
| 707 |
+
|
| 708 |
+
register_setting(
|
| 709 |
+
'woocommerce_ac_settings',
|
| 710 |
+
'wcal_gdpr_opt_out_message'
|
| 711 |
+
);
|
| 712 |
+
|
| 713 |
+
register_setting(
|
| 714 |
+
'woocommerce_ac_email_settings',
|
| 715 |
+
'wcal_from_name'
|
| 716 |
+
);
|
| 717 |
+
register_setting(
|
| 718 |
+
'woocommerce_ac_email_settings',
|
| 719 |
+
'wcal_from_email'
|
| 720 |
+
);
|
| 721 |
+
register_setting(
|
| 722 |
+
'woocommerce_ac_email_settings',
|
| 723 |
+
'wcal_reply_email'
|
| 724 |
+
);
|
| 725 |
+
|
| 726 |
+
do_action ( "wcal_add_new_settings" );
|
| 727 |
+
}
|
| 728 |
+
|
| 729 |
+
/**
|
| 730 |
+
* Settings API callback for section "ac_lite_general_settings_section".
|
| 731 |
+
* @since 2.5
|
| 732 |
+
*/
|
| 733 |
+
function ac_lite_general_options_callback() {
|
| 734 |
+
|
| 735 |
+
}
|
| 736 |
+
|
| 737 |
+
/**
|
| 738 |
+
* Settings API callback for the enable cart reminder emails
|
| 739 |
+
* @since 5.5
|
| 740 |
+
*/
|
| 741 |
+
public static function wcal_enable_cart_emails_callback( $args ) {
|
| 742 |
+
|
| 743 |
+
$enable_cart_emails = get_option( 'wcal_enable_cart_emails' );
|
| 744 |
+
|
| 745 |
+
if (isset( $enable_cart_emails ) && $enable_cart_emails == "" ) {
|
| 746 |
+
$enable_cart_emails = 'off';
|
| 747 |
+
}
|
| 748 |
+
$html = '<input type="checkbox" id="wcal_enable_cart_emails" name="wcal_enable_cart_emails" value="on" ' . checked( 'on', $enable_cart_emails, false ) . ' />';
|
| 749 |
+
$html .= '<label for="wcal_enable_cart_emails"> ' . $args[0] . '</label>';
|
| 750 |
+
echo $html;
|
| 751 |
+
}
|
| 752 |
+
|
| 753 |
+
/**
|
| 754 |
+
* Settings API callback for cart time field.
|
| 755 |
+
* @param array $args Arguments
|
| 756 |
+
* @since 2.5
|
| 757 |
+
*/
|
| 758 |
+
function ac_lite_cart_abandoned_time_callback( $args ) {
|
| 759 |
+
// First, we read the option
|
| 760 |
+
$cart_abandoned_time = get_option( 'ac_lite_cart_abandoned_time' );
|
| 761 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
| 762 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
| 763 |
+
printf(
|
| 764 |
+
'<input type="text" id="ac_lite_cart_abandoned_time" name="ac_lite_cart_abandoned_time" value="%s" />',
|
| 765 |
+
isset( $cart_abandoned_time ) ? esc_attr( $cart_abandoned_time ) : ''
|
| 766 |
+
);
|
| 767 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
| 768 |
+
$html = '<label for="ac_lite_cart_abandoned_time"> ' . $args[0] . '</label>';
|
| 769 |
+
echo $html;
|
| 770 |
+
}
|
| 771 |
+
|
| 772 |
+
/**
|
| 773 |
+
* Settings API cart time field validation.
|
| 774 |
+
* @param int | string $input
|
| 775 |
+
* @return int | string $output
|
| 776 |
+
* @since 2.5
|
| 777 |
+
*/
|
| 778 |
+
function ac_lite_cart_time_validation( $input ) {
|
| 779 |
+
$output = '';
|
| 780 |
+
if ( '' != $input && ( is_numeric( $input) && $input > 0 ) ) {
|
| 781 |
+
$output = stripslashes( $input) ;
|
| 782 |
+
} else {
|
| 783 |
+
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-abandoned-cart' ) );
|
| 784 |
+
}
|
| 785 |
+
return $output;
|
| 786 |
+
}
|
| 787 |
+
|
| 788 |
+
/**
|
| 789 |
+
* Validation for automatically delete abandoned carts after X days.
|
| 790 |
+
* @param int | string $input input of the field Abandoned cart cut off time
|
| 791 |
+
* @return int | string $output Error message or the input value
|
| 792 |
+
* @since 5.0
|
| 793 |
+
*/
|
| 794 |
+
public static function wcal_delete_days_validation( $input ) {
|
| 795 |
+
$output = '';
|
| 796 |
+
if ( '' == $input || ( is_numeric( $input ) && $input > 0 ) ) {
|
| 797 |
+
$output = stripslashes( $input );
|
| 798 |
+
} else {
|
| 799 |
+
add_settings_error( 'ac_lite_delete_abandoned_order_days', 'error found', __( 'Automatically Delete Abandoned Orders after X days has to be greater than 0.', 'woocommerce-abandoned-cart' ) );
|
| 800 |
+
}
|
| 801 |
+
return $output;
|
| 802 |
+
}
|
| 803 |
+
|
| 804 |
+
/**
|
| 805 |
+
* Callback for deleting abandoned order after X days field.
|
| 806 |
+
* @param array $args Argument given while adding the field
|
| 807 |
+
* @since 5.0
|
| 808 |
+
*/
|
| 809 |
+
public static function wcal_delete_abandoned_orders_days_callback( $args ) {
|
| 810 |
+
// First, we read the option
|
| 811 |
+
$delete_abandoned_order_days = get_option( 'ac_lite_delete_abandoned_order_days' );
|
| 812 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
| 813 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
| 814 |
+
printf(
|
| 815 |
+
'<input type="text" id="ac_lite_delete_abandoned_order_days" name="ac_lite_delete_abandoned_order_days" value="%s" />',
|
| 816 |
+
isset( $delete_abandoned_order_days ) ? esc_attr( $delete_abandoned_order_days ) : ''
|
| 817 |
+
);
|
| 818 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
| 819 |
+
$html = '<label for="ac_lite_delete_abandoned_order_days"> ' . $args[0] . '</label>';
|
| 820 |
+
echo $html;
|
| 821 |
+
}
|
| 822 |
+
|
| 823 |
+
/**
|
| 824 |
+
* Settings API callback for email admin on cart recovery field.
|
| 825 |
+
* @param array $args Arguments
|
| 826 |
+
* @since 2.5
|
| 827 |
+
*/
|
| 828 |
+
function ac_lite_email_admin_on_recovery( $args ) {
|
| 829 |
+
// First, we read the option
|
| 830 |
+
$email_admin_on_recovery = get_option( 'ac_lite_email_admin_on_recovery' );
|
| 831 |
+
|
| 832 |
+
// This condition added to avoid the notie displyed while Check box is unchecked.
|
| 833 |
+
if ( isset( $email_admin_on_recovery ) && '' == $email_admin_on_recovery ) {
|
| 834 |
+
$email_admin_on_recovery = 'off';
|
| 835 |
+
}
|
| 836 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
| 837 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
| 838 |
+
$html='';
|
| 839 |
+
printf(
|
| 840 |
+
'<input type="checkbox" id="ac_lite_email_admin_on_recovery" name="ac_lite_email_admin_on_recovery" value="on"
|
| 841 |
+
' . checked('on', $email_admin_on_recovery, false).' />'
|
| 842 |
+
);
|
| 843 |
+
|
| 844 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
| 845 |
+
$html .= '<label for="ac_lite_email_admin_on_recovery"> ' . $args[0] . '</label>';
|
| 846 |
+
echo $html;
|
| 847 |
+
}
|
| 848 |
+
/**
|
| 849 |
+
* Settings API callback for capturing guest cart which do not reach the checkout page.
|
| 850 |
+
* @param array $args Arguments
|
| 851 |
+
* @since 2.7
|
| 852 |
+
*/
|
| 853 |
+
function wcal_track_guest_cart_from_cart_page_callback( $args ) {
|
| 854 |
+
// First, we read the option
|
| 855 |
+
$disable_guest_cart_from_cart_page = get_option( 'ac_lite_track_guest_cart_from_cart_page' );
|
| 856 |
+
|
| 857 |
+
// This condition added to avoid the notice displyed while Check box is unchecked.
|
| 858 |
+
if ( isset( $disable_guest_cart_from_cart_page ) && '' == $disable_guest_cart_from_cart_page ) {
|
| 859 |
+
$disable_guest_cart_from_cart_page = 'off';
|
| 860 |
+
}
|
| 861 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
| 862 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
| 863 |
+
$html = '';
|
| 864 |
+
|
| 865 |
+
printf(
|
| 866 |
+
'<input type="checkbox" id="ac_lite_track_guest_cart_from_cart_page" name="ac_lite_track_guest_cart_from_cart_page" value="on"
|
| 867 |
+
'.checked( 'on', $disable_guest_cart_from_cart_page, false ) . ' />' );
|
| 868 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
| 869 |
+
$html .= '<label for="ac_lite_track_guest_cart_from_cart_page"> ' . $args[0] . '</label>';
|
| 870 |
+
echo $html;
|
| 871 |
+
}
|
| 872 |
+
|
| 873 |
+
/**
|
| 874 |
+
* Call back function for guest user cart capture message
|
| 875 |
+
* @param array $args Argument for adding field details
|
| 876 |
+
* @since 7.8
|
| 877 |
+
*/
|
| 878 |
+
public static function wcal_guest_cart_capture_msg_callback( $args ) {
|
| 879 |
+
|
| 880 |
+
$guest_msg = get_option( 'wcal_guest_cart_capture_msg' );
|
| 881 |
+
|
| 882 |
+
$html = "<textarea rows='4' cols='80' id='wcal_guest_cart_capture_msg' name='wcal_guest_cart_capture_msg'>" . htmlspecialchars( $guest_msg, ENT_QUOTES ) . "</textarea>";
|
| 883 |
+
|
| 884 |
+
$html .= '<label for="wcal_guest_cart_capture_msg"> ' . $args[0] . '</label>';
|
| 885 |
+
echo $html;
|
| 886 |
+
}
|
| 887 |
+
|
| 888 |
+
/**
|
| 889 |
+
* Call back function for registered user cart capture message
|
| 890 |
+
* @param array $args Argument for adding field details
|
| 891 |
+
* @since 7.8
|
| 892 |
+
*/
|
| 893 |
+
public static function wcal_logged_cart_capture_msg_callback( $args ) {
|
| 894 |
+
|
| 895 |
+
$logged_msg = get_option( 'wcal_logged_cart_capture_msg' );
|
| 896 |
+
|
| 897 |
+
$html = "<input type='text' id='wcal_logged_cart_capture_msg' name='wcal_logged_cart_capture_msg' value='" . htmlspecialchars( $logged_msg, ENT_QUOTES ) . "' style='width:60%;'/>";
|
| 898 |
+
|
| 899 |
+
$html .= '<label for="wcal_logged_cart_capture_msg"> ' . $args[0] . '</label>';
|
| 900 |
+
echo $html;
|
| 901 |
+
}
|
| 902 |
+
|
| 903 |
+
|
| 904 |
+
/**
|
| 905 |
+
* Text to allow the user the choice to opt out of cart tracking
|
| 906 |
+
* @since 5.5
|
| 907 |
+
*/
|
| 908 |
+
public static function wcal_gdpr_allow_opt_out_callback( $args ) {
|
| 909 |
+
|
| 910 |
+
$wcal_gdpr_allow_opt_out = get_option( 'wcal_gdpr_allow_opt_out' );
|
| 911 |
+
|
| 912 |
+
$html = "<input type='text' class='regular-text' id='wcal_gdpr_allow_opt_out' name='wcal_gdpr_allow_opt_out' value='" . htmlspecialchars( $wcal_gdpr_allow_opt_out, ENT_QUOTES ) . "' />";
|
| 913 |
+
|
| 914 |
+
$html .= '<label for="wcal_gdpr_allow_opt_out"> ' . $args[0] . '</label>';
|
| 915 |
+
echo $html;
|
| 916 |
+
}
|
| 917 |
+
|
| 918 |
+
/**
|
| 919 |
+
* Message to display when the user chooses to opt out of cart tracking.
|
| 920 |
+
* @since 5.5
|
| 921 |
+
*/
|
| 922 |
+
public static function wcal_gdpr_opt_out_msg_callback( $args ) {
|
| 923 |
+
|
| 924 |
+
$wcal_gdpr_opt_out_message = get_option( 'wcal_gdpr_opt_out_message' );
|
| 925 |
+
|
| 926 |
+
$html = "<input type='text' id='wcal_gdpr_opt_out_message' name='wcal_gdpr_opt_out_message' value='" . htmlspecialchars( $wcal_gdpr_opt_out_message, ENT_QUOTES ) . "' style='width:60%;'/>";
|
| 927 |
+
|
| 928 |
+
$html .= '<label for="wcal_gdpr_opt_out_message"> ' . $args[0] . '</label>';
|
| 929 |
+
echo $html;
|
| 930 |
+
}
|
| 931 |
+
|
| 932 |
+
/**
|
| 933 |
+
* Settings API callback for Abandoned cart email settings of the plugin.
|
| 934 |
+
* @since 3.5
|
| 935 |
+
*/
|
| 936 |
+
function wcal_email_callback () {
|
| 937 |
+
|
| 938 |
+
}
|
| 939 |
+
|
| 940 |
+
/**
|
| 941 |
+
* Settings API callback for from name used in Abandoned cart email.
|
| 942 |
+
* @param array $args Arguments
|
| 943 |
+
* @since 3.5
|
| 944 |
+
*/
|
| 945 |
+
public static function wcal_from_name_callback( $args ) {
|
| 946 |
+
// First, we read the option
|
| 947 |
+
$wcal_from_name = get_option( 'wcal_from_name' );
|
| 948 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
| 949 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
| 950 |
+
printf(
|
| 951 |
+
'<input type="text" id="wcal_from_name" name="wcal_from_name" value="%s" />',
|
| 952 |
+
isset( $wcal_from_name ) ? esc_attr( $wcal_from_name ) : ''
|
| 953 |
+
);
|
| 954 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
| 955 |
+
$html = '<label for="wcal_from_name_label"> ' . $args[0] . '</label>';
|
| 956 |
+
echo $html;
|
| 957 |
+
}
|
| 958 |
+
|
| 959 |
+
/**
|
| 960 |
+
* Settings API callback for from email used in Abandoned cart email.
|
| 961 |
+
* @param array $args Arguments
|
| 962 |
+
* @since 3.5
|
| 963 |
+
*/
|
| 964 |
+
public static function wcal_from_email_callback( $args ) {
|
| 965 |
+
// First, we read the option
|
| 966 |
+
$wcal_from_email = get_option( 'wcal_from_email' );
|
| 967 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
| 968 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
| 969 |
+
printf(
|
| 970 |
+
'<input type="text" id="wcal_from_email" name="wcal_from_email" value="%s" />',
|
| 971 |
+
isset( $wcal_from_email ) ? esc_attr( $wcal_from_email ) : ''
|
| 972 |
+
);
|
| 973 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
| 974 |
+
$html = '<label for="wcal_from_email_label"> ' . $args[0] . '</label>';
|
| 975 |
+
echo $html;
|
| 976 |
+
}
|
| 977 |
+
|
| 978 |
+
/**
|
| 979 |
+
* Settings API callback for reply email used in Abandoned cart email.
|
| 980 |
+
* @param array $args Arguments
|
| 981 |
+
* @since 3.5
|
| 982 |
+
*/
|
| 983 |
+
public static function wcal_reply_email_callback( $args ) {
|
| 984 |
+
// First, we read the option
|
| 985 |
+
$wcal_reply_email = get_option( 'wcal_reply_email' );
|
| 986 |
+
// Next, we update the name attribute to access this element's ID in the context of the display options array
|
| 987 |
+
// We also access the show_header element of the options collection in the call to the checked() helper function
|
| 988 |
+
printf(
|
| 989 |
+
'<input type="text" id="wcal_reply_email" name="wcal_reply_email" value="%s" />',
|
| 990 |
+
isset( $wcal_reply_email ) ? esc_attr( $wcal_reply_email ) : ''
|
| 991 |
+
);
|
| 992 |
+
// Here, we'll take the first argument of the array and add it to a label next to the checkbox
|
| 993 |
+
$html = '<label for="wcal_reply_email_label"> ' . $args[0] . '</label>';
|
| 994 |
+
echo $html;
|
| 995 |
+
}
|
| 996 |
+
|
| 997 |
+
/**
|
| 998 |
+
* Add a submenu page under the WooCommerce.
|
| 999 |
+
* @hook admin_menu
|
| 1000 |
+
* @since 1.0
|
| 1001 |
+
*/
|
| 1002 |
+
function wcal_admin_menu() {
|
| 1003 |
+
$page = add_submenu_page ( 'woocommerce', __( 'Abandoned Carts', 'woocommerce-abandoned-cart' ), __( 'Abandoned Carts', 'woocommerce-abandoned-cart' ), 'manage_woocommerce', 'woocommerce_ac_page', array( &$this, 'wcal_menu_page' ) );
|
| 1004 |
+
}
|
| 1005 |
+
|
| 1006 |
+
/**
|
| 1007 |
+
* Capture the cart and insert the information of the cart into DataBase.
|
| 1008 |
+
* @hook woocommerce_cart_updated
|
| 1009 |
+
* @globals mixed $wpdb
|
| 1010 |
+
* @globals mixed $woocommerce
|
| 1011 |
+
* @since 1.0
|
| 1012 |
+
*/
|
| 1013 |
+
function wcal_store_cart_timestamp() {
|
| 1014 |
+
|
| 1015 |
+
$block_crawlers = apply_filters( 'wcal_block_crawlers', false );
|
| 1016 |
+
|
| 1017 |
+
if ( $block_crawlers ) {
|
| 1018 |
+
return;
|
| 1019 |
+
}
|
| 1020 |
+
|
| 1021 |
+
if ( get_transient( 'wcal_email_sent_id' ) !== false ) {
|
| 1022 |
+
wcal_common::wcal_set_cart_session( 'email_sent_id', get_transient( 'wcal_email_sent_id' ) );
|
| 1023 |
+
delete_transient( 'wcal_email_sent_id' );
|
| 1024 |
+
}
|
| 1025 |
+
if ( get_transient( 'wcal_abandoned_id' ) !== false ) {
|
| 1026 |
+
wcal_common::wcal_set_cart_session( 'abandoned_cart_id_lite', get_transient( 'wcal_abandoned_id' ) );
|
| 1027 |
+
delete_transient( 'wcal_abandoned_id' );
|
| 1028 |
+
}
|
| 1029 |
+
|
| 1030 |
+
global $wpdb,$woocommerce;
|
| 1031 |
+
$current_time = current_time( 'timestamp' );
|
| 1032 |
+
$cut_off_time = get_option( 'ac_lite_cart_abandoned_time' );
|
| 1033 |
+
$track_guest_cart_from_cart_page = get_option( 'ac_lite_track_guest_cart_from_cart_page' );
|
| 1034 |
+
$cart_ignored = 0;
|
| 1035 |
+
$recovered_cart = 0;
|
| 1036 |
+
|
| 1037 |
+
$track_guest_user_cart_from_cart = "";
|
| 1038 |
+
if ( isset( $track_guest_cart_from_cart_page ) ) {
|
| 1039 |
+
$track_guest_user_cart_from_cart = $track_guest_cart_from_cart_page;
|
| 1040 |
+
}
|
| 1041 |
+
|
| 1042 |
+
if ( isset( $cut_off_time ) ) {
|
| 1043 |
+
$cart_cut_off_time = intval( $cut_off_time ) * 60;
|
| 1044 |
+
} else {
|
| 1045 |
+
$cart_cut_off_time = 60 * 60;
|
| 1046 |
+
}
|
| 1047 |
+
$compare_time = $current_time - $cart_cut_off_time;
|
| 1048 |
+
|
| 1049 |
+
if ( is_user_logged_in() ) {
|
| 1050 |
+
|
| 1051 |
+
$user_id = get_current_user_id();
|
| 1052 |
+
$gdpr_consent = get_user_meta( $user_id, 'wcal_gdpr_tracking_choice', true );
|
| 1053 |
+
|
| 1054 |
+
if( $gdpr_consent === '' ) {
|
| 1055 |
+
$gdpr_consent = true;
|
| 1056 |
+
}
|
| 1057 |
+
|
| 1058 |
+
if( $gdpr_consent ) {
|
| 1059 |
+
|
| 1060 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
| 1061 |
+
WHERE user_id = %d
|
| 1062 |
+
AND cart_ignored = %s
|
| 1063 |
+
AND recovered_cart = %d ";
|
| 1064 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $user_id, $cart_ignored, $recovered_cart ) );
|
| 1065 |
+
|
| 1066 |
+
if ( 0 == count( $results ) ) {
|
| 1067 |
+
//$wcal_woocommerce_persistent_cart =version_compare( $woocommerce->version, '3.1.0', ">=" ) ? '_woocommerce_persistent_cart_' . get_current_blog_id() : '_woocommerce_persistent_cart' ;
|
| 1068 |
+
|
| 1069 |
+
//$cart_info_meta = json_encode( get_user_meta( $user_id, $wcal_woocommerce_persistent_cart, true ) );
|
| 1070 |
+
|
| 1071 |
+
$cart_info_meta = array();
|
| 1072 |
+
$cart_info_meta['cart'] = WC()->session->cart;
|
| 1073 |
+
$cart_info_meta = json_encode( $cart_info_meta );
|
| 1074 |
+
|
| 1075 |
+
if( '' !== $cart_info_meta && '{"cart":[]}' != $cart_info_meta && '""' !== $cart_info_meta ) {
|
| 1076 |
+
$cart_info = $cart_info_meta;
|
| 1077 |
+
$user_type = "REGISTERED";
|
| 1078 |
+
$insert_query = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
| 1079 |
+
( user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored, user_type )
|
| 1080 |
+
VALUES ( %d, %s, %d, %s, %s )";
|
| 1081 |
+
$wpdb->query( $wpdb->prepare( $insert_query, $user_id, $cart_info,$current_time, $cart_ignored, $user_type ) );
|
| 1082 |
+
|
| 1083 |
+
$abandoned_cart_id = $wpdb->insert_id;
|
| 1084 |
+
wcal_common::wcal_set_cart_session( 'abandoned_cart_id_lite', $abandoned_cart_id );
|
| 1085 |
+
}
|
| 1086 |
+
} elseif ( isset( $results[0]->abandoned_cart_time ) && $compare_time > $results[0]->abandoned_cart_time ) {
|
| 1087 |
+
//$wcal_woocommerce_persistent_cart = version_compare( $woocommerce->version, '3.1.0', ">=" ) ? '_woocommerce_persistent_cart_' . get_current_blog_id() : '_woocommerce_persistent_cart' ;
|
| 1088 |
+
//$updated_cart_info = json_encode( get_user_meta( $user_id, $wcal_woocommerce_persistent_cart, true ) );
|
| 1089 |
+
|
| 1090 |
+
$updated_cart_info = array();
|
| 1091 |
+
$updated_cart_info['cart'] = WC()->session->cart;
|
| 1092 |
+
$updated_cart_info = json_encode( $updated_cart_info );
|
| 1093 |
+
|
| 1094 |
+
if ( ! $this->wcal_compare_carts( $user_id, $results[0]->abandoned_cart_info ) ) {
|
| 1095 |
+
$updated_cart_ignored = 1;
|
| 1096 |
+
$query_ignored = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
| 1097 |
+
SET cart_ignored = %s
|
| 1098 |
+
WHERE user_id = %d ";
|
| 1099 |
+
$wpdb->query( $wpdb->prepare( $query_ignored, $updated_cart_ignored, $user_id ) );
|
| 1100 |
+
|
| 1101 |
+
$user_type = "REGISTERED";
|
| 1102 |
+
$query_update = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
| 1103 |
+
(user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored, user_type)
|
| 1104 |
+
VALUES (%d, %s, %d, %s, %s)";
|
| 1105 |
+
$wpdb->query( $wpdb->prepare( $query_update, $user_id, $updated_cart_info, $current_time, $cart_ignored, $user_type ) );
|
| 1106 |
+
|
| 1107 |
+
update_user_meta ( $user_id, '_woocommerce_ac_modified_cart', md5( "yes" ) );
|
| 1108 |
+
|
| 1109 |
+
$abandoned_cart_id = $wpdb->insert_id;
|
| 1110 |
+
wcal_common::wcal_set_cart_session( 'abandoned_cart_id_lite', $abandoned_cart_id );
|
| 1111 |
+
} else {
|
| 1112 |
+
update_user_meta ( $user_id, '_woocommerce_ac_modified_cart', md5( "no" ) );
|
| 1113 |
+
}
|
| 1114 |
+
} else {
|
| 1115 |
+
//$wcal_woocommerce_persistent_cart = version_compare( $woocommerce->version, '3.1.0', ">=" ) ? '_woocommerce_persistent_cart_' . get_current_blog_id() : '_woocommerce_persistent_cart' ;
|
| 1116 |
+
//$updated_cart_info = json_encode( get_user_meta( $user_id, $wcal_woocommerce_persistent_cart, true ) );
|
| 1117 |
+
|
| 1118 |
+
$updated_cart_info = array();
|
| 1119 |
+
$updated_cart_info['cart'] = WC()->session->cart;
|
| 1120 |
+
$updated_cart_info = json_encode( $updated_cart_info );
|
| 1121 |
+
|
| 1122 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
| 1123 |
+
SET abandoned_cart_info = %s,
|
| 1124 |
+
abandoned_cart_time = %d
|
| 1125 |
+
WHERE user_id = %d
|
| 1126 |
+
AND cart_ignored = %s ";
|
| 1127 |
+
$wpdb->query( $wpdb->prepare( $query_update, $updated_cart_info, $current_time, $user_id, $cart_ignored ) );
|
| 1128 |
+
|
| 1129 |
+
$query_update = "SELECT * FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE user_id ='" . $user_id . "' AND cart_ignored='0' ";
|
| 1130 |
+
$get_abandoned_record = $wpdb->get_results( $query_update );
|
| 1131 |
+
|
| 1132 |
+
if ( count( $get_abandoned_record ) > 0 ) {
|
| 1133 |
+
$abandoned_cart_id = $get_abandoned_record[0]->id;
|
| 1134 |
+
wcal_common::wcal_set_cart_session( 'abandoned_cart_id_lite', $abandoned_cart_id );
|
| 1135 |
+
}
|
| 1136 |
+
}
|
| 1137 |
+
}
|
| 1138 |
+
} else {
|
| 1139 |
+
//start here guest user
|
| 1140 |
+
$user_id = wcal_common::wcal_get_cart_session( 'user_id' );
|
| 1141 |
+
|
| 1142 |
+
// GDPR consent.
|
| 1143 |
+
$gdpr_consent = true;
|
| 1144 |
+
$show_gdpr_msg = wcal_common::wcal_get_cart_session( 'wcal_cart_tracking_refused' );
|
| 1145 |
+
if ( isset( $show_gdpr_msg ) && 'yes' === $show_gdpr_msg ) {
|
| 1146 |
+
$gdpr_consent = false;
|
| 1147 |
+
}
|
| 1148 |
+
|
| 1149 |
+
if ( $gdpr_consent ) {
|
| 1150 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE user_id = %d AND cart_ignored = '0' AND recovered_cart = '0' AND user_id != '0'";
|
| 1151 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $user_id ) );
|
| 1152 |
+
$cart = array();
|
| 1153 |
+
|
| 1154 |
+
$get_cookie = WC()->session->get_customer_id();
|
| 1155 |
+
|
| 1156 |
+
if ( function_exists('WC') ) {
|
| 1157 |
+
$cart['cart'] = WC()->session->cart;
|
| 1158 |
+
} else {
|
| 1159 |
+
$cart['cart'] = $woocommerce->session->cart;
|
| 1160 |
+
}
|
| 1161 |
+
|
| 1162 |
+
$updated_cart_info = json_encode( $cart );
|
| 1163 |
+
//$updated_cart_info = addslashes ( $updated_cart_info );
|
| 1164 |
+
|
| 1165 |
+
if ( count( $results ) > 0 && '{"cart":[]}' != $updated_cart_info ) {
|
| 1166 |
+
if ( $compare_time > $results[0]->abandoned_cart_time ) {
|
| 1167 |
+
if ( ! $this->wcal_compare_only_guest_carts( $updated_cart_info, $results[0]->abandoned_cart_info ) ) {
|
| 1168 |
+
|
| 1169 |
+
$query_ignored = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
| 1170 |
+
SET cart_ignored = '1'
|
| 1171 |
+
WHERE user_id ='".$user_id."'";
|
| 1172 |
+
$wpdb->query( $query_ignored );
|
| 1173 |
+
|
| 1174 |
+
$user_type = 'GUEST';
|
| 1175 |
+
$query_update = "INSERT INTO `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
| 1176 |
+
(user_id, abandoned_cart_info, abandoned_cart_time, cart_ignored, user_type)
|
| 1177 |
+
VALUES (%d, %s, %d, %s, %s)";
|
| 1178 |
+
$wpdb->query( $wpdb->prepare( $query_update, $user_id, $updated_cart_info, $current_time, $cart_ignored, $user_type ) );
|
| 1179 |
+
update_user_meta( $user_id, '_woocommerce_ac_modified_cart', md5("yes") );
|
| 1180 |
+
} else {
|
| 1181 |
+
update_user_meta( $user_id, '_woocommerce_ac_modified_cart', md5("no") );
|
| 1182 |
+
}
|
| 1183 |
+
} else {
|
| 1184 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_abandoned_cart_history_lite`
|
| 1185 |
+
SET abandoned_cart_info = '".$updated_cart_info."', abandoned_cart_time = '".$current_time."'
|
| 1186 |
+
WHERE user_id='".$user_id."' AND cart_ignored='0' ";
|
| 1187 |
+
$wpdb->query( $query_update );
|
| 1188 |
+
}
|
| 1189 |
+
} else {
|
| 1190 |
+
/**
|
| 1191 |
+
* Here we capture the guest cart from the cart page.
|
| 1192 |
+
* @since 3.5
|
| 1193 |
+
*/
|
| 1194 |
+
if ( 'on' == $track_guest_user_cart_from_cart && isset( $get_cookie ) && '' != $get_cookie ) {
|
| 1195 |
+
$query = "SELECT * FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE session_id LIKE %s AND cart_ignored = '0' AND recovered_cart = '0' ";
|
| 1196 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $get_cookie ) );
|
| 1197 |
+
if ( 0 == count( $results ) ) {
|
| 1198 |
+
$cart_info = $updated_cart_info;
|
| 1199 |
+
$blank_cart_info = '[]';
|
| 1200 |
+
if ( $blank_cart_info != $cart_info && '{"cart":[]}' != $cart_info ) {
|
| 1201 |
+
$insert_query = "INSERT INTO `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
| 1202 |
+
( abandoned_cart_info , abandoned_cart_time , cart_ignored , recovered_cart, user_type, session_id )
|
| 1203 |
+
VALUES ( '" . $cart_info."' , '" . $current_time . "' , '0' , '0' , 'GUEST', '". $get_cookie ."' )";
|
| 1204 |
+
$wpdb->query( $insert_query );
|
| 1205 |
+
$abandoned_cart_id = $wpdb->insert_id;
|
| 1206 |
+
}
|
| 1207 |
+
} elseif ( $compare_time > $results[0]->abandoned_cart_time ) {
|
| 1208 |
+
$blank_cart_info = '[]';
|
| 1209 |
+
if ( $blank_cart_info != $updated_cart_info && '{"cart":[]}' != $updated_cart_info ) {
|
| 1210 |
+
if ( ! $this->wcal_compare_only_guest_carts( $updated_cart_info, $results[0]->abandoned_cart_info ) ) {
|
| 1211 |
+
$query_ignored = "UPDATE `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` SET cart_ignored = '1' WHERE session_id ='" . $get_cookie . "'";
|
| 1212 |
+
$wpdb->query( $query_ignored );
|
| 1213 |
+
$query_update = "INSERT INTO `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
| 1214 |
+
( abandoned_cart_info, abandoned_cart_time, cart_ignored, recovered_cart, user_type, session_id )
|
| 1215 |
+
VALUES ( '" . $updated_cart_info . "', '" . $current_time . "', '0', '0', 'GUEST', '". $get_cookie ."' )";
|
| 1216 |
+
$wpdb->query( $query_update );
|
| 1217 |
+
$abandoned_cart_id = $wpdb->insert_id;
|
| 1218 |
+
}
|
| 1219 |
+
}
|
| 1220 |
+
} else {
|
| 1221 |
+
$blank_cart_info = '[]';
|
| 1222 |
+
if ( $blank_cart_info != $updated_cart_info && '{"cart":[]}' != $updated_cart_info ) {
|
| 1223 |
+
if ( ! $this->wcal_compare_only_guest_carts( $updated_cart_info, $results[0]->abandoned_cart_info ) ) {
|
| 1224 |
+
$query_update = "UPDATE `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` SET abandoned_cart_info = '" . $updated_cart_info . "', abandoned_cart_time = '" . $current_time . "' WHERE session_id ='" . $get_cookie . "' AND cart_ignored='0' ";
|
| 1225 |
+
$wpdb->query( $query_update );
|
| 1226 |
+
}
|
| 1227 |
+
}
|
| 1228 |
+
}
|
| 1229 |
+
if( isset( $abandoned_cart_id ) ) {
|
| 1230 |
+
// add the abandoned id in the session
|
| 1231 |
+
wcal_common::wcal_set_cart_session( 'abandoned_cart_id_lite', $abandoned_cart_id );
|
| 1232 |
+
}
|
| 1233 |
+
}
|
| 1234 |
+
}
|
| 1235 |
+
}
|
| 1236 |
+
}
|
| 1237 |
+
}
|
| 1238 |
+
|
| 1239 |
+
public function wcal_detect_crawlers( $ignore ){
|
| 1240 |
+
$user_agent = isset( $_SERVER['HTTP_USER_AGENT'] ) ? $_SERVER['HTTP_USER_AGENT'] : '';
|
| 1241 |
+
|
| 1242 |
+
if ( '' === $user_agent ) {
|
| 1243 |
+
return $ignore;
|
| 1244 |
+
}
|
| 1245 |
+
|
| 1246 |
+
// Current list of bots being blocked:
|
| 1247 |
+
// 1. Googlebot, BingBot, DuckDuckBot, YandexBot, Exabot
|
| 1248 |
+
// 2. cURL
|
| 1249 |
+
// 3. wget
|
| 1250 |
+
// 4. Yahoo/Slurp
|
| 1251 |
+
// 5. Baiduspider
|
| 1252 |
+
// 6. Sogou
|
| 1253 |
+
// 7. Alexa
|
| 1254 |
+
$bot_agents = array(
|
| 1255 |
+
'curl',
|
| 1256 |
+
'wget',
|
| 1257 |
+
'bot',
|
| 1258 |
+
'bots',
|
| 1259 |
+
'slurp',
|
| 1260 |
+
'baiduspider',
|
| 1261 |
+
'sogou',
|
| 1262 |
+
'ia_archiver',
|
| 1263 |
+
);
|
| 1264 |
+
|
| 1265 |
+
foreach( $bot_agents as $url) {
|
| 1266 |
+
if ( stripos( $user_agent, $url ) !== false ) {
|
| 1267 |
+
return true;
|
| 1268 |
+
}
|
| 1269 |
+
}
|
| 1270 |
+
|
| 1271 |
+
return $ignore;
|
| 1272 |
+
}
|
| 1273 |
+
|
| 1274 |
+
/**
|
| 1275 |
+
* It will unsubscribe the abandoned cart, so user will not recieve further abandoned cart emails.
|
| 1276 |
+
* @hook template_include
|
| 1277 |
+
* @param string $args Arguments
|
| 1278 |
+
* @return string $args
|
| 1279 |
+
* @globals mixed $wpdb
|
| 1280 |
+
* @since 2.9
|
| 1281 |
+
*/
|
| 1282 |
+
function wcal_email_unsubscribe( $args ) {
|
| 1283 |
+
global $wpdb;
|
| 1284 |
+
|
| 1285 |
+
if ( isset( $_GET['wcal_track_unsubscribe'] ) && $_GET['wcal_track_unsubscribe'] == 'wcal_unsubscribe' ) {
|
| 1286 |
+
$encoded_email_id = rawurldecode( $_GET['validate'] );
|
| 1287 |
+
$validate_email_id_string = str_replace( " " , "+", $encoded_email_id );
|
| 1288 |
+
$validate_email_address_string = '';
|
| 1289 |
+
$validate_email_id_decode = 0;
|
| 1290 |
+
$cryptKey = get_option( 'wcal_security_key' );
|
| 1291 |
+
$validate_email_id_decode = Wcal_Aes_Ctr::decrypt( $validate_email_id_string, $cryptKey, 256 );
|
| 1292 |
+
if ( isset( $_GET['track_email_id'] ) ) {
|
| 1293 |
+
$encoded_email_address = rawurldecode( $_GET['track_email_id'] );
|
| 1294 |
+
$validate_email_address_string = str_replace( " " , "+", $encoded_email_address );
|
| 1295 |
+
}
|
| 1296 |
+
$query_id = "SELECT * FROM `" . $wpdb->prefix . "ac_sent_history_lite` WHERE id = %d ";
|
| 1297 |
+
$results_sent = $wpdb->get_results ( $wpdb->prepare( $query_id, $validate_email_id_decode ) );
|
| 1298 |
+
$email_address = '';
|
| 1299 |
+
if ( isset( $results_sent[0] ) ) {
|
| 1300 |
+
$email_address = $results_sent[0]->sent_email_id;
|
| 1301 |
+
}
|
| 1302 |
+
if ( $validate_email_address_string == hash( 'sha256', $email_address ) && '' != $email_address ) {
|
| 1303 |
+
$email_sent_id = $validate_email_id_decode;
|
| 1304 |
+
$get_ac_id_query = "SELECT abandoned_order_id FROM `" . $wpdb->prefix . "ac_sent_history_lite` WHERE id = %d";
|
| 1305 |
+
$get_ac_id_results = $wpdb->get_results( $wpdb->prepare( $get_ac_id_query , $email_sent_id ) );
|
| 1306 |
+
$user_id = 0;
|
| 1307 |
+
if ( isset( $get_ac_id_results[0] ) ) {
|
| 1308 |
+
$get_user_id_query = "SELECT user_id FROM `" . $wpdb->prefix . "ac_abandoned_cart_history_lite` WHERE id = %d";
|
| 1309 |
+
$get_user_results = $wpdb->get_results( $wpdb->prepare( $get_user_id_query , $get_ac_id_results[0]->abandoned_order_id ) );
|
| 1310 |
+
}
|
| 1311 |
+
if ( isset( $get_user_results[0] ) ) {
|
| 1312 |
+
$user_id = $get_user_results[0]->user_id;
|
| 1313 |
+
}
|
| 1314 |
+
|
| 1315 |
+
$unsubscribe_query = "UPDATE `" . $wpdb->prefix . "ac_abandoned_cart_history_lite`
|
| 1316 |
+
SET unsubscribe_link = '1'
|
| 1317 |
+
WHERE user_id= %d AND cart_ignored='0' ";
|
| 1318 |
+
$wpdb->query( $wpdb->prepare( $unsubscribe_query , $user_id ) );
|
| 1319 |
+
echo "Unsubscribed Successfully";
|
| 1320 |
+
sleep( 2 );
|
| 1321 |
+
$url = get_option( 'siteurl' );
|
| 1322 |
+
?>
|
| 1323 |
+
<script>
|
| 1324 |
+
location.href = "<?php echo $url; ?>";
|
| 1325 |
+
</script>
|
| 1326 |
+
<?php
|
| 1327 |
+
}
|
| 1328 |
+
} else {
|
| 1329 |
+
return $args;
|
| 1330 |
+
}
|
| 1331 |
+
}
|
| 1332 |
+
|
| 1333 |
+
/**
|
| 1334 |
+
* It will track the URL of cart link from email, and it will populate the logged-in and guest users cart.
|
| 1335 |
+
* @hook template_include
|
| 1336 |
+
* @param string $template
|
| 1337 |
+
* @return string $template
|
| 1338 |
+
* @globals mixed $wpdb
|
| 1339 |
+
* @globals mixed $woocommerce
|
| 1340 |
+
* @since 1.0
|
| 1341 |
+
*/
|
| 1342 |
+
function wcal_email_track_links( $template ) {
|
| 1343 |
+
global $woocommerce;
|
| 1344 |
+
$track_link = '';
|
| 1345 |
+
|
| 1346 |
+
if ( isset( $_GET['wcal_action'] ) ) {
|
| 1347 |
+
$track_link = $_GET['wcal_action'];
|
| 1348 |
+
}
|
| 1349 |
+
if ( $track_link == 'track_links' ) {
|
| 1350 |
+
if ( '' === session_id() ) {
|
| 1351 |
+
//session has not started
|
| 1352 |
+
session_start();
|
| 1353 |
+
}
|
| 1354 |
+
global $wpdb;
|
| 1355 |
+
$validate_server_string = rawurldecode( $_GET ['validate'] );
|
| 1356 |
+
$validate_server_string = str_replace( " " , "+", $validate_server_string );
|
| 1357 |
+
$validate_encoded_string = $validate_server_string;
|
| 1358 |
+
$cryptKey = get_option( 'wcal_security_key' );
|
| 1359 |
+
$link_decode = Wcal_Aes_Ctr::decrypt( $validate_encoded_string, $cryptKey, 256 );
|
| 1360 |
+
$sent_email_id_pos = strpos( $link_decode, '&' );
|
| 1361 |
+
$email_sent_id = substr( $link_decode , 0, $sent_email_id_pos );
|
| 1362 |
+
|
| 1363 |
+
wcal_common::wcal_set_cart_session( 'email_sent_id', $email_sent_id );
|
| 1364 |
+
set_transient( 'wcal_email_sent_id', $email_sent_id, 5 );
|
| 1365 |
+
|
| 1366 |
+
$url_pos = strpos( $link_decode, '=' );
|
| 1367 |
+
$url_pos = $url_pos + 1;
|
| 1368 |
+
$url = substr( $link_decode, $url_pos );
|
| 1369 |
+
$get_ac_id_query = "SELECT abandoned_order_id FROM `".$wpdb->prefix."ac_sent_history_lite` WHERE id = %d";
|
| 1370 |
+
$get_ac_id_results = $wpdb->get_results( $wpdb->prepare( $get_ac_id_query, $email_sent_id ) );
|
| 1371 |
+
|
| 1372 |
+
wcal_common::wcal_set_cart_session( 'abandoned_cart_id_lite', $get_ac_id_results[0]->abandoned_order_id );
|
| 1373 |
+
set_transient( 'wcal_abandoned_id', $get_ac_id_results[0]->abandoned_order_id, 5 );
|
| 1374 |
+
|
| 1375 |
+
$get_user_results = array();
|
| 1376 |
+
if ( count( $get_ac_id_results ) > 0 ) {
|
| 1377 |
+
$get_user_id_query = "SELECT user_id FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE id = %d";
|
| 1378 |
+
$get_user_results = $wpdb->get_results( $wpdb->prepare( $get_user_id_query, $get_ac_id_results[0]->abandoned_order_id ) );
|
| 1379 |
+
}
|
| 1380 |
+
$user_id = 0;
|
| 1381 |
+
if ( isset( $get_user_results ) && count( $get_user_results ) > 0 ) {
|
| 1382 |
+
$user_id = $get_user_results[0]->user_id;
|
| 1383 |
+
}
|
| 1384 |
+
if ( 0 == $user_id ) {
|
| 1385 |
+
echo "Link expired";
|
| 1386 |
+
exit;
|
| 1387 |
+
}
|
| 1388 |
+
$user = wp_set_current_user( $user_id );
|
| 1389 |
+
if ( $user_id >= "63000000" ) {
|
| 1390 |
+
$query_guest = "SELECT * from `". $wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE id = %d";
|
| 1391 |
+
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $user_id ) );
|
| 1392 |
+
$query_cart = "SELECT recovered_cart FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE user_id = %d";
|
| 1393 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query_cart, $user_id ) );
|
| 1394 |
+
if ( $results_guest && $results[0]->recovered_cart == '0' ) {
|
| 1395 |
+
wcal_common::wcal_set_cart_session( 'guest_first_name', $results_guest[0]->billing_first_name );
|
| 1396 |
+
wcal_common::wcal_set_cart_session( 'guest_last_name', $results_guest[0]->billing_last_name );
|
| 1397 |
+
wcal_common::wcal_set_cart_session( 'guest_email', $results_guest[0]->email_id );
|
| 1398 |
+
wcal_common::wcal_set_cart_session( 'user_id', $user_id );
|
| 1399 |
+
} else {
|
| 1400 |
+
if ( version_compare( $woocommerce->version, '3.0.0', ">=" ) ) {
|
| 1401 |
+
wp_safe_redirect( get_permalink( wc_get_page_id( 'shop' ) ) );
|
| 1402 |
+
exit;
|
| 1403 |
+
} else {
|
| 1404 |
+
wp_safe_redirect( get_permalink( woocommerce_get_page_id( 'shop' ) ) );
|
| 1405 |
+
exit;
|
| 1406 |
+
}
|
| 1407 |
+
}
|
| 1408 |
+
}
|
| 1409 |
+
|
| 1410 |
+
if ( $user_id < "63000000" ) {
|
| 1411 |
+
$user_login = $user->data->user_login;
|
| 1412 |
+
wp_set_auth_cookie( $user_id );
|
| 1413 |
+
$my_temp = wc_load_persistent_cart( $user_login, $user );
|
| 1414 |
+
do_action( 'wp_login', $user_login, $user );
|
| 1415 |
+
if ( isset( $sign_in ) && is_wp_error( $sign_in ) ) {
|
| 1416 |
+
echo $sign_in->get_error_message();
|
| 1417 |
+
exit;
|
| 1418 |
+
}
|
| 1419 |
+
} else
|
| 1420 |
+
$my_temp = $this->wcal_load_guest_persistent_cart( $user_id );
|
| 1421 |
+
|
| 1422 |
+
if ( $email_sent_id > 0 && is_numeric( $email_sent_id ) ) {
|
| 1423 |
+
wp_safe_redirect( $url );
|
| 1424 |
+
exit;
|
| 1425 |
+
}
|
| 1426 |
+
} else
|
| 1427 |
+
return $template;
|
| 1428 |
+
}
|
| 1429 |
+
|
| 1430 |
+
/**
|
| 1431 |
+
* When customer clicks on the abandoned cart link and that cart is for the the guest users the it will load the guest
|
| 1432 |
+
* user's cart detail.
|
| 1433 |
+
* @globals mixed $woocommerce
|
| 1434 |
+
* @since 1.0
|
| 1435 |
+
*/
|
| 1436 |
+
function wcal_load_guest_persistent_cart() {
|
| 1437 |
+
if ( wcal_common::wcal_get_cart_session( 'user_id' ) != '' ) {
|
| 1438 |
+
global $woocommerce;
|
| 1439 |
+
$saved_cart = json_decode( get_user_meta( wcal_common::wcal_get_cart_session( 'user_id' ), '_woocommerce_persistent_cart',true ), true );
|
| 1440 |
+
$c = array();
|
| 1441 |
+
$cart_contents_total = $cart_contents_weight = $cart_contents_count = $cart_contents_tax = $total = $subtotal = $subtotal_ex_tax = $tax_total = 0;
|
| 1442 |
+
if ( count( $saved_cart ) > 0 ) {
|
| 1443 |
+
foreach ( $saved_cart as $key => $value ) {
|
| 1444 |
+
foreach ( $value as $a => $b ) {
|
| 1445 |
+
$c['product_id'] = $b['product_id'];
|
| 1446 |
+
$c['variation_id'] = $b['variation_id'];
|
| 1447 |
+
$c['variation'] = $b['variation'];
|
| 1448 |
+
$c['quantity'] = $b['quantity'];
|
| 1449 |
+
$product_id = $b['product_id'];
|
| 1450 |
+
$c['data'] = wc_get_product( $product_id );
|
| 1451 |
+
$c['line_total'] = $b['line_total'];
|
| 1452 |
+
$c['line_tax'] = $cart_contents_tax;
|
| 1453 |
+
$c['line_subtotal'] = $b['line_subtotal'];
|
| 1454 |
+
$c['line_subtotal_tax'] = $cart_contents_tax;
|
| 1455 |
+
$value_new[ $a ] = $c;
|
| 1456 |
+
$cart_contents_total = $b['line_subtotal'] + $cart_contents_total;
|
| 1457 |
+
$cart_contents_count = $cart_contents_count + $b['quantity'];
|
| 1458 |
+
$total = $total + $b['line_total'];
|
| 1459 |
+
$subtotal = $subtotal + $b['line_subtotal'];
|
| 1460 |
+
$subtotal_ex_tax = $subtotal_ex_tax + $b['line_subtotal'];
|
| 1461 |
+
}
|
| 1462 |
+
$saved_cart_data[ $key ] = $value_new;
|
| 1463 |
+
$woocommerce_cart_hash = $a;
|
| 1464 |
+
}
|
| 1465 |
+
}
|
| 1466 |
+
|
| 1467 |
+
if ( $saved_cart ) {
|
| 1468 |
+
if ( empty( $woocommerce->session->cart ) || ! is_array( $woocommerce->session->cart ) || sizeof( $woocommerce->session->cart ) == 0 ) {
|
| 1469 |
+
$woocommerce->session->cart = $saved_cart['cart'];
|
| 1470 |
+
$woocommerce->session->cart_contents_total = $cart_contents_total;
|
| 1471 |
+
$woocommerce->session->cart_contents_weight = $cart_contents_weight;
|
| 1472 |
+
$woocommerce->session->cart_contents_count = $cart_contents_count;
|
| 1473 |
+
$woocommerce->session->cart_contents_tax = $cart_contents_tax;
|
| 1474 |
+
$woocommerce->session->total = $total;
|
| 1475 |
+
$woocommerce->session->subtotal = $subtotal;
|
| 1476 |
+
$woocommerce->session->subtotal_ex_tax = $subtotal_ex_tax;
|
| 1477 |
+
$woocommerce->session->tax_total = $tax_total;
|
| 1478 |
+
$woocommerce->session->shipping_taxes = array();
|
| 1479 |
+
$woocommerce->session->taxes = array();
|
| 1480 |
+
$woocommerce->session->ac_customer = array();
|
| 1481 |
+
$woocommerce->cart->cart_contents = $saved_cart_data['cart'];
|
| 1482 |
+
$woocommerce->cart->cart_contents_total = $cart_contents_total;
|
| 1483 |
+
$woocommerce->cart->cart_contents_weight = $cart_contents_weight;
|
| 1484 |
+
$woocommerce->cart->cart_contents_count = $cart_contents_count;
|
| 1485 |
+
$woocommerce->cart->cart_contents_tax = $cart_contents_tax;
|
| 1486 |
+
$woocommerce->cart->total = $total;
|
| 1487 |
+
$woocommerce->cart->subtotal = $subtotal;
|
| 1488 |
+
$woocommerce->cart->subtotal_ex_tax = $subtotal_ex_tax;
|
| 1489 |
+
$woocommerce->cart->tax_total = $tax_total;
|
| 1490 |
+
}
|
| 1491 |
+
}
|
| 1492 |
+
}
|
| 1493 |
+
}
|
| 1494 |
+
|
| 1495 |
+
/**
|
| 1496 |
+
* It will compare only guest users cart while capturing the cart.
|
| 1497 |
+
* @param json_encode $new_cart New abandoned cart details
|
| 1498 |
+
* @param json_encode $last_abandoned_cart Old abandoned cart details
|
| 1499 |
+
* @return boolean true | false
|
| 1500 |
+
* @since 1.0
|
| 1501 |
+
*/
|
| 1502 |
+
function wcal_compare_only_guest_carts( $new_cart, $last_abandoned_cart ) {
|
| 1503 |
+
$current_woo_cart = array();
|
| 1504 |
+
$current_woo_cart = json_decode( stripslashes( $new_cart ), true );
|
| 1505 |
+
$abandoned_cart_arr = array();
|
| 1506 |
+
$abandoned_cart_arr = json_decode( $last_abandoned_cart, true );
|
| 1507 |
+
$temp_variable = "";
|
| 1508 |
+
if ( isset( $current_woo_cart['cart'] ) && isset( $abandoned_cart_arr['cart'] ) ) {
|
| 1509 |
+
if ( count( $current_woo_cart['cart'] ) >= count( $abandoned_cart_arr['cart'] ) ) {
|
| 1510 |
+
//do nothing
|
| 1511 |
+
} else {
|
| 1512 |
+
$temp_variable = $current_woo_cart;
|
| 1513 |
+
$current_woo_cart = $abandoned_cart_arr;
|
| 1514 |
+
$abandoned_cart_arr = $temp_variable;
|
| 1515 |
+
}
|
| 1516 |
+
if ( is_array( $current_woo_cart ) || is_object( $current_woo_cart ) ) {
|
| 1517 |
+
foreach( $current_woo_cart as $key => $value ) {
|
| 1518 |
+
foreach( $value as $item_key => $item_value ) {
|
| 1519 |
+
$current_cart_product_id = $item_value['product_id'];
|
| 1520 |
+
$current_cart_variation_id = $item_value['variation_id'];
|
| 1521 |
+
$current_cart_quantity = $item_value['quantity'];
|
| 1522 |
+
|
| 1523 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['product_id'] ) ){
|
| 1524 |
+
$abandoned_cart_product_id = $abandoned_cart_arr[$key][$item_key]['product_id'];
|
| 1525 |
+
} else {
|
| 1526 |
+
$abandoned_cart_product_id = "";
|
| 1527 |
+
}
|
| 1528 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['variation_id'] ) ) {
|
| 1529 |
+
$abandoned_cart_variation_id = $abandoned_cart_arr[$key][$item_key]['variation_id'];
|
| 1530 |
+
} else {
|
| 1531 |
+
$abandoned_cart_variation_id = "";
|
| 1532 |
+
}
|
| 1533 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['quantity'] ) ) {
|
| 1534 |
+
$abandoned_cart_quantity = $abandoned_cart_arr[$key][$item_key]['quantity'];
|
| 1535 |
+
} else {
|
| 1536 |
+
$abandoned_cart_quantity = "";
|
| 1537 |
+
}
|
| 1538 |
+
if ( ( $current_cart_product_id != $abandoned_cart_product_id ) ||
|
| 1539 |
+
( $current_cart_variation_id != $abandoned_cart_variation_id ) ||
|
| 1540 |
+
( $current_cart_quantity != $abandoned_cart_quantity ) ) {
|
| 1541 |
+
return false;
|
| 1542 |
+
}
|
| 1543 |
+
}
|
| 1544 |
+
}
|
| 1545 |
+
}
|
| 1546 |
+
}
|
| 1547 |
+
return true;
|
| 1548 |
+
}
|
| 1549 |
+
|
| 1550 |
+
/**
|
| 1551 |
+
* It will compare only loggedin users cart while capturing the cart.
|
| 1552 |
+
* @param int | string $user_id User id
|
| 1553 |
+
* @param json_encode $last_abandoned_cart Old abandoned cart details
|
| 1554 |
+
* @return boolean true | false
|
| 1555 |
+
* @since 1.0
|
| 1556 |
+
*/
|
| 1557 |
+
function wcal_compare_carts( $user_id, $last_abandoned_cart ) {
|
| 1558 |
+
global $woocommerce;
|
| 1559 |
+
$current_woo_cart = array();
|
| 1560 |
+
$abandoned_cart_arr = array();
|
| 1561 |
+
$wcal_woocommerce_persistent_cart =version_compare( $woocommerce->version, '3.1.0', ">=" ) ? '_woocommerce_persistent_cart_' . get_current_blog_id() : '_woocommerce_persistent_cart' ;
|
| 1562 |
+
$current_woo_cart = get_user_meta( $user_id, $wcal_woocommerce_persistent_cart, true );
|
| 1563 |
+
$abandoned_cart_arr = json_decode( $last_abandoned_cart, true );
|
| 1564 |
+
$temp_variable = "";
|
| 1565 |
+
if ( isset( $current_woo_cart['cart'] ) && isset( $abandoned_cart_arr['cart'] ) ) {
|
| 1566 |
+
if ( count( $current_woo_cart['cart'] ) >= count( $abandoned_cart_arr['cart'] ) ) {
|
| 1567 |
+
//do nothing
|
| 1568 |
+
} else {
|
| 1569 |
+
$temp_variable = $current_woo_cart;
|
| 1570 |
+
$current_woo_cart = $abandoned_cart_arr;
|
| 1571 |
+
$abandoned_cart_arr = $temp_variable;
|
| 1572 |
+
}
|
| 1573 |
+
if ( is_array( $current_woo_cart ) && is_array( $abandoned_cart_arr ) ) {
|
| 1574 |
+
foreach ( $current_woo_cart as $key => $value ) {
|
| 1575 |
+
|
| 1576 |
+
foreach ( $value as $item_key => $item_value ) {
|
| 1577 |
+
$current_cart_product_id = $item_value['product_id'];
|
| 1578 |
+
$current_cart_variation_id = $item_value['variation_id'];
|
| 1579 |
+
$current_cart_quantity = $item_value['quantity'];
|
| 1580 |
+
|
| 1581 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['product_id'] ) ) {
|
| 1582 |
+
$abandoned_cart_product_id = $abandoned_cart_arr[$key][$item_key]['product_id'];
|
| 1583 |
+
} else {
|
| 1584 |
+
$abandoned_cart_product_id = "";
|
| 1585 |
+
}
|
| 1586 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['variation_id'] ) ) {
|
| 1587 |
+
$abandoned_cart_variation_id = $abandoned_cart_arr[$key][$item_key]['variation_id'];
|
| 1588 |
+
} else {
|
| 1589 |
+
$abandoned_cart_variation_id = "";
|
| 1590 |
+
}
|
| 1591 |
+
if ( isset( $abandoned_cart_arr[$key][$item_key]['quantity'] ) ) {
|
| 1592 |
+
$abandoned_cart_quantity = $abandoned_cart_arr[$key][$item_key]['quantity'];
|
| 1593 |
+
} else {
|
| 1594 |
+
$abandoned_cart_quantity = "";
|
| 1595 |
+
}
|
| 1596 |
+
if ( ( $current_cart_product_id != $abandoned_cart_product_id ) ||
|
| 1597 |
+
( $current_cart_variation_id != $abandoned_cart_variation_id ) ||
|
| 1598 |
+
( $current_cart_quantity != $abandoned_cart_quantity ) )
|
| 1599 |
+
{
|
| 1600 |
+
return false;
|
| 1601 |
+
}
|
| 1602 |
+
}
|
| 1603 |
+
}
|
| 1604 |
+
}
|
| 1605 |
+
}
|
| 1606 |
+
return true;
|
| 1607 |
+
}
|
| 1608 |
+
|
| 1609 |
+
/**
|
| 1610 |
+
* It will add the wp editor for email body on the email edit page.
|
| 1611 |
+
* @hook admin_init
|
| 1612 |
+
* @since 2.6
|
| 1613 |
+
*/
|
| 1614 |
+
function wcal_action_admin_init() {
|
| 1615 |
+
|
| 1616 |
+
// only hook up these filters if we're in the admin panel and the current user has permission
|
| 1617 |
+
// to edit posts and pages
|
| 1618 |
+
if ( ! isset( $_GET['page'] ) || $_GET['page'] != "woocommerce_ac_page" ) {
|
| 1619 |
+
return;
|
| 1620 |
+
}
|
| 1621 |
+
if ( ! current_user_can( 'edit_posts' ) && ! current_user_can( 'edit_pages' ) ) {
|
| 1622 |
+
return;
|
| 1623 |
+
}
|
| 1624 |
+
if ( 'true' == get_user_option( 'rich_editing' ) ) {
|
| 1625 |
+
remove_filter( 'the_excerpt', 'wpautop' );
|
| 1626 |
+
add_filter( 'tiny_mce_before_init', array( &$this, 'wcal_format_tiny_MCE' ) );
|
| 1627 |
+
add_filter( 'mce_buttons', array( &$this, 'wcal_filter_mce_button' ) );
|
| 1628 |
+
add_filter( 'mce_external_plugins', array( &$this, 'wcal_filter_mce_plugin' ) );
|
| 1629 |
+
}
|
| 1630 |
+
}
|
| 1631 |
+
|
| 1632 |
+
/**
|
| 1633 |
+
* It will create a button on the WordPress editor.
|
| 1634 |
+
* @hook mce_buttons
|
| 1635 |
+
* @param array $buttons
|
| 1636 |
+
* @return array $buttons
|
| 1637 |
+
* @since 2.6
|
| 1638 |
+
*/
|
| 1639 |
+
function wcal_filter_mce_button( $buttons ) {
|
| 1640 |
+
// add a separation before our button, here our button's id is "mygallery_button"
|
| 1641 |
+
array_push( $buttons, 'abandoncart', '|' );
|
| 1642 |
+
return $buttons;
|
| 1643 |
+
}
|
| 1644 |
+
|
| 1645 |
+
/**
|
| 1646 |
+
* It will add the list for the added extra button.
|
| 1647 |
+
* @hook mce_external_plugins
|
| 1648 |
+
* @param array $plugins
|
| 1649 |
+
* @return array $plugins
|
| 1650 |
+
* @since 2.6
|
| 1651 |
+
*/
|
| 1652 |
+
function wcal_filter_mce_plugin( $plugins ) {
|
| 1653 |
+
// this plugin file will work the magic of our button
|
| 1654 |
+
$plugins['abandoncart'] = plugin_dir_url( __FILE__ ) . 'assets/js/abandoncart_plugin_button.js';
|
| 1655 |
+
return $plugins;
|
| 1656 |
+
}
|
| 1657 |
+
|
| 1658 |
+
/**
|
| 1659 |
+
* It will add the tabs on the Abandoned cart page.
|
| 1660 |
+
* @since 1.0
|
| 1661 |
+
*/
|
| 1662 |
+
function wcal_display_tabs() {
|
| 1663 |
+
|
| 1664 |
+
$action = '';
|
| 1665 |
+
$active_listcart = '';
|
| 1666 |
+
$active_emailtemplates = '';
|
| 1667 |
+
$active_settings = '';
|
| 1668 |
+
$active_stats = '';
|
| 1669 |
+
$active_dash = '';
|
| 1670 |
+
|
| 1671 |
+
if( isset( $_GET[ 'action' ] ) ) {
|
| 1672 |
+
$action = $_GET[ 'action' ];
|
| 1673 |
+
} else {
|
| 1674 |
+
$action = '';
|
| 1675 |
+
$action = apply_filters( 'wcal_default_tab', $action );
|
| 1676 |
+
}
|
| 1677 |
+
|
| 1678 |
+
switch( $action ) {
|
| 1679 |
+
case '':
|
| 1680 |
+
case 'dashboard':
|
| 1681 |
+
$active_dash = 'nav-tab-active';
|
| 1682 |
+
break;
|
| 1683 |
+
case 'listcart':
|
| 1684 |
+
case 'orderdetails':
|
| 1685 |
+
$active_listcart = 'nav-tab-active';
|
| 1686 |
+
break;
|
| 1687 |
+
case 'emailtemplates':
|
| 1688 |
+
$active_emailtemplates = 'nav-tab-active';
|
| 1689 |
+
break;
|
| 1690 |
+
case 'emailsettings':
|
| 1691 |
+
$active_settings = 'nav-tab-active';
|
| 1692 |
+
break;
|
| 1693 |
+
case 'stats':
|
| 1694 |
+
$active_stats = 'nav-tab-active';
|
| 1695 |
break;
|
| 1696 |
+
case 'report':
|
| 1697 |
+
$active_report = 'nav-tab-active';
|
| 1698 |
+
break;
|
| 1699 |
+
}
|
| 1700 |
+
|
| 1701 |
+
?>
|
| 1702 |
+
<div style="background-image: url('<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/assets/images/ac_tab_icon.png') !important;" class="icon32"><br>
|
| 1703 |
+
</div>
|
| 1704 |
+
<h2 class="nav-tab-wrapper woo-nav-tab-wrapper">
|
| 1705 |
+
<a href="admin.php?page=woocommerce_ac_page&action=dashboard" class="nav-tab <?php if ( isset( $active_dash ) ) echo $active_dash; ?>"> <?php _e( 'Dashboard', 'woocommerce-abandoned-cart' );?> </a>
|
| 1706 |
+
<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-abandoned-cart' );?> </a>
|
| 1707 |
+
<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-abandoned-cart' );?> </a>
|
| 1708 |
+
<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-abandoned-cart' );?> </a>
|
| 1709 |
+
<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-abandoned-cart' );?> </a>
|
| 1710 |
+
<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-abandoned-cart' );?> </a>
|
| 1711 |
+
|
| 1712 |
+
<?php do_action( 'wcal_add_settings_tab' ); ?>
|
| 1713 |
+
</h2>
|
| 1714 |
+
<?php
|
| 1715 |
+
}
|
| 1716 |
+
|
| 1717 |
+
/**
|
| 1718 |
+
* It will add the scripts needed for the plugin.
|
| 1719 |
+
* @hook admin_enqueue_scripts
|
| 1720 |
+
* @param string $hook Name of hook
|
| 1721 |
+
* @since 1.0
|
| 1722 |
+
*/
|
| 1723 |
+
function wcal_enqueue_scripts_js( $hook ) {
|
| 1724 |
+
global $pagenow, $woocommerce;
|
| 1725 |
+
$page = isset( $_GET['page'] ) ? $_GET['page'] : '';
|
| 1726 |
+
$action = isset( $_GET['action'] ) ? $_GET['action'] : '';
|
| 1727 |
+
|
| 1728 |
+
if ( $page === '' || $page !== 'woocommerce_ac_page' ) {
|
| 1729 |
+
return;
|
| 1730 |
+
} else {
|
| 1731 |
+
wp_enqueue_script( 'jquery' );
|
| 1732 |
+
wp_enqueue_script(
|
| 1733 |
+
'jquery-ui-min',
|
| 1734 |
+
plugins_url( '/assets/js/jquery-ui.min.js', __FILE__ ),
|
| 1735 |
+
'',
|
| 1736 |
+
'',
|
| 1737 |
+
false
|
| 1738 |
+
);
|
| 1739 |
+
wp_enqueue_script( 'jquery-ui-datepicker' );
|
| 1740 |
+
wp_enqueue_script(
|
| 1741 |
+
'jquery-tip',
|
| 1742 |
+
plugins_url( '/assets/js/jquery.tipTip.minified.js', __FILE__ ),
|
| 1743 |
+
'',
|
| 1744 |
+
'',
|
| 1745 |
+
false
|
| 1746 |
+
);
|
| 1747 |
+
|
| 1748 |
+
|
| 1749 |
+
wp_register_script( 'woocommerce_admin', plugins_url() . '/woocommerce/assets/js/admin/woocommerce_admin.min.js', array( 'jquery', 'jquery-tiptip' ) );
|
| 1750 |
+
wp_register_script( 'woocommerce_tip_tap', plugins_url() . '/woocommerce/assets/js/jquery-tiptip/jquery.tipTip.min.js', array( 'jquery') );
|
| 1751 |
+
wp_enqueue_script( 'woocommerce_tip_tap');
|
| 1752 |
+
wp_enqueue_script( 'woocommerce_admin');
|
| 1753 |
+
$locale = localeconv();
|
| 1754 |
+
$decimal = isset( $locale['decimal_point'] ) ? $locale['decimal_point'] : '.';
|
| 1755 |
+
$params = array(
|
| 1756 |
+
/* translators: %s: decimal */
|
| 1757 |
+
'i18n_decimal_error' => sprintf( __( 'Please enter in decimal (%s) format without thousand separators.', 'woocommerce' ), $decimal ),
|
| 1758 |
+
/* translators: %s: price decimal separator */
|
| 1759 |
+
'i18n_mon_decimal_error' => sprintf( __( 'Please enter in monetary decimal (%s) format without thousand separators and currency symbols.', 'woocommerce' ), wc_get_price_decimal_separator() ),
|
| 1760 |
+
'i18n_country_iso_error' => __( 'Please enter in country code with two capital letters.', 'woocommerce' ),
|
| 1761 |
+
'i18_sale_less_than_regular_error' => __( 'Please enter in a value less than the regular price.', 'woocommerce' ),
|
| 1762 |
+
'decimal_point' => $decimal,
|
| 1763 |
+
'mon_decimal_point' => wc_get_price_decimal_separator(),
|
| 1764 |
+
'strings' => array(
|
| 1765 |
+
'import_products' => __( 'Import', 'woocommerce' ),
|
| 1766 |
+
'export_products' => __( 'Export', 'woocommerce' ),
|
| 1767 |
+
),
|
| 1768 |
+
'urls' => array(
|
| 1769 |
+
'import_products' => esc_url_raw( admin_url( 'edit.php?post_type=product&page=product_importer' ) ),
|
| 1770 |
+
'export_products' => esc_url_raw( admin_url( 'edit.php?post_type=product&page=product_exporter' ) ),
|
| 1771 |
+
),
|
| 1772 |
+
);
|
| 1773 |
+
/**
|
| 1774 |
+
* If we dont localize this script then from the WooCommerce check it will not run the javascript further and tooltip wont show any data.
|
| 1775 |
+
* Also, we need above all parameters for the WooCoomerce js file. So we have taken it from the WooCommerce.
|
| 1776 |
+
* @since: 5.1.2
|
| 1777 |
+
*/
|
| 1778 |
+
wp_localize_script( 'woocommerce_admin', 'woocommerce_admin', $params );
|
| 1779 |
+
?>
|
| 1780 |
+
<script type="text/javascript" >
|
| 1781 |
+
function wcal_activate_email_template( template_id, active_state ) {
|
| 1782 |
+
location.href = 'admin.php?page=woocommerce_ac_page&action=emailtemplates&mode=activate_template&id='+template_id+'&active_state='+active_state ;
|
| 1783 |
+
}
|
| 1784 |
+
</script>
|
| 1785 |
+
<?php
|
| 1786 |
+
$js_src = includes_url('js/tinymce/') . 'tinymce.min.js';
|
| 1787 |
+
wp_enqueue_script( 'tinyMce_ac',$js_src );
|
| 1788 |
+
wp_enqueue_script( 'ac_email_variables', plugins_url() . '/woocommerce-abandoned-cart/assets/js/abandoncart_plugin_button.js' );
|
| 1789 |
+
wp_enqueue_script( 'wcal_activate_template', plugins_url() . '/woocommerce-abandoned-cart/assets/js/wcal_template_activate.js' );
|
| 1790 |
+
|
| 1791 |
+
// needed only on the dashboard page
|
| 1792 |
+
if( 'woocommerce_ac_page' === $page && ( '' === $action || 'dashboard' === $action ) ) {
|
| 1793 |
+
wp_register_script( 'jquery-ui-datepicker', plugins_url() . '/woocommerce/assets/js/admin/ui-datepicker.js' );
|
| 1794 |
+
wp_enqueue_script( 'jquery-ui-datepicker' );
|
| 1795 |
+
|
| 1796 |
+
wp_enqueue_script (
|
| 1797 |
+
'bootstrap_js',
|
| 1798 |
+
plugins_url() . '/woocommerce-abandoned-cart/assets/js/admin/bootstrap.min.js',
|
| 1799 |
+
'',
|
| 1800 |
+
'',
|
| 1801 |
+
false );
|
| 1802 |
+
|
| 1803 |
+
wp_enqueue_script (
|
| 1804 |
+
'reports_js',
|
| 1805 |
+
plugins_url() . '/woocommerce-abandoned-cart/assets/js/admin/wcal_adv_dashboard.min.js',
|
| 1806 |
+
'',
|
| 1807 |
+
'',
|
| 1808 |
+
false
|
| 1809 |
+
);
|
| 1810 |
+
}
|
| 1811 |
+
// needed only on the abandoned orders page
|
| 1812 |
+
wp_enqueue_script( 'wcal_abandoned_cart_details', plugins_url() . '/woocommerce-abandoned-cart/assets/js/admin/wcal_abandoned_cart_detail_modal.min.js' );
|
| 1813 |
+
|
| 1814 |
+
wp_enqueue_script( 'wcal_admin_notices', plugins_url() . '/woocommerce-abandoned-cart/assets/js/admin/wcal_ts_dismiss_notice.js' );
|
| 1815 |
+
wp_localize_script( 'wcal_admin_notices', 'wcal_dismiss_params', array(
|
| 1816 |
+
'ajax_url' => admin_url( 'admin-ajax.php' )
|
| 1817 |
+
)
|
| 1818 |
+
);
|
| 1819 |
+
}
|
| 1820 |
+
}
|
| 1821 |
+
|
| 1822 |
+
/**
|
| 1823 |
+
* It will add the parameter to the editor.
|
| 1824 |
+
* @hook tiny_mce_before_init
|
| 1825 |
+
* @param array $in
|
| 1826 |
+
* @return array $in
|
| 1827 |
+
* @since 2.6
|
| 1828 |
+
*/
|
| 1829 |
+
function wcal_format_tiny_MCE( $in ) {
|
| 1830 |
+
$in['force_root_block'] = false;
|
| 1831 |
+
$in['valid_children'] = '+body[style]';
|
| 1832 |
+
$in['remove_linebreaks'] = false;
|
| 1833 |
+
$in['gecko_spellcheck'] = false;
|
| 1834 |
+
$in['keep_styles'] = true;
|
| 1835 |
+
$in['accessibility_focus'] = true;
|
| 1836 |
+
$in['tabfocus_elements'] = 'major-publishing-actions';
|
| 1837 |
+
$in['media_strict'] = false;
|
| 1838 |
+
$in['paste_remove_styles'] = false;
|
| 1839 |
+
$in['paste_remove_spans'] = false;
|
| 1840 |
+
$in['paste_strip_class_attributes'] = 'none';
|
| 1841 |
+
$in['paste_text_use_dialog'] = true;
|
| 1842 |
+
$in['wpeditimage_disable_captions'] = true;
|
| 1843 |
+
$in['wpautop'] = false;
|
| 1844 |
+
$in['apply_source_formatting'] = true;
|
| 1845 |
+
$in['cleanup'] = true;
|
| 1846 |
+
$in['convert_newlines_to_brs'] = FALSE;
|
| 1847 |
+
$in['fullpage_default_xml_pi'] = false;
|
| 1848 |
+
$in['convert_urls'] = false;
|
| 1849 |
+
// Do not remove redundant BR tags
|
| 1850 |
+
$in['remove_redundant_brs'] = false;
|
| 1851 |
+
return $in;
|
| 1852 |
+
}
|
| 1853 |
+
|
| 1854 |
+
/**
|
| 1855 |
+
* It will add the necesaary css for the plugin.
|
| 1856 |
+
* @hook admin_enqueue_scripts
|
| 1857 |
+
* @param string $hook Name of page
|
| 1858 |
+
* @since 1.0
|
| 1859 |
+
*/
|
| 1860 |
+
function wcal_enqueue_scripts_css( $hook ) {
|
| 1861 |
+
|
| 1862 |
+
global $pagenow;
|
| 1863 |
+
|
| 1864 |
+
$page = isset( $_GET['page'] ) ? $_GET['page'] : '';
|
| 1865 |
+
|
| 1866 |
+
if ( $page != 'woocommerce_ac_page' ) {
|
| 1867 |
+
return;
|
| 1868 |
+
} else if ( $page === 'woocommerce_ac_page' && ( isset( $_GET['action'] ) && 'dashboard' === $_GET[ 'action' ] ) || ! isset( $_GET[ 'action' ] ) ) {
|
| 1869 |
+
wp_enqueue_style( 'wcal-dashboard-adv', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/wcal_reports_adv.css' );
|
| 1870 |
+
|
| 1871 |
+
wp_register_style( 'bootstrap_css', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/bootstrap.min.css', '', '', 'all' );
|
| 1872 |
+
wp_enqueue_style( 'bootstrap_css' );
|
| 1873 |
+
|
| 1874 |
+
wp_enqueue_style( 'wcal-font-awesome', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/font-awesome.css' );
|
| 1875 |
+
|
| 1876 |
+
wp_enqueue_style( 'wcal-font-awesome-min', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/font-awesome.min.css' );
|
| 1877 |
+
|
| 1878 |
+
wp_enqueue_style( 'jquery-ui', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/jquery-ui.css', '', '', false );
|
| 1879 |
+
wp_enqueue_style( 'woocommerce_admin_styles', plugins_url() . '/woocommerce/assets/css/admin.css' );
|
| 1880 |
wp_enqueue_style( 'jquery-ui-style', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/jquery-ui-smoothness.css' );
|
| 1881 |
wp_enqueue_style( 'wcal-reports', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/wcal_reports.min.css' );
|
| 1882 |
+
|
| 1883 |
+
} elseif ( $page === 'woocommerce_ac_page' ) {
|
| 1884 |
+
|
| 1885 |
+
wp_enqueue_style( 'jquery-ui', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/jquery-ui.css', '', '', false );
|
| 1886 |
+
wp_enqueue_style( 'woocommerce_admin_styles', plugins_url() . '/woocommerce/assets/css/admin.css' );
|
| 1887 |
+
|
| 1888 |
+
wp_enqueue_style( 'jquery-ui-style', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/jquery-ui-smoothness.css' );
|
| 1889 |
+
wp_enqueue_style( 'abandoned-orders-list', plugins_url() . '/woocommerce-abandoned-cart/assets/css/view.abandoned.orders.style.css' );
|
| 1890 |
+
wp_enqueue_style( 'wcal_email_template', plugins_url() . '/woocommerce-abandoned-cart/assets/css/wcal_template_activate.css' );
|
| 1891 |
+
wp_enqueue_style( 'wcal_cart_details', plugins_url() . '/woocommerce-abandoned-cart/assets/css/admin/wcal_abandoned_cart_detail_modal.min.css' );
|
| 1892 |
+
}
|
| 1893 |
+
}
|
| 1894 |
+
|
| 1895 |
+
|
| 1896 |
+
/**
|
| 1897 |
+
* When we have added the wp list table for the listing then while deleting the record with the bulk action it was showing
|
| 1898 |
+
* the notice. To overcome the wp redirect warning we need to start the ob_start.
|
| 1899 |
+
* @hook init
|
| 1900 |
+
* @since 2.5.2
|
| 1901 |
+
*/
|
| 1902 |
+
function wcal_app_output_buffer() {
|
| 1903 |
+
ob_start();
|
| 1904 |
+
}
|
| 1905 |
+
|
| 1906 |
+
/**
|
| 1907 |
+
* Abandon Cart Settings Page. It will show the tabs, notices for the plugin.
|
| 1908 |
+
* It will also update the template records and display the template fields.
|
| 1909 |
+
* It will also show the abandoned cart details page.
|
| 1910 |
+
* It will also show the details of all the tabs.
|
| 1911 |
+
* @globals mixed $wpdb
|
| 1912 |
+
* @since 1.0
|
| 1913 |
+
*/
|
| 1914 |
+
function wcal_menu_page() {
|
| 1915 |
+
|
| 1916 |
+
if ( is_user_logged_in() ) {
|
| 1917 |
+
global $wpdb;
|
| 1918 |
+
// Check the user capabilities
|
| 1919 |
+
if ( ! current_user_can( 'manage_woocommerce' ) ) {
|
| 1920 |
+
wp_die( __( 'You do not have sufficient permissions to access this page.', 'woocommerce-abandoned-cart' ) );
|
| 1921 |
+
}
|
| 1922 |
+
?>
|
| 1923 |
+
<div class="wrap">
|
| 1924 |
+
<h2><?php _e( 'WooCommerce - Abandon Cart Lite', 'woocommerce-abandoned-cart' ); ?></h2>
|
| 1925 |
+
<?php
|
| 1926 |
+
|
| 1927 |
+
if ( isset( $_GET['ac_update'] ) && 'email_templates' === $_GET['ac_update'] ) {
|
| 1928 |
+
$status = wcal_common::update_templates_table();
|
| 1929 |
+
|
| 1930 |
+
if ( $status !== false ) {
|
| 1931 |
+
wcal_common::show_update_success();
|
| 1932 |
+
} else {
|
| 1933 |
+
wcal_common::show_update_failure();
|
| 1934 |
+
}
|
| 1935 |
+
}
|
| 1936 |
+
|
| 1937 |
+
if ( isset( $_GET['action'] ) ) {
|
| 1938 |
+
$action = $_GET['action'];
|
| 1939 |
+
} else {
|
| 1940 |
+
$action = "";
|
| 1941 |
+
$action = apply_filters( 'wcal_default_tab', $action );
|
| 1942 |
+
}
|
| 1943 |
+
if ( isset( $_GET['mode'] ) ) {
|
| 1944 |
+
$mode = $_GET['mode'];
|
| 1945 |
+
} else {
|
| 1946 |
+
$mode = "";
|
| 1947 |
+
}
|
| 1948 |
+
$this->wcal_display_tabs();
|
| 1949 |
+
|
| 1950 |
+
do_action ( 'wcal_add_tab_content' );
|
| 1951 |
+
|
| 1952 |
+
/**
|
| 1953 |
+
* When we delete the item from the below drop down it is registred in action 2
|
| 1954 |
+
*/
|
| 1955 |
+
if ( isset( $_GET['action2'] ) ) {
|
| 1956 |
+
$action_two = $_GET['action2'];
|
| 1957 |
+
} else {
|
| 1958 |
+
$action_two = "";
|
| 1959 |
+
}
|
| 1960 |
+
// Detect when a bulk action is being triggered on abandoned orders page.
|
| 1961 |
+
if ( 'wcal_delete' === $action || 'wcal_delete' === $action_two ) {
|
| 1962 |
+
$ids = isset( $_GET['abandoned_order_id'] ) ? $_GET['abandoned_order_id'] : false;
|
| 1963 |
+
if ( ! is_array( $ids ) ) {
|
| 1964 |
+
$ids = array( $ids );
|
| 1965 |
+
}
|
| 1966 |
+
foreach ( $ids as $id ) {
|
| 1967 |
+
$class = new Wcal_Delete_Handler();
|
| 1968 |
+
$class->wcal_delete_bulk_action_handler_function( $id );
|
| 1969 |
+
}
|
| 1970 |
+
}
|
| 1971 |
+
//Detect when a bulk action is being triggered on temnplates page.
|
| 1972 |
+
if ( 'wcal_delete_template' === $action || 'wcal_delete_template' === $action_two ) {
|
| 1973 |
+
$ids = isset( $_GET['template_id'] ) ? $_GET['template_id'] : false;
|
| 1974 |
+
if ( ! is_array( $ids ) ) {
|
| 1975 |
+
$ids = array( $ids );
|
| 1976 |
+
}
|
| 1977 |
+
foreach ( $ids as $id ) {
|
| 1978 |
+
$class = new Wcal_Delete_Handler();
|
| 1979 |
+
$class->wcal_delete_template_bulk_action_handler_function( $id );
|
| 1980 |
+
}
|
| 1981 |
+
}
|
| 1982 |
+
|
| 1983 |
+
if ( isset( $_GET['wcal_deleted'] ) && 'YES' == $_GET['wcal_deleted'] ) { ?>
|
| 1984 |
+
<div id="message" class="updated fade">
|
| 1985 |
+
<p><strong><?php _e( 'The Abandoned cart has been successfully deleted.', 'woocommerce-abandoned-cart' ); ?></strong></p>
|
| 1986 |
+
</div>
|
| 1987 |
+
<?php }
|
| 1988 |
+
if ( isset( $_GET ['wcal_template_deleted'] ) && 'YES' == $_GET['wcal_template_deleted'] ) { ?>
|
| 1989 |
+
<div id="message" class="updated fade">
|
| 1990 |
+
<p><strong><?php _e( 'The Template has been successfully deleted.', 'woocommerce-abandoned-cart' ); ?></strong></p>
|
| 1991 |
+
</div>
|
| 1992 |
+
<?php }
|
| 1993 |
+
if ( 'emailsettings' == $action ) {
|
| 1994 |
+
// Save the field values
|
| 1995 |
+
?>
|
| 1996 |
+
<p><?php _e( 'Change settings for sending email notifications to Customers, to Admin etc.', 'woocommerce-abandoned-cart' ); ?></p>
|
| 1997 |
+
<div id="content">
|
| 1998 |
+
<?php
|
| 1999 |
+
$wcal_general_settings_class = $wcal_email_setting = $wcap_sms_settings = $wcap_atc_settings = $wcap_fb_settings = "";
|
| 2000 |
+
|
| 2001 |
+
$section = isset( $_GET[ 'wcal_section' ] ) ? $_GET[ 'wcal_section' ] : '';
|
| 2002 |
+
|
| 2003 |
+
switch( $section ) {
|
| 2004 |
+
|
| 2005 |
+
case 'wcal_general_settings':
|
| 2006 |
+
case '':
|
| 2007 |
+
$wcal_general_settings_class = "current";
|
| 2008 |
+
break;
|
| 2009 |
+
|
| 2010 |
+
case 'wcal_email_settings':
|
| 2011 |
+
$wcal_email_setting = "current";
|
| 2012 |
+
break;
|
| 2013 |
+
|
| 2014 |
+
case 'wcap_sms_settings':
|
| 2015 |
+
$wcap_sms_settings = "current";
|
| 2016 |
+
break;
|
| 2017 |
+
|
| 2018 |
+
case 'wcap_atc_settings':
|
| 2019 |
+
$wcap_atc_settings = "current";
|
| 2020 |
+
break;
|
| 2021 |
+
|
| 2022 |
+
case 'wcap_fb_settings':
|
| 2023 |
+
$wcap_fb_settings = "current";
|
| 2024 |
+
break;
|
| 2025 |
+
|
| 2026 |
+
default:
|
| 2027 |
+
$wcal_general_settings_class = "current";
|
| 2028 |
+
break;
|
| 2029 |
+
|
| 2030 |
+
}
|
| 2031 |
?>
|
| 2032 |
+
<ul class="subsubsub" id="wcal_general_settings_list">
|
| 2033 |
+
<li>
|
| 2034 |
+
<a href="admin.php?page=woocommerce_ac_page&action=emailsettings&wcal_section=wcal_general_settings" class="<?php echo $wcal_general_settings_class; ?>"><?php _e( 'General Settings', 'woocommerce-abandoned-cart' );?> </a> |
|
| 2035 |
+
</li>
|
| 2036 |
+
<li>
|
| 2037 |
+
<a href="admin.php?page=woocommerce_ac_page&action=emailsettings&wcal_section=wcal_email_settings" class="<?php echo $wcal_email_setting; ?>"><?php _e( 'Email Sending Settings', 'woocommerce-abandoned-cart' );?> </a> |
|
| 2038 |
+
</li>
|
| 2039 |
+
<li>
|
| 2040 |
+
<a href="admin.php?page=woocommerce_ac_page&action=emailsettings&wcal_section=wcap_atc_settings" class="<?php echo $wcap_atc_settings; ?>"><?php _e( 'Add To Cart Popup Editor', 'woocommerce-ac' );?> </a> |
|
| 2041 |
+
</li>
|
| 2042 |
+
<li>
|
| 2043 |
+
<a href="admin.php?page=woocommerce_ac_page&action=emailsettings&wcal_section=wcap_fb_settings" class="<?php echo $wcap_fb_settings; ?>"><?php _e( 'Facebook Messenger', 'woocommerce-ac' );?> </a> |
|
| 2044 |
+
</li>
|
| 2045 |
+
<li>
|
| 2046 |
+
<a href="admin.php?page=woocommerce_ac_page&action=emailsettings&wcal_section=wcap_sms_settings" class="<?php echo $wcap_sms_settings; ?>"><?php _e( 'SMS', 'woocommerce-ac' );?> </a>
|
| 2047 |
+
</li>
|
| 2048 |
+
|
| 2049 |
+
</ul>
|
| 2050 |
+
<br class="clear">
|
| 2051 |
+
<?php
|
| 2052 |
+
if ( 'wcal_general_settings' == $section || '' == $section ) {
|
| 2053 |
+
?>
|
| 2054 |
+
<form method="post" action="options.php">
|
| 2055 |
+
<?php settings_fields( 'woocommerce_ac_settings' ); ?>
|
| 2056 |
+
<?php do_settings_sections( 'woocommerce_ac_page' ); ?>
|
| 2057 |
+
<?php settings_errors(); ?>
|
| 2058 |
+
<?php submit_button(); ?>
|
| 2059 |
+
</form>
|
| 2060 |
+
<?php
|
| 2061 |
+
} else if ( 'wcal_email_settings' == $section ) {
|
| 2062 |
+
?>
|
| 2063 |
+
<form method="post" action="options.php">
|
| 2064 |
+
<?php settings_fields ( 'woocommerce_ac_email_settings' ); ?>
|
| 2065 |
+
<?php do_settings_sections( 'woocommerce_ac_email_page' ); ?>
|
| 2066 |
+
<?php settings_errors(); ?>
|
| 2067 |
+
<?php submit_button(); ?>
|
| 2068 |
+
</form>
|
| 2069 |
+
<?php
|
| 2070 |
+
} elseif( 'wcap_atc_settings' == $section ) {
|
| 2071 |
+
WCAP_Pro_Settings::wcap_atc_settings();
|
| 2072 |
+
} elseif( 'wcap_fb_settings' == $section ) {
|
| 2073 |
+
WCAP_Pro_Settings::wcap_fb_settings();
|
| 2074 |
+
} elseif( 'wcap_sms_settings' == $section ) {
|
| 2075 |
+
WCAP_Pro_Settings::wcap_sms_settings();
|
| 2076 |
+
}
|
| 2077 |
+
?>
|
| 2078 |
+
</div>
|
| 2079 |
+
<?php
|
| 2080 |
+
} else if ( 'dashboard' === $action || '' === $action || '-1' === $action || '1' === $action_two ) {
|
| 2081 |
+
include_once( 'includes/classes/class-wcal-dashboard-report.php' );
|
| 2082 |
+
Wcal_Dashboard_Report::wcal_dashboard_display();
|
| 2083 |
+
|
| 2084 |
+
} else if ( $action == 'listcart' ) {
|
| 2085 |
+
|
| 2086 |
+
?>
|
| 2087 |
+
<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-abandoned-cart' );?> </p>
|
| 2088 |
+
<?php
|
| 2089 |
+
$get_all_abandoned_count = wcal_common::wcal_get_abandoned_order_count( 'wcal_all_abandoned' );
|
| 2090 |
+
$get_registered_user_ac_count = wcal_common::wcal_get_abandoned_order_count( 'wcal_all_registered' );
|
| 2091 |
+
$get_guest_user_ac_count = wcal_common::wcal_get_abandoned_order_count( 'wcal_all_guest' );
|
| 2092 |
+
$get_visitor_user_ac_count = wcal_common::wcal_get_abandoned_order_count( 'wcal_all_visitor' );
|
| 2093 |
+
|
| 2094 |
+
$wcal_user_reg_text = 'User';
|
| 2095 |
+
if ( $get_registered_user_ac_count > 1 ) {
|
| 2096 |
+
$wcal_user_reg_text = 'Users';
|
| 2097 |
+
}
|
| 2098 |
+
$wcal_user_gus_text = 'User';
|
| 2099 |
+
if ( $get_guest_user_ac_count > 1 ) {
|
| 2100 |
+
$wcal_user_gus_text = 'Users';
|
| 2101 |
+
}
|
| 2102 |
+
$wcal_all_abandoned_carts = $section = $wcal_all_registered = $wcal_all_guest = $wcal_all_visitor = "" ;
|
| 2103 |
+
|
| 2104 |
+
if ( isset( $_GET[ 'wcal_section' ] ) ) {
|
| 2105 |
+
$section = $_GET[ 'wcal_section' ];
|
| 2106 |
+
} else {
|
| 2107 |
+
$section = '';
|
| 2108 |
+
}
|
| 2109 |
+
if ( 'wcal_all_abandoned' == $section || '' == $section ) {
|
| 2110 |
+
$wcal_all_abandoned_carts = "current";
|
| 2111 |
+
}
|
| 2112 |
+
|
| 2113 |
+
if ( 'wcal_all_registered' == $section ) {
|
| 2114 |
+
$wcal_all_registered = "current";
|
| 2115 |
+
$wcal_all_abandoned_carts = "";
|
| 2116 |
+
}
|
| 2117 |
+
if ( 'wcal_all_guest' == $section ) {
|
| 2118 |
+
$wcal_all_guest = "current";
|
| 2119 |
+
$wcal_all_abandoned_carts = "";
|
| 2120 |
+
}
|
| 2121 |
+
|
| 2122 |
+
if ( 'wcal_all_visitor' == $section ) {
|
| 2123 |
+
$wcal_all_visitor = "current";
|
| 2124 |
+
$wcal_all_abandoned_carts = "";
|
| 2125 |
+
}
|
| 2126 |
+
?>
|
| 2127 |
+
<ul class="subsubsub" id="wcal_recovered_orders_list">
|
| 2128 |
+
<li>
|
| 2129 |
+
<a href="admin.php?page=woocommerce_ac_page&action=listcart&wcal_section=wcal_all_abandoned" class="<?php echo $wcal_all_abandoned_carts; ?>"><?php _e( "All ", 'woocommerce-abandoned-cart' ) ;?> <span class = "count" > <?php echo "( $get_all_abandoned_count )" ?> </span></a>
|
| 2130 |
+
</li>
|
| 2131 |
+
|
| 2132 |
+
<?php if ( $get_registered_user_ac_count > 0 ) { ?>
|
| 2133 |
+
<li>
|
| 2134 |
+
| <a href="admin.php?page=woocommerce_ac_page&action=listcart&wcal_section=wcal_all_registered" class="<?php echo $wcal_all_registered; ?>"><?php printf( __( 'Registered %s', 'woocommerce-abandoned-cart' ), $wcal_user_reg_text ); ?> <span class = "count" > <?php echo "( $get_registered_user_ac_count )" ?> </span></a>
|
| 2135 |
+
</li>
|
| 2136 |
+
<?php } ?>
|
| 2137 |
+
|
| 2138 |
+
<?php if ( $get_guest_user_ac_count > 0 ) { ?>
|
| 2139 |
+
<li>
|
| 2140 |
+
| <a href="admin.php?page=woocommerce_ac_page&action=listcart&wcal_section=wcal_all_guest" class="<?php echo $wcal_all_guest; ?>"><?php printf( __( 'Guest %s', 'woocommerce-abandoned-cart' ), $wcal_user_gus_text ); ?> <span class = "count" > <?php echo "( $get_guest_user_ac_count )" ?> </span></a>
|
| 2141 |
+
</li>
|
| 2142 |
+
<?php } ?>
|
| 2143 |
+
|
| 2144 |
+
<?php if ( $get_visitor_user_ac_count > 0 ) { ?>
|
| 2145 |
+
<li>
|
| 2146 |
+
| <a href="admin.php?page=woocommerce_ac_page&action=listcart&wcal_section=wcal_all_visitor" class="<?php echo $wcal_all_visitor; ?>"><?php _e( "Carts without Customer Details", 'woocommerce-abandoned-cart' ); ?> <span class = "count" > <?php echo "( $get_visitor_user_ac_count )" ?> </span></a>
|
| 2147 |
+
</li>
|
| 2148 |
+
<?php } ?>
|
| 2149 |
+
</ul>
|
| 2150 |
+
|
| 2151 |
+
<?php
|
| 2152 |
+
global $wpdb;
|
| 2153 |
+
include_once( 'includes/classes/class-wcal-abandoned-orders-table.php' );
|
| 2154 |
+
$wcal_abandoned_order_list = new WCAL_Abandoned_Orders_Table();
|
| 2155 |
+
$wcal_abandoned_order_list->wcal_abandoned_order_prepare_items();
|
| 2156 |
+
?>
|
| 2157 |
+
<div class="wrap">
|
| 2158 |
+
<form id="wcal-abandoned-orders" method="get" >
|
| 2159 |
+
<input type="hidden" name="page" value="woocommerce_ac_page" />
|
| 2160 |
+
<input type="hidden" name="action" value="listcart" />
|
| 2161 |
+
<?php $wcal_abandoned_order_list->display(); ?>
|
| 2162 |
+
</form>
|
| 2163 |
+
</div>
|
| 2164 |
+
<?php
|
| 2165 |
+
} elseif ( ( 'emailtemplates' == $action && ( 'edittemplate' != $mode && 'addnewtemplate' != $mode ) || '' == $action || '-1' == $action || '-1' == $action_two ) ) {
|
| 2166 |
+
?>
|
| 2167 |
+
<p> <?php _e( 'Add email templates at different intervals to maximize the possibility of recovering your abandoned carts.', 'woocommerce-abandoned-cart' );?> </p>
|
| 2168 |
+
<?php
|
| 2169 |
+
// Save the field values
|
| 2170 |
+
$insert_template_successfuly = $update_template_successfuly = '';
|
| 2171 |
+
if ( isset( $_POST['ac_settings_frm'] ) && 'save' == $_POST['ac_settings_frm'] ) {
|
| 2172 |
+
$woocommerce_ac_email_subject = trim( htmlspecialchars( $_POST['woocommerce_ac_email_subject'] ), ENT_QUOTES );
|
| 2173 |
+
$woocommerce_ac_email_body = trim( $_POST['woocommerce_ac_email_body'] );
|
| 2174 |
+
$woocommerce_ac_template_name = trim( $_POST['woocommerce_ac_template_name'] );
|
| 2175 |
+
$woocommerce_ac_email_header = stripslashes( trim( htmlspecialchars( $_POST['wcal_wc_email_header'] ), ENT_QUOTES ) );
|
| 2176 |
+
|
| 2177 |
+
$email_frequency = trim( $_POST['email_frequency'] );
|
| 2178 |
+
$day_or_hour = trim( $_POST['day_or_hour'] );
|
| 2179 |
+
$is_wc_template = ( empty( $_POST['is_wc_template'] ) ) ? '0' : '1';
|
| 2180 |
+
$default_value = 0 ;
|
| 2181 |
+
|
| 2182 |
+
$query = "INSERT INTO `".$wpdb->prefix."ac_email_templates_lite`
|
| 2183 |
+
(subject, body, frequency, day_or_hour, template_name, is_wc_template, default_template, wc_email_header )
|
| 2184 |
+
VALUES ( %s, %s, %d, %s, %s, %s, %d, %s )";
|
| 2185 |
+
|
| 2186 |
+
$insert_template_successfuly = $wpdb->query( $wpdb->prepare( $query,
|
| 2187 |
+
$woocommerce_ac_email_subject,
|
| 2188 |
+
$woocommerce_ac_email_body,
|
| 2189 |
+
$email_frequency,
|
| 2190 |
+
$day_or_hour,
|
| 2191 |
+
$woocommerce_ac_template_name,
|
| 2192 |
+
$is_wc_template,
|
| 2193 |
+
$default_value,
|
| 2194 |
+
$woocommerce_ac_email_header )
|
| 2195 |
+
);
|
| 2196 |
+
}
|
| 2197 |
+
|
| 2198 |
+
if ( isset( $_POST['ac_settings_frm'] ) && 'update' == $_POST['ac_settings_frm'] ) {
|
| 2199 |
+
|
| 2200 |
+
$updated_is_active = '0';
|
| 2201 |
+
|
| 2202 |
+
$email_frequency = trim( $_POST['email_frequency'] );
|
| 2203 |
+
$day_or_hour = trim( $_POST['day_or_hour'] );
|
| 2204 |
+
$is_wc_template = ( empty( $_POST['is_wc_template'] ) ) ? '0' : '1';
|
| 2205 |
+
|
| 2206 |
+
$woocommerce_ac_email_subject = trim( htmlspecialchars( $_POST['woocommerce_ac_email_subject'] ), ENT_QUOTES );
|
| 2207 |
+
$woocommerce_ac_email_body = trim( $_POST['woocommerce_ac_email_body'] );
|
| 2208 |
+
$woocommerce_ac_template_name = trim( $_POST['woocommerce_ac_template_name'] );
|
| 2209 |
+
$woocommerce_ac_email_header = stripslashes( trim( htmlspecialchars( $_POST['wcal_wc_email_header'] ), ENT_QUOTES ) );
|
| 2210 |
+
$id = trim( $_POST['id'] );
|
| 2211 |
+
|
| 2212 |
+
$check_query = "SELECT * FROM `".$wpdb->prefix."ac_email_templates_lite`
|
| 2213 |
+
WHERE id = %d ";
|
| 2214 |
+
$check_results = $wpdb->get_results( $wpdb->prepare( $check_query, $id ) );
|
| 2215 |
+
$default_value = '';
|
| 2216 |
+
|
| 2217 |
+
if ( count( $check_results ) > 0 ) {
|
| 2218 |
+
if ( isset( $check_results[0]->default_template ) && $check_results[0]->default_template == '1' ) {
|
| 2219 |
+
$default_value = '1';
|
| 2220 |
+
}
|
| 2221 |
+
}
|
| 2222 |
+
|
| 2223 |
+
$query_update_latest = "UPDATE `".$wpdb->prefix."ac_email_templates_lite`
|
| 2224 |
+
SET
|
| 2225 |
+
subject = %s,
|
| 2226 |
+
body = %s,
|
| 2227 |
+
frequency = %d,
|
| 2228 |
+
day_or_hour = %s,
|
| 2229 |
+
template_name = %s,
|
| 2230 |
+
is_wc_template = %s,
|
| 2231 |
+
default_template = %d,
|
| 2232 |
+
wc_email_header = %s
|
| 2233 |
+
WHERE id = %d ";
|
| 2234 |
+
|
| 2235 |
+
$update_template_successfuly = $wpdb->query( $wpdb->prepare( $query_update_latest,
|
| 2236 |
+
$woocommerce_ac_email_subject,
|
| 2237 |
+
$woocommerce_ac_email_body,
|
| 2238 |
+
$email_frequency,
|
| 2239 |
+
$day_or_hour,
|
| 2240 |
+
$woocommerce_ac_template_name,
|
| 2241 |
+
$is_wc_template,
|
| 2242 |
+
$default_value,
|
| 2243 |
+
$woocommerce_ac_email_header,
|
| 2244 |
+
$id )
|
| 2245 |
+
);
|
| 2246 |
+
|
| 2247 |
+
}
|
| 2248 |
+
|
| 2249 |
+
if ( 'emailtemplates' == $action && 'removetemplate' == $mode ) {
|
| 2250 |
+
$id_remove = $_GET['id'];
|
| 2251 |
+
$query_remove = "DELETE FROM `".$wpdb->prefix."ac_email_templates_lite` WHERE id= %d ";
|
| 2252 |
+
$wpdb->query( $wpdb->prepare( $query_remove, $id_remove ) );
|
| 2253 |
+
}
|
| 2254 |
+
|
| 2255 |
+
if ( 'emailtemplates' == $action && 'activate_template' == $mode ) {
|
| 2256 |
+
$template_id = $_GET['id'];
|
| 2257 |
+
$current_template_status = $_GET['active_state'];
|
| 2258 |
+
|
| 2259 |
+
if ( "1" == $current_template_status ) {
|
| 2260 |
+
$active = "0";
|
| 2261 |
+
} else {
|
| 2262 |
+
$active = "1";
|
| 2263 |
+
|
| 2264 |
+
$query_update = "SELECT * FROM `".$wpdb->prefix."ac_email_templates_lite` WHERE id ='" . $template_id . "'";
|
| 2265 |
+
$get_selected_template_result = $wpdb->get_results( $query_update );
|
| 2266 |
+
|
| 2267 |
+
$email_frequncy = $get_selected_template_result[0]->frequency;
|
| 2268 |
+
$email_day_or_hour = $get_selected_template_result[0]->day_or_hour;
|
| 2269 |
+
|
| 2270 |
+
$query_update = "UPDATE `".$wpdb->prefix."ac_email_templates_lite` SET is_active='0' WHERE frequency='" . $email_frequncy . "' AND day_or_hour='" . $email_day_or_hour . "' ";
|
| 2271 |
+
$wcap_updated = $wpdb->query( $query_update );
|
| 2272 |
+
}
|
| 2273 |
+
|
| 2274 |
+
$query_update = "UPDATE `" . $wpdb->prefix . "ac_email_templates_lite`
|
| 2275 |
+
SET
|
| 2276 |
+
is_active = '" . $active . "'
|
| 2277 |
+
WHERE id = '" . $template_id . "' ";
|
| 2278 |
+
$wpdb->query( $query_update );
|
| 2279 |
+
|
| 2280 |
+
wp_safe_redirect( admin_url( '/admin.php?page=woocommerce_ac_page&action=emailtemplates' ) );
|
| 2281 |
+
}
|
| 2282 |
+
|
| 2283 |
+
if ( isset( $_POST['ac_settings_frm'] ) && 'save' == $_POST['ac_settings_frm'] && ( isset( $insert_template_successfuly ) && $insert_template_successfuly != '' ) ) { ?>
|
| 2284 |
+
<div id="message" class="updated fade">
|
| 2285 |
+
<p>
|
| 2286 |
+
<strong>
|
| 2287 |
+
<?php _e( 'The Email Template has been successfully added. In order to start sending this email to your customers, please activate it.', 'woocommerce-abandoned-cart' ); ?>
|
| 2288 |
+
</strong>
|
| 2289 |
+
</p>
|
| 2290 |
+
</div>
|
| 2291 |
+
<?php } else if ( isset( $_POST['ac_settings_frm'] ) && 'save' == $_POST['ac_settings_frm'] && ( isset( $insert_template_successfuly ) && '' == $insert_template_successfuly ) ) {
|
| 2292 |
+
?>
|
| 2293 |
+
<div id="message" class="error fade">
|
| 2294 |
+
<p>
|
| 2295 |
+
<strong>
|
| 2296 |
+
<?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-abandoned-cart' ); ?>
|
| 2297 |
+
</strong>
|
| 2298 |
+
</p>
|
| 2299 |
+
</div>
|
| 2300 |
+
<?php
|
| 2301 |
+
}
|
| 2302 |
+
|
| 2303 |
+
if ( isset( $_POST['ac_settings_frm'] ) && 'update' == $_POST['ac_settings_frm'] && isset( $update_template_successfuly ) && $update_template_successfuly !== false ) { ?>
|
| 2304 |
+
<div id="message" class="updated fade">
|
| 2305 |
+
<p>
|
| 2306 |
+
<strong>
|
| 2307 |
+
<?php _e( 'The Email Template has been successfully updated.', 'woocommerce-abandoned-cart' ); ?>
|
| 2308 |
+
</strong>
|
| 2309 |
+
</p>
|
| 2310 |
+
</div>
|
| 2311 |
+
<?php } else if ( isset( $_POST['ac_settings_frm'] ) && $_POST['ac_settings_frm'] == 'update' && isset( $update_template_successfuly) && $update_template_successfuly === false ){
|
| 2312 |
+
?>
|
| 2313 |
+
<div id="message" class="error fade">
|
| 2314 |
+
<p>
|
| 2315 |
+
<strong>
|
| 2316 |
+
<?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-abandoned-cart' ); ?>
|
| 2317 |
+
</strong>
|
| 2318 |
+
</p>
|
| 2319 |
+
</div>
|
| 2320 |
+
<?php
|
| 2321 |
+
}
|
| 2322 |
+
?>
|
| 2323 |
+
<div class="tablenav">
|
| 2324 |
+
<p style="float:left;">
|
| 2325 |
+
<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-abandoned-cart' ); ?>
|
| 2326 |
+
</a>
|
| 2327 |
+
</p>
|
| 2328 |
+
|
| 2329 |
+
<?php
|
| 2330 |
+
/* From here you can do whatever you want with the data from the $result link. */
|
| 2331 |
+
include_once('includes/classes/class-wcal-templates-table.php');
|
| 2332 |
+
$wcal_template_list = new WCAL_Templates_Table();
|
| 2333 |
+
$wcal_template_list->wcal_templates_prepare_items();
|
| 2334 |
+
?>
|
| 2335 |
+
<div class="wrap">
|
| 2336 |
+
<form id="wcal-abandoned-templates" method="get" >
|
| 2337 |
+
<input type="hidden" name="page" value="woocommerce_ac_page" />
|
| 2338 |
+
<input type="hidden" name="action" value="emailtemplates" />
|
| 2339 |
+
<?php $wcal_template_list->display(); ?>
|
| 2340 |
+
</form>
|
| 2341 |
+
</div>
|
| 2342 |
+
</div>
|
| 2343 |
+
<?php
|
| 2344 |
+
} elseif ( 'stats' == $action || '' == $action ) {
|
| 2345 |
+
?>
|
| 2346 |
+
<p>
|
| 2347 |
+
<script language='javascript'>
|
| 2348 |
+
jQuery( document ).ready( function() {
|
| 2349 |
+
jQuery( '#duration_select' ).change( function() {
|
| 2350 |
+
var group_name = jQuery( '#duration_select' ).val();
|
| 2351 |
+
var today = new Date();
|
| 2352 |
+
var start_date = "";
|
| 2353 |
+
var end_date = "";
|
| 2354 |
+
if ( group_name == "yesterday" ) {
|
| 2355 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 1 );
|
| 2356 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 1 );
|
| 2357 |
+
} else if ( group_name == "today") {
|
| 2358 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
| 2359 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
| 2360 |
+
} else if ( group_name == "last_seven" ) {
|
| 2361 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 7 );
|
| 2362 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
| 2363 |
+
} else if ( group_name == "last_fifteen" ) {
|
| 2364 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 15 );
|
| 2365 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
| 2366 |
+
} else if ( group_name == "last_thirty" ) {
|
| 2367 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 30 );
|
| 2368 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
| 2369 |
+
} else if ( group_name == "last_ninety" ) {
|
| 2370 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 90 );
|
| 2371 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
| 2372 |
+
} else if ( group_name == "last_year_days" ) {
|
| 2373 |
+
start_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() - 365 );
|
| 2374 |
+
end_date = new Date( today.getFullYear(), today.getMonth(), today.getDate() );
|
| 2375 |
+
}
|
| 2376 |
+
|
| 2377 |
+
var monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
|
| 2378 |
+
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
| 2379 |
+
|
| 2380 |
+
var start_date_value = start_date.getDate() + " " + monthNames[start_date.getMonth()] + " " + start_date.getFullYear();
|
| 2381 |
+
var end_date_value = end_date.getDate() + " " + monthNames[end_date.getMonth()] + " " + end_date.getFullYear();
|
| 2382 |
+
|
| 2383 |
+
jQuery( '#start_date' ).val( start_date_value );
|
| 2384 |
+
jQuery( '#end_date' ).val( end_date_value );
|
| 2385 |
+
} );
|
| 2386 |
+
});
|
| 2387 |
+
</script>
|
| 2388 |
+
<?php
|
| 2389 |
+
|
| 2390 |
+
if ( isset( $_POST['duration_select'] ) ){
|
| 2391 |
+
$duration_range = $_POST['duration_select'];
|
| 2392 |
+
} else {
|
| 2393 |
+
$duration_range = "";
|
| 2394 |
+
}
|
| 2395 |
+
if ( '' == $duration_range ) {
|
| 2396 |
+
if ( isset( $_GET['duration_select'] ) ){
|
| 2397 |
+
$duration_range = $_GET['duration_select'];
|
| 2398 |
+
}
|
| 2399 |
+
}
|
| 2400 |
+
if ( '' == $duration_range ) $duration_range = "last_seven";
|
| 2401 |
+
|
| 2402 |
+
_e( 'The Report below shows how many Abandoned Carts we were able to recover for you by sending automatic emails to encourage shoppers.', 'woocommerce-abandoned-cart');
|
| 2403 |
+
?>
|
| 2404 |
+
<div id="recovered_stats" class="postbox" style="display:block">
|
| 2405 |
+
<div class="inside">
|
| 2406 |
+
<form method="post" action="admin.php?page=woocommerce_ac_page&action=stats" id="ac_stats">
|
| 2407 |
+
<select id="duration_select" name="duration_select" >
|
| 2408 |
+
<?php
|
| 2409 |
+
foreach ( $this->duration_range_select as $key => $value ) {
|
| 2410 |
+
$sel = "";
|
| 2411 |
+
if ( $key == $duration_range ) {
|
| 2412 |
+
$sel = " selected ";
|
| 2413 |
+
}
|
| 2414 |
+
echo"<option value='$key' $sel> $value </option>";
|
| 2415 |
+
}
|
| 2416 |
+
$date_sett = $this->start_end_dates[ $duration_range ];
|
| 2417 |
+
?>
|
| 2418 |
+
</select>
|
| 2419 |
+
<script type="text/javascript">
|
| 2420 |
+
jQuery( document ).ready( function()
|
| 2421 |
+
{
|
| 2422 |
+
var formats = ["d.m.y", "d M yy","MM d, yy"];
|
| 2423 |
+
jQuery( "#start_date" ).datepicker( { dateFormat: formats[1] } );
|
| 2424 |
+
});
|
| 2425 |
+
|
| 2426 |
+
jQuery( document ).ready( function()
|
| 2427 |
+
{
|
| 2428 |
+
var formats = ["d.m.y", "d M yy","MM d, yy"];
|
| 2429 |
+
jQuery( "#end_date" ).datepicker( { dateFormat: formats[1] } );
|
| 2430 |
+
});
|
| 2431 |
+
</script>
|
| 2432 |
+
<?php
|
| 2433 |
+
include_once('includes/classes/class-wcal-recover-orders-table.php');
|
| 2434 |
+
$wcal_recover_orders_list = new WCAL_Recover_Orders_Table();
|
| 2435 |
+
$wcal_recover_orders_list->wcal_recovered_orders_prepare_items();
|
| 2436 |
+
|
| 2437 |
+
if ( isset( $_POST['start_date'] ) ) $start_date_range = $_POST['start_date'];
|
| 2438 |
+
else $start_date_range = "";
|
| 2439 |
+
|
| 2440 |
+
if ( $start_date_range == "" ) {
|
| 2441 |
+
$start_date_range = $date_sett['start_date'];
|
| 2442 |
+
}
|
| 2443 |
+
|
| 2444 |
+
if ( isset( $_POST['end_date'] ) ) $end_date_range = $_POST['end_date'];
|
| 2445 |
+
else $end_date_range = "";
|
| 2446 |
+
|
| 2447 |
+
if ( $end_date_range == "" ) {
|
| 2448 |
+
$end_date_range = $date_sett['end_date'];
|
| 2449 |
+
}
|
| 2450 |
+
?>
|
| 2451 |
+
<label class="start_label" for="start_day"> <?php _e( 'Start Date:', 'woocommerce-abandoned-cart' ); ?> </label>
|
| 2452 |
+
<input type="text" id="start_date" name="start_date" readonly="readonly" value="<?php echo $start_date_range; ?>"/>
|
| 2453 |
+
<label class="end_label" for="end_day"> <?php _e( 'End Date:', 'woocommerce-abandoned-cart' ); ?> </label>
|
| 2454 |
+
<input type="text" id="end_date" name="end_date" readonly="readonly" value="<?php echo $end_date_range; ?>"/>
|
| 2455 |
+
<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( 'Go', 'woocommerce-abandoned-cart' ); ?>" />
|
| 2456 |
+
</form>
|
| 2457 |
+
</div>
|
| 2458 |
+
</div>
|
| 2459 |
+
<div id="recovered_stats" class="postbox" style="display:block">
|
| 2460 |
+
<div class="inside" >
|
| 2461 |
+
<?php
|
| 2462 |
+
$count = $wcal_recover_orders_list->total_abandoned_cart_count;
|
| 2463 |
+
$total_of_all_order = $wcal_recover_orders_list->total_order_amount;
|
| 2464 |
+
$recovered_item = $wcal_recover_orders_list->recovered_item;
|
| 2465 |
+
$recovered_total = wc_price( $wcal_recover_orders_list->total_recover_amount );
|
| 2466 |
+
?>
|
| 2467 |
+
<p style="font-size: 15px;">
|
| 2468 |
+
<?php
|
| 2469 |
+
printf( __( 'During the selected range <strong>%d</strong> carts totaling <strong>%s</strong> were abandoned. We were able to recover <strong>%d</strong> of them, which led to an extra <strong>%s</strong>', 'woocommerce-abandoned-cart' ), $count, $total_of_all_order, $recovered_item, $recovered_total );
|
| 2470 |
+
?>
|
| 2471 |
+
</p>
|
| 2472 |
+
</div>
|
| 2473 |
+
</div>
|
| 2474 |
+
<div class="wrap">
|
| 2475 |
+
<form id="wcal-recover-orders" method="get" >
|
| 2476 |
+
<input type="hidden" name="page" value="woocommerce_ac_page" />
|
| 2477 |
+
<input type="hidden" name="action" value="stats" />
|
| 2478 |
+
<?php $wcal_recover_orders_list->display(); ?>
|
| 2479 |
+
</form>
|
| 2480 |
+
</div>
|
| 2481 |
+
<?php
|
| 2482 |
+
} elseif ( 'orderdetails' == $action ) {
|
| 2483 |
+
global $woocommerce;
|
| 2484 |
+
$ac_order_id = $_GET['id'];
|
| 2485 |
+
?>
|
| 2486 |
+
<p> </p>
|
| 2487 |
+
<div id="ac_order_details" class="postbox" style="display:block">
|
| 2488 |
+
<h3 class="details-title"> <p> <?php printf( __( 'Abandoned Order #%s Details', 'woocommerce-abandoned-cart' ), $ac_order_id); ?> </p> </h3>
|
| 2489 |
+
<div class="inside">
|
| 2490 |
+
<table cellpadding="0" cellspacing="0" class="wp-list-table widefat fixed posts">
|
| 2491 |
+
<tr>
|
| 2492 |
+
<th> <?php _e( 'Item', 'woocommerce-abandoned-cart' ); ?> </th>
|
| 2493 |
+
<th> <?php _e( 'Name', 'woocommerce-abandoned-cart' ); ?> </th>
|
| 2494 |
+
<th> <?php _e( 'Quantity', 'woocommerce-abandoned-cart' ); ?> </th>
|
| 2495 |
+
<th> <?php _e( 'Line Subtotal', 'woocommerce-abandoned-cart' ); ?> </th>
|
| 2496 |
+
<th> <?php _e( 'Line Total', 'woocommerce-abandoned-cart' ); ?> </th>
|
| 2497 |
+
</tr>
|
| 2498 |
+
<?php
|
| 2499 |
+
$query = "SELECT * FROM `".$wpdb->prefix."ac_abandoned_cart_history_lite` WHERE id = %d ";
|
| 2500 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query,$_GET['id'] ) );
|
| 2501 |
+
|
| 2502 |
+
$shipping_charges = 0;
|
| 2503 |
+
$currency_symbol = get_woocommerce_currency_symbol();
|
| 2504 |
+
$number_decimal = wc_get_price_decimals();
|
| 2505 |
+
if ( $results[0]->user_type == "GUEST" && "0" != $results[0]->user_id ) {
|
| 2506 |
+
$query_guest = "SELECT * FROM `".$wpdb->prefix."ac_guest_abandoned_cart_history_lite` WHERE id = %d";
|
| 2507 |
+
$results_guest = $wpdb->get_results( $wpdb->prepare( $query_guest, $results[0]->user_id ) );
|
| 2508 |
+
$user_email = $user_first_name = $user_last_name = $user_billing_postcode = $user_shipping_postcode = '';
|
| 2509 |
+
$shipping_charges = '';
|
| 2510 |
+
if ( count( $results_guest ) > 0 ) {
|
| 2511 |
+
$user_email = $results_guest[0]->email_id;
|
| 2512 |
+
$user_first_name = $results_guest[0]->billing_first_name;
|
| 2513 |
+
$user_last_name = $results_guest[0]->billing_last_name;
|
| 2514 |
+
$user_billing_postcode = $results_guest[0]->billing_zipcode;
|
| 2515 |
+
$user_shipping_postcode = $results_guest[0]->shipping_zipcode;
|
| 2516 |
+
$shipping_charges = $results_guest[0]->shipping_charges;
|
| 2517 |
+
}
|
| 2518 |
+
$user_billing_company = $user_billing_address_1 = $user_billing_address_2 = $user_billing_city = $user_billing_state = $user_billing_country = $user_billing_phone = "";
|
| 2519 |
+
$user_shipping_company = $user_shipping_address_1 = $user_shipping_address_2 = $user_shipping_city = $user_shipping_state = $user_shipping_country = "";
|
| 2520 |
+
} else if ( $results[0]->user_type == "GUEST" && $results[0]->user_id == "0" ) {
|
| 2521 |
+
$user_email = '';
|
| 2522 |
+
$user_first_name = "Visitor";
|
| 2523 |
+
$user_last_name = "";
|
| 2524 |
+
$user_billing_postcode = '';
|
| 2525 |
+
$user_shipping_postcode = '';
|
| 2526 |
+
$shipping_charges = '';
|
| 2527 |
+
$user_billing_phone = '';
|
| 2528 |
+
$user_billing_company = $user_billing_address_1 = $user_billing_address_2 = $user_billing_city = $user_billing_state = $user_billing_country = "";
|
| 2529 |
+
$user_shipping_company = $user_shipping_address_1 = $user_shipping_address_2 = $user_shipping_city = $user_shipping_state = $user_shipping_country = "";
|
| 2530 |
+
} else {
|
| 2531 |
+
$user_id = $results[0]->user_id;
|
| 2532 |
+
if ( isset( $results[0]->user_login ) ) {
|
| 2533 |
+
$user_login = $results[0]->user_login;
|
| 2534 |
+
}
|
| 2535 |
+
$user_email = get_user_meta( $results[0]->user_id, 'billing_email', true );
|
| 2536 |
+
if ( '' == $user_email ) {
|
| 2537 |
+
$user_data = get_userdata( $results[0]->user_id );
|
| 2538 |
+
if ( isset( $user_data->user_email ) ) {
|
| 2539 |
+
$user_email = $user_data->user_email;
|
| 2540 |
+
} else {
|
| 2541 |
+
$user_email = '';
|
| 2542 |
+
}
|
| 2543 |
+
}
|
| 2544 |
+
|
| 2545 |
+
$user_first_name = "";
|
| 2546 |
+
$user_first_name_temp = get_user_meta( $user_id, 'billing_first_name', true );
|
| 2547 |
+
if ( isset( $user_first_name_temp ) && '' == $user_first_name_temp ) {
|
| 2548 |
+
$user_data = get_userdata( $user_id );
|
| 2549 |
+
if ( isset( $user_data->first_name ) ) {
|
| 2550 |
+
$user_first_name = $user_data->first_name;
|
| 2551 |
+
} else {
|
| 2552 |
+
$user_first_name = '';
|
| 2553 |
+
}
|
| 2554 |
+
} else {
|
| 2555 |
+
$user_first_name = $user_first_name_temp;
|
| 2556 |
+
}
|
| 2557 |
+
$user_last_name = "";
|
| 2558 |
+
$user_last_name_temp = get_user_meta( $user_id, 'billing_last_name', true );
|
| 2559 |
+
if ( isset( $user_last_name_temp ) && "" == $user_last_name_temp ) {
|
| 2560 |
+
$user_data = get_userdata( $user_id );
|
| 2561 |
+
if ( isset( $user_data->last_name ) ) {
|
| 2562 |
+
$user_last_name = $user_data->last_name;
|
| 2563 |
+
} else {
|
| 2564 |
+
$user_last_name = '';
|
| 2565 |
+
}
|
| 2566 |
+
} else {
|
| 2567 |
+
$user_last_name = $user_last_name_temp;
|
| 2568 |
+
}
|
| 2569 |
+
$user_billing_first_name = get_user_meta( $results[0]->user_id, 'billing_first_name' );
|
| 2570 |
+
$user_billing_last_name = get_user_meta( $results[0]->user_id, 'billing_last_name' );
|
| 2571 |
+
|
| 2572 |
+
$user_billing_details = wcal_common::wcal_get_billing_details( $results[0]->user_id );
|
| 2573 |
+
|
| 2574 |
+
$user_billing_company = $user_billing_details[ 'billing_company' ];
|
| 2575 |
+
$user_billing_address_1 = $user_billing_details[ 'billing_address_1' ];
|
| 2576 |
+
$user_billing_address_2 = $user_billing_details[ 'billing_address_2' ];
|
| 2577 |
+
$user_billing_city = $user_billing_details[ 'billing_city' ];
|
| 2578 |
+
$user_billing_postcode = $user_billing_details[ 'billing_postcode' ] ;
|
| 2579 |
+
$user_billing_country = $user_billing_details[ 'billing_country' ];
|
| 2580 |
+
$user_billing_state = $user_billing_details[ 'billing_state' ];
|
| 2581 |
+
|
| 2582 |
+
$user_billing_phone_temp = get_user_meta( $results[0]->user_id, 'billing_phone' );
|
| 2583 |
+
if ( isset( $user_billing_phone_temp[0] ) ) {
|
| 2584 |
+
$user_billing_phone = $user_billing_phone_temp[0];
|
| 2585 |
+
} else {
|
| 2586 |
+
$user_billing_phone = "";
|
| 2587 |
+
}
|
| 2588 |
+
$user_shipping_first_name = get_user_meta( $results[0]->user_id, 'shipping_first_name' );
|
| 2589 |
+
$user_shipping_last_name = get_user_meta( $results[0]->user_id, 'shipping_last_name' );
|
| 2590 |
+
$user_shipping_company_temp = get_user_meta( $results[0]->user_id, 'shipping_company' );
|
| 2591 |
+
if ( isset( $user_shipping_company_temp[0] ) ) {
|
| 2592 |
+
$user_shipping_company = $user_shipping_company_temp[0];
|
| 2593 |
+
} else {
|
| 2594 |
+
$user_shipping_company = "";
|
| 2595 |
+
}
|
| 2596 |
+
$user_shipping_address_1_temp = get_user_meta( $results[0]->user_id, 'shipping_address_1' );
|
| 2597 |
+
if ( isset( $user_shipping_address_1_temp[0] ) ) {
|
| 2598 |
+
$user_shipping_address_1 = $user_shipping_address_1_temp[0];
|
| 2599 |
+
} else {
|
| 2600 |
+
$user_shipping_address_1 = "";
|
| 2601 |
+
}
|
| 2602 |
+
$user_shipping_address_2_temp = get_user_meta( $results[0]->user_id, 'shipping_address_2' );
|
| 2603 |
+
if ( isset( $user_shipping_address_2_temp[0] ) ) {
|
| 2604 |
+
$user_shipping_address_2 = $user_shipping_address_2_temp[0];
|
| 2605 |
+
} else {
|
| 2606 |
+
$user_shipping_address_2 = "";
|
| 2607 |
+
}
|
| 2608 |
+
$user_shipping_city_temp = get_user_meta( $results[0]->user_id, 'shipping_city' );
|
| 2609 |
+
if ( isset( $user_shipping_city_temp[0] ) ) {
|
| 2610 |
+
$user_shipping_city = $user_shipping_city_temp[0];
|
| 2611 |
+
} else {
|
| 2612 |
+
$user_shipping_city = "";
|
| 2613 |
+
}
|
| 2614 |
+
$user_shipping_postcode_temp = get_user_meta( $results[0]->user_id, 'shipping_postcode' );
|
| 2615 |
+
if ( isset( $user_shipping_postcode_temp[0] ) ) {
|
| 2616 |
+
$user_shipping_postcode = $user_shipping_postcode_temp[0];
|
| 2617 |
+
} else {
|
| 2618 |
+
$user_shipping_postcode = "";
|
| 2619 |
+
}
|
| 2620 |
+
$user_shipping_country_temp = get_user_meta( $results[0]->user_id, 'shipping_country' );
|
| 2621 |
+
$user_shipping_country = "";
|
| 2622 |
+
if ( isset( $user_shipping_country_temp[0] ) ) {
|
| 2623 |
+
$user_shipping_country = $user_shipping_country_temp[0];
|
| 2624 |
+
if ( isset( $woocommerce->countries->countries[ $user_shipping_country ] ) ) {
|
| 2625 |
+
$user_shipping_country = $woocommerce->countries->countries[ $user_shipping_country ];
|
| 2626 |
+
}else {
|
| 2627 |
+
$user_shipping_country = "";
|
| 2628 |
+
}
|
| 2629 |
+
}
|
| 2630 |
+
$user_shipping_state_temp = get_user_meta( $results[0]->user_id, 'shipping_state' );
|
| 2631 |
+
$user_shipping_state = "";
|
| 2632 |
+
if ( isset( $user_shipping_state_temp[0] ) ) {
|
| 2633 |
+
$user_shipping_state = $user_shipping_state_temp[0];
|
| 2634 |
+
if ( isset( $woocommerce->countries->states[ $user_shipping_country_temp[0] ][ $user_shipping_state ] ) ) {
|
| 2635 |
+
# code...
|
| 2636 |
+
$user_shipping_state = $woocommerce->countries->states[ $user_shipping_country_temp[0] ][ $user_shipping_state ];
|
| 2637 |
+
}
|
| 2638 |
+
}
|
| 2639 |
+
}
|
| 2640 |
+
|
| 2641 |
+
$cart_details = array();
|
| 2642 |
+
$cart_info = json_decode( $results[0]->abandoned_cart_info );
|
| 2643 |
+
$cart_details = (array) $cart_info->cart;
|
| 2644 |
+
$item_subtotal = $item_total = 0;
|
| 2645 |
+
|
| 2646 |
+
if ( is_array ( $cart_details ) && count( $cart_details ) > 0 ) {
|
| 2647 |
+
foreach ( $cart_details as $k => $v ) {
|
| 2648 |
+
|
| 2649 |
+
$item_details = wcal_common::wcal_get_cart_details( $v );
|
| 2650 |
+
|
| 2651 |
+
$product_id = $v->product_id;
|
| 2652 |
+
$product = wc_get_product( $product_id );
|
| 2653 |
+
if( ! $product ) { // product not found, exclude it from the cart display
|
| 2654 |
+
continue;
|
| 2655 |
+
}
|
| 2656 |
+
$prod_image = $product->get_image(array(200, 200));
|
| 2657 |
+
$product_page_url = get_permalink( $product_id );
|
| 2658 |
+
$product_name = $item_details[ 'product_name' ];
|
| 2659 |
+
$item_subtotal = $item_details[ 'item_total_formatted' ];
|
| 2660 |
+
$item_total = $item_details[ 'item_total' ];
|
| 2661 |
+
$quantity_total = $item_details[ 'qty' ];
|
| 2662 |
+
|
| 2663 |
+
$qty_item_text = 'item';
|
| 2664 |
+
if ( $quantity_total > 1 ) {
|
| 2665 |
+
$qty_item_text = 'items';
|
| 2666 |
+
}
|
| 2667 |
+
?>
|
| 2668 |
+
<tr>
|
| 2669 |
+
<td> <?php echo $prod_image; ?></td>
|
| 2670 |
+
<td> <?php echo '<a href="' . $product_page_url . '"> ' . $product_name . ' </a>'; ?> </td>
|
| 2671 |
+
<td> <?php echo $quantity_total; ?></td>
|
| 2672 |
+
<td> <?php echo $item_subtotal; ?></td>
|
| 2673 |
+
<td> <?php echo $item_total; ?></td>
|
| 2674 |
+
</tr>
|
| 2675 |
+
<?php
|
| 2676 |
+
$item_subtotal = $item_total = 0;
|
| 2677 |
+
}
|
| 2678 |
+
}
|
| 2679 |
+
?>
|
| 2680 |
+
</table>
|
| 2681 |
+
</div>
|
| 2682 |
+
</div>
|
| 2683 |
+
<div id="ac_order_customer_details" class="postbox" style="display:block">
|
| 2684 |
+
<h3 class="details-title"> <p> <?php _e( 'Customer Details' , 'woocommerce-abandoned-cart' ); ?> </p> </h3>
|
| 2685 |
+
<div class="inside" style="height: 300px;" >
|
| 2686 |
+
<div id="order_data" class="panel">
|
| 2687 |
+
<div style="width:50%;float:left">
|
| 2688 |
+
<h3> <p> <?php _e( 'Billing Details' , 'woocommerce-abandoned-cart' ); ?> </p> </h3>
|
| 2689 |
+
<p> <strong> <?php _e( 'Name:' , 'woocommerce-abandoned-cart' ); ?> </strong>
|
| 2690 |
+
<?php echo $user_first_name." ".$user_last_name;?>
|
| 2691 |
+
</p>
|
| 2692 |
+
<p> <strong> <?php _e( 'Address:' , 'woocommerce-abandoned-cart' ); ?> </strong>
|
| 2693 |
+
<?php echo $user_billing_company."</br>".
|
| 2694 |
+
$user_billing_address_1."</br>".
|
| 2695 |
+
$user_billing_address_2."</br>".
|
| 2696 |
+
$user_billing_city."</br>".
|
| 2697 |
+
$user_billing_postcode."</br>".
|
| 2698 |
+
$user_billing_state."</br>".
|
| 2699 |
+
$user_billing_country."</br>";
|
| 2700 |
+
?>
|
| 2701 |
+
</p>
|
| 2702 |
+
<p> <strong> <?php _e( 'Email:', 'woocommerce-abandoned-cart' ); ?> </strong>
|
| 2703 |
+
<?php $user_mail_to = "mailto:".$user_email; ?>
|
| 2704 |
+
<a href=<?php echo $user_mail_to;?>><?php echo $user_email;?> </a>
|
| 2705 |
+
</p>
|
| 2706 |
+
<p> <strong> <?php _e( 'Phone:', 'woocommerce-abandoned-cart' ); ?> </strong>
|
| 2707 |
+
<?php echo $user_billing_phone;?>
|
| 2708 |
+
</p>
|
| 2709 |
+
</div>
|
| 2710 |
+
<div style="width:50%;float:right">
|
| 2711 |
+
<h3> <p> <?php _e( 'Shipping Details', 'woocommerce-abandoned-cart' ); ?> </p> </h3>
|
| 2712 |
+
<p> <strong> <?php _e( 'Address:', 'woocommerce-abandoned-cart' ); ?> </strong>
|
| 2713 |
+
<?php
|
| 2714 |
+
if ( $user_shipping_company == '' &&
|
| 2715 |
+
$user_shipping_address_1 == '' &&
|
| 2716 |
+
$user_shipping_address_2 == '' &&
|
| 2717 |
+
$user_shipping_city == '' &&
|
| 2718 |
+
$user_shipping_postcode == '' &&
|
| 2719 |
+
$user_shipping_state == '' &&
|
| 2720 |
+
$user_shipping_country == '') {
|
| 2721 |
+
echo "Shipping Address same as Billing Address";
|
| 2722 |
+
} else { ?>
|
| 2723 |
+
<?php echo $user_shipping_company."</br>".
|
| 2724 |
+
$user_shipping_address_1."</br>".
|
| 2725 |
+
$user_shipping_address_2."</br>".
|
| 2726 |
+
$user_shipping_city."</br>".
|
| 2727 |
+
$user_shipping_postcode."</br>".
|
| 2728 |
+
$user_shipping_state."</br>".
|
| 2729 |
+
$user_shipping_country."</br>";
|
| 2730 |
+
?>
|
| 2731 |
+
<br><br>
|
| 2732 |
+
<strong><?php _e( 'Shipping Charges', 'woocommerce-abandoned-lite' ); ?>: </strong>
|
| 2733 |
+
<?php if ( $shipping_charges != 0 ) echo $currency_symbol . $shipping_charges;?>
|
| 2734 |
+
</p>
|
| 2735 |
+
<?php }?>
|
| 2736 |
+
</div>
|
| 2737 |
+
</div>
|
| 2738 |
+
</div>
|
| 2739 |
+
</div>
|
| 2740 |
+
<?php } elseif ( $action == 'report' ) {
|
| 2741 |
+
|
| 2742 |
+
include_once('includes/classes/class-wcal-product-report-table.php');
|
| 2743 |
+
$wcal_product_report_list = new WCAL_Product_Report_Table();
|
| 2744 |
+
$wcal_product_report_list->wcal_product_report_prepare_items();
|
| 2745 |
+
?>
|
| 2746 |
+
<div class="wrap">
|
| 2747 |
+
<form id="wcal-sent-emails" method="get" >
|
| 2748 |
+
<input type="hidden" name="page" value="woocommerce_ac_page" />
|
| 2749 |
+
<input type="hidden" name="action" value="report" />
|
| 2750 |
+
<?php $wcal_product_report_list->display(); ?>
|
| 2751 |
+
</form>
|
| 2752 |
+
</div>
|
| 2753 |
+
<?php }
|
| 2754 |
+
}
|
| 2755 |
+
echo( "</table>" );
|
| 2756 |
+
|
| 2757 |
+
if ( isset( $_GET['action'] ) ) {
|
| 2758 |
+
$action = $_GET['action'];
|
| 2759 |
+
}
|
| 2760 |
+
if ( isset( $_GET['mode'] ) ) {
|
| 2761 |
+
$mode = $_GET['mode'];
|
| 2762 |
+
}
|
| 2763 |
+
if ( 'emailtemplates' == $action && ( 'addnewtemplate' == $mode || 'edittemplate' == $mode ) ) {
|
| 2764 |
+
if ( 'edittemplate' == $mode ) {
|
| 2765 |
+
$results = array();
|
| 2766 |
+
if ( isset( $_GET['id'] ) ) {
|
| 2767 |
+
$edit_id = $_GET['id'];
|
| 2768 |
+
$query = "SELECT wpet . * FROM `".$wpdb->prefix."ac_email_templates_lite` AS wpet WHERE id = %d ";
|
| 2769 |
+
$results = $wpdb->get_results( $wpdb->prepare( $query, $edit_id ) );
|
| 2770 |
+
}
|
| 2771 |
+
}
|
| 2772 |
+
$active_post = ( empty( $_POST['is_active'] ) ) ? '0' : '1';
|
| 2773 |
+
?>
|
| 2774 |
+
<div id="content">
|
| 2775 |
+
<form method="post" action="admin.php?page=woocommerce_ac_page&action=emailtemplates" id="ac_settings">
|
| 2776 |
+
<input type="hidden" name="mode" value="<?php echo $mode;?>" />
|
| 2777 |
+
<?php
|
| 2778 |
+
$id_by = "";
|
| 2779 |
+
if ( isset( $_GET['id'] ) ) {
|
| 2780 |
+
$id_by = $_GET['id'];
|
| 2781 |
+
}
|
| 2782 |
+
?>
|
| 2783 |
+
<input type="hidden" name="id" value="<?php echo $id_by ;?>" />
|
| 2784 |
+
<?php
|
| 2785 |
+
$button_mode = "save";
|
| 2786 |
+
$display_message = "Add Email Template";
|
| 2787 |
+
if ( 'edittemplate' == $mode ) {
|
| 2788 |
+
$button_mode = "update";
|
| 2789 |
+
$display_message = "Edit Email Template";
|
| 2790 |
+
}
|
| 2791 |
+
print'<input type="hidden" name="ac_settings_frm" value="'.$button_mode.'">';?>
|
| 2792 |
+
<div id="poststuff">
|
| 2793 |
+
<div> <!-- <div class="postbox" > -->
|
| 2794 |
+
<h3 class="hndle"><?php _e( $display_message, 'woocommerce-abandoned-cart' ); ?></h3>
|
| 2795 |
+
<div>
|
| 2796 |
+
<table class="form-table" id="addedit_template">
|
| 2797 |
+
<tr>
|
| 2798 |
+
<th>
|
| 2799 |
+
<label for="woocommerce_ac_template_name"><b><?php _e( 'Template Name:', 'woocommerce-abandoned-cart');?></b></label>
|
| 2800 |
+
</th>
|
| 2801 |
+
<td>
|
| 2802 |
+
<?php
|
| 2803 |
+
$template_name = "";
|
| 2804 |
+
if ( 'edittemplate' == $mode && count( $results ) > 0 && isset( $results[0]->template_name ) ) {
|
| 2805 |
+
$template_name = $results[0]->template_name;
|
| 2806 |
+
}
|
| 2807 |
+
print'<input type="text" name="woocommerce_ac_template_name" id="woocommerce_ac_template_name" class="regular-text" value="'.$template_name.'">';?>
|
| 2808 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter a template name for reference', 'woocommerce-abandoned-cart') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
| 2809 |
+
</td>
|
| 2810 |
+
</tr>
|
| 2811 |
+
|
| 2812 |
+
<tr>
|
| 2813 |
+
<th>
|
| 2814 |
+
<label for="woocommerce_ac_email_subject"><b><?php _e( 'Subject:', 'woocommerce-abandoned-cart' ); ?></b></label>
|
| 2815 |
+
</th>
|
| 2816 |
+
<td>
|
| 2817 |
+
<?php
|
| 2818 |
+
$subject_edit = "";
|
| 2819 |
+
if ( 'edittemplate' == $mode && count( $results ) > 0 && isset( $results[0]->subject ) ) {
|
| 2820 |
+
$subject_edit= stripslashes ( $results[0]->subject );
|
| 2821 |
+
}
|
| 2822 |
+
print'<input type="text" name="woocommerce_ac_email_subject" id="woocommerce_ac_email_subject" class="regular-text" value="'.$subject_edit.'">';?>
|
| 2823 |
+
<img class="help_tip" width="16" height="16" data-tip='<?php _e('Enter the subject that should appear in the email sent', 'woocommerce-abandoned-cart') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
| 2824 |
+
</td>
|
| 2825 |
+
</tr>
|
| 2826 |
+
|
| 2827 |
+
<tr>
|
| 2828 |
+
<th>
|
| 2829 |
+
<label for="woocommerce_ac_email_body"><b><?php _e( 'Email Body:', 'woocommerce-abandoned-cart' ); ?></b></label>
|
| 2830 |
+
</th>
|
| 2831 |
+
<td>
|
| 2832 |
+
<?php
|
| 2833 |
+
$initial_data = "";
|
| 2834 |
+
if ( 'edittemplate' == $mode && count( $results ) > 0 && isset( $results[0]->body ) ) {
|
| 2835 |
+
$initial_data = stripslashes( $results[0]->body );
|
| 2836 |
+
}
|
| 2837 |
+
|
| 2838 |
+
$initial_data = str_replace ( "My document title", "", $initial_data );
|
| 2839 |
+
wp_editor(
|
| 2840 |
+
$initial_data,
|
| 2841 |
+
'woocommerce_ac_email_body',
|
| 2842 |
+
array(
|
| 2843 |
+
'media_buttons' => true,
|
| 2844 |
+
'textarea_rows' => 15,
|
| 2845 |
+
'tabindex' => 4,
|
| 2846 |
+
'tinymce' => array(
|
| 2847 |
+
'theme_advanced_buttons1' => 'bold,italic,underline,|,bullist,numlist,blockquote,|,link,unlink,|,spellchecker,fullscreen,|,formatselect,styleselect'
|
| 2848 |
+
),
|
| 2849 |
+
)
|
| 2850 |
+
);
|
| 2851 |
+
|
| 2852 |
+
?>
|
| 2853 |
+
<?php echo stripslashes( get_option( 'woocommerce_ac_email_body' ) ); ?>
|
| 2854 |
+
<span class="description">
|
| 2855 |
+
<?php
|
| 2856 |
+
_e( 'Message to be sent in the reminder email.', 'woocommerce-abandoned-cart' );
|
| 2857 |
+
?>
|
| 2858 |
+
<img width="16" height="16" src="<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/assets/images/information.png" onClick="wcal_show_help_tips()"/>
|
| 2859 |
+
</span>
|
| 2860 |
+
<span id="help_message" style="display:none">
|
| 2861 |
+
1. You can add customer & cart information in the template using this icon <img width="20" height="20" src="<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/assets/images/ac_editor_icon.png" /> in top left of the editor.<br>
|
| 2862 |
+
2. The product information/cart contents table will be added in emails using the {{products.cart}} merge field.<br>
|
| 2863 |
+
3. Insert/Remove any of the new shortcodes that have been included for the default template.<br>
|
| 2864 |
+
4. Change the look and feel of the table by modifying the table style properties using CSS in "Text" mode. <br>
|
| 2865 |
+
5. Change the text color of the table rows by using the Toolbar of the editor. <br>
|
| 2866 |
+
|
| 2867 |
+
</span>
|
| 2868 |
+
</td>
|
| 2869 |
+
</tr>
|
| 2870 |
+
<script type="text/javascript">
|
| 2871 |
+
function wcal_show_help_tips() {
|
| 2872 |
+
if ( jQuery( '#help_message' ) . css( 'display' ) == 'none') {
|
| 2873 |
+
document.getElementById( "help_message" ).style.display = "block";
|
| 2874 |
+
}
|
| 2875 |
+
else {
|
| 2876 |
+
document.getElementById( "help_message" ) . style.display = "none";
|
| 2877 |
+
}
|
| 2878 |
+
}
|
| 2879 |
+
</script>
|
| 2880 |
+
|
| 2881 |
+
<tr>
|
| 2882 |
+
<th>
|
| 2883 |
+
<label for="is_wc_template"><b><?php _e( 'Use WooCommerce Template Style:', 'woocommerce-abandoned-cart' ); ?></b></label>
|
| 2884 |
+
</th>
|
| 2885 |
+
<td>
|
| 2886 |
+
<?php
|
| 2887 |
+
$is_wc_template = "";
|
| 2888 |
+
if ( 'edittemplate' == $mode && count( $results ) > 0 && isset( $results[0]->is_wc_template ) ) {
|
| 2889 |
+
$use_wc_template = $results[0]->is_wc_template;
|
| 2890 |
+
|
| 2891 |
+
if ( '1' == $use_wc_template ) {
|
| 2892 |
+
$is_wc_template = "checked";
|
| 2893 |
+
} else {
|
| 2894 |
+
$is_wc_template = "";
|
| 2895 |
+
}
|
| 2896 |
+
}
|
| 2897 |
+
print'<input type="checkbox" name="is_wc_template" id="is_wc_template" ' . $is_wc_template . '> </input>'; ?>
|
| 2898 |
+
<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-abandoned-cart' ) ; ?> >
|
| 2899 |
+
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-abandoned-cart' ) ; ?>>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.
|
| 2900 |
+
</td>
|
| 2901 |
+
</tr>
|
| 2902 |
+
|
| 2903 |
+
<tr>
|
| 2904 |
+
<th>
|
| 2905 |
+
<label for="wcal_wc_email_header"><b><?php _e( 'Email Template Header Text: ', 'woocommerce-abandoned-cart' ); ?></b></label>
|
| 2906 |
+
</th>
|
| 2907 |
+
<td>
|
| 2908 |
+
|
| 2909 |
+
<?php
|
| 2910 |
+
|
| 2911 |
+
$wcal_wc_email_header = "";
|
| 2912 |
+
if ( 'edittemplate' == $mode && count( $results ) > 0 && isset( $results[0]->wc_email_header ) ) {
|
| 2913 |
+
$wcal_wc_email_header = $results[0]->wc_email_header;
|
| 2914 |
+
}
|
| 2915 |
+
if ( '' == $wcal_wc_email_header ) {
|
| 2916 |
+
$wcal_wc_email_header = "Abandoned cart reminder";
|
| 2917 |
+
}
|
| 2918 |
+
print'<input type="text" name="wcal_wc_email_header" id="wcal_wc_email_header" class="regular-text" value="' . $wcal_wc_email_header . '">'; ?>
|
| 2919 |
+
<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-abandoned-cart' ) ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
| 2920 |
+
</td>
|
| 2921 |
+
</tr>
|
| 2922 |
+
|
| 2923 |
+
<tr>
|
| 2924 |
+
<th>
|
| 2925 |
+
<label for="woocommerce_ac_email_frequency"><b><?php _e( 'Send this email:', 'woocommerce-abandoned-cart' ); ?></b></label>
|
| 2926 |
+
</th>
|
| 2927 |
+
<td>
|
| 2928 |
+
<select name="email_frequency" id="email_frequency">
|
| 2929 |
+
<?php
|
| 2930 |
+
$frequency_edit = "";
|
| 2931 |
+
if ( 'edittemplate' == $mode && count( $results ) > 0 && isset( $results[0]->frequency ) ) {
|
| 2932 |
+
$frequency_edit = $results[0]->frequency;
|
| 2933 |
+
}
|
| 2934 |
+
for ( $i = 1; $i < 4; $i++ ) {
|
| 2935 |
+
printf( "<option %s value='%s'>%s</option>\n",
|
| 2936 |
+
selected( $i, $frequency_edit, false ),
|
| 2937 |
+
esc_attr( $i ),
|
| 2938 |
+
$i
|
| 2939 |
+
);
|
| 2940 |
+
}
|
| 2941 |
+
?>
|
| 2942 |
+
</select>
|
| 2943 |
+
|
| 2944 |
+
<select name="day_or_hour" id="day_or_hour">
|
| 2945 |
+
<?php
|
| 2946 |
+
$days_or_hours_edit = "";
|
| 2947 |
+
if ( 'edittemplate' == $mode && count( $results ) > 0 && isset( $results[0]->day_or_hour ) )
|
| 2948 |
+
{
|
| 2949 |
+
$days_or_hours_edit = $results[0]->day_or_hour;
|
| 2950 |
+
}
|
| 2951 |
+
$days_or_hours = array(
|
| 2952 |
+
'Days' => 'Day(s)',
|
| 2953 |
+
'Hours' => 'Hour(s)'
|
| 2954 |
+
);
|
| 2955 |
+
foreach( $days_or_hours as $k => $v )
|
| 2956 |
+
{
|
| 2957 |
+
printf( "<option %s value='%s'>%s</option>\n",
|
| 2958 |
+
selected( $k, $days_or_hours_edit, false ),
|
| 2959 |
+
esc_attr( $k ),
|
| 2960 |
+
$v
|
| 2961 |
+
);
|
| 2962 |
+
}
|
| 2963 |
+
?>
|
| 2964 |
+
</select>
|
| 2965 |
+
<span class="description">
|
| 2966 |
+
<?php _e( 'after cart is abandoned.', 'woocommerce-abandoned-cart' ); ?>
|
| 2967 |
+
</span>
|
| 2968 |
+
</td>
|
| 2969 |
+
</tr>
|
| 2970 |
+
|
| 2971 |
+
<tr>
|
| 2972 |
+
<th>
|
| 2973 |
+
<label for="woocommerce_ac_email_preview"><b><?php _e( 'Send a test email to:', 'woocommerce-abandoned-cart' ); ?></b></label>
|
| 2974 |
+
</th>
|
| 2975 |
+
<td>
|
| 2976 |
+
<input type="text" id="send_test_email" name="send_test_email" class="regular-text" >
|
| 2977 |
+
<input type="button" value="Send a test email" id="preview_email" onclick="javascript:void(0);">
|
| 2978 |
+
<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-abandoned-cart') ?>' src="<?php echo plugins_url(); ?>/woocommerce/assets/images/help.png" />
|
| 2979 |
+
<br>
|
| 2980 |
+
<img class="ajax_img" src="<?php echo plugins_url() . '/woocommerce-abandoned-cart/assets/images/ajax-loader.gif';?>" style="display:none;" />
|
| 2981 |
+
<div id="preview_email_sent_msg" style="display:none;"></div>
|
| 2982 |
+
</td>
|
| 2983 |
+
</tr>
|
| 2984 |
+
</table>
|
| 2985 |
+
</div>
|
| 2986 |
+
</div>
|
| 2987 |
+
</div>
|
| 2988 |
+
<p class="submit">
|
| 2989 |
+
<?php
|
| 2990 |
+
$button_value = __( "Save Changes", 'woocommerce-abandoned-cart' );
|
| 2991 |
+
if ( 'edittemplate' == $mode ) {
|
| 2992 |
+
$button_value = __( "Update Changes", 'woocommerce-abandoned-cart' );
|
| 2993 |
+
}
|
| 2994 |
+
?>
|
| 2995 |
+
<input type="submit" name="Submit" class="button-primary" value="<?php esc_attr_e( $button_value ); ?>" />
|
| 2996 |
+
</p>
|
| 2997 |
+
</form>
|
| 2998 |
+
</div>
|
| 2999 |
+
<?php
|
| 3000 |
+
}
|
| 3001 |
+
}
|
| 3002 |
+
|
| 3003 |
+
/**
|
| 3004 |
+
* It will add the footer text for the plugin.
|
| 3005 |
+
* @hook admin_footer_text
|
| 3006 |
+
* @param string $footer_text Text
|
| 3007 |
+
* @return string $footer_text
|
| 3008 |
+
* @since 1.0
|
| 3009 |
+
*/
|
| 3010 |
+
function wcal_admin_footer_text( $footer_text ) {
|
| 3011 |
+
|
| 3012 |
+
if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] === 'woocommerce_ac_page' ) {
|
| 3013 |
+
$footer_text = __( 'If you love <strong>Abandoned Cart Lite for WooCommerce</strong>, then please leave us a <a href="https://wordpress.org/support/plugin/woocommerce-abandoned-cart/reviews/?rate=5#new-post" target="_blank" class="ac-rating-link" data-rated="Thanks :)">★★★★★</a> rating. Thank you in advance. :)', 'woocommerce-abandoned-cart' );
|
| 3014 |
+
wc_enqueue_js( "
|
| 3015 |
+
jQuery( 'a.ac-rating-link' ).click( function() {
|
| 3016 |
+
jQuery( this ).parent().text( jQuery( this ).data( 'rated' ) );
|
| 3017 |
+
});
|
| 3018 |
+
" );
|
| 3019 |
+
}
|
| 3020 |
+
return $footer_text;
|
| 3021 |
+
}
|
| 3022 |
+
|
| 3023 |
+
/**
|
| 3024 |
+
* It will sort the record for the product reports tab.
|
| 3025 |
+
* @param array $unsort_array Unsorted array
|
| 3026 |
+
* @param string $order Order details
|
| 3027 |
+
* @return array $array
|
| 3028 |
+
* @since 2.6
|
| 3029 |
+
*/
|
| 3030 |
+
function bubble_sort_function( $unsort_array, $order ) {
|
| 3031 |
+
$temp = array();
|
| 3032 |
+
foreach ( $unsort_array as $key => $value )
|
| 3033 |
+
$temp[ $key ] = $value; //concatenate something unique to make sure two equal weights don't overwrite each other
|
| 3034 |
+
asort( $temp, SORT_NUMERIC ); // or ksort( $temp, SORT_NATURAL ); see paragraph above to understand why
|
| 3035 |
+
|
| 3036 |
+
if ( 'desc' == $order ) {
|
| 3037 |
+
$array = array_reverse( $temp, true );
|
| 3038 |
+
} else if ( $order == 'asc' ) {
|
| 3039 |
+
$array = $temp;
|
| 3040 |
+
}
|
| 3041 |
+
unset( $temp );
|
| 3042 |
+
return $array;
|
| 3043 |
+
}
|
| 3044 |
+
|
| 3045 |
+
/**
|
| 3046 |
+
* It will be called when we send the test email from the email edit page.
|
| 3047 |
+
* @hook wp_ajax_wcal_preview_email_sent
|
| 3048 |
+
* @since 1.0
|
| 3049 |
+
*/
|
| 3050 |
+
function wcal_action_send_preview() {
|
| 3051 |
+
?>
|
| 3052 |
+
<script type="text/javascript" >
|
| 3053 |
+
jQuery( document ).ready( function( $ )
|
| 3054 |
+
{
|
| 3055 |
+
$( "table#addedit_template input#preview_email" ).click( function()
|
| 3056 |
+
{
|
| 3057 |
+
$( '.ajax_img' ).show();
|
| 3058 |
+
var email_body = '';
|
| 3059 |
+
if ( jQuery("#wp-woocommerce_ac_email_body-wrap").hasClass( "tmce-active" ) ) {
|
| 3060 |
+
email_body = tinyMCE.get('woocommerce_ac_email_body').getContent();
|
| 3061 |
+
} else {
|
| 3062 |
+
email_body = jQuery('#woocommerce_ac_email_body').val();
|
| 3063 |
+
}
|
| 3064 |
+
var subject_email_preview = $( '#woocommerce_ac_email_subject' ).val();
|
| 3065 |
+
var body_email_preview = email_body;
|
| 3066 |
+
var send_email_id = $( '#send_test_email' ).val();
|
| 3067 |
+
var is_wc_template = document.getElementById( "is_wc_template" ).checked;
|
| 3068 |
+
var wc_template_header = $( '#wcal_wc_email_header' ).val() != '' ? $( '#wcal_wc_email_header' ).val() : 'Abandoned cart reminder';
|
| 3069 |
+
var data = {
|
| 3070 |
+
subject_email_preview: subject_email_preview,
|
| 3071 |
+
body_email_preview : body_email_preview,
|
| 3072 |
+
send_email_id : send_email_id,
|
| 3073 |
+
is_wc_template : is_wc_template,
|
| 3074 |
+
wc_template_header : wc_template_header,
|
| 3075 |
+
action : 'wcal_preview_email_sent'
|
| 3076 |
+
};
|
| 3077 |
+
|
| 3078 |
+
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
|
| 3079 |
+
$.post( ajaxurl, data, function( response ) {
|
| 3080 |
+
$( '.ajax_img' ).hide();
|
| 3081 |
+
if ( 'not sent' == response ) {
|
| 3082 |
+
$( "#preview_email_sent_msg" ).html( "Test email is not sent as the Email body is empty." );
|
| 3083 |
+
$( "#preview_email_sent_msg" ).fadeIn();
|
| 3084 |
+
setTimeout( function(){$( "#preview_email_sent_msg" ).fadeOut();}, 4000 );
|
| 3085 |
+
} else {
|
| 3086 |
+
$( "#preview_email_sent_msg" ).html( "<img src='<?php echo plugins_url(); ?>/woocommerce-abandoned-cart/assets/images/check.jpg'> Email has been sent successfully." );
|
| 3087 |
+
$( "#preview_email_sent_msg" ).fadeIn();
|
| 3088 |
+
setTimeout( function(){$( "#preview_email_sent_msg" ).fadeOut();}, 3000 );
|
| 3089 |
+
}
|
| 3090 |
+
//alert('Got this from the server: ' + response);
|
| 3091 |
+
});
|
| 3092 |
+
});
|
| 3093 |
+
});
|
| 3094 |
+
</script>
|
| 3095 |
+
<?php
|
| 3096 |
+
}
|
| 3097 |
+
|
| 3098 |
+
/**
|
| 3099 |
+
* Ajax function used to add the details in the abandoned order
|
| 3100 |
+
* popup view.
|
| 3101 |
+
*
|
| 3102 |
+
* @since 5.6
|
| 3103 |
+
*/
|
| 3104 |
+
public static function wcal_abandoned_cart_info() {
|
| 3105 |
+
|
| 3106 |
+
Wcal_Abandoned_Cart_Details::wcal_get_cart_detail_view( $_POST );
|
| 3107 |
+
die();
|
| 3108 |
+
}
|
| 3109 |
+
|
| 3110 |
+
/**
|
| 3111 |
+
* Ajax function which will save the notice state as dismissed.
|
| 3112 |
+
*
|
| 3113 |
+
* @since 5.7
|
| 3114 |
+
*/
|
| 3115 |
+
public static function wcal_dismiss_admin_notice() {
|
| 3116 |
+
|
| 3117 |
+
$notice_key = isset( $_POST[ 'notice' ] ) ? $_POST[ 'notice' ] : '';
|
| 3118 |
+
if ( '' !== $notice_key ) {
|
| 3119 |
+
update_option( $notice_key, true );
|
| 3120 |
+
}
|
| 3121 |
+
die();
|
| 3122 |
+
}
|
| 3123 |
+
|
| 3124 |
+
/**
|
| 3125 |
+
* It will update the template satus when we change the template active status from the email template list page.
|
| 3126 |
+
* @hook wp_ajax_wcal_toggle_template_status
|
| 3127 |
+
* @globals mixed $wpdb
|
| 3128 |
+
* @since 4.4
|
| 3129 |
+
*/
|
| 3130 |
+
public static function wcal_toggle_template_status () {
|
| 3131 |
+
global $wpdb;
|
| 3132 |
+
$template_id = $_POST['wcal_template_id'];
|
| 3133 |
+
$current_template_status = $_POST['current_state'];
|
| 3134 |
+
|
| 3135 |
+
if ( "on" == $current_template_status ) {
|
| 3136 |
+
$query_update = "SELECT * FROM `" . $wpdb->prefix . "ac_email_templates_lite` WHERE id ='" . $template_id . "'";
|
| 3137 |
+
$get_selected_template_result = $wpdb->get_results( $query_update );
|
| 3138 |
+
$email_frequncy = $get_selected_template_result[0]->frequency;
|
| 3139 |
+
$email_day_or_hour = $get_selected_template_result[0]->day_or_hour;
|
| 3140 |
+
$query_update = "UPDATE `" . $wpdb->prefix . "ac_email_templates_lite` SET is_active='0' WHERE frequency='" . $email_frequncy . "' AND day_or_hour='" . $email_day_or_hour . "' ";
|
| 3141 |
+
$wcal_updated = $wpdb->query( $query_update );
|
| 3142 |
+
|
| 3143 |
+
if ( 1 == $wcal_updated ){
|
| 3144 |
+
$query_update_get_id = "SELECT id FROM `" . $wpdb->prefix . "ac_email_templates_lite` WHERE id != $template_id AND frequency='" . $email_frequncy . "' AND day_or_hour='" . $email_day_or_hour . "' ";
|
| 3145 |
+
$wcal_updated_get_id = $wpdb->get_results( $query_update_get_id );
|
| 3146 |
+
$wcal_all_ids = '';
|
| 3147 |
+
foreach ( $wcal_updated_get_id as $wcal_updated_get_id_key => $wcal_updated_get_id_value ) {
|
| 3148 |
+
# code...
|
| 3149 |
+
if ( '' == $wcal_all_ids ){
|
| 3150 |
+
$wcal_all_ids = $wcal_updated_get_id_value->id;
|
| 3151 |
+
} else {
|
| 3152 |
+
$wcal_all_ids = $wcal_all_ids . ',' . $wcal_updated_get_id_value->id;
|
| 3153 |
+
}
|
| 3154 |
+
}
|
| 3155 |
+
echo 'wcal-template-updated:'. $wcal_all_ids ;
|
| 3156 |
+
}
|
| 3157 |
+
|
| 3158 |
+
$active = "1";
|
| 3159 |
+
|
| 3160 |
+
update_option( 'wcal_template_' . $template_id . '_time', current_time( 'timestamp' ) );
|
| 3161 |
+
} else {
|
| 3162 |
+
$active = "0";
|
| 3163 |
+
}
|
| 3164 |
+
$query_update = "UPDATE `" . $wpdb->prefix . "ac_email_templates_lite`
|
| 3165 |
+
SET
|
| 3166 |
+
is_active = '" . $active . "'
|
| 3167 |
+
WHERE id = '" . $template_id . "' ";
|
| 3168 |
+
$wpdb->query( $query_update );
|
| 3169 |
+
|
| 3170 |
+
wp_die();
|
| 3171 |
+
}
|
| 3172 |
+
/**
|
| 3173 |
+
* It will replace the test email data with the static content.
|
| 3174 |
+
* @return string email sent | not sent
|
| 3175 |
+
* @since 1.0
|
| 3176 |
+
*/
|
| 3177 |
+
function wcal_preview_email_sent() {
|
| 3178 |
+
if ( '' != $_POST['body_email_preview'] ) {
|
| 3179 |
+
$from_email_name = get_option ( 'wcal_from_name' );
|
| 3180 |
+
$reply_name_preview = get_option ( 'wcal_from_email' );
|
| 3181 |
+
$from_email_preview = get_option ( 'wcal_reply_email' );
|
| 3182 |
+
$subject_email_preview = stripslashes ( $_POST['subject_email_preview'] );
|
| 3183 |
+
$subject_email_preview = convert_smilies ( $subject_email_preview );
|
| 3184 |
+
$subject_email_preview = str_ireplace( '{{customer.firstname}}', 'John', $subject_email_preview );
|
| 3185 |
+
$body_email_preview = convert_smilies ( $_POST['body_email_preview'] );
|
| 3186 |
+
$is_wc_template = $_POST['is_wc_template'];
|
| 3187 |
+
$wc_template_header = stripslashes( $_POST['wc_template_header'] );
|
| 3188 |
+
|
| 3189 |
+
$body_email_preview = str_ireplace( '{{customer.firstname}}', 'John', $body_email_preview );
|
| 3190 |
+
$body_email_preview = str_ireplace( '{{customer.firstname}}', 'John', $body_email_preview );
|
| 3191 |
+
$body_email_preview = str_ireplace( '{{customer.lastname}}', 'Doe', $body_email_preview );
|
| 3192 |
+
$body_email_preview = str_ireplace( '{{customer.fullname}}', 'John'." ".'Doe', $body_email_preview );
|
| 3193 |
+
$current_time_stamp = current_time( 'timestamp' );
|
| 3194 |
+
$date_format = date_i18n( get_option( 'date_format' ), $current_time_stamp );
|
| 3195 |
+
$time_format = date_i18n( get_option( 'time_format' ), $current_time_stamp );
|
| 3196 |
+
$test_date = $date_format . ' ' . $time_format;
|
| 3197 |
+
$body_email_preview = str_ireplace( '{{cart.abandoned_date}}', $test_date, $body_email_preview );
|
| 3198 |
+
$cart_url = wc_get_page_permalink( 'cart' );
|
| 3199 |
+
$body_email_preview = str_ireplace( '{{cart.link}}', $cart_url, $body_email_preview );
|
| 3200 |
+
$body_email_preview = str_ireplace( '{{cart.unsubscribe}}', '#', $body_email_preview );
|
| 3201 |
+
$wcal_price = wc_price( '100' );
|
| 3202 |
+
$wcal_total_price = wc_price( '200' );
|
| 3203 |
+
if ( class_exists( 'WP_Better_Emails' ) ) {
|
| 3204 |
+
$headers = "From: " . $from_email_name . " <" . $from_email_preview . ">" . "\r\n";
|
| 3205 |
+
$headers .= "Content-Type: text/plain" . "\r\n";
|
| 3206 |
+
$headers .= "Reply-To: " . $reply_name_preview . " " . "\r\n";
|
| 3207 |
+
$var = '<table width = 100%>
|
| 3208 |
+
<tr> <td colspan="5"> <h3>'.__( 'Your Shopping Cart', 'woocommerce-abandoned-cart' ).'</h3> </td></tr>
|
| 3209 |
+
<tr align="center">
|
| 3210 |
+
<th>'.__( 'Item', 'woocommerce-abandoned-cart' ).'</th>
|
| 3211 |
+
<th>'.__( 'Name', 'woocommerce-abandoned-cart' ).'</th>
|
| 3212 |
+
<th>'.__( 'Quantity', 'woocommerce-abandoned-cart' ).'</th>
|
| 3213 |
+
<th>'.__( 'Price', 'woocommerce-abandoned-cart' ).'</th>
|
| 3214 |
+
<th>'.__( 'Line Subtotal', 'woocommerce-abandoned-cart' ).'</th>
|
| 3215 |
+
</tr>
|
| 3216 |
+
<tr align="center">
|
| 3217 |
+
<td><img class="demo_img" width="42" height="42" src="'.plugins_url().'/woocommerce-abandoned-cart/assets/images/shoes.jpg"/></td>
|
| 3218 |
+
<td>'.__( "Men's Formal Shoes", 'woocommerce-abandoned-cart' ).'</td>
|
| 3219 |
+
<td>1</td>
|
| 3220 |
+
<td>' . $wcal_price . '</td>
|
| 3221 |
+
<td>' . $wcal_price . '</td>
|
| 3222 |
+
</tr>
|
| 3223 |
+
<tr align="center">
|
| 3224 |
+
<td><img class="demo_img" width="42" height="42" src="'.plugins_url().'/woocommerce-abandoned-cart/assets/images/handbag.jpg"/></td>
|
| 3225 |
+
<td>'.__( "Woman's Hand Bags", 'woocommerce-abandoned-cart' ).'</td>
|
| 3226 |
+
<td>1</td>
|
| 3227 |
+
<td>' . $wcal_price . '</td>
|
| 3228 |
+
<td>' . $wcal_price . '</td>
|
| 3229 |
+
</tr>
|
| 3230 |
+
<tr align="center">
|
| 3231 |
+
<td></td>
|
| 3232 |
+
<td></td>
|
| 3233 |
+
<td></td>
|
| 3234 |
+
<td>'.__( "Cart Total:", 'woocommerce-abandoned-cart' ).'</td>
|
| 3235 |
+
<td>' . $wcal_total_price . '</td>
|
| 3236 |
+
</tr>
|
| 3237 |
+
</table>';
|
| 3238 |
+
} else {
|
| 3239 |
+
$headers = "From: " . $from_email_name . " <" . $from_email_preview . ">" . "\r\n";
|
| 3240 |
+
$headers .= "Content-Type: text/html" . "\r\n";
|
| 3241 |
+
$headers .= "Reply-To: " . $reply_name_preview . " " . "\r\n";
|
| 3242 |
+
$var = '<h3>'.__( "Your Shopping Cart", 'woocommerce-abandoned-cart' ).'</h3>
|
| 3243 |
+
<table border="0" cellpadding="10" cellspacing="0" class="templateDataTable">
|
| 3244 |
+
<tr align="center">
|
| 3245 |
+
<th>'.__( "Item", 'woocommerce-abandoned-cart' ).'</th>
|
| 3246 |
+
<th>'.__( "Name", 'woocommerce-abandoned-cart' ).'</th>
|
| 3247 |
+
<th>'.__( "Quantity", 'woocommerce-abandoned-cart' ).'</th>
|
| 3248 |
+
<th>'.__( "Price", 'woocommerce-abandoned-cart' ).'</th>
|
| 3249 |
+
<th>'.__( "Line Subtotal", 'woocommerce-abandoned-cart' ).'</th>
|
| 3250 |
+
</tr>
|
| 3251 |
+
<tr align="center">
|
| 3252 |
+
<td><img class="demo_img" width="42" height="42" src="'.plugins_url().'/woocommerce-abandoned-cart/assets/images/shoes.jpg"/></td>
|
| 3253 |
+
<td>'.__( "Men's Formal Shoes", 'woocommerce-abandoned-cart' ).'</td>
|
| 3254 |
+
<td>1</td>
|
| 3255 |
+
<td>' . $wcal_price . '</td>
|
| 3256 |
+
<td>' . $wcal_price . '</td>
|
| 3257 |
+
</tr>
|
| 3258 |
+
<tr align="center">
|
| 3259 |
+
<td><img class="demo_img" width="42" height="42" src="'.plugins_url().'/woocommerce-abandoned-cart/assets/images/handbag.jpg"/></td>
|
| 3260 |
+
<td>'.__( "Woman's Hand Bags", 'woocommerce-abandoned-cart' ).'</td>
|
| 3261 |
+
<td>1</td>
|
| 3262 |
+
<td>' . $wcal_price . '</td>
|
| 3263 |
+
<td>' . $wcal_price . '</td>
|
| 3264 |
+
</tr>
|
| 3265 |
+
<tr align="center">
|
| 3266 |
+
<td></td>
|
| 3267 |
+
<td></td>
|
| 3268 |
+
<td></td>
|
| 3269 |
+
<td>'.__( "Cart Total:", 'woocommerce-abandoned-cart' ).'</td>
|
| 3270 |
+
<td>' . $wcal_total_price . '</td>
|
| 3271 |
+
</tr>
|
| 3272 |
+
</table>';
|
| 3273 |
+
}
|
| 3274 |
+
$body_email_preview = str_ireplace( '{{products.cart}}', $var, $body_email_preview );
|
| 3275 |
+
if ( isset( $_POST['send_email_id'] ) ) {
|
| 3276 |
+
$to_email_preview = $_POST['send_email_id'];
|
| 3277 |
+
} else {
|
| 3278 |
+
$to_email_preview = "";
|
| 3279 |
+
}
|
| 3280 |
+
$user_email_from = get_option( 'admin_email' );
|
| 3281 |
+
$body_email_final_preview = stripslashes( $body_email_preview );
|
| 3282 |
+
|
| 3283 |
+
if ( isset( $is_wc_template ) && 'true' == $is_wc_template ) {
|
| 3284 |
+
ob_start();
|
| 3285 |
+
// Get email heading
|
| 3286 |
+
wc_get_template( 'emails/email-header.php', array( 'email_heading' => $wc_template_header ) );
|
| 3287 |
+
$email_body_template_header = ob_get_clean();
|
| 3288 |
+
|
| 3289 |
+
ob_start();
|
| 3290 |
+
wc_get_template( 'emails/email-footer.php' );
|
| 3291 |
+
$email_body_template_footer = ob_get_clean();
|
| 3292 |
+
|
| 3293 |
+
$final_email_body = $email_body_template_header . $body_email_final_preview . $email_body_template_footer;
|
| 3294 |
+
|
| 3295 |
+
$site_title = get_bloginfo( 'name' );
|
| 3296 |
+
$email_body_template_footer = str_ireplace( '{site_title}', $site_title, $email_body_template_footer );
|
| 3297 |
+
|
| 3298 |
+
wc_mail( $to_email_preview, $subject_email_preview, $final_email_body , $headers );
|
| 3299 |
+
}
|
| 3300 |
+
else {
|
| 3301 |
+
wp_mail( $to_email_preview, $subject_email_preview, stripslashes( $body_email_preview ), $headers );
|
| 3302 |
+
}
|
| 3303 |
+
echo "email sent";
|
| 3304 |
+
die();
|
| 3305 |
+
} else {
|
| 3306 |
+
echo "not sent";
|
| 3307 |
+
die();
|
| 3308 |
+
}
|
| 3309 |
+
}
|
| 3310 |
+
}
|
| 3311 |
}
|
| 3312 |
$woocommerce_abandon_cart = new woocommerce_abandon_cart_lite();
|
| 3313 |
?>
|
