Discount Rules for WooCommerce - Version 2.4.2

Version Description

  • 21/06/22 =
  • Feature: Option to schedule sale page product rebuild on daily once.
  • Improvement: Event: advanced_woo_discount_rules_variation_title_modify_count
  • Improvement: Event: advanced_woo_discount_rules_refresh_shipping_options_on_order_review
  • Fix: Cart coupon Condition not working when cart is empty.
  • Fix: Fatal error due to Invalid Product ID on save rule.
  • Fix: Warning on ajax strikeout.
  • Fix: Strikeout not displayed for BXGY cheapest individual product on product page and cross sell block.
  • Fix: BXGY discount applies before matches.
  • Fix: esc_attr() applied to prevent XSS issues.
Download this release

Release Info

Developer flycart
Plugin Icon 128x128 Discount Rules for WooCommerce
Version 2.4.2
Comparing to
See all releases

Code changes from version 2.4.1 to 2.4.2

Files changed (59) hide show
  1. common.php +3 -3
  2. i18n/languages/woo-discount-rules.pot +252 -240
  3. readme.txt +13 -2
  4. v2/App/Compatibility/AeliaCurrencySwitcherByAelia.php +1 -1
  5. v2/App/Compatibility/CompositeProductsBySomewhereWarm.php +1 -1
  6. v2/App/Compatibility/CurrencySwitcherByRealmag777.php +1 -1
  7. v2/App/Compatibility/CurrencySwitcherByVillatheme.php +1 -1
  8. v2/App/Compatibility/CurrencySwitcherByWPWham.php +1 -1
  9. v2/App/Compatibility/ExtraProductOptionsProByThemeHigh.php +1 -1
  10. v2/App/Compatibility/FacebookForWoocommerceByFacebook.php +1 -1
  11. v2/App/Compatibility/MultiCurrencyByTivNet.php +1 -1
  12. v2/App/Compatibility/MultiCurrencyByWPML.php +1 -1
  13. v2/App/Compatibility/PriceBasedOnCountryByOscarGare.php +1 -1
  14. v2/App/Compatibility/ProductAddOnsByWooCommerce.php +1 -1
  15. v2/App/Compatibility/WholesalePricesByRymeraWebCo.php +1 -1
  16. v2/App/Controllers/Admin/Settings.php +2 -1
  17. v2/App/Controllers/Admin/WDRAjax.php +32 -6
  18. v2/App/Controllers/Configuration.php +1 -0
  19. v2/App/Controllers/DiscountCalculator.php +3 -0
  20. v2/App/Controllers/ManageDiscount.php +6 -1
  21. v2/App/Controllers/OnSaleShortCode.php +46 -37
  22. v2/App/Helpers/Helper.php +3 -3
  23. v2/App/Helpers/Rule.php +69 -45
  24. v2/App/Helpers/Schedule.php +106 -0
  25. v2/App/Helpers/SurveyForm.php +35 -36
  26. v2/App/Helpers/Validation.php +2 -1
  27. v2/App/Helpers/Woocommerce.php +2 -1
  28. v2/App/Router.php +9 -0
  29. v2/App/Views/Admin/Menu.php +10 -10
  30. v2/App/Views/Admin/Rules/Conditions/Cart/LineItemCount.php +4 -4
  31. v2/App/Views/Admin/Rules/Conditions/Cart/Subtotal.php +4 -4
  32. v2/App/Views/Admin/Rules/Conditions/Main.php +14 -14
  33. v2/App/Views/Admin/Rules/DiscountBatch/Main.php +6 -6
  34. v2/App/Views/Admin/Rules/Discounts/Bulk.php +10 -10
  35. v2/App/Views/Admin/Rules/Discounts/Cart.php +2 -2
  36. v2/App/Views/Admin/Rules/Discounts/Main.php +2 -2
  37. v2/App/Views/Admin/Rules/Discounts/simple.php +3 -3
  38. v2/App/Views/Admin/Rules/Filters/Main.php +14 -13
  39. v2/App/Views/Admin/Rules/Manage.php +8 -8
  40. v2/App/Views/Admin/Rules/Others/CommonTemplates.php +4 -4
  41. v2/App/Views/Admin/Rules/Others/QuantityPromotion.php +7 -8
  42. v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php +5 -5
  43. v2/App/Views/Admin/Tabs/AdvancedOptions.php +1 -1
  44. v2/App/Views/Admin/Tabs/DiscountRule.php +125 -96
  45. v2/App/Views/Admin/Tabs/ImportExport.php +2 -2
  46. v2/App/Views/Admin/Tabs/RecipeTypes/BogoDiscountRecipe.php +2 -2
  47. v2/App/Views/Admin/Tabs/RecipeTypes/BundleDiscountRecipe.php +1 -1
  48. v2/App/Views/Admin/Tabs/RecipeTypes/SimpleDiscountRecipe.php +3 -3
  49. v2/App/Views/Admin/Tabs/Statistics.php +6 -6
  50. v2/App/Views/Admin/Tabs/settings.php +28 -11
  51. v2/App/Views/Templates/discount_table.php +8 -7
  52. v2/Assets/Js/admin-statistics.min.js +1 -1
  53. v2/Assets/Js/admin_script.js +47 -23
  54. v2/Assets/Js/admin_script.min.js +1 -1
  55. v2/Assets/Js/awdr-dynamic-price.min.js +1 -1
  56. v2/Assets/Js/awdr_recipe.min.js +1 -1
  57. v2/Assets/Js/rulebuilder.min.js +1 -1
  58. v2/Assets/Js/site_main.min.js +1 -1
  59. woo-discount-rules.php +11 -4
common.php CHANGED
@@ -14,7 +14,7 @@ add_action('wp_ajax_awdr_switch_version', function (){
14
  }
15
  if (current_user_can( 'manage_woocommerce' )) {
16
  if($version !== '' && $page !== ''){
17
- $url = admin_url('admin.php?page=' . $page . '&awdr_switch_plugin_to=' . $version);
18
  $do_switch = true;
19
  if (!isAWDREnvironmentCompatible()) {
20
  $return['message'] = __('Discount Rules 2.0 requires minimum PHP version of ', 'woo-discount-rules') . ' ' . WDR_REQUIRED_PHP_VERSION;
@@ -62,7 +62,7 @@ add_action('advanced_woo_discount_rules_on_settings_head', function () {
62
  }
63
  global $awdr_load_version;
64
  $version = ($awdr_load_version == "v1") ? "v2" : "v1";
65
- $url = admin_url('admin.php?page=' . $page . '&awdr_switch_plugin_to=' . $version);
66
  $message = __('Discount Rules V2 comes with a better UI and advanced options.', 'woo-discount-rules');
67
  $button_text = __("Switch to New User Interface", 'woo-discount-rules');
68
  if($version == "v1"){
@@ -81,7 +81,7 @@ add_action('advanced_woo_discount_rules_on_settings_head', function () {
81
  Click the "Switch" button to start using the new interface.</p>
82
  </div>';
83
 
84
- echo '<div style="background: #fff;padding: 20px;font-size: 13px;font-weight: bold;">' . $message . ' <button class="btn btn-info awdr-switch-version-button" data-version="' . $version . '" data-page="'.$page.'" data-nonce="'.$nounce.'">' . $button_text . '</button></div>';
85
  echo "<div class='wdr_switch_message' style='color:#a00;font-weight: bold;'></div>";
86
  }
87
  });
14
  }
15
  if (current_user_can( 'manage_woocommerce' )) {
16
  if($version !== '' && $page !== ''){
17
+ $url = esc_url(admin_url('admin.php?page=' . $page . '&awdr_switch_plugin_to=' . $version));
18
  $do_switch = true;
19
  if (!isAWDREnvironmentCompatible()) {
20
  $return['message'] = __('Discount Rules 2.0 requires minimum PHP version of ', 'woo-discount-rules') . ' ' . WDR_REQUIRED_PHP_VERSION;
62
  }
63
  global $awdr_load_version;
64
  $version = ($awdr_load_version == "v1") ? "v2" : "v1";
65
+ $url = esc_url(admin_url('admin.php?page=' . $page . '&awdr_switch_plugin_to=' . $version));
66
  $message = __('Discount Rules V2 comes with a better UI and advanced options.', 'woo-discount-rules');
67
  $button_text = __("Switch to New User Interface", 'woo-discount-rules');
68
  if($version == "v1"){
81
  Click the "Switch" button to start using the new interface.</p>
82
  </div>';
83
 
84
+ echo '<div style="background: #fff;padding: 20px;font-size: 13px;font-weight: bold;">' . $message . ' <button class="btn btn-info awdr-switch-version-button" data-version="' . esc_attr($version) . '" data-page="' . esc_attr($page) . '" data-nonce="' . esc_attr($nounce) . '">' . $button_text . '</button></div>';
85
  echo "<div class='wdr_switch_message' style='color:#a00;font-weight: bold;'></div>";
86
  }
87
  });
i18n/languages/woo-discount-rules.pot CHANGED
@@ -4,15 +4,15 @@ msgstr ""
4
  "Content-Type: text/plain; charset=UTF-8\n"
5
  "Content-Transfer-Encoding: 8bit\n"
6
  "Project-Id-Version: Woo Discount Rules\n"
7
- "POT-Creation-Date: 2022-04-05\n"
8
- "PO-Revision-Date: 2022-04-05"
9
  "Language-Team: Flycart\n"
10
  "MIME-Version: 1.0\n"
11
  "Language: \n"
12
  "X-Generator: Loco https://localise.biz/\n"
13
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;"
14
 
15
- #: common.php:9 v2/App/Controllers/Admin/WDRAjax.php:782
16
  msgid "Invalid request"
17
  msgstr ""
18
 
@@ -90,8 +90,8 @@ msgid ""
90
  msgstr ""
91
 
92
  #: v2/App/Compatibility/CurrencySwitcherByRealmag777.php:60
93
- #: v2/App/Compatibility/CurrencySwitcherByVillatheme.php:56
94
- #: v2/App/Compatibility/CurrencySwitcherByWPWham.php:44
95
  msgid "Add compatible for WooCommerce Currency Switcher"
96
  msgstr ""
97
 
@@ -176,7 +176,7 @@ msgid "Guest"
176
  msgstr ""
177
 
178
  #: v2/App/Controllers/Admin/Settings.php:437
179
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:78
180
  msgid "Disable"
181
  msgstr ""
182
 
@@ -185,12 +185,12 @@ msgid "Active"
185
  msgstr ""
186
 
187
  #: v2/App/Controllers/Admin/Settings.php:439
188
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:77
189
  msgid "Enable"
190
  msgstr ""
191
 
192
  #: v2/App/Controllers/Admin/Settings.php:440
193
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:294
194
  msgid " - (Running)"
195
  msgstr ""
196
 
@@ -243,12 +243,12 @@ msgid "Oops! Coupon already exists in Woocommerce"
243
  msgstr ""
244
 
245
  #: v2/App/Controllers/Admin/Settings.php:453
246
- #: v2/App/Controllers/Admin/Settings.php:523
247
  msgid "Copied!"
248
  msgstr ""
249
 
250
  #: v2/App/Controllers/Admin/Settings.php:454
251
- #: v2/App/Views/Admin/Tabs/settings.php:543
252
  msgid "Copy ShortCode"
253
  msgstr ""
254
 
@@ -288,7 +288,7 @@ msgid ""
288
  "<p>Note : You can also exclude products/categories.</p>"
289
  msgstr ""
290
 
291
- #: v2/App/Controllers/Admin/Settings.php:464 v2/App/Helpers/Rule.php:1237
292
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:59
293
  #: v2/App/Views/Admin/Rules/Manage.php:242
294
  msgid "Discount"
@@ -512,46 +512,50 @@ msgstr ""
512
  msgid "<span>Discount applies to custom taxonomy</span>"
513
  msgstr ""
514
 
515
- #: v2/App/Controllers/Admin/Settings.php:514
516
- msgid "Processing please wait.."
517
  msgstr ""
518
 
519
  #: v2/App/Controllers/Admin/Settings.php:515
520
- msgid "Rebuild index processed"
521
  msgstr ""
522
 
523
  #: v2/App/Controllers/Admin/Settings.php:516
524
- msgid "Please select the rules to build index"
525
  msgstr ""
526
 
527
  #: v2/App/Controllers/Admin/Settings.php:517
528
- msgid "Invalid File. Upload : <b style='color:red;'>.csv</b> File. </br>"
529
  msgstr ""
530
 
531
  #: v2/App/Controllers/Admin/Settings.php:518
 
 
 
 
532
  msgid ""
533
  "<b>This rule is not running currently:</b> Rule reached maximum usage limit"
534
  msgstr ""
535
 
536
- #: v2/App/Controllers/Admin/Settings.php:519
537
  msgid ""
538
  "<b>This rule is not running currently:</b> Start date and time is set in the "
539
  "future date"
540
  msgstr ""
541
 
542
- #: v2/App/Controllers/Admin/Settings.php:520
543
  msgid "<b>This rule is not running currently:</b> Validity expired"
544
  msgstr ""
545
 
546
- #: v2/App/Controllers/Admin/Settings.php:521
547
  msgid "Select State"
548
  msgstr ""
549
 
550
- #: v2/App/Controllers/Admin/Settings.php:522
551
  msgid "Copy URL"
552
  msgstr ""
553
 
554
- #: v2/App/Controllers/Admin/Settings.php:524
555
  msgid "Coupon url copied!"
556
  msgstr ""
557
 
@@ -564,12 +568,12 @@ msgid "Compatibility"
564
  msgstr ""
565
 
566
  #: v2/App/Controllers/Admin/Tabs/DiscountRules.php:22
567
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:11
568
  msgid "Discount Rules"
569
  msgstr ""
570
 
571
  #: v2/App/Controllers/Admin/Tabs/Help.php:17
572
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:58
573
  #: v2/App/Views/Admin/Tabs/help.php:8
574
  msgid "Documentation"
575
  msgstr ""
@@ -620,7 +624,7 @@ msgstr ""
620
  msgid "Authentication required"
621
  msgstr ""
622
 
623
- #: v2/App/Controllers/Admin/WDRAjax.php:743
624
  msgid "Search State"
625
  msgstr ""
626
 
@@ -639,7 +643,7 @@ msgstr ""
639
  msgid "Products"
640
  msgstr ""
641
 
642
- #: v2/App/Controllers/Base.php:194 v2/App/Views/Admin/Tabs/DiscountRule.php:191
643
  msgid "Product Adjustment"
644
  msgstr ""
645
 
@@ -648,53 +652,53 @@ msgstr ""
648
  msgid "Simple Discount"
649
  msgstr ""
650
 
651
- #: v2/App/Controllers/Base.php:200 v2/App/Views/Admin/Tabs/DiscountRule.php:194
652
  msgid "Cart Adjustment"
653
  msgstr ""
654
 
655
  #: v2/App/Controllers/Base.php:206 v2/App/Controllers/Base.php:207
656
  #: v2/App/Helpers/ProOptions.php:338
657
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:200
658
  msgid "Bulk Discount"
659
  msgstr ""
660
 
661
- #: v2/App/Controllers/ManageDiscount.php:173
662
  msgid "<span class=\"onsale\">{{percentage}}%</span>"
663
  msgstr ""
664
 
665
- #: v2/App/Controllers/ManageDiscount.php:184
666
  msgid "<span class=\"onsale\">Sale!</span>"
667
  msgstr ""
668
 
669
- #: v2/App/Controllers/ManageDiscount.php:774
670
- #: v2/App/Controllers/ManageDiscount.php:994
671
- #: v2/App/Controllers/ManageDiscount.php:997 v2/App/Helpers/Helper.php:271
672
  #: v2/App/Helpers/Helper.php:272
673
  msgid "Cart discount"
674
  msgstr ""
675
 
676
- #: v2/App/Controllers/ManageDiscount.php:1058
677
  #, php-format
678
  msgid "Coupon \"%s\" is currently not available!"
679
  msgstr ""
680
 
681
- #: v2/App/Controllers/ManageDiscount.php:1273
682
  #, php-format
683
  msgid ""
684
  "Sorry, it is not possible to apply coupon <b>\"%s\"</b> as you already have "
685
  "a discount applied in cart."
686
  msgstr ""
687
 
688
- #: v2/App/Controllers/ManageDiscount.php:1287
689
  msgid "Coupon code applied successfully."
690
  msgstr ""
691
 
692
- #: v2/App/Controllers/ManageDiscount.php:1711
693
  #: v2/App/Views/Admin/Tabs/settings.php:441
694
  msgid "Discount <strong>{{title}}</strong> has been applied to your cart."
695
  msgstr ""
696
 
697
- #: v2/App/Controllers/ManageDiscount.php:1841
698
  msgid "You saved {{total_discount}}"
699
  msgstr ""
700
 
@@ -962,7 +966,7 @@ msgstr ""
962
  msgid "Bundle (Set) Discount - PRO -"
963
  msgstr ""
964
 
965
- #: v2/App/Helpers/Rule.php:1315 v2/App/Helpers/Rule.php:1415
966
  #: v2/App/Views/Admin/Tabs/ImportExport.php:101
967
  msgid "Untitled Rule"
968
  msgstr ""
@@ -975,77 +979,77 @@ msgstr ""
975
  msgid "Sending Feedback"
976
  msgstr ""
977
 
978
- #: v2/App/Helpers/SurveyForm.php:241
979
  msgid "Upgrading to PRO."
980
  msgstr ""
981
 
982
- #: v2/App/Helpers/SurveyForm.php:245
983
  msgid "I am switching to a different discount plugin."
984
  msgstr ""
985
 
986
- #: v2/App/Helpers/SurveyForm.php:249
987
  msgid "I could not get my discount rule to work."
988
  msgstr ""
989
 
990
- #: v2/App/Helpers/SurveyForm.php:253
991
  msgid "It does not meet my discount requirements."
992
  msgstr ""
993
 
994
- #: v2/App/Helpers/SurveyForm.php:257
995
  msgid "Plugin is complex."
996
  msgstr ""
997
 
998
- #: v2/App/Helpers/SurveyForm.php:261
999
  msgid "I'm trying to troubleshoot the plugin."
1000
  msgstr ""
1001
 
1002
- #: v2/App/Helpers/SurveyForm.php:265
1003
  msgid "I was instructed to deactivate by Flycart Support."
1004
  msgstr ""
1005
 
1006
- #: v2/App/Helpers/SurveyForm.php:269
1007
  msgid "I no longer use this plugin."
1008
  msgstr ""
1009
 
1010
- #: v2/App/Helpers/SurveyForm.php:273
1011
  msgid "It's a temporary deactivation."
1012
  msgstr ""
1013
 
1014
- #: v2/App/Helpers/SurveyForm.php:277
1015
  msgid "Other"
1016
  msgstr ""
1017
 
1018
- #: v2/App/Helpers/SurveyForm.php:279
1019
  msgid "Please share the reason"
1020
  msgstr ""
1021
 
1022
- #: v2/App/Helpers/SurveyForm.php:289
1023
  msgid "Quick Feedback"
1024
  msgstr ""
1025
 
1026
- #: v2/App/Helpers/SurveyForm.php:290
1027
  msgid "Close"
1028
  msgstr ""
1029
 
1030
- #: v2/App/Helpers/SurveyForm.php:298
1031
  #, php-format
1032
  msgid "If you have a moment, please share why you are deactivating %s:"
1033
  msgstr ""
1034
 
1035
- #: v2/App/Helpers/SurveyForm.php:299
1036
  msgid "Discount Rules for WooCommerce"
1037
  msgstr ""
1038
 
1039
- #: v2/App/Helpers/SurveyForm.php:327
1040
  msgid "Submit & Deactivate"
1041
  msgstr ""
1042
 
1043
- #: v2/App/Helpers/SurveyForm.php:329
1044
  msgid "Skip & Deactivate"
1045
  msgstr ""
1046
 
1047
  #: v2/App/Helpers/Validation.php:146 v2/App/Helpers/Validation.php:151
1048
- #: v2/App/Helpers/Validation.php:348 v2/App/Helpers/Validation.php:544
1049
  msgid "Invalid characters"
1050
  msgstr ""
1051
 
@@ -1082,144 +1086,140 @@ msgstr ""
1082
  msgid "Invalid inputs"
1083
  msgstr ""
1084
 
1085
- #: v2/App/Helpers/Validation.php:518
1086
  msgid "Validation error"
1087
  msgstr ""
1088
 
1089
- #: v2/App/Helpers/Woocommerce.php:985
1090
  msgid "Sunday"
1091
  msgstr ""
1092
 
1093
- #: v2/App/Helpers/Woocommerce.php:986
1094
  msgid "Monday"
1095
  msgstr ""
1096
 
1097
- #: v2/App/Helpers/Woocommerce.php:987
1098
  msgid "Tuesday"
1099
  msgstr ""
1100
 
1101
- #: v2/App/Helpers/Woocommerce.php:988
1102
  msgid "Wednesday"
1103
  msgstr ""
1104
 
1105
- #: v2/App/Helpers/Woocommerce.php:989
1106
  msgid "Thursday"
1107
  msgstr ""
1108
 
1109
- #: v2/App/Helpers/Woocommerce.php:990
1110
  msgid "Friday"
1111
  msgstr ""
1112
 
1113
- #: v2/App/Helpers/Woocommerce.php:991
1114
  msgid "Saturday"
1115
  msgstr ""
1116
 
1117
- #: v2/App/Helpers/Woocommerce.php:1002
1118
  msgid ""
1119
  "Woocommerce before main content(Archive / Shop / Cat Pages / single product)"
1120
  msgstr ""
1121
 
1122
- #: v2/App/Helpers/Woocommerce.php:1003
1123
  msgid "Woocommerce archive description(Archive / Shop / Cat Pages)"
1124
  msgstr ""
1125
 
1126
- #: v2/App/Helpers/Woocommerce.php:1004
1127
  msgid "Woocommerce before shop loop(Archive / Shop / Cat Pages)"
1128
  msgstr ""
1129
 
1130
- #: v2/App/Helpers/Woocommerce.php:1005
1131
  msgid "Woocommerce after shop loop(Archive / Shop / Cat Pages)"
1132
  msgstr ""
1133
 
1134
- #: v2/App/Helpers/Woocommerce.php:1006
1135
  msgid ""
1136
  "Woocommerce after main content(Archive / Shop / Cat Pages / single product)"
1137
  msgstr ""
1138
 
1139
- #: v2/App/Helpers/Woocommerce.php:1007 v2/App/Views/Admin/Tabs/settings.php:230
1140
  #: v2/App/Views/Admin/Tabs/settings.php:248
1141
  msgid "Woocommerce before single product"
1142
  msgstr ""
1143
 
1144
- #: v2/App/Helpers/Woocommerce.php:1008 v2/App/Views/Admin/Tabs/settings.php:232
1145
  #: v2/App/Views/Admin/Tabs/settings.php:250
1146
  msgid "Woocommerce before single product summary"
1147
  msgstr ""
1148
 
1149
- #: v2/App/Helpers/Woocommerce.php:1009 v2/App/Views/Admin/Tabs/settings.php:231
1150
  #: v2/App/Views/Admin/Tabs/settings.php:249
1151
  msgid "Woocommerce after single product summary"
1152
  msgstr ""
1153
 
1154
- #: v2/App/Helpers/Woocommerce.php:1010 v2/App/Views/Admin/Tabs/settings.php:229
1155
  #: v2/App/Views/Admin/Tabs/settings.php:247
1156
  msgid "Woocommerce after single product"
1157
  msgstr ""
1158
 
1159
- #: v2/App/Helpers/Woocommerce.php:1011
1160
  msgid "Woocommerce before cart"
1161
  msgstr ""
1162
 
1163
- #: v2/App/Helpers/Woocommerce.php:1012
1164
  msgid "Woocommerce before cart table"
1165
  msgstr ""
1166
 
1167
- #: v2/App/Helpers/Woocommerce.php:1013
1168
  msgid "Woocommerce before cart contents"
1169
  msgstr ""
1170
 
1171
- #: v2/App/Helpers/Woocommerce.php:1014
1172
  msgid "Woocommerce cart contents"
1173
  msgstr ""
1174
 
1175
- #: v2/App/Helpers/Woocommerce.php:1015
1176
  msgid "Woocommerce after cart contents"
1177
  msgstr ""
1178
 
1179
- #: v2/App/Helpers/Woocommerce.php:1016
1180
  msgid "Woocommerce after cart table"
1181
  msgstr ""
1182
 
1183
- #: v2/App/Helpers/Woocommerce.php:1017
1184
  msgid "Woocommerce after cart"
1185
  msgstr ""
1186
 
1187
- #: v2/App/Helpers/Woocommerce.php:1018
1188
  msgid "Woocommerce before checkout form"
1189
  msgstr ""
1190
 
1191
- #: v2/App/Helpers/Woocommerce.php:1020
1192
  msgid "Woocommerce before checkout billing form"
1193
  msgstr ""
1194
 
1195
- #: v2/App/Helpers/Woocommerce.php:1021
1196
  msgid "Woocommerce after checkout billing form"
1197
  msgstr ""
1198
 
1199
- #: v2/App/Helpers/Woocommerce.php:1022
1200
  msgid "Woocommerce before checkout shipping form"
1201
  msgstr ""
1202
 
1203
- #: v2/App/Helpers/Woocommerce.php:1023
1204
  msgid "Woocommerce after checkout shipping form"
1205
  msgstr ""
1206
 
1207
- #: v2/App/Helpers/Woocommerce.php:1024
1208
  msgid "Woocommerce before order notes"
1209
  msgstr ""
1210
 
1211
- #: v2/App/Helpers/Woocommerce.php:1025
1212
  msgid "Woocommerce after order notes"
1213
  msgstr ""
1214
 
1215
- #: v2/App/Helpers/Woocommerce.php:1559
1216
  msgid "Coupon already exists in WooCommerce. Please select another name"
1217
  msgstr ""
1218
 
1219
- #: v2/App/Views/Admin/Menu.php:33
1220
- msgid "Rebuild index"
1221
- msgstr ""
1222
-
1223
  #: v2/App/Views/Admin/Rules/Conditions/Cart/LineItemCount.php:12
1224
  #: v2/App/Views/Admin/Rules/Conditions/Cart/Subtotal.php:13
1225
  msgid "Less than ( &lt; )"
@@ -1391,7 +1391,7 @@ msgid "Preview"
1391
  msgstr ""
1392
 
1393
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:22
1394
- #: v2/App/Views/Admin/Tabs/settings.php:623
1395
  msgid "Note:"
1396
  msgstr ""
1397
 
@@ -1419,9 +1419,10 @@ msgstr ""
1419
  #: v2/App/Views/Admin/Tabs/settings.php:304
1420
  #: v2/App/Views/Admin/Tabs/settings.php:333
1421
  #: v2/App/Views/Admin/Tabs/settings.php:425
1422
- #: v2/App/Views/Admin/Tabs/settings.php:563
1423
  #: v2/App/Views/Admin/Tabs/settings.php:580
1424
  #: v2/App/Views/Admin/Tabs/settings.php:597
 
1425
  msgid "Yes"
1426
  msgstr ""
1427
 
@@ -1437,9 +1438,10 @@ msgstr ""
1437
  #: v2/App/Views/Admin/Tabs/settings.php:308
1438
  #: v2/App/Views/Admin/Tabs/settings.php:339
1439
  #: v2/App/Views/Admin/Tabs/settings.php:430
1440
- #: v2/App/Views/Admin/Tabs/settings.php:568
1441
  #: v2/App/Views/Admin/Tabs/settings.php:585
1442
  #: v2/App/Views/Admin/Tabs/settings.php:602
 
1443
  msgid "No"
1444
  msgstr ""
1445
 
@@ -1542,13 +1544,13 @@ msgstr ""
1542
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:53
1543
  #: v2/App/Views/Admin/Rules/Discounts/Cart.php:24
1544
  #: v2/App/Views/Admin/Rules/Discounts/simple.php:23
1545
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:110
1546
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:336
1547
  msgid "Discount Type"
1548
  msgstr ""
1549
 
1550
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:63
1551
- #: v2/App/Views/Admin/Tabs/settings.php:689
1552
  msgid "Discount Value"
1553
  msgstr ""
1554
 
@@ -1578,6 +1580,8 @@ msgid "Discount label"
1578
  msgstr ""
1579
 
1580
  #: v2/App/Views/Admin/Rules/Discounts/Cart.php:42
 
 
1581
  msgid "Discount Label"
1582
  msgstr ""
1583
 
@@ -1698,18 +1702,18 @@ msgstr ""
1698
  msgid "Not In List"
1699
  msgstr ""
1700
 
1701
- #: v2/App/Views/Admin/Rules/Filters/Main.php:81
1702
  msgid "Select "
1703
  msgstr ""
1704
 
1705
- #: v2/App/Views/Admin/Rules/Filters/Main.php:97
1706
  msgid ""
1707
  "Choose products that get the discount using \"In List\". If you want to "
1708
  "exclude a few products, choose \"Not In List\" and select the products you "
1709
  "wanted to exclude from discount. (You can add multiple filters)"
1710
  msgstr ""
1711
 
1712
- #: v2/App/Views/Admin/Rules/Filters/Main.php:100
1713
  msgid ""
1714
  "Choose categories that get the discount using \"In List\". If you want to "
1715
  "exclude a few categories, choose \"Not In List\" and select the categories "
@@ -1717,7 +1721,7 @@ msgid ""
1717
  "type)"
1718
  msgstr ""
1719
 
1720
- #: v2/App/Views/Admin/Rules/Filters/Main.php:103
1721
  msgid ""
1722
  "Choose attributes that get the discount using \"In List\". If you want to "
1723
  "exclude a few attributes, choose \"Not In List\" and select the attributes "
@@ -1725,36 +1729,36 @@ msgid ""
1725
  "type)"
1726
  msgstr ""
1727
 
1728
- #: v2/App/Views/Admin/Rules/Filters/Main.php:106
1729
  msgid ""
1730
  "Choose tags that get the discount using \"In List\". If you want to exclude "
1731
  "a few tags, choose \"Not In List\" and select the tags you wanted to exclude "
1732
  "from discount. (You can add multiple filters of same type)"
1733
  msgstr ""
1734
 
1735
- #: v2/App/Views/Admin/Rules/Filters/Main.php:109
1736
  msgid ""
1737
  "Choose SKUs that get the discount using \"In List\". If you want to exclude "
1738
  "a few SKUs, choose \"Not In List\" and select the SKUs you wanted to exclude "
1739
  "from discount. (You can add multiple filters of same type)"
1740
  msgstr ""
1741
 
1742
- #: v2/App/Views/Admin/Rules/Filters/Main.php:112
1743
  msgid ""
1744
  "Choose whether you want to include (or exclude) products on sale (those "
1745
  "having a sale price) for the discount "
1746
  msgstr ""
1747
 
1748
- #: v2/App/Views/Admin/Rules/Filters/Main.php:115
1749
- #: v2/App/Views/Admin/Rules/Filters/Main.php:161
1750
  msgid "Discount applies to all eligible products in the store"
1751
  msgstr ""
1752
 
1753
- #: v2/App/Views/Admin/Rules/Filters/Main.php:119
1754
  msgid "Discount applies to custom taxonomy"
1755
  msgstr ""
1756
 
1757
- #: v2/App/Views/Admin/Rules/Filters/Main.php:172
1758
  msgid "Add filter"
1759
  msgstr ""
1760
 
@@ -1832,25 +1836,25 @@ msgstr ""
1832
  msgid "Select discount type and its value (percentage/price/fixed price)"
1833
  msgstr ""
1834
 
1835
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:16
1836
  #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:17
1837
  msgid "Promotion Message"
1838
  msgstr ""
1839
 
1840
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:18
1841
  msgid "Quantity from"
1842
  msgstr ""
1843
 
1844
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:22
1845
  msgid "0"
1846
  msgstr ""
1847
 
1848
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:24
1849
  #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:25
1850
  msgid "Set a threshold from which you want to start showing promotion message"
1851
  msgstr ""
1852
 
1853
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:25
1854
  #, php-format
1855
  msgid ""
1856
  "<b>Example:</b> Let's say you offer a 10% discount for 5 quantities and "
@@ -1858,21 +1862,21 @@ msgid ""
1858
  "text when his cart quantities reaches 3"
1859
  msgstr ""
1860
 
1861
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:28
1862
  #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:29
1863
  msgid "Message"
1864
  msgstr ""
1865
 
1866
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:32
1867
  #, php-format
1868
  msgid "Buy {{difference_quantity}} more products and get 10% discount"
1869
  msgstr ""
1870
 
1871
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:33
1872
  msgid "{{difference_quantity}} -> Difference amount to get discount"
1873
  msgstr ""
1874
 
1875
- #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:34
1876
  #, php-format
1877
  msgid ""
1878
  "<b>Eg:</b> Buy {{difference_quantity}} more products and get 10% discount"
@@ -1929,32 +1933,32 @@ msgstr ""
1929
  msgid "Disable recalculate when coupon apply"
1930
  msgstr ""
1931
 
1932
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:13
1933
  msgid "Add New Rule"
1934
  msgstr ""
1935
 
1936
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:16
1937
  msgid "Migrate rules from v1"
1938
  msgstr ""
1939
 
1940
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:23
1941
  msgid "Migration"
1942
  msgstr ""
1943
 
1944
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:27
1945
  #: v2/App/Views/Admin/welcome-text.php:9
1946
  msgid "Migrate rules from v1 to v2"
1947
  msgstr ""
1948
 
1949
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:31
1950
  msgid "Available price rules"
1951
  msgstr ""
1952
 
1953
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:34
1954
  msgid "Available cart rules"
1955
  msgstr ""
1956
 
1957
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:37
1958
  msgid ""
1959
  "Once migration is completed, please open the rules and check their "
1960
  "configuration once again to make sure it meets your discount scenario. If "
@@ -1963,236 +1967,236 @@ msgid ""
1963
  "\">https://www.flycart.org/support</a>"
1964
  msgstr ""
1965
 
1966
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:42
1967
  #: v2/App/Views/Admin/welcome-text.php:14
1968
  msgid "Migrate"
1969
  msgstr ""
1970
 
1971
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:43
1972
  #: v2/App/Views/Admin/welcome-text.php:15
1973
  msgid "Skip"
1974
  msgstr ""
1975
 
1976
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:56
1977
  msgid "View Examples"
1978
  msgstr ""
1979
 
1980
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:68
1981
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:74
1982
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:85
1983
  msgid "Search Rules"
1984
  msgstr ""
1985
 
1986
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:76
1987
  msgid "Bulk Actions"
1988
  msgstr ""
1989
 
1990
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:79
1991
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:307
1992
  msgid "Delete"
1993
  msgstr ""
1994
 
1995
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:81
1996
  msgid "Apply"
1997
  msgstr ""
1998
 
1999
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:89
2000
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:374
2001
  msgid "item"
2002
  msgstr ""
2003
 
2004
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:89
2005
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:374
2006
  msgid "items"
2007
  msgstr ""
2008
 
2009
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:105
2010
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:331
2011
  msgid "Title"
2012
  msgstr ""
2013
 
2014
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:112
2015
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:338
2016
  msgid "Start Date"
2017
  msgstr ""
2018
 
2019
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:114
2020
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:340
2021
  msgid "Expired On"
2022
  msgstr ""
2023
 
2024
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:119
2025
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:345
2026
  msgid "Language(s)"
2027
  msgstr ""
2028
 
2029
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:127
2030
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:353
2031
  msgid "Status"
2032
  msgstr ""
2033
 
2034
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:129
2035
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:355
2036
  msgid "Action"
2037
  msgstr ""
2038
 
2039
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:151
2040
  msgid "Exclusive"
2041
  msgstr ""
2042
 
2043
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:180
2044
  msgid "Created by: "
2045
  msgstr ""
2046
 
2047
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:180
2048
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:182
2049
  msgid " On: "
2050
  msgstr ""
2051
 
2052
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:182
2053
  msgid "Modified by: "
2054
  msgstr ""
2055
 
2056
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:197
2057
  #: v2/App/Views/Admin/Tabs/help.php:112
2058
  msgid "Free Shipping"
2059
  msgstr ""
2060
 
2061
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:203
2062
  msgid "Set Discount"
2063
  msgstr ""
2064
 
2065
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:206
2066
  msgid "Buy X get X"
2067
  msgstr ""
2068
 
2069
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:209
2070
  msgid "Buy X get Y"
2071
  msgstr ""
2072
 
2073
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:252
2074
  msgid "Enabled"
2075
  msgstr ""
2076
 
2077
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:252
2078
  #: v2/App/Views/Admin/Tabs/settings.php:398
2079
  msgid "Disabled"
2080
  msgstr ""
2081
 
2082
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:263
2083
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:277
2084
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:290
2085
  msgid " - ( Not running )"
2086
  msgstr ""
2087
 
2088
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:264
2089
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:278
2090
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:291
2091
  msgid "Rule reached maximum usage limit"
2092
  msgstr ""
2093
 
2094
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:268
2095
  msgid " - ( Will run in future)"
2096
  msgstr ""
2097
 
2098
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:271
2099
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:284
2100
  msgid "Your server current date and time:"
2101
  msgstr ""
2102
 
2103
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:281
2104
  msgid " - ( Not running - validity expired)"
2105
  msgstr ""
2106
 
2107
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:302
2108
  msgid "Edit"
2109
  msgstr ""
2110
 
2111
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:304
2112
  msgid "Duplicate"
2113
  msgstr ""
2114
 
2115
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:318
2116
  msgid "No rules found."
2117
  msgstr ""
2118
 
2119
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:389
2120
  #: v2/App/Views/Admin/Tabs/help.php:160
2121
  msgid "Looking for more features? Upgrade to PRO"
2122
  msgstr ""
2123
 
2124
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:394
2125
  #: v2/App/Views/Admin/Tabs/help.php:165
2126
  msgid "With PRO version, you can create:"
2127
  msgstr ""
2128
 
2129
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:395
2130
  #: v2/App/Views/Admin/Tabs/help.php:166
2131
  msgid "- Categories based discounts"
2132
  msgstr ""
2133
 
2134
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:396
2135
  #: v2/App/Views/Admin/Tabs/help.php:167
2136
  msgid "- User roles based discounts"
2137
  msgstr ""
2138
 
2139
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:397
2140
  #: v2/App/Views/Admin/Tabs/help.php:168
2141
  msgid "- Buy One Get One Free deals"
2142
  msgstr ""
2143
 
2144
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:398
2145
  #: v2/App/Views/Admin/Tabs/help.php:169
2146
  msgid "- Buy X Get Y deals"
2147
  msgstr ""
2148
 
2149
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:399
2150
  #: v2/App/Views/Admin/Tabs/help.php:170
2151
  #, php-format
2152
  msgid "- Buy 2, get 1 at 50% discount"
2153
  msgstr ""
2154
 
2155
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:400
2156
  #: v2/App/Views/Admin/Tabs/help.php:171
2157
  msgid "- Buy 3 for $10 (Package / Bundle [Set] Discount)"
2158
  msgstr ""
2159
 
2160
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:401
2161
  #: v2/App/Views/Admin/Tabs/help.php:172
2162
  msgid "- Different discounts with one coupon code"
2163
  msgstr ""
2164
 
2165
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:402
2166
  #: v2/App/Views/Admin/Tabs/help.php:173
2167
  msgid "- Purchase history based discounts"
2168
  msgstr ""
2169
 
2170
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:403
2171
  #: v2/App/Views/Admin/Tabs/help.php:174
2172
  msgid "- Free product / gift"
2173
  msgstr ""
2174
 
2175
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:404
2176
  #: v2/App/Views/Admin/Tabs/help.php:175
2177
  msgid "- Discount for variants"
2178
  msgstr ""
2179
 
2180
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:405
2181
  #: v2/App/Views/Admin/Tabs/help.php:176
2182
  msgid "- Conditional discounts"
2183
  msgstr ""
2184
 
2185
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:406
2186
  #: v2/App/Views/Admin/Tabs/help.php:177
2187
  msgid "- Fixed cost discounts"
2188
  msgstr ""
2189
 
2190
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:407
2191
  #: v2/App/Views/Admin/Tabs/help.php:178
2192
  msgid "- Offer fixed price on certain conditions"
2193
  msgstr ""
2194
 
2195
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:408
2196
  #: v2/App/Views/Admin/Tabs/help.php:179
2197
  msgid "Go PRO"
2198
  msgstr ""
@@ -2641,7 +2645,7 @@ msgid "Show discount table on product page"
2641
  msgstr ""
2642
 
2643
  #: v2/App/Views/Admin/Tabs/settings.php:213
2644
- #: v2/App/Views/Admin/Tabs/settings.php:618
2645
  msgid "Customize Discount Table"
2646
  msgstr ""
2647
 
@@ -2870,202 +2874,210 @@ msgstr ""
2870
  msgid "Save and Build Index"
2871
  msgstr ""
2872
 
 
 
 
 
2873
  #: v2/App/Views/Admin/Tabs/settings.php:540
 
 
 
 
2874
  msgid ""
2875
  "ShortCode to load all products which has discount through Woo Discount Rules"
2876
  msgstr ""
2877
 
2878
- #: v2/App/Views/Admin/Tabs/settings.php:549
2879
  msgid "Third party plugin conflict fixes & options"
2880
  msgstr ""
2881
 
2882
- #: v2/App/Views/Admin/Tabs/settings.php:550
2883
  msgid ""
2884
  "Use these advanced options ONLY when you use a third party plugin that "
2885
  "interacts with product pricing & discounts and only when you DONT see the "
2886
  "discounts applying. Otherwise these options should be left as NO."
2887
  msgstr ""
2888
 
2889
- #: v2/App/Views/Admin/Tabs/settings.php:551
2890
  msgid ""
2891
  "IMPORTANT: Please consult with our support team by opening a ticket at <a "
2892
  "href=\"https://www.flycart.org/support\" target=\"_blank\">https://www."
2893
  "flycart.org/support</a> before you use these options."
2894
  msgstr ""
2895
 
2896
- #: v2/App/Views/Admin/Tabs/settings.php:556
2897
  msgid ""
2898
  "Do you have custom prices set using another plugin or custom code? (Example: "
2899
  "A wholesale price or a country specific pricing)"
2900
  msgstr ""
2901
 
2902
- #: v2/App/Views/Admin/Tabs/settings.php:557
2903
  msgid ""
2904
  "If you have custom prices for your products like using another plugin and if "
2905
  "you do not see the discount NOT applied, enable this option."
2906
  msgstr ""
2907
 
2908
- #: v2/App/Views/Admin/Tabs/settings.php:573
2909
  msgid "Disable re-calculating the cart total on cart page"
2910
  msgstr ""
2911
 
2912
- #: v2/App/Views/Admin/Tabs/settings.php:574
2913
  msgid ""
2914
  "This will be helpful if you see the discounts not working. It could be "
2915
  "because other plugins might be force re-calculating the totals in cart."
2916
  msgstr ""
2917
 
2918
- #: v2/App/Views/Admin/Tabs/settings.php:590
2919
  msgid "Disable re-calculating the total when applying the coupon."
2920
  msgstr ""
2921
 
2922
- #: v2/App/Views/Admin/Tabs/settings.php:591
2923
  msgid ""
2924
  "This will be useful, if you see the discounts being removed after the coupon "
2925
  "applies... or the discount does not work after applying a coupon."
2926
  msgstr ""
2927
 
2928
- #: v2/App/Views/Admin/Tabs/settings.php:621
2929
  msgid "Settings Saved"
2930
  msgstr ""
2931
 
2932
- #: v2/App/Views/Admin/Tabs/settings.php:622
2933
  msgid "Oops! Something went wrong."
2934
  msgstr ""
2935
 
2936
- #: v2/App/Views/Admin/Tabs/settings.php:623
2937
  msgid " This table contains sample content for design purpose."
2938
  msgstr ""
2939
 
2940
- #: v2/App/Views/Admin/Tabs/settings.php:633
2941
  msgid "Table Header"
2942
  msgstr ""
2943
 
2944
- #: v2/App/Views/Admin/Tabs/settings.php:634
2945
  msgid "Show/Hide table header column names"
2946
  msgstr ""
2947
 
2948
- #: v2/App/Views/Admin/Tabs/settings.php:639
2949
  msgid "Show"
2950
  msgstr ""
2951
 
2952
- #: v2/App/Views/Admin/Tabs/settings.php:642
2953
  msgid "Don't Show"
2954
  msgstr ""
2955
 
2956
- #: v2/App/Views/Admin/Tabs/settings.php:647
2957
  msgid "Title column Name on table"
2958
  msgstr ""
2959
 
2960
- #: v2/App/Views/Admin/Tabs/settings.php:648
2961
  msgid "Give name for rule title column"
2962
  msgstr ""
2963
 
2964
- #: v2/App/Views/Admin/Tabs/settings.php:659
2965
  msgid "Discount column Name on table"
2966
  msgstr ""
2967
 
2968
- #: v2/App/Views/Admin/Tabs/settings.php:660
2969
  msgid "Give name for discount column"
2970
  msgstr ""
2971
 
2972
- #: v2/App/Views/Admin/Tabs/settings.php:671
2973
  msgid "Range column Name on table"
2974
  msgstr ""
2975
 
2976
- #: v2/App/Views/Admin/Tabs/settings.php:672
2977
  msgid "Give name for range column"
2978
  msgstr ""
2979
 
2980
- #: v2/App/Views/Admin/Tabs/settings.php:683
2981
  msgid "Discount column value on table"
2982
  msgstr ""
2983
 
2984
- #: v2/App/Views/Admin/Tabs/settings.php:684
2985
  msgid "Show Discount value/price in table"
2986
  msgstr ""
2987
 
2988
- #: v2/App/Views/Admin/Tabs/settings.php:692
2989
  msgid "Discounted Price"
2990
  msgstr ""
2991
 
2992
- #: v2/App/Views/Admin/Tabs/settings.php:767
2993
- #: v2/App/Views/Admin/Tabs/settings.php:790
2994
  msgid "Bulk Rule"
2995
  msgstr ""
2996
 
2997
- #: v2/App/Views/Admin/Tabs/settings.php:775
2998
- #: v2/App/Views/Admin/Tabs/settings.php:821
2999
- #: v2/App/Views/Admin/Tabs/settings.php:888
3000
- #: v2/App/Views/Templates/discount_table.php:141
3001
  msgid " flat"
3002
  msgstr ""
3003
 
3004
- #: v2/App/Views/Admin/Tabs/settings.php:781
3005
  msgid "1 - 5"
3006
  msgstr ""
3007
 
3008
- #: v2/App/Views/Admin/Tabs/settings.php:804
3009
  msgid "11 - 15"
3010
  msgstr ""
3011
 
3012
- #: v2/App/Views/Admin/Tabs/settings.php:813
3013
  msgid "Bulk Flat discount"
3014
  msgstr ""
3015
 
3016
- #: v2/App/Views/Admin/Tabs/settings.php:827
3017
  msgid "50 - 60"
3018
  msgstr ""
3019
 
3020
- #: v2/App/Views/Admin/Tabs/settings.php:836
3021
  msgid "Bulk percentage discount"
3022
  msgstr ""
3023
 
3024
- #: v2/App/Views/Admin/Tabs/settings.php:849
3025
  msgid "70 - 80"
3026
  msgstr ""
3027
 
3028
- #: v2/App/Views/Admin/Tabs/settings.php:858
3029
  #, php-format
3030
  msgid "Bulk % discount"
3031
  msgstr ""
3032
 
3033
- #: v2/App/Views/Admin/Tabs/settings.php:871
3034
  msgid "450 - 500"
3035
  msgstr ""
3036
 
3037
- #: v2/App/Views/Admin/Tabs/settings.php:880
3038
  msgid "Bulk flat"
3039
  msgstr ""
3040
 
3041
- #: v2/App/Views/Admin/Tabs/settings.php:894
3042
  msgid "600 - 700"
3043
  msgstr ""
3044
 
3045
- #: v2/App/Views/Admin/Tabs/settings.php:903
3046
  msgid "set percentage discount"
3047
  msgstr ""
3048
 
3049
- #: v2/App/Views/Admin/Tabs/settings.php:916
3050
  msgid "5"
3051
  msgstr ""
3052
 
3053
- #: v2/App/Views/Admin/Tabs/settings.php:925
3054
  msgid "Fixed discount for set"
3055
  msgstr ""
3056
 
3057
- #: v2/App/Views/Admin/Tabs/settings.php:938
3058
  msgid "10"
3059
  msgstr ""
3060
 
3061
- #: v2/App/Views/Admin/Tabs/settings.php:947
3062
  msgid "set flat discount"
3063
  msgstr ""
3064
 
3065
- #: v2/App/Views/Admin/Tabs/settings.php:960
3066
  msgid "15"
3067
  msgstr ""
3068
 
3069
- #: v2/App/Views/Templates/discount_table.php:136
3070
  msgid " (in cart)"
3071
  msgstr ""
4
  "Content-Type: text/plain; charset=UTF-8\n"
5
  "Content-Transfer-Encoding: 8bit\n"
6
  "Project-Id-Version: Woo Discount Rules\n"
7
+ "POT-Creation-Date: 2022-06-21\n"
8
+ "PO-Revision-Date: 2022-06-21"
9
  "Language-Team: Flycart\n"
10
  "MIME-Version: 1.0\n"
11
  "Language: \n"
12
  "X-Generator: Loco https://localise.biz/\n"
13
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;"
14
 
15
+ #: common.php:9 v2/App/Controllers/Admin/WDRAjax.php:808
16
  msgid "Invalid request"
17
  msgstr ""
18
 
90
  msgstr ""
91
 
92
  #: v2/App/Compatibility/CurrencySwitcherByRealmag777.php:60
93
+ #: v2/App/Compatibility/CurrencySwitcherByVillatheme.php:58
94
+ #: v2/App/Compatibility/CurrencySwitcherByWPWham.php:46
95
  msgid "Add compatible for WooCommerce Currency Switcher"
96
  msgstr ""
97
 
176
  msgstr ""
177
 
178
  #: v2/App/Controllers/Admin/Settings.php:437
179
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:88
180
  msgid "Disable"
181
  msgstr ""
182
 
185
  msgstr ""
186
 
187
  #: v2/App/Controllers/Admin/Settings.php:439
188
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:87
189
  msgid "Enable"
190
  msgstr ""
191
 
192
  #: v2/App/Controllers/Admin/Settings.php:440
193
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:316
194
  msgid " - (Running)"
195
  msgstr ""
196
 
243
  msgstr ""
244
 
245
  #: v2/App/Controllers/Admin/Settings.php:453
246
+ #: v2/App/Controllers/Admin/Settings.php:524
247
  msgid "Copied!"
248
  msgstr ""
249
 
250
  #: v2/App/Controllers/Admin/Settings.php:454
251
+ #: v2/App/Views/Admin/Tabs/settings.php:560
252
  msgid "Copy ShortCode"
253
  msgstr ""
254
 
288
  "<p>Note : You can also exclude products/categories.</p>"
289
  msgstr ""
290
 
291
+ #: v2/App/Controllers/Admin/Settings.php:464 v2/App/Helpers/Rule.php:1261
292
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:59
293
  #: v2/App/Views/Admin/Rules/Manage.php:242
294
  msgid "Discount"
512
  msgid "<span>Discount applies to custom taxonomy</span>"
513
  msgstr ""
514
 
515
+ #: v2/App/Controllers/Admin/Settings.php:514 v2/App/Views/Admin/Menu.php:33
516
+ msgid "Rebuild index"
517
  msgstr ""
518
 
519
  #: v2/App/Controllers/Admin/Settings.php:515
520
+ msgid "Processing please wait.."
521
  msgstr ""
522
 
523
  #: v2/App/Controllers/Admin/Settings.php:516
524
+ msgid "Rebuild index processed"
525
  msgstr ""
526
 
527
  #: v2/App/Controllers/Admin/Settings.php:517
528
+ msgid "Please select the rules to build index"
529
  msgstr ""
530
 
531
  #: v2/App/Controllers/Admin/Settings.php:518
532
+ msgid "Invalid File. Upload : <b style='color:red;'>.csv</b> File. </br>"
533
+ msgstr ""
534
+
535
+ #: v2/App/Controllers/Admin/Settings.php:519
536
  msgid ""
537
  "<b>This rule is not running currently:</b> Rule reached maximum usage limit"
538
  msgstr ""
539
 
540
+ #: v2/App/Controllers/Admin/Settings.php:520
541
  msgid ""
542
  "<b>This rule is not running currently:</b> Start date and time is set in the "
543
  "future date"
544
  msgstr ""
545
 
546
+ #: v2/App/Controllers/Admin/Settings.php:521
547
  msgid "<b>This rule is not running currently:</b> Validity expired"
548
  msgstr ""
549
 
550
+ #: v2/App/Controllers/Admin/Settings.php:522
551
  msgid "Select State"
552
  msgstr ""
553
 
554
+ #: v2/App/Controllers/Admin/Settings.php:523
555
  msgid "Copy URL"
556
  msgstr ""
557
 
558
+ #: v2/App/Controllers/Admin/Settings.php:525
559
  msgid "Coupon url copied!"
560
  msgstr ""
561
 
568
  msgstr ""
569
 
570
  #: v2/App/Controllers/Admin/Tabs/DiscountRules.php:22
571
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:15
572
  msgid "Discount Rules"
573
  msgstr ""
574
 
575
  #: v2/App/Controllers/Admin/Tabs/Help.php:17
576
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:68
577
  #: v2/App/Views/Admin/Tabs/help.php:8
578
  msgid "Documentation"
579
  msgstr ""
624
  msgid "Authentication required"
625
  msgstr ""
626
 
627
+ #: v2/App/Controllers/Admin/WDRAjax.php:769
628
  msgid "Search State"
629
  msgstr ""
630
 
643
  msgid "Products"
644
  msgstr ""
645
 
646
+ #: v2/App/Controllers/Base.php:194 v2/App/Views/Admin/Tabs/DiscountRule.php:207
647
  msgid "Product Adjustment"
648
  msgstr ""
649
 
652
  msgid "Simple Discount"
653
  msgstr ""
654
 
655
+ #: v2/App/Controllers/Base.php:200 v2/App/Views/Admin/Tabs/DiscountRule.php:210
656
  msgid "Cart Adjustment"
657
  msgstr ""
658
 
659
  #: v2/App/Controllers/Base.php:206 v2/App/Controllers/Base.php:207
660
  #: v2/App/Helpers/ProOptions.php:338
661
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:216
662
  msgid "Bulk Discount"
663
  msgstr ""
664
 
665
+ #: v2/App/Controllers/ManageDiscount.php:176
666
  msgid "<span class=\"onsale\">{{percentage}}%</span>"
667
  msgstr ""
668
 
669
+ #: v2/App/Controllers/ManageDiscount.php:187
670
  msgid "<span class=\"onsale\">Sale!</span>"
671
  msgstr ""
672
 
673
+ #: v2/App/Controllers/ManageDiscount.php:780
674
+ #: v2/App/Controllers/ManageDiscount.php:1000
675
+ #: v2/App/Controllers/ManageDiscount.php:1003 v2/App/Helpers/Helper.php:271
676
  #: v2/App/Helpers/Helper.php:272
677
  msgid "Cart discount"
678
  msgstr ""
679
 
680
+ #: v2/App/Controllers/ManageDiscount.php:1069
681
  #, php-format
682
  msgid "Coupon \"%s\" is currently not available!"
683
  msgstr ""
684
 
685
+ #: v2/App/Controllers/ManageDiscount.php:1284
686
  #, php-format
687
  msgid ""
688
  "Sorry, it is not possible to apply coupon <b>\"%s\"</b> as you already have "
689
  "a discount applied in cart."
690
  msgstr ""
691
 
692
+ #: v2/App/Controllers/ManageDiscount.php:1298
693
  msgid "Coupon code applied successfully."
694
  msgstr ""
695
 
696
+ #: v2/App/Controllers/ManageDiscount.php:1726
697
  #: v2/App/Views/Admin/Tabs/settings.php:441
698
  msgid "Discount <strong>{{title}}</strong> has been applied to your cart."
699
  msgstr ""
700
 
701
+ #: v2/App/Controllers/ManageDiscount.php:1856
702
  msgid "You saved {{total_discount}}"
703
  msgstr ""
704
 
966
  msgid "Bundle (Set) Discount - PRO -"
967
  msgstr ""
968
 
969
+ #: v2/App/Helpers/Rule.php:1339 v2/App/Helpers/Rule.php:1439
970
  #: v2/App/Views/Admin/Tabs/ImportExport.php:101
971
  msgid "Untitled Rule"
972
  msgstr ""
979
  msgid "Sending Feedback"
980
  msgstr ""
981
 
982
+ #: v2/App/Helpers/SurveyForm.php:240
983
  msgid "Upgrading to PRO."
984
  msgstr ""
985
 
986
+ #: v2/App/Helpers/SurveyForm.php:244
987
  msgid "I am switching to a different discount plugin."
988
  msgstr ""
989
 
990
+ #: v2/App/Helpers/SurveyForm.php:248
991
  msgid "I could not get my discount rule to work."
992
  msgstr ""
993
 
994
+ #: v2/App/Helpers/SurveyForm.php:252
995
  msgid "It does not meet my discount requirements."
996
  msgstr ""
997
 
998
+ #: v2/App/Helpers/SurveyForm.php:256
999
  msgid "Plugin is complex."
1000
  msgstr ""
1001
 
1002
+ #: v2/App/Helpers/SurveyForm.php:260
1003
  msgid "I'm trying to troubleshoot the plugin."
1004
  msgstr ""
1005
 
1006
+ #: v2/App/Helpers/SurveyForm.php:264
1007
  msgid "I was instructed to deactivate by Flycart Support."
1008
  msgstr ""
1009
 
1010
+ #: v2/App/Helpers/SurveyForm.php:268
1011
  msgid "I no longer use this plugin."
1012
  msgstr ""
1013
 
1014
+ #: v2/App/Helpers/SurveyForm.php:272
1015
  msgid "It's a temporary deactivation."
1016
  msgstr ""
1017
 
1018
+ #: v2/App/Helpers/SurveyForm.php:276
1019
  msgid "Other"
1020
  msgstr ""
1021
 
1022
+ #: v2/App/Helpers/SurveyForm.php:278
1023
  msgid "Please share the reason"
1024
  msgstr ""
1025
 
1026
+ #: v2/App/Helpers/SurveyForm.php:288
1027
  msgid "Quick Feedback"
1028
  msgstr ""
1029
 
1030
+ #: v2/App/Helpers/SurveyForm.php:289
1031
  msgid "Close"
1032
  msgstr ""
1033
 
1034
+ #: v2/App/Helpers/SurveyForm.php:297
1035
  #, php-format
1036
  msgid "If you have a moment, please share why you are deactivating %s:"
1037
  msgstr ""
1038
 
1039
+ #: v2/App/Helpers/SurveyForm.php:298
1040
  msgid "Discount Rules for WooCommerce"
1041
  msgstr ""
1042
 
1043
+ #: v2/App/Helpers/SurveyForm.php:326
1044
  msgid "Submit & Deactivate"
1045
  msgstr ""
1046
 
1047
+ #: v2/App/Helpers/SurveyForm.php:328
1048
  msgid "Skip & Deactivate"
1049
  msgstr ""
1050
 
1051
  #: v2/App/Helpers/Validation.php:146 v2/App/Helpers/Validation.php:151
1052
+ #: v2/App/Helpers/Validation.php:348 v2/App/Helpers/Validation.php:545
1053
  msgid "Invalid characters"
1054
  msgstr ""
1055
 
1086
  msgid "Invalid inputs"
1087
  msgstr ""
1088
 
1089
+ #: v2/App/Helpers/Validation.php:519
1090
  msgid "Validation error"
1091
  msgstr ""
1092
 
1093
+ #: v2/App/Helpers/Woocommerce.php:987
1094
  msgid "Sunday"
1095
  msgstr ""
1096
 
1097
+ #: v2/App/Helpers/Woocommerce.php:988
1098
  msgid "Monday"
1099
  msgstr ""
1100
 
1101
+ #: v2/App/Helpers/Woocommerce.php:989
1102
  msgid "Tuesday"
1103
  msgstr ""
1104
 
1105
+ #: v2/App/Helpers/Woocommerce.php:990
1106
  msgid "Wednesday"
1107
  msgstr ""
1108
 
1109
+ #: v2/App/Helpers/Woocommerce.php:991
1110
  msgid "Thursday"
1111
  msgstr ""
1112
 
1113
+ #: v2/App/Helpers/Woocommerce.php:992
1114
  msgid "Friday"
1115
  msgstr ""
1116
 
1117
+ #: v2/App/Helpers/Woocommerce.php:993
1118
  msgid "Saturday"
1119
  msgstr ""
1120
 
1121
+ #: v2/App/Helpers/Woocommerce.php:1004
1122
  msgid ""
1123
  "Woocommerce before main content(Archive / Shop / Cat Pages / single product)"
1124
  msgstr ""
1125
 
1126
+ #: v2/App/Helpers/Woocommerce.php:1005
1127
  msgid "Woocommerce archive description(Archive / Shop / Cat Pages)"
1128
  msgstr ""
1129
 
1130
+ #: v2/App/Helpers/Woocommerce.php:1006
1131
  msgid "Woocommerce before shop loop(Archive / Shop / Cat Pages)"
1132
  msgstr ""
1133
 
1134
+ #: v2/App/Helpers/Woocommerce.php:1007
1135
  msgid "Woocommerce after shop loop(Archive / Shop / Cat Pages)"
1136
  msgstr ""
1137
 
1138
+ #: v2/App/Helpers/Woocommerce.php:1008
1139
  msgid ""
1140
  "Woocommerce after main content(Archive / Shop / Cat Pages / single product)"
1141
  msgstr ""
1142
 
1143
+ #: v2/App/Helpers/Woocommerce.php:1009 v2/App/Views/Admin/Tabs/settings.php:230
1144
  #: v2/App/Views/Admin/Tabs/settings.php:248
1145
  msgid "Woocommerce before single product"
1146
  msgstr ""
1147
 
1148
+ #: v2/App/Helpers/Woocommerce.php:1010 v2/App/Views/Admin/Tabs/settings.php:232
1149
  #: v2/App/Views/Admin/Tabs/settings.php:250
1150
  msgid "Woocommerce before single product summary"
1151
  msgstr ""
1152
 
1153
+ #: v2/App/Helpers/Woocommerce.php:1011 v2/App/Views/Admin/Tabs/settings.php:231
1154
  #: v2/App/Views/Admin/Tabs/settings.php:249
1155
  msgid "Woocommerce after single product summary"
1156
  msgstr ""
1157
 
1158
+ #: v2/App/Helpers/Woocommerce.php:1012 v2/App/Views/Admin/Tabs/settings.php:229
1159
  #: v2/App/Views/Admin/Tabs/settings.php:247
1160
  msgid "Woocommerce after single product"
1161
  msgstr ""
1162
 
1163
+ #: v2/App/Helpers/Woocommerce.php:1013
1164
  msgid "Woocommerce before cart"
1165
  msgstr ""
1166
 
1167
+ #: v2/App/Helpers/Woocommerce.php:1014
1168
  msgid "Woocommerce before cart table"
1169
  msgstr ""
1170
 
1171
+ #: v2/App/Helpers/Woocommerce.php:1015
1172
  msgid "Woocommerce before cart contents"
1173
  msgstr ""
1174
 
1175
+ #: v2/App/Helpers/Woocommerce.php:1016
1176
  msgid "Woocommerce cart contents"
1177
  msgstr ""
1178
 
1179
+ #: v2/App/Helpers/Woocommerce.php:1017
1180
  msgid "Woocommerce after cart contents"
1181
  msgstr ""
1182
 
1183
+ #: v2/App/Helpers/Woocommerce.php:1018
1184
  msgid "Woocommerce after cart table"
1185
  msgstr ""
1186
 
1187
+ #: v2/App/Helpers/Woocommerce.php:1019
1188
  msgid "Woocommerce after cart"
1189
  msgstr ""
1190
 
1191
+ #: v2/App/Helpers/Woocommerce.php:1020
1192
  msgid "Woocommerce before checkout form"
1193
  msgstr ""
1194
 
1195
+ #: v2/App/Helpers/Woocommerce.php:1022
1196
  msgid "Woocommerce before checkout billing form"
1197
  msgstr ""
1198
 
1199
+ #: v2/App/Helpers/Woocommerce.php:1023
1200
  msgid "Woocommerce after checkout billing form"
1201
  msgstr ""
1202
 
1203
+ #: v2/App/Helpers/Woocommerce.php:1024
1204
  msgid "Woocommerce before checkout shipping form"
1205
  msgstr ""
1206
 
1207
+ #: v2/App/Helpers/Woocommerce.php:1025
1208
  msgid "Woocommerce after checkout shipping form"
1209
  msgstr ""
1210
 
1211
+ #: v2/App/Helpers/Woocommerce.php:1026
1212
  msgid "Woocommerce before order notes"
1213
  msgstr ""
1214
 
1215
+ #: v2/App/Helpers/Woocommerce.php:1027
1216
  msgid "Woocommerce after order notes"
1217
  msgstr ""
1218
 
1219
+ #: v2/App/Helpers/Woocommerce.php:1561
1220
  msgid "Coupon already exists in WooCommerce. Please select another name"
1221
  msgstr ""
1222
 
 
 
 
 
1223
  #: v2/App/Views/Admin/Rules/Conditions/Cart/LineItemCount.php:12
1224
  #: v2/App/Views/Admin/Rules/Conditions/Cart/Subtotal.php:13
1225
  msgid "Less than ( &lt; )"
1391
  msgstr ""
1392
 
1393
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:22
1394
+ #: v2/App/Views/Admin/Tabs/settings.php:640
1395
  msgid "Note:"
1396
  msgstr ""
1397
 
1419
  #: v2/App/Views/Admin/Tabs/settings.php:304
1420
  #: v2/App/Views/Admin/Tabs/settings.php:333
1421
  #: v2/App/Views/Admin/Tabs/settings.php:425
1422
+ #: v2/App/Views/Admin/Tabs/settings.php:546
1423
  #: v2/App/Views/Admin/Tabs/settings.php:580
1424
  #: v2/App/Views/Admin/Tabs/settings.php:597
1425
+ #: v2/App/Views/Admin/Tabs/settings.php:614
1426
  msgid "Yes"
1427
  msgstr ""
1428
 
1438
  #: v2/App/Views/Admin/Tabs/settings.php:308
1439
  #: v2/App/Views/Admin/Tabs/settings.php:339
1440
  #: v2/App/Views/Admin/Tabs/settings.php:430
1441
+ #: v2/App/Views/Admin/Tabs/settings.php:551
1442
  #: v2/App/Views/Admin/Tabs/settings.php:585
1443
  #: v2/App/Views/Admin/Tabs/settings.php:602
1444
+ #: v2/App/Views/Admin/Tabs/settings.php:619
1445
  msgid "No"
1446
  msgstr ""
1447
 
1544
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:53
1545
  #: v2/App/Views/Admin/Rules/Discounts/Cart.php:24
1546
  #: v2/App/Views/Admin/Rules/Discounts/simple.php:23
1547
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:123
1548
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:360
1549
  msgid "Discount Type"
1550
  msgstr ""
1551
 
1552
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:63
1553
+ #: v2/App/Views/Admin/Tabs/settings.php:706
1554
  msgid "Discount Value"
1555
  msgstr ""
1556
 
1580
  msgstr ""
1581
 
1582
  #: v2/App/Views/Admin/Rules/Discounts/Cart.php:42
1583
+ #: v2/App/Views/Admin/Rules/Discounts/Main.php:102
1584
+ #: v2/App/Views/Admin/Rules/Discounts/simple.php:48
1585
  msgid "Discount Label"
1586
  msgstr ""
1587
 
1702
  msgid "Not In List"
1703
  msgstr ""
1704
 
1705
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:82
1706
  msgid "Select "
1707
  msgstr ""
1708
 
1709
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:98
1710
  msgid ""
1711
  "Choose products that get the discount using \"In List\". If you want to "
1712
  "exclude a few products, choose \"Not In List\" and select the products you "
1713
  "wanted to exclude from discount. (You can add multiple filters)"
1714
  msgstr ""
1715
 
1716
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:101
1717
  msgid ""
1718
  "Choose categories that get the discount using \"In List\". If you want to "
1719
  "exclude a few categories, choose \"Not In List\" and select the categories "
1721
  "type)"
1722
  msgstr ""
1723
 
1724
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:104
1725
  msgid ""
1726
  "Choose attributes that get the discount using \"In List\". If you want to "
1727
  "exclude a few attributes, choose \"Not In List\" and select the attributes "
1729
  "type)"
1730
  msgstr ""
1731
 
1732
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:107
1733
  msgid ""
1734
  "Choose tags that get the discount using \"In List\". If you want to exclude "
1735
  "a few tags, choose \"Not In List\" and select the tags you wanted to exclude "
1736
  "from discount. (You can add multiple filters of same type)"
1737
  msgstr ""
1738
 
1739
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:110
1740
  msgid ""
1741
  "Choose SKUs that get the discount using \"In List\". If you want to exclude "
1742
  "a few SKUs, choose \"Not In List\" and select the SKUs you wanted to exclude "
1743
  "from discount. (You can add multiple filters of same type)"
1744
  msgstr ""
1745
 
1746
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:113
1747
  msgid ""
1748
  "Choose whether you want to include (or exclude) products on sale (those "
1749
  "having a sale price) for the discount "
1750
  msgstr ""
1751
 
1752
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:116
1753
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:162
1754
  msgid "Discount applies to all eligible products in the store"
1755
  msgstr ""
1756
 
1757
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:120
1758
  msgid "Discount applies to custom taxonomy"
1759
  msgstr ""
1760
 
1761
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:173
1762
  msgid "Add filter"
1763
  msgstr ""
1764
 
1836
  msgid "Select discount type and its value (percentage/price/fixed price)"
1837
  msgstr ""
1838
 
1839
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:15
1840
  #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:17
1841
  msgid "Promotion Message"
1842
  msgstr ""
1843
 
1844
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:17
1845
  msgid "Quantity from"
1846
  msgstr ""
1847
 
1848
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:21
1849
  msgid "0"
1850
  msgstr ""
1851
 
1852
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:23
1853
  #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:25
1854
  msgid "Set a threshold from which you want to start showing promotion message"
1855
  msgstr ""
1856
 
1857
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:24
1858
  #, php-format
1859
  msgid ""
1860
  "<b>Example:</b> Let's say you offer a 10% discount for 5 quantities and "
1862
  "text when his cart quantities reaches 3"
1863
  msgstr ""
1864
 
1865
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:27
1866
  #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:29
1867
  msgid "Message"
1868
  msgstr ""
1869
 
1870
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:31
1871
  #, php-format
1872
  msgid "Buy {{difference_quantity}} more products and get 10% discount"
1873
  msgstr ""
1874
 
1875
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:32
1876
  msgid "{{difference_quantity}} -> Difference amount to get discount"
1877
  msgstr ""
1878
 
1879
+ #: v2/App/Views/Admin/Rules/Others/QuantityPromotion.php:33
1880
  #, php-format
1881
  msgid ""
1882
  "<b>Eg:</b> Buy {{difference_quantity}} more products and get 10% discount"
1933
  msgid "Disable recalculate when coupon apply"
1934
  msgstr ""
1935
 
1936
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:17
1937
  msgid "Add New Rule"
1938
  msgstr ""
1939
 
1940
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:21
1941
  msgid "Migrate rules from v1"
1942
  msgstr ""
1943
 
1944
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:29
1945
  msgid "Migration"
1946
  msgstr ""
1947
 
1948
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:33
1949
  #: v2/App/Views/Admin/welcome-text.php:9
1950
  msgid "Migrate rules from v1 to v2"
1951
  msgstr ""
1952
 
1953
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:37
1954
  msgid "Available price rules"
1955
  msgstr ""
1956
 
1957
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:40
1958
  msgid "Available cart rules"
1959
  msgstr ""
1960
 
1961
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:43
1962
  msgid ""
1963
  "Once migration is completed, please open the rules and check their "
1964
  "configuration once again to make sure it meets your discount scenario. If "
1967
  "\">https://www.flycart.org/support</a>"
1968
  msgstr ""
1969
 
1970
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:48
1971
  #: v2/App/Views/Admin/welcome-text.php:14
1972
  msgid "Migrate"
1973
  msgstr ""
1974
 
1975
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:49
1976
  #: v2/App/Views/Admin/welcome-text.php:15
1977
  msgid "Skip"
1978
  msgstr ""
1979
 
1980
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:64
1981
  msgid "View Examples"
1982
  msgstr ""
1983
 
1984
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:78
1985
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:84
1986
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:98
1987
  msgid "Search Rules"
1988
  msgstr ""
1989
 
1990
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:86
1991
  msgid "Bulk Actions"
1992
  msgstr ""
1993
 
1994
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:89
1995
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:331
1996
  msgid "Delete"
1997
  msgstr ""
1998
 
1999
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:92
2000
  msgid "Apply"
2001
  msgstr ""
2002
 
2003
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:102
2004
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:398
2005
  msgid "item"
2006
  msgstr ""
2007
 
2008
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:102
2009
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:398
2010
  msgid "items"
2011
  msgstr ""
2012
 
2013
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:118
2014
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:355
2015
  msgid "Title"
2016
  msgstr ""
2017
 
2018
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:125
2019
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:362
2020
  msgid "Start Date"
2021
  msgstr ""
2022
 
2023
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:127
2024
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:364
2025
  msgid "Expired On"
2026
  msgstr ""
2027
 
2028
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:132
2029
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:369
2030
  msgid "Language(s)"
2031
  msgstr ""
2032
 
2033
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:140
2034
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:377
2035
  msgid "Status"
2036
  msgstr ""
2037
 
2038
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:142
2039
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:379
2040
  msgid "Action"
2041
  msgstr ""
2042
 
2043
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:164
2044
  msgid "Exclusive"
2045
  msgstr ""
2046
 
2047
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:193
2048
  msgid "Created by: "
2049
  msgstr ""
2050
 
2051
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:194
2052
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:198
2053
  msgid " On: "
2054
  msgstr ""
2055
 
2056
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:197
2057
  msgid "Modified by: "
2058
  msgstr ""
2059
 
2060
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:213
2061
  #: v2/App/Views/Admin/Tabs/help.php:112
2062
  msgid "Free Shipping"
2063
  msgstr ""
2064
 
2065
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:219
2066
  msgid "Set Discount"
2067
  msgstr ""
2068
 
2069
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:222
2070
  msgid "Buy X get X"
2071
  msgstr ""
2072
 
2073
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:225
2074
  msgid "Buy X get Y"
2075
  msgstr ""
2076
 
2077
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:268
2078
  msgid "Enabled"
2079
  msgstr ""
2080
 
2081
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:268
2082
  #: v2/App/Views/Admin/Tabs/settings.php:398
2083
  msgid "Disabled"
2084
  msgstr ""
2085
 
2086
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:279
2087
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:294
2088
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:310
2089
  msgid " - ( Not running )"
2090
  msgstr ""
2091
 
2092
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:280
2093
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:297
2094
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:313
2095
  msgid "Rule reached maximum usage limit"
2096
  msgstr ""
2097
 
2098
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:284
2099
  msgid " - ( Will run in future)"
2100
  msgstr ""
2101
 
2102
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:288
2103
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:304
2104
  msgid "Your server current date and time:"
2105
  msgstr ""
2106
 
2107
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:300
2108
  msgid " - ( Not running - validity expired)"
2109
  msgstr ""
2110
 
2111
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:324
2112
  msgid "Edit"
2113
  msgstr ""
2114
 
2115
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:327
2116
  msgid "Duplicate"
2117
  msgstr ""
2118
 
2119
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:342
2120
  msgid "No rules found."
2121
  msgstr ""
2122
 
2123
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:415
2124
  #: v2/App/Views/Admin/Tabs/help.php:160
2125
  msgid "Looking for more features? Upgrade to PRO"
2126
  msgstr ""
2127
 
2128
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:420
2129
  #: v2/App/Views/Admin/Tabs/help.php:165
2130
  msgid "With PRO version, you can create:"
2131
  msgstr ""
2132
 
2133
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:421
2134
  #: v2/App/Views/Admin/Tabs/help.php:166
2135
  msgid "- Categories based discounts"
2136
  msgstr ""
2137
 
2138
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:422
2139
  #: v2/App/Views/Admin/Tabs/help.php:167
2140
  msgid "- User roles based discounts"
2141
  msgstr ""
2142
 
2143
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:423
2144
  #: v2/App/Views/Admin/Tabs/help.php:168
2145
  msgid "- Buy One Get One Free deals"
2146
  msgstr ""
2147
 
2148
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:424
2149
  #: v2/App/Views/Admin/Tabs/help.php:169
2150
  msgid "- Buy X Get Y deals"
2151
  msgstr ""
2152
 
2153
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:425
2154
  #: v2/App/Views/Admin/Tabs/help.php:170
2155
  #, php-format
2156
  msgid "- Buy 2, get 1 at 50% discount"
2157
  msgstr ""
2158
 
2159
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:426
2160
  #: v2/App/Views/Admin/Tabs/help.php:171
2161
  msgid "- Buy 3 for $10 (Package / Bundle [Set] Discount)"
2162
  msgstr ""
2163
 
2164
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:427
2165
  #: v2/App/Views/Admin/Tabs/help.php:172
2166
  msgid "- Different discounts with one coupon code"
2167
  msgstr ""
2168
 
2169
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:428
2170
  #: v2/App/Views/Admin/Tabs/help.php:173
2171
  msgid "- Purchase history based discounts"
2172
  msgstr ""
2173
 
2174
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:429
2175
  #: v2/App/Views/Admin/Tabs/help.php:174
2176
  msgid "- Free product / gift"
2177
  msgstr ""
2178
 
2179
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:430
2180
  #: v2/App/Views/Admin/Tabs/help.php:175
2181
  msgid "- Discount for variants"
2182
  msgstr ""
2183
 
2184
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:431
2185
  #: v2/App/Views/Admin/Tabs/help.php:176
2186
  msgid "- Conditional discounts"
2187
  msgstr ""
2188
 
2189
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:432
2190
  #: v2/App/Views/Admin/Tabs/help.php:177
2191
  msgid "- Fixed cost discounts"
2192
  msgstr ""
2193
 
2194
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:433
2195
  #: v2/App/Views/Admin/Tabs/help.php:178
2196
  msgid "- Offer fixed price on certain conditions"
2197
  msgstr ""
2198
 
2199
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:437
2200
  #: v2/App/Views/Admin/Tabs/help.php:179
2201
  msgid "Go PRO"
2202
  msgstr ""
2645
  msgstr ""
2646
 
2647
  #: v2/App/Views/Admin/Tabs/settings.php:213
2648
+ #: v2/App/Views/Admin/Tabs/settings.php:635
2649
  msgid "Customize Discount Table"
2650
  msgstr ""
2651
 
2874
  msgid "Save and Build Index"
2875
  msgstr ""
2876
 
2877
+ #: v2/App/Views/Admin/Tabs/settings.php:539
2878
+ msgid "Select cron to run daily"
2879
+ msgstr ""
2880
+
2881
  #: v2/App/Views/Admin/Tabs/settings.php:540
2882
+ msgid "This setting will be useful for validity based rules."
2883
+ msgstr ""
2884
+
2885
+ #: v2/App/Views/Admin/Tabs/settings.php:557
2886
  msgid ""
2887
  "ShortCode to load all products which has discount through Woo Discount Rules"
2888
  msgstr ""
2889
 
2890
+ #: v2/App/Views/Admin/Tabs/settings.php:566
2891
  msgid "Third party plugin conflict fixes & options"
2892
  msgstr ""
2893
 
2894
+ #: v2/App/Views/Admin/Tabs/settings.php:567
2895
  msgid ""
2896
  "Use these advanced options ONLY when you use a third party plugin that "
2897
  "interacts with product pricing & discounts and only when you DONT see the "
2898
  "discounts applying. Otherwise these options should be left as NO."
2899
  msgstr ""
2900
 
2901
+ #: v2/App/Views/Admin/Tabs/settings.php:568
2902
  msgid ""
2903
  "IMPORTANT: Please consult with our support team by opening a ticket at <a "
2904
  "href=\"https://www.flycart.org/support\" target=\"_blank\">https://www."
2905
  "flycart.org/support</a> before you use these options."
2906
  msgstr ""
2907
 
2908
+ #: v2/App/Views/Admin/Tabs/settings.php:573
2909
  msgid ""
2910
  "Do you have custom prices set using another plugin or custom code? (Example: "
2911
  "A wholesale price or a country specific pricing)"
2912
  msgstr ""
2913
 
2914
+ #: v2/App/Views/Admin/Tabs/settings.php:574
2915
  msgid ""
2916
  "If you have custom prices for your products like using another plugin and if "
2917
  "you do not see the discount NOT applied, enable this option."
2918
  msgstr ""
2919
 
2920
+ #: v2/App/Views/Admin/Tabs/settings.php:590
2921
  msgid "Disable re-calculating the cart total on cart page"
2922
  msgstr ""
2923
 
2924
+ #: v2/App/Views/Admin/Tabs/settings.php:591
2925
  msgid ""
2926
  "This will be helpful if you see the discounts not working. It could be "
2927
  "because other plugins might be force re-calculating the totals in cart."
2928
  msgstr ""
2929
 
2930
+ #: v2/App/Views/Admin/Tabs/settings.php:607
2931
  msgid "Disable re-calculating the total when applying the coupon."
2932
  msgstr ""
2933
 
2934
+ #: v2/App/Views/Admin/Tabs/settings.php:608
2935
  msgid ""
2936
  "This will be useful, if you see the discounts being removed after the coupon "
2937
  "applies... or the discount does not work after applying a coupon."
2938
  msgstr ""
2939
 
2940
+ #: v2/App/Views/Admin/Tabs/settings.php:638
2941
  msgid "Settings Saved"
2942
  msgstr ""
2943
 
2944
+ #: v2/App/Views/Admin/Tabs/settings.php:639
2945
  msgid "Oops! Something went wrong."
2946
  msgstr ""
2947
 
2948
+ #: v2/App/Views/Admin/Tabs/settings.php:640
2949
  msgid " This table contains sample content for design purpose."
2950
  msgstr ""
2951
 
2952
+ #: v2/App/Views/Admin/Tabs/settings.php:650
2953
  msgid "Table Header"
2954
  msgstr ""
2955
 
2956
+ #: v2/App/Views/Admin/Tabs/settings.php:651
2957
  msgid "Show/Hide table header column names"
2958
  msgstr ""
2959
 
2960
+ #: v2/App/Views/Admin/Tabs/settings.php:656
2961
  msgid "Show"
2962
  msgstr ""
2963
 
2964
+ #: v2/App/Views/Admin/Tabs/settings.php:659
2965
  msgid "Don't Show"
2966
  msgstr ""
2967
 
2968
+ #: v2/App/Views/Admin/Tabs/settings.php:664
2969
  msgid "Title column Name on table"
2970
  msgstr ""
2971
 
2972
+ #: v2/App/Views/Admin/Tabs/settings.php:665
2973
  msgid "Give name for rule title column"
2974
  msgstr ""
2975
 
2976
+ #: v2/App/Views/Admin/Tabs/settings.php:676
2977
  msgid "Discount column Name on table"
2978
  msgstr ""
2979
 
2980
+ #: v2/App/Views/Admin/Tabs/settings.php:677
2981
  msgid "Give name for discount column"
2982
  msgstr ""
2983
 
2984
+ #: v2/App/Views/Admin/Tabs/settings.php:688
2985
  msgid "Range column Name on table"
2986
  msgstr ""
2987
 
2988
+ #: v2/App/Views/Admin/Tabs/settings.php:689
2989
  msgid "Give name for range column"
2990
  msgstr ""
2991
 
2992
+ #: v2/App/Views/Admin/Tabs/settings.php:700
2993
  msgid "Discount column value on table"
2994
  msgstr ""
2995
 
2996
+ #: v2/App/Views/Admin/Tabs/settings.php:701
2997
  msgid "Show Discount value/price in table"
2998
  msgstr ""
2999
 
3000
+ #: v2/App/Views/Admin/Tabs/settings.php:709
3001
  msgid "Discounted Price"
3002
  msgstr ""
3003
 
3004
+ #: v2/App/Views/Admin/Tabs/settings.php:784
3005
+ #: v2/App/Views/Admin/Tabs/settings.php:807
3006
  msgid "Bulk Rule"
3007
  msgstr ""
3008
 
3009
+ #: v2/App/Views/Admin/Tabs/settings.php:792
3010
+ #: v2/App/Views/Admin/Tabs/settings.php:838
3011
+ #: v2/App/Views/Admin/Tabs/settings.php:905
3012
+ #: v2/App/Views/Templates/discount_table.php:142
3013
  msgid " flat"
3014
  msgstr ""
3015
 
3016
+ #: v2/App/Views/Admin/Tabs/settings.php:798
3017
  msgid "1 - 5"
3018
  msgstr ""
3019
 
3020
+ #: v2/App/Views/Admin/Tabs/settings.php:821
3021
  msgid "11 - 15"
3022
  msgstr ""
3023
 
3024
+ #: v2/App/Views/Admin/Tabs/settings.php:830
3025
  msgid "Bulk Flat discount"
3026
  msgstr ""
3027
 
3028
+ #: v2/App/Views/Admin/Tabs/settings.php:844
3029
  msgid "50 - 60"
3030
  msgstr ""
3031
 
3032
+ #: v2/App/Views/Admin/Tabs/settings.php:853
3033
  msgid "Bulk percentage discount"
3034
  msgstr ""
3035
 
3036
+ #: v2/App/Views/Admin/Tabs/settings.php:866
3037
  msgid "70 - 80"
3038
  msgstr ""
3039
 
3040
+ #: v2/App/Views/Admin/Tabs/settings.php:875
3041
  #, php-format
3042
  msgid "Bulk % discount"
3043
  msgstr ""
3044
 
3045
+ #: v2/App/Views/Admin/Tabs/settings.php:888
3046
  msgid "450 - 500"
3047
  msgstr ""
3048
 
3049
+ #: v2/App/Views/Admin/Tabs/settings.php:897
3050
  msgid "Bulk flat"
3051
  msgstr ""
3052
 
3053
+ #: v2/App/Views/Admin/Tabs/settings.php:911
3054
  msgid "600 - 700"
3055
  msgstr ""
3056
 
3057
+ #: v2/App/Views/Admin/Tabs/settings.php:920
3058
  msgid "set percentage discount"
3059
  msgstr ""
3060
 
3061
+ #: v2/App/Views/Admin/Tabs/settings.php:933
3062
  msgid "5"
3063
  msgstr ""
3064
 
3065
+ #: v2/App/Views/Admin/Tabs/settings.php:942
3066
  msgid "Fixed discount for set"
3067
  msgstr ""
3068
 
3069
+ #: v2/App/Views/Admin/Tabs/settings.php:955
3070
  msgid "10"
3071
  msgstr ""
3072
 
3073
+ #: v2/App/Views/Admin/Tabs/settings.php:964
3074
  msgid "set flat discount"
3075
  msgstr ""
3076
 
3077
+ #: v2/App/Views/Admin/Tabs/settings.php:977
3078
  msgid "15"
3079
  msgstr ""
3080
 
3081
+ #: v2/App/Views/Templates/discount_table.php:137
3082
  msgid " (in cart)"
3083
  msgstr ""
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: flycart
3
  Donate link: https://flycart.org/
4
  Tags: woocommerce, coupons, discounts, dynamic pricing, Buy One Get One Free, pricing deals, bulk discount, discount
5
  Requires at least: 4.4.1
6
- Tested up to: 5.9
7
- Stable tag: 2.4.1
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -336,6 +336,17 @@ Note : Enable recursive checkbox if the discounts should be applied in sequentia
336
 
337
  == Changelog ==
338
 
 
 
 
 
 
 
 
 
 
 
 
339
  = 2.4.1 - 17/05/22 =
340
  * Improvement: Added template override path for Bulk table.
341
  * Improvement: Removed backslash while using single quote on promotion message.
3
  Donate link: https://flycart.org/
4
  Tags: woocommerce, coupons, discounts, dynamic pricing, Buy One Get One Free, pricing deals, bulk discount, discount
5
  Requires at least: 4.4.1
6
+ Tested up to: 6.0
7
+ Stable tag: 2.4.2
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
336
 
337
  == Changelog ==
338
 
339
+ = 2.4.2 - 21/06/22 =
340
+ * Feature: Option to schedule sale page product rebuild on daily once.
341
+ * Improvement: Event: advanced_woo_discount_rules_variation_title_modify_count
342
+ * Improvement: Event: advanced_woo_discount_rules_refresh_shipping_options_on_order_review
343
+ * Fix: Cart coupon Condition not working when cart is empty.
344
+ * Fix: Fatal error due to Invalid Product ID on save rule.
345
+ * Fix: Warning on ajax strikeout.
346
+ * Fix: Strikeout not displayed for BXGY cheapest individual product on product page and cross sell block.
347
+ * Fix: BXGY discount applies before matches.
348
+ * Fix: esc_attr() applied to prevent XSS issues.
349
+
350
  = 2.4.1 - 17/05/22 =
351
  * Improvement: Added template override path for Bulk table.
352
  * Improvement: Removed backslash while using single quote on promotion message.
v2/App/Compatibility/AeliaCurrencySwitcherByAelia.php CHANGED
@@ -45,7 +45,7 @@ class AeliaCurrencySwitcherByAelia extends Base
45
  ?>
46
  <div class="awdr-compatible-field">
47
  <label>
48
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
49
  <?php esc_html_e('Add compatible for Aelia Currency Switcher', 'woo-discount-rules'); ?>
50
  </label>
51
  </div>
45
  ?>
46
  <div class="awdr-compatible-field">
47
  <label>
48
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
49
  <?php esc_html_e('Add compatible for Aelia Currency Switcher', 'woo-discount-rules'); ?>
50
  </label>
51
  </div>
v2/App/Compatibility/CompositeProductsBySomewhereWarm.php CHANGED
@@ -47,7 +47,7 @@ class CompositeProductsBySomewhereWarm extends Base
47
  ?>
48
  <div class="awdr-compatible-field">
49
  <label>
50
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
51
  <?php esc_html_e('Add compatible for WooCommerce Composite Products', 'woo-discount-rules'); ?>
52
  </label>
53
  <br>
47
  ?>
48
  <div class="awdr-compatible-field">
49
  <label>
50
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
51
  <?php esc_html_e('Add compatible for WooCommerce Composite Products', 'woo-discount-rules'); ?>
52
  </label>
53
  <br>
v2/App/Compatibility/CurrencySwitcherByRealmag777.php CHANGED
@@ -56,7 +56,7 @@ class CurrencySwitcherByRealmag777 extends Base
56
  ?>
57
  <div class="awdr-compatible-field">
58
  <label>
59
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
60
  <?php esc_html_e('Add compatible for WooCommerce Currency Switcher', 'woo-discount-rules'); ?>
61
  </label>
62
  </div>
56
  ?>
57
  <div class="awdr-compatible-field">
58
  <label>
59
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
60
  <?php esc_html_e('Add compatible for WooCommerce Currency Switcher', 'woo-discount-rules'); ?>
61
  </label>
62
  </div>
v2/App/Compatibility/CurrencySwitcherByVillatheme.php CHANGED
@@ -54,7 +54,7 @@ class CurrencySwitcherByVillatheme extends Base
54
  ?>
55
  <div class="awdr-compatible-field">
56
  <label>
57
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
58
  <?php esc_html_e('Add compatible for WooCommerce Currency Switcher', 'woo-discount-rules'); ?>
59
  </label>
60
  </div>
54
  ?>
55
  <div class="awdr-compatible-field">
56
  <label>
57
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
58
  <?php esc_html_e('Add compatible for WooCommerce Currency Switcher', 'woo-discount-rules'); ?>
59
  </label>
60
  </div>
v2/App/Compatibility/CurrencySwitcherByWPWham.php CHANGED
@@ -42,7 +42,7 @@ class CurrencySwitcherByWPWham extends Base
42
  ?>
43
  <div class="awdr-compatible-field">
44
  <label>
45
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
46
  <?php esc_html_e('Add compatible for WooCommerce Currency Switcher', 'woo-discount-rules'); ?>
47
  </label>
48
  </div>
42
  ?>
43
  <div class="awdr-compatible-field">
44
  <label>
45
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
46
  <?php esc_html_e('Add compatible for WooCommerce Currency Switcher', 'woo-discount-rules'); ?>
47
  </label>
48
  </div>
v2/App/Compatibility/ExtraProductOptionsProByThemeHigh.php CHANGED
@@ -50,7 +50,7 @@ class ExtraProductOptionsProByThemeHigh extends Base
50
  ?>
51
  <div class="awdr-compatible-field">
52
  <label>
53
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
54
  <?php esc_html_e('Add compatible for WooCommerce Extra Product Options', 'woo-discount-rules'); ?>
55
  </label>
56
  <br>
50
  ?>
51
  <div class="awdr-compatible-field">
52
  <label>
53
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
54
  <?php esc_html_e('Add compatible for WooCommerce Extra Product Options', 'woo-discount-rules'); ?>
55
  </label>
56
  <br>
v2/App/Compatibility/FacebookForWoocommerceByFacebook.php CHANGED
@@ -40,7 +40,7 @@ class FacebookForWoocommerceByFacebook extends Base
40
  ?>
41
  <div class="awdr-compatible-field">
42
  <label>
43
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
44
  <?php esc_html_e('Add compatible for Facebook for WooCommerce', 'woo-discount-rules'); ?>
45
  </label>
46
  <br>
40
  ?>
41
  <div class="awdr-compatible-field">
42
  <label>
43
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
44
  <?php esc_html_e('Add compatible for Facebook for WooCommerce', 'woo-discount-rules'); ?>
45
  </label>
46
  <br>
v2/App/Compatibility/MultiCurrencyByTivNet.php CHANGED
@@ -56,7 +56,7 @@ class MultiCurrencyByTivNet extends Base
56
  ?>
57
  <div class="awdr-compatible-field">
58
  <label>
59
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
60
  <?php esc_html_e('Add compatible for WooCommerce Multi-Currency.', 'woo-discount-rules'); ?>
61
  </label>
62
  </div>
56
  ?>
57
  <div class="awdr-compatible-field">
58
  <label>
59
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
60
  <?php esc_html_e('Add compatible for WooCommerce Multi-Currency.', 'woo-discount-rules'); ?>
61
  </label>
62
  </div>
v2/App/Compatibility/MultiCurrencyByWPML.php CHANGED
@@ -45,7 +45,7 @@ class MultiCurrencyByWPML extends Base
45
  ?>
46
  <div class="awdr-compatible-field">
47
  <label>
48
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
49
  <?php esc_html_e('Add additional compatible for WPML (Multi-Currency)', 'woo-discount-rules'); ?>
50
  </label>
51
  </div>
45
  ?>
46
  <div class="awdr-compatible-field">
47
  <label>
48
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
49
  <?php esc_html_e('Add additional compatible for WPML (Multi-Currency)', 'woo-discount-rules'); ?>
50
  </label>
51
  </div>
v2/App/Compatibility/PriceBasedOnCountryByOscarGare.php CHANGED
@@ -43,7 +43,7 @@ class PriceBasedOnCountryByOscarGare extends Base
43
  ?>
44
  <div class="awdr-compatible-field">
45
  <label>
46
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
47
  <?php esc_html_e('Add compatible for WooCommerce Price Based on Country', 'woo-discount-rules'); ?>
48
  </label>
49
  </div>
43
  ?>
44
  <div class="awdr-compatible-field">
45
  <label>
46
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
47
  <?php esc_html_e('Add compatible for WooCommerce Price Based on Country', 'woo-discount-rules'); ?>
48
  </label>
49
  </div>
v2/App/Compatibility/ProductAddOnsByWooCommerce.php CHANGED
@@ -104,7 +104,7 @@ class ProductAddOnsByWooCommerce extends Base
104
  ?>
105
  <div class="awdr-compatible-field">
106
  <label>
107
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
108
  <?php esc_html_e('Show discount price in product pages for WooCommerce Product Add Ons.', 'woo-discount-rules'); ?>
109
  </label>
110
  </div>
104
  ?>
105
  <div class="awdr-compatible-field">
106
  <label>
107
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
108
  <?php esc_html_e('Show discount price in product pages for WooCommerce Product Add Ons.', 'woo-discount-rules'); ?>
109
  </label>
110
  </div>
v2/App/Compatibility/WholesalePricesByRymeraWebCo.php CHANGED
@@ -47,7 +47,7 @@ class WholesalePricesByRymeraWebCo extends Base
47
  ?>
48
  <div class="awdr-compatible-field">
49
  <label>
50
- <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
51
  <?php esc_html_e('Add compatible for WooCommerce Wholesale Prices', 'woo-discount-rules'); ?>
52
  </label>
53
  </div>
47
  ?>
48
  <div class="awdr-compatible-field">
49
  <label>
50
+ <input type="checkbox" name="wdrc[<?php echo esc_attr($this->key); ?>]" id="<?php echo esc_attr($this->key); ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
51
  <?php esc_html_e('Add compatible for WooCommerce Wholesale Prices', 'woo-discount-rules'); ?>
52
  </label>
53
  </div>
v2/App/Controllers/Admin/Settings.php CHANGED
@@ -63,7 +63,7 @@ class Settings extends Base
63
  function wdr_action_link($links)
64
  {
65
  $action_links = array(
66
- 'settings' => '<a href="' . admin_url('admin.php?page=woo_discount_rules&tab=settings') . '">' . __('Settings', 'woo-discount-rules') . '</a>',
67
  );
68
  return array_merge($action_links, $links);
69
  }
@@ -511,6 +511,7 @@ If a customer buys 2 of Product A - Small, 4 of Product A - Medium, 6 of Prod
511
  'filter_SKUs' => __('<span>Choose SKUs that get the discount using "In List". If you want to exclude a few SKUs, choose "Not In List" and select the SKUs you wanted to exclude from discount. (You can add multiple filters of same type)</span>', 'woo-discount-rules'),
512
  'filter_On_sale_products' => __('<span>Choose whether you want to include (or exclude) products on sale (those having a sale price) for the discount </span>', 'woo-discount-rules'),
513
  'filter_custom_taxonomies' => __('<span>Discount applies to custom taxonomy</span>', 'woo-discount-rules'),
 
514
  'rebuild_on_sale_list_processing_text' => __('Processing please wait..', 'woo-discount-rules'),
515
  'rebuild_on_sale_list_processed_text' => __('Rebuild index processed', 'woo-discount-rules'),
516
  'rebuild_on_sale_list_error_please_select_rule' => __('Please select the rules to build index', 'woo-discount-rules'),
63
  function wdr_action_link($links)
64
  {
65
  $action_links = array(
66
+ 'settings' => '<a href="' . esc_url(admin_url('admin.php?page=woo_discount_rules&tab=settings')) . '">' . __('Settings', 'woo-discount-rules') . '</a>',
67
  );
68
  return array_merge($action_links, $links);
69
  }
511
  'filter_SKUs' => __('<span>Choose SKUs that get the discount using "In List". If you want to exclude a few SKUs, choose "Not In List" and select the SKUs you wanted to exclude from discount. (You can add multiple filters of same type)</span>', 'woo-discount-rules'),
512
  'filter_On_sale_products' => __('<span>Choose whether you want to include (or exclude) products on sale (those having a sale price) for the discount </span>', 'woo-discount-rules'),
513
  'filter_custom_taxonomies' => __('<span>Discount applies to custom taxonomy</span>', 'woo-discount-rules'),
514
+ 'rebuild_on_sale_list_build_text' => __('Rebuild index', 'woo-discount-rules'),
515
  'rebuild_on_sale_list_processing_text' => __('Processing please wait..', 'woo-discount-rules'),
516
  'rebuild_on_sale_list_processed_text' => __('Rebuild index processed', 'woo-discount-rules'),
517
  'rebuild_on_sale_list_error_please_select_rule' => __('Please select the rules to build index', 'woo-discount-rules'),
v2/App/Controllers/Admin/WDRAjax.php CHANGED
@@ -87,7 +87,8 @@ class WDRAjax extends Base
87
  Helper::validateRequest('wdr_ajax_rule_build_index');
88
  $shortcode_manager = new OnSaleShortCode();
89
  $rules = $this->input->post('rules', array());
90
- $status = $shortcode_manager->rebuildOnSaleList($rules);
 
91
  wp_send_json_success($status);
92
  }
93
 
@@ -411,6 +412,13 @@ class WDRAjax extends Base
411
  $save_config['applied_rule_message'] = Rule::validateHtmlBeforeSave($this->input->post('applied_rule_message'));
412
  $save_config['discount_label_for_combined_discounts'] = Rule::validateHtmlBeforeSave($this->input->post('discount_label_for_combined_discounts'));
413
  $save_config['free_shipping_title'] = Rule::validateHtmlBeforeSave($this->input->post('free_shipping_title'));
 
 
 
 
 
 
 
414
  return array('result' => Configuration::saveConfig(configuration::DEFAULT_OPTION, $save_config), 'save_popup' => $save_alert, 'security_pass' => 'passed');
415
  }
416
 
@@ -450,9 +458,9 @@ class WDRAjax extends Base
450
  }
451
  $redirect_url = false;
452
  if (!empty($this->input->post('wdr_save_close', ''))) {
453
- $redirect_url = admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules')));
454
  } elseif (empty($this->input->post('edit_rule', ''))) {
455
- $redirect_url = admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_id)));
456
  }
457
  $build_index = array();
458
  if ($rule_id) {
@@ -489,8 +497,13 @@ class WDRAjax extends Base
489
  '%d'
490
  )
491
  );
 
 
 
 
 
492
  }
493
- wp_send_json($deleted);
494
  }
495
 
496
  /**
@@ -549,8 +562,13 @@ class WDRAjax extends Base
549
  '%d'
550
  )
551
  );
 
552
  }
553
- wp_send_json($rule_status);
 
 
 
 
554
  }
555
 
556
  /**
@@ -563,6 +581,14 @@ class WDRAjax extends Base
563
  $action_type = $this->input->post('wdr_bulk_action', '');
564
  $saved_rules = $this->input->post('saved_rules', '');
565
  Helper::validateRequest('awdr_ajax_rule_bulk_actions');
 
 
 
 
 
 
 
 
566
  if ($action_type == 'enable') {
567
  if (!empty($saved_rules) && is_array($saved_rules)) {
568
  foreach ($saved_rules as $saved_rule_id) {
@@ -772,7 +798,7 @@ class WDRAjax extends Base
772
  $rule_data = $recipes_data[$awdr_recipe_type];
773
  $rule_id = $recipes_object->save($rule_data);
774
  if (!empty($rule_id)) {
775
- $redirect_url = admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_id)));
776
  } else {
777
  $redirect_url = '';
778
  }
87
  Helper::validateRequest('wdr_ajax_rule_build_index');
88
  $shortcode_manager = new OnSaleShortCode();
89
  $rules = $this->input->post('rules', array());
90
+ $update = (bool) $this->input->post('update', 0);
91
+ $status = $shortcode_manager->rebuildOnSaleList($rules, $update);
92
  wp_send_json_success($status);
93
  }
94
 
412
  $save_config['applied_rule_message'] = Rule::validateHtmlBeforeSave($this->input->post('applied_rule_message'));
413
  $save_config['discount_label_for_combined_discounts'] = Rule::validateHtmlBeforeSave($this->input->post('discount_label_for_combined_discounts'));
414
  $save_config['free_shipping_title'] = Rule::validateHtmlBeforeSave($this->input->post('free_shipping_title'));
415
+
416
+ if (isset($save_config['run_rebuild_on_sale_index_cron']) && $save_config['run_rebuild_on_sale_index_cron']) {
417
+ \Wdr\App\Helpers\Schedule::runRebuildOnSaleIndex();
418
+ } else {
419
+ \Wdr\App\Helpers\Schedule::stopRebuildOnSaleIndex();
420
+ }
421
+
422
  return array('result' => Configuration::saveConfig(configuration::DEFAULT_OPTION, $save_config), 'save_popup' => $save_alert, 'security_pass' => 'passed');
423
  }
424
 
458
  }
459
  $redirect_url = false;
460
  if (!empty($this->input->post('wdr_save_close', ''))) {
461
+ $redirect_url = esc_url(admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules'))));
462
  } elseif (empty($this->input->post('edit_rule', ''))) {
463
+ $redirect_url = esc_url(admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_id))));
464
  }
465
  $build_index = array();
466
  if ($rule_id) {
497
  '%d'
498
  )
499
  );
500
+ OnSaleShortCode::updateOnsaleRebuildPageStatus($row_id);
501
+ }
502
+ $build_index = array();
503
+ if ($row_id) {
504
+ $build_index = OnSaleShortCode::getOnPageReBuildOption($row_id);
505
  }
506
+ wp_send_json(array('deleted' => $deleted, 'build_index' => $build_index));
507
  }
508
 
509
  /**
562
  '%d'
563
  )
564
  );
565
+ OnSaleShortCode::updateOnsaleRebuildPageStatus($row_id);
566
  }
567
+ $build_index = array();
568
+ if ($row_id) {
569
+ $build_index = OnSaleShortCode::getOnPageReBuildOption($row_id);
570
+ }
571
+ wp_send_json(array('status' => $rule_status, 'build_index' => $build_index));
572
  }
573
 
574
  /**
581
  $action_type = $this->input->post('wdr_bulk_action', '');
582
  $saved_rules = $this->input->post('saved_rules', '');
583
  Helper::validateRequest('awdr_ajax_rule_bulk_actions');
584
+ if (!empty($saved_rules) && is_array($saved_rules)) {
585
+ $rebuild_on_sale_rules = self::$config->getConfig('awdr_rebuild_on_sale_rules', array());
586
+ if (!empty($rebuild_on_sale_rules)) {
587
+ if (in_array('all', $rebuild_on_sale_rules) || count(array_intersect($saved_rules, $rebuild_on_sale_rules)) > 0) {
588
+ OnSaleShortCode::setRequiredRebuild();
589
+ }
590
+ }
591
+ }
592
  if ($action_type == 'enable') {
593
  if (!empty($saved_rules) && is_array($saved_rules)) {
594
  foreach ($saved_rules as $saved_rule_id) {
798
  $rule_data = $recipes_data[$awdr_recipe_type];
799
  $rule_id = $recipes_object->save($rule_data);
800
  if (!empty($rule_id)) {
801
+ $redirect_url = esc_url(admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_id))));
802
  } else {
803
  $redirect_url = '';
804
  }
v2/App/Controllers/Configuration.php CHANGED
@@ -73,6 +73,7 @@ class Configuration
73
  'disable_recalculate_total' => 0, // 0,1
74
  'disable_recalculate_total_when_coupon_apply' => 0, // 0,1
75
  'wdr_hide_other_shipping' => 0, // 0,1
 
76
  );
77
  private static $default_advanced_section_config = array(
78
  'wdr_override_custom_price' => 0, // 0,1
73
  'disable_recalculate_total' => 0, // 0,1
74
  'disable_recalculate_total_when_coupon_apply' => 0, // 0,1
75
  'wdr_hide_other_shipping' => 0, // 0,1
76
+ 'run_rebuild_on_sale_index_cron' => 0, // 0,1
77
  );
78
  private static $default_advanced_section_config = array(
79
  'wdr_override_custom_price' => 0, // 0,1
v2/App/Controllers/DiscountCalculator.php CHANGED
@@ -736,6 +736,9 @@ class DiscountCalculator extends Base
736
  }
737
  if($discounted_price > 0){
738
  if ($ajax_price) {
 
 
 
739
  self::$total_discounts['ajax_product'][$rule_id] = apply_filters('advanced_woo_discount_rules_calculated_discounts_of_each_rule_for_ajax_price', self::$total_discounts['ajax_product'][$rule_id], $product_id, $rule_id, $filter_passed, $cart_item, $is_cart, $rule);
740
  $ajax_discounts[$rule_id] = $discounted_price;
741
  }else{
736
  }
737
  if($discounted_price > 0){
738
  if ($ajax_price) {
739
+ if(!isset(self::$total_discounts['ajax_product'][$rule_id])){
740
+ self::$total_discounts['ajax_product'][$rule_id] = array();
741
+ }
742
  self::$total_discounts['ajax_product'][$rule_id] = apply_filters('advanced_woo_discount_rules_calculated_discounts_of_each_rule_for_ajax_price', self::$total_discounts['ajax_product'][$rule_id], $product_id, $rule_id, $filter_passed, $cart_item, $is_cart, $rule);
743
  $ajax_discounts[$rule_id] = $discounted_price;
744
  }else{
v2/App/Controllers/ManageDiscount.php CHANGED
@@ -504,7 +504,7 @@ class ManageDiscount extends Base
504
  if(!Woocommerce::variationIsVisible($variation)){
505
  continue;
506
  }
507
- if(!$variation->is_in_stock()) {
508
  continue;
509
  }
510
  $prices = self::calculateInitialAndDiscountedPrice($variation, $quantity);
@@ -1053,6 +1053,11 @@ class ManageDiscount extends Base
1053
  $available_url_coupons = $rule_helper->getAllUrlCoupons();
1054
  $available_url_coupons = array_map('\Wdr\App\Helpers\Woocommerce::formatStringToLower', $available_url_coupons);
1055
  $coupons = explode(",", $_GET['wdr_coupon']);
 
 
 
 
 
1056
  foreach ( $coupons as $coupon ) {
1057
  $coupon_code = rawurldecode( $coupon );
1058
  $coupon_code = Woocommerce::formatStringToLower($coupon_code);
504
  if(!Woocommerce::variationIsVisible($variation)){
505
  continue;
506
  }
507
+ if(!$variation->is_in_stock()) {
508
  continue;
509
  }
510
  $prices = self::calculateInitialAndDiscountedPrice($variation, $quantity);
1053
  $available_url_coupons = $rule_helper->getAllUrlCoupons();
1054
  $available_url_coupons = array_map('\Wdr\App\Helpers\Woocommerce::formatStringToLower', $available_url_coupons);
1055
  $coupons = explode(",", $_GET['wdr_coupon']);
1056
+ if (isset($woocommerce->session) && method_exists($woocommerce->session, 'has_session')) {
1057
+ if ( ! $woocommerce->session->has_session() && method_exists($woocommerce->session, 'set_customer_session_cookie')) {
1058
+ $woocommerce->session->set_customer_session_cookie( true );
1059
+ }
1060
+ }
1061
  foreach ( $coupons as $coupon ) {
1062
  $coupon_code = rawurldecode( $coupon );
1063
  $coupon_code = Woocommerce::formatStringToLower($coupon_code);
v2/App/Controllers/OnSaleShortCode.php CHANGED
@@ -64,13 +64,13 @@ class OnSaleShortCode extends ManageDiscount
64
  if($is_pro){
65
  $rules = self::getReBuildOnSaleRules();
66
  if(!empty($rules)){
 
 
 
 
 
67
  if(is_array($rules) && (in_array("all", $rules) || in_array($id, $rules))){
68
- $option['available'] = true;
69
  $option['rule_depend_on_sale_page'] = true;
70
- $is_required = self::isRequiredRebuild();
71
- if(!empty($is_required) && $is_required == 1){
72
- $option['required_rebuild'] = true;
73
- }
74
  }
75
  }
76
  }
@@ -90,9 +90,13 @@ class OnSaleShortCode extends ManageDiscount
90
  }
91
 
92
  protected function getSelectedRules($rules_ids){
 
 
93
  $rule_helper = new Rule();
94
  $this->updateRebuildRulesInSettings($rules_ids);
95
- return $rule_helper->getAvailableRules($this->getAvailableConditions(), $rules_ids);
 
 
96
  }
97
 
98
  /**
@@ -126,56 +130,61 @@ class OnSaleShortCode extends ManageDiscount
126
  return update_option(self::$required_rebuild_key, $val);
127
  }
128
 
129
- public function rebuildOnSaleList($rules_ids){
130
  $this->on_sale_list = array();
131
- if(empty($rules_ids)){
132
  update_option(self::$on_sale_list_key, array());
 
133
  self::setRequiredRebuild(0);
134
- return ;
135
- }
136
- if(!empty($rules_ids) && is_array($rules_ids)){
137
  if(!in_array("all", $rules_ids)){
138
  self::$available_rules = $this->getSelectedRules($rules_ids);
 
 
139
  }
140
  } else {
141
- self::getReBuildOnSaleRules();
142
  $rules_ids = self::getReBuildOnSaleRules();
143
  if(!empty($rules_ids)){
144
  if(!in_array("all", $rules_ids)){
145
  self::$available_rules = $this->getSelectedRules($rules_ids);
146
  }
 
 
147
  }
148
  }
149
  if (!empty(self::$available_rules)) {
150
  foreach (self::$available_rules as $rule) {
151
- if($rule->rule->enabled == 1){
152
- $discount_type = $rule->getRuleDiscountType();
153
- if($discount_type != 'wdr_free_shipping'){
154
- $filters = $rule->getFilter();
155
- $additional_filter = $this->getAdditionalFilters($rule->rule, $discount_type);
156
- if(!empty($additional_filter)){
157
- if(isset($additional_filter['product']) && !empty($additional_filter['product'])){
158
- if(empty($filters)){
159
- $filters = new \stdClass();
 
 
 
 
 
 
 
 
160
  }
161
- $filters->bogo = new \stdClass();
162
- $filters->bogo->type = 'products';
163
- $filters->bogo->method = 'in_list';
164
- $filters->bogo->value = $additional_filter['product'];
165
- $filters->bogo->product_variants = array();
166
- $filters->bogo->product_variants_for_sale_badge = array();
167
- }
168
- if(isset($additional_filter['category']) && !empty($additional_filter['category'])){
169
- if(empty($filters)){
170
- $filters = new \stdClass();
171
  }
172
- $filters->bogo = new \stdClass();
173
- $filters->bogo->type = 'product_category';
174
- $filters->bogo->method = 'in_list';
175
- $filters->bogo->value = $additional_filter['category'];
176
  }
 
177
  }
178
- $this->rebuildOnSaleListForARule($rule, $filters, $additional_filter);
179
  }
180
  }
181
  }
@@ -183,7 +192,7 @@ class OnSaleShortCode extends ManageDiscount
183
  self::setRequiredRebuild(0);
184
  }
185
  }
186
-
187
  protected function mergeAllRebuildRules(){
188
  $final_on_sale_list = array();
189
  $exclude_list = $include_list = array();
64
  if($is_pro){
65
  $rules = self::getReBuildOnSaleRules();
66
  if(!empty($rules)){
67
+ $option['available'] = true;
68
+ $is_required = self::isRequiredRebuild();
69
+ if(!empty($is_required) && $is_required == 1){
70
+ $option['required_rebuild'] = true;
71
+ }
72
  if(is_array($rules) && (in_array("all", $rules) || in_array($id, $rules))){
 
73
  $option['rule_depend_on_sale_page'] = true;
 
 
 
 
74
  }
75
  }
76
  }
90
  }
91
 
92
  protected function getSelectedRules($rules_ids){
93
+ // To fetch rule based on date and active rules
94
+ add_filter('advanced_woo_discount_rules_is_front_end_request_for_fetching_rules', '__return_true', 101);
95
  $rule_helper = new Rule();
96
  $this->updateRebuildRulesInSettings($rules_ids);
97
+ $rules = $rule_helper->getAvailableRules($this->getAvailableConditions(), $rules_ids);
98
+ remove_filter('advanced_woo_discount_rules_is_front_end_request_for_fetching_rules', '__return_true', 101);
99
+ return $rules;
100
  }
101
 
102
  /**
130
  return update_option(self::$required_rebuild_key, $val);
131
  }
132
 
133
+ public function rebuildOnSaleList($rules_ids = [], $update = false){
134
  $this->on_sale_list = array();
135
+ if ($update && empty($rules_ids)){
136
  update_option(self::$on_sale_list_key, array());
137
+ $this->updateRebuildRulesInSettings(array());
138
  self::setRequiredRebuild(0);
139
+ return;
140
+ } elseif ($update && is_array($rules_ids)){
 
141
  if(!in_array("all", $rules_ids)){
142
  self::$available_rules = $this->getSelectedRules($rules_ids);
143
+ } else {
144
+ $this->updateRebuildRulesInSettings($rules_ids);
145
  }
146
  } else {
 
147
  $rules_ids = self::getReBuildOnSaleRules();
148
  if(!empty($rules_ids)){
149
  if(!in_array("all", $rules_ids)){
150
  self::$available_rules = $this->getSelectedRules($rules_ids);
151
  }
152
+ } else {
153
+ return;
154
  }
155
  }
156
  if (!empty(self::$available_rules)) {
157
  foreach (self::$available_rules as $rule) {
158
+ if($rule->rule->enabled == 1 && $rule->rule->deleted == 0) {
159
+ if($rule->isSpecificConditionsPassed(['order_date', 'order_time', 'order_date_and_time', 'order_days'])) {
160
+ $discount_type = $rule->getRuleDiscountType();
161
+ if($discount_type != 'wdr_free_shipping'){
162
+ $filters = $rule->getFilter();
163
+ $additional_filter = $this->getAdditionalFilters($rule->rule, $discount_type);
164
+ if(!empty($additional_filter)){
165
+ if(isset($additional_filter['product']) && !empty($additional_filter['product'])){
166
+ if(empty($filters)){
167
+ $filters = new \stdClass();
168
+ }
169
+ $filters->bogo = new \stdClass();
170
+ $filters->bogo->type = 'products';
171
+ $filters->bogo->method = 'in_list';
172
+ $filters->bogo->value = $additional_filter['product'];
173
+ $filters->bogo->product_variants = array();
174
+ $filters->bogo->product_variants_for_sale_badge = array();
175
  }
176
+ if(isset($additional_filter['category']) && !empty($additional_filter['category'])){
177
+ if(empty($filters)){
178
+ $filters = new \stdClass();
179
+ }
180
+ $filters->bogo = new \stdClass();
181
+ $filters->bogo->type = 'product_category';
182
+ $filters->bogo->method = 'in_list';
183
+ $filters->bogo->value = $additional_filter['category'];
 
 
184
  }
 
 
 
 
185
  }
186
+ $this->rebuildOnSaleListForARule($rule, $filters, $additional_filter);
187
  }
 
188
  }
189
  }
190
  }
192
  self::setRequiredRebuild(0);
193
  }
194
  }
195
+
196
  protected function mergeAllRebuildRules(){
197
  $final_on_sale_list = array();
198
  $exclude_list = $include_list = array();
v2/App/Helpers/Helper.php CHANGED
@@ -332,10 +332,10 @@ class Helper
332
 
333
  public static function displayCompatibleCheckMessages()
334
  {
335
- if (version_compare(WDR_VERSION, '2.4.1', '>=')) {
336
  if (defined('WDR_PRO_VERSION')) {
337
- if (version_compare(WDR_PRO_VERSION, '2.4.1', '<')) {
338
- $url = admin_url() . "plugins.php";
339
  $plugin_page = '<a target="_blank" href="' . $url . '">' . __('Update now', 'woo-discount-rules') . '</a>';
340
  ?>
341
  <br>
332
 
333
  public static function displayCompatibleCheckMessages()
334
  {
335
+ if (version_compare(WDR_VERSION, '2.4.2', '>=')) {
336
  if (defined('WDR_PRO_VERSION')) {
337
+ if (version_compare(WDR_PRO_VERSION, '2.4.2', '<')) {
338
+ $url = esc_url(admin_url() . "plugins.php");
339
  $plugin_page = '<a target="_blank" href="' . $url . '">' . __('Update now', 'woo-discount-rules') . '</a>';
340
  ?>
341
  <br>
v2/App/Helpers/Rule.php CHANGED
@@ -1084,6 +1084,28 @@ class Rule
1084
  * @return bool
1085
  */
1086
  function isCartConditionsPassed($cart)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1087
  {
1088
  $rule_object = $this;
1089
  /*if (empty($cart)) {
@@ -1103,59 +1125,61 @@ class Rule
1103
  }
1104
  foreach ($conditions as $condition) {
1105
  $type = isset($condition->type) ? $condition->type : NULL;
1106
- $options = isset($condition->options) ? $condition->options : array();
1107
- if (!empty($type) && !empty($options)) {
1108
- //if condition available, then check the cart against the condition
1109
- if (isset($this->available_conditions[$type]['object'])) {
1110
- if(is_object($this->available_conditions[$type]['object'])){
1111
- $this->available_conditions[$type]['object']->rule = $this;
1112
- if(method_exists($this->available_conditions[$type]['object'], 'check')){
1113
- $is_condition_passed = $this->available_conditions[$type]['object']->check($cart, $options);
 
 
 
 
1114
  } else {
1115
  $is_condition_passed = false;
1116
  }
1117
- } else {
1118
- $is_condition_passed = false;
1119
- }
1120
- }elseif(!isset($this->available_conditions[$type]['object'])){
1121
- $is_custom_taxonomy = strpos($type, "wdr_cart_item_"); //wdr_cart_item_
1122
- if ( $is_custom_taxonomy === (int) 0 && $is_custom_taxonomy !== false && isset($this->available_conditions['cart_item_products_taxonomy']['object'])) {
1123
- $custom_taxonomy = str_replace("wdr_cart_item_", "", $type);
1124
- if(is_object($this->available_conditions['cart_item_products_taxonomy']['object'])){
1125
- $this->available_conditions['cart_item_products_taxonomy']['object']->rule = $this;
1126
- if(method_exists($this->available_conditions['cart_item_products_taxonomy']['object'], 'check')){
1127
- $options = (array)$options;
1128
- $options['custom_taxonomy'] = $custom_taxonomy;
1129
- $options = (object)$options;
1130
- $is_condition_passed = $this->available_conditions['cart_item_products_taxonomy']['object']->check($cart, $options);
1131
  } else {
1132
  $is_condition_passed = false;
1133
  }
1134
  } else {
1135
- $is_condition_passed = false;
1136
- }
1137
- }else{
1138
- $object_not_available = apply_filters('advanced_woo_discount_rules_condition_object_not_available', false, $cart, $this, $condition_relationship);
1139
- if($object_not_available){
1140
- $is_condition_passed = apply_filters('advanced_woo_discount_rules_set_condition_status', false, $cart, $this, $condition_relationship);
1141
- }else{
1142
- continue;
1143
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1144
  }
1145
- } else {
1146
- $is_condition_passed = false;
1147
- }
1148
- //if relationship is "and" and if current condition get fails, no need to check any other conditions provided by admin.just return rule condition failed
1149
- if (isset($is_condition_passed) && !$is_condition_passed && $condition_relationship == "and") {
1150
- return apply_filters('advanced_woo_discount_rules_is_conditions_passed', false, $rule_object, $this->rule);
1151
- }
1152
- //if relationship is "or" and if current condition get pass, no need to check any other conditions provided by admin.just return rule condition passed
1153
- if (isset($is_condition_passed) && $is_condition_passed && $condition_relationship == "or") {
1154
- return apply_filters('advanced_woo_discount_rules_is_conditions_passed', true, $rule_object, $this->rule);
1155
- }
1156
- //Check if any conditions fails
1157
- if (isset($is_condition_passed) && !$is_condition_passed) {
1158
- $conditions_result[] = false;
1159
  }
1160
  }
1161
  }
@@ -1579,7 +1603,7 @@ class Rule
1579
  if (!empty($product_ids)) {
1580
  foreach ($product_ids as $product_id) {
1581
  $product = Woocommerce::getProduct($product_id);
1582
- if (method_exists($product, 'is_type')) {
1583
  if ($product->is_type(array('variable', 'variable-subscription'))) {
1584
  $additional_variants = Woocommerce::getProductChildren($product);
1585
  if (!empty($additional_variants) && is_array($additional_variants)) {
1084
  * @return bool
1085
  */
1086
  function isCartConditionsPassed($cart)
1087
+ {
1088
+ return $this->isConditionsPassed($cart);
1089
+ }
1090
+
1091
+ /**
1092
+ * Check only the specified conditions are passed
1093
+ * @param array $condition_types
1094
+ * @param array $cart
1095
+ * @return bool
1096
+ */
1097
+ function isSpecificConditionsPassed($condition_types, $cart = [])
1098
+ {
1099
+ return $this->isConditionsPassed($cart, $condition_types);
1100
+ }
1101
+
1102
+ /**
1103
+ * Check the conditions are passed
1104
+ * @param array $cart
1105
+ * @param array|null $condition_types
1106
+ * @return bool
1107
+ */
1108
+ protected function isConditionsPassed($cart, $condition_types = null)
1109
  {
1110
  $rule_object = $this;
1111
  /*if (empty($cart)) {
1125
  }
1126
  foreach ($conditions as $condition) {
1127
  $type = isset($condition->type) ? $condition->type : NULL;
1128
+ if (empty($condition_types) || (is_array($condition_types) && in_array($type, $condition_types))) {
1129
+ $options = isset($condition->options) ? $condition->options : array();
1130
+ if (!empty($type) && !empty($options)) {
1131
+ //if condition available, then check the cart against the condition
1132
+ if (isset($this->available_conditions[$type]['object'])) {
1133
+ if (is_object($this->available_conditions[$type]['object'])) {
1134
+ $this->available_conditions[$type]['object']->rule = $this;
1135
+ if (method_exists($this->available_conditions[$type]['object'], 'check')) {
1136
+ $is_condition_passed = $this->available_conditions[$type]['object']->check($cart, $options);
1137
+ } else {
1138
+ $is_condition_passed = false;
1139
+ }
1140
  } else {
1141
  $is_condition_passed = false;
1142
  }
1143
+ } elseif (!isset($this->available_conditions[$type]['object'])) {
1144
+ $is_custom_taxonomy = strpos($type, "wdr_cart_item_"); //wdr_cart_item_
1145
+ if ($is_custom_taxonomy === (int)0 && $is_custom_taxonomy !== false && isset($this->available_conditions['cart_item_products_taxonomy']['object'])) {
1146
+ $custom_taxonomy = str_replace("wdr_cart_item_", "", $type);
1147
+ if (is_object($this->available_conditions['cart_item_products_taxonomy']['object'])) {
1148
+ $this->available_conditions['cart_item_products_taxonomy']['object']->rule = $this;
1149
+ if (method_exists($this->available_conditions['cart_item_products_taxonomy']['object'], 'check')) {
1150
+ $options = (array)$options;
1151
+ $options['custom_taxonomy'] = $custom_taxonomy;
1152
+ $options = (object)$options;
1153
+ $is_condition_passed = $this->available_conditions['cart_item_products_taxonomy']['object']->check($cart, $options);
1154
+ } else {
1155
+ $is_condition_passed = false;
1156
+ }
1157
  } else {
1158
  $is_condition_passed = false;
1159
  }
1160
  } else {
1161
+ $object_not_available = apply_filters('advanced_woo_discount_rules_condition_object_not_available', false, $cart, $this, $condition_relationship);
1162
+ if ($object_not_available) {
1163
+ $is_condition_passed = apply_filters('advanced_woo_discount_rules_set_condition_status', false, $cart, $this, $condition_relationship);
1164
+ } else {
1165
+ continue;
1166
+ }
 
 
1167
  }
1168
+ } else {
1169
+ $is_condition_passed = false;
1170
+ }
1171
+ //if relationship is "and" and if current condition get fails, no need to check any other conditions provided by admin.just return rule condition failed
1172
+ if (isset($is_condition_passed) && !$is_condition_passed && $condition_relationship == "and") {
1173
+ return apply_filters('advanced_woo_discount_rules_is_conditions_passed', false, $rule_object, $this->rule);
1174
+ }
1175
+ //if relationship is "or" and if current condition get pass, no need to check any other conditions provided by admin.just return rule condition passed
1176
+ if (isset($is_condition_passed) && $is_condition_passed && $condition_relationship == "or") {
1177
+ return apply_filters('advanced_woo_discount_rules_is_conditions_passed', true, $rule_object, $this->rule);
1178
+ }
1179
+ //Check if any conditions fails
1180
+ if (isset($is_condition_passed) && !$is_condition_passed) {
1181
+ $conditions_result[] = false;
1182
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1183
  }
1184
  }
1185
  }
1603
  if (!empty($product_ids)) {
1604
  foreach ($product_ids as $product_id) {
1605
  $product = Woocommerce::getProduct($product_id);
1606
+ if (!empty($product) && method_exists($product, 'is_type')) {
1607
  if ($product->is_type(array('variable', 'variable-subscription'))) {
1608
  $additional_variants = Woocommerce::getProductChildren($product);
1609
  if (!empty($additional_variants) && is_array($additional_variants)) {
v2/App/Helpers/Schedule.php ADDED
@@ -0,0 +1,106 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Wdr\App\Helpers;
4
+
5
+ use Wdr\App\Controllers\Configuration;
6
+
7
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
8
+
9
+ class Schedule
10
+ {
11
+ /**
12
+ * Add schedule event (wp_schedule_event)
13
+ *
14
+ * @param $timestamp
15
+ * @param $recurrence
16
+ * @param $hook
17
+ * @param $args
18
+ * @return bool|\WP_Error
19
+ */
20
+ public static function addEvent($timestamp, $recurrence, $hook, $args = array())
21
+ {
22
+ if (function_exists('wp_schedule_event')) {
23
+ return wp_schedule_event($timestamp, $recurrence, $hook, $args);
24
+ }
25
+ return false;
26
+ }
27
+
28
+ /**
29
+ * Get schedule event object (wp_get_scheduled_event)
30
+ *
31
+ * @param $hook
32
+ * @param $args
33
+ * @param $timestamp
34
+ * @return false|object
35
+ */
36
+ public static function get($hook, $args = array(), $timestamp = null)
37
+ {
38
+ if (function_exists('wp_get_scheduled_event')) {
39
+ return wp_get_scheduled_event($hook, $args, $timestamp);
40
+ }
41
+ return false;
42
+ }
43
+
44
+ /**
45
+ * Check if the schedule event is exists or not
46
+ *
47
+ * @param $hook
48
+ * @param $args
49
+ * @param $timestamp
50
+ * @return bool
51
+ */
52
+ public static function hasEvent($hook, $args = array(), $timestamp = null)
53
+ {
54
+ return self::get($hook, $args, $timestamp) !== false;
55
+ }
56
+
57
+ /**
58
+ * Remove scheduled event (wp_clear_scheduled_hook)
59
+ *
60
+ * @param $hook
61
+ * @param $args
62
+ * @return false|int|\WP_Error
63
+ */
64
+ public static function removeEvent($hook, $args = array())
65
+ {
66
+ if (function_exists('wp_clear_scheduled_hook')) {
67
+ return wp_clear_scheduled_hook($hook, $args);
68
+ }
69
+ return false;
70
+ }
71
+
72
+ /**
73
+ * Check config then run Rebuild On Sale Page index daily
74
+ */
75
+ public static function mayRunRebuildOnSaleIndex()
76
+ {
77
+ $config = new Configuration();
78
+ $rebuild_on_sale_rules = $config->getConfig('awdr_rebuild_on_sale_rules', array());
79
+ $run_rebuild_on_sale_index_cron = $config->getConfig('run_rebuild_on_sale_index_cron', 0);
80
+ if (!empty($rebuild_on_sale_rules) && $run_rebuild_on_sale_index_cron) {
81
+ self::runRebuildOnSaleIndex();
82
+ }
83
+ }
84
+
85
+ /**
86
+ * To run Rebuild On Sale Page index daily
87
+ */
88
+ public static function runRebuildOnSaleIndex()
89
+ {
90
+ if (!self::hasEvent('advanced_woo_discount_rules_scheduled_rebuild_on_sale_index_event')) {
91
+ $time = strtotime(get_gmt_from_date(date('Y-m-d 00:00:00')));
92
+ $recurrence = apply_filters('advanced_woo_discount_rules_scheduled_rebuild_on_sale_index_event_recurrence', 'daily');
93
+ return (bool) self::addEvent($time, $recurrence, 'advanced_woo_discount_rules_scheduled_rebuild_on_sale_index_event');
94
+ }
95
+ return true;
96
+ }
97
+
98
+ /**
99
+ * Stop Rebuild On Sale Page indexing daily
100
+ */
101
+ public static function stopRebuildOnSaleIndex() {
102
+ if (self::hasEvent('advanced_woo_discount_rules_scheduled_rebuild_on_sale_index_event')) {
103
+ self::removeEvent('advanced_woo_discount_rules_scheduled_rebuild_on_sale_index_event');
104
+ }
105
+ }
106
+ }
v2/App/Helpers/SurveyForm.php CHANGED
@@ -48,8 +48,8 @@ class SurveyForm
48
  ?>
49
  <script type="text/javascript">
50
  jQuery(function ($) {
51
- var $deactivateLink = $('#the-list').find('[data-slug="<?php echo $this->plugin; ?>"] span.deactivate a'),
52
- $overlay = $('#plugin-deactivate-survey-<?php echo $this->plugin; ?>'),
53
  $form = $overlay.find('form'),
54
  formOpen = false;
55
  // Plugin listing table deactivate link.
@@ -57,22 +57,22 @@ class SurveyForm
57
  event.preventDefault();
58
  $overlay.css('display', 'table');
59
  formOpen = true;
60
- $form.find('.<?php echo $this->plugin; ?>-deactivate-survey-option:first-of-type input[type=radio]').focus();
61
  });
62
  // Survey radio option selected.
63
  $form.on('change', 'input[type=radio]', function (event) {
64
  event.preventDefault();
65
  $form.find('input[type=text], .error').hide();
66
- $form.find('.<?php echo $this->plugin; ?>-deactivate-survey-option').removeClass('selected');
67
- $(this).closest('.<?php echo $this->plugin; ?>-deactivate-survey-option').addClass('selected').find('input[type=text]').show();
68
  });
69
  // Survey Skip & Deactivate.
70
- $form.on('click', '.<?php echo $this->plugin; ?>-deactivate-survey-deactivate', function (event) {
71
  event.preventDefault();
72
  location.href = $deactivateLink.attr('href');
73
  });
74
  // close button
75
- $form.on('click', '.<?php echo $this->plugin; ?>-deactivate-survey-close', function (event) {
76
  event.preventDefault();
77
  $overlay.css('display', 'none');
78
  formOpen = false;
@@ -81,11 +81,11 @@ class SurveyForm
81
  $form.submit(function (event) {
82
  event.preventDefault();
83
  if (!$form.find('input[type=radio]:checked').val()) {
84
- $form.find('.<?php echo $this->plugin; ?>-deactivate-survey-footer').prepend('<span class="error"><?php echo esc_js(__('Please select an option', $this->plugin_text_domain)); ?></span>');
85
  return;
86
  }
87
- $form.find('.<?php echo $this->plugin; ?>-deactivate-survey-submit').html('<?php echo esc_js(__('Sending Feedback', $this->plugin_text_domain)); ?>').attr("disabled", true).removeClass('button-primary');
88
- var reason = $form.find('.selected .<?php echo $this->plugin; ?>-deactivate-survey-option-reason').val();
89
  if (reason === "Other") {
90
  reason = $form.find('.selected input[type=text]').val();
91
  }
@@ -93,14 +93,13 @@ class SurveyForm
93
  subject: "Discount Rules for WooCommerce plugin deactivation survey form!",
94
  message: reason,
95
  url: '<?php echo esc_url(home_url()); ?>',
96
- name: '<?php echo $display_name; ?>',
97
  code: $form.find('.selected input[type=radio]').val(),
98
- token: "<?php echo $this->token ?>"
99
  };
100
  var submitSurvey = $.ajax(
101
  {
102
-
103
- url: "<?php echo $this->endpoint; ?>",
104
  type: "POST",
105
  data: JSON.stringify(request_data),
106
  dataType: 'json',
@@ -280,18 +279,18 @@ class SurveyForm
280
  ),
281
  );
282
  ?>
283
- <div class="<?php echo $this->plugin; ?>-deactivate-survey-modal"
284
- id="plugin-deactivate-survey-<?php echo $this->plugin; ?>">
285
- <div class="<?php echo $this->plugin; ?>-deactivate-survey-wrap">
286
- <form class="<?php echo $this->plugin; ?>-deactivate-survey" method="post">
287
- <span class="<?php echo $this->plugin; ?>-deactivate-survey-header">
288
  <span class="dashicons dashicons-testimonial"></span>
289
  <?php echo ' ' . esc_html__('Quick Feedback', $this->plugin_text_domain); ?>
290
  <span title="<?php esc_attr_e('Close', $this->plugin_text_domain); ?> "
291
- class="<?php echo $this->plugin; ?>-deactivate-survey-close">✕</span>
292
  </span>
293
 
294
- <span class="<?php echo $this->plugin; ?>-deactivate-survey-desc">
295
  <?php
296
  printf(
297
  /* translators: %s - plugin name. */
@@ -300,33 +299,33 @@ class SurveyForm
300
  );
301
  ?>
302
  </span>
303
- <div class="<?php echo $this->plugin; ?>-deactivate-survey-options">
304
  <?php foreach ($options as $id => $option) : ?>
305
- <div class="<?php echo $this->plugin; ?>-deactivate-survey-option">
306
- <label for="<?php echo $this->plugin; ?>-deactivate-survey-option-<?php echo $this->plugin; ?>-<?php echo $id; ?>"
307
- class="<?php echo $this->plugin; ?>-deactivate-survey-option-label">
308
- <input id="<?php echo $this->plugin; ?>-deactivate-survey-option-<?php echo $this->plugin; ?>-<?php echo $id; ?>"
309
- class="<?php echo $this->plugin; ?>-deactivate-survey-option-input"
310
  type="radio"
311
- name="code" value="<?php echo $id; ?>"/>
312
- <span class="<?php echo $this->plugin; ?>-deactivate-survey-option-title"><?php echo $option['title']; ?></span>
313
- <input class="<?php echo $this->plugin; ?>-deactivate-survey-option-reason"
314
  type="hidden"
315
- value="<?php echo $option['reason']; ?>"/>
316
  </label>
317
  <?php if (!empty($option['details'])) : ?>
318
- <input class="<?php echo $this->plugin; ?>-deactivate-survey-option-details"
319
  type="text"
320
- placeholder="<?php echo $option['details']; ?>"/>
321
  <?php endif; ?>
322
  </div>
323
  <?php endforeach; ?>
324
  </div>
325
- <div class="<?php echo $this->plugin; ?>-deactivate-survey-footer">
326
  <button type="submit"
327
- class="<?php echo $this->plugin; ?>-deactivate-survey-submit button button-primary button-large"><?php echo esc_html__('Submit & Deactivate', $this->plugin_text_domain); ?></button>
328
  <a href="#"
329
- class="<?php echo $this->plugin; ?>-deactivate-survey-deactivate"><?php echo esc_html__('Skip & Deactivate', $this->plugin_text_domain); ?></a>
330
  </div>
331
  </form>
332
  </div>
48
  ?>
49
  <script type="text/javascript">
50
  jQuery(function ($) {
51
+ var $deactivateLink = $('#the-list').find('[data-slug="<?php echo esc_attr($this->plugin); ?>"] span.deactivate a'),
52
+ $overlay = $('#plugin-deactivate-survey-<?php echo esc_attr($this->plugin); ?>'),
53
  $form = $overlay.find('form'),
54
  formOpen = false;
55
  // Plugin listing table deactivate link.
57
  event.preventDefault();
58
  $overlay.css('display', 'table');
59
  formOpen = true;
60
+ $form.find('.<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option:first-of-type input[type=radio]').focus();
61
  });
62
  // Survey radio option selected.
63
  $form.on('change', 'input[type=radio]', function (event) {
64
  event.preventDefault();
65
  $form.find('input[type=text], .error').hide();
66
+ $form.find('.<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option').removeClass('selected');
67
+ $(this).closest('.<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option').addClass('selected').find('input[type=text]').show();
68
  });
69
  // Survey Skip & Deactivate.
70
+ $form.on('click', '.<?php echo esc_attr($this->plugin); ?>-deactivate-survey-deactivate', function (event) {
71
  event.preventDefault();
72
  location.href = $deactivateLink.attr('href');
73
  });
74
  // close button
75
+ $form.on('click', '.<?php echo esc_attr($this->plugin); ?>-deactivate-survey-close', function (event) {
76
  event.preventDefault();
77
  $overlay.css('display', 'none');
78
  formOpen = false;
81
  $form.submit(function (event) {
82
  event.preventDefault();
83
  if (!$form.find('input[type=radio]:checked').val()) {
84
+ $form.find('.<?php echo esc_attr($this->plugin); ?>-deactivate-survey-footer').prepend('<span class="error"><?php echo esc_js(__('Please select an option', $this->plugin_text_domain)); ?></span>');
85
  return;
86
  }
87
+ $form.find('.<?php echo esc_attr($this->plugin); ?>-deactivate-survey-submit').html('<?php echo esc_js(__('Sending Feedback', $this->plugin_text_domain)); ?>').attr("disabled", true).removeClass('button-primary');
88
+ var reason = $form.find('.selected .<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option-reason').val();
89
  if (reason === "Other") {
90
  reason = $form.find('.selected input[type=text]').val();
91
  }
93
  subject: "Discount Rules for WooCommerce plugin deactivation survey form!",
94
  message: reason,
95
  url: '<?php echo esc_url(home_url()); ?>',
96
+ name: '<?php echo esc_attr($display_name); ?>',
97
  code: $form.find('.selected input[type=radio]').val(),
98
+ token: "<?php echo esc_attr($this->token); ?>"
99
  };
100
  var submitSurvey = $.ajax(
101
  {
102
+ url: "<?php echo esc_attr($this->endpoint); ?>",
 
103
  type: "POST",
104
  data: JSON.stringify(request_data),
105
  dataType: 'json',
279
  ),
280
  );
281
  ?>
282
+ <div class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-modal"
283
+ id="plugin-deactivate-survey-<?php echo esc_attr($this->plugin); ?>">
284
+ <div class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-wrap">
285
+ <form class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey" method="post">
286
+ <span class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-header">
287
  <span class="dashicons dashicons-testimonial"></span>
288
  <?php echo ' ' . esc_html__('Quick Feedback', $this->plugin_text_domain); ?>
289
  <span title="<?php esc_attr_e('Close', $this->plugin_text_domain); ?> "
290
+ class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-close">✕</span>
291
  </span>
292
 
293
+ <span class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-desc">
294
  <?php
295
  printf(
296
  /* translators: %s - plugin name. */
299
  );
300
  ?>
301
  </span>
302
+ <div class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-options">
303
  <?php foreach ($options as $id => $option) : ?>
304
+ <div class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option">
305
+ <label for="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option-<?php echo esc_attr($this->plugin); ?>-<?php echo esc_attr($id); ?>"
306
+ class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option-label">
307
+ <input id="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option-<?php echo esc_attr($this->plugin); ?>-<?php echo esc_attr($id); ?>"
308
+ class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option-input"
309
  type="radio"
310
+ name="code" value="<?php echo esc_attr($id); ?>"/>
311
+ <span class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option-title"><?php echo esc_html($option['title']); ?></span>
312
+ <input class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option-reason"
313
  type="hidden"
314
+ value="<?php echo esc_attr($option['reason']); ?>"/>
315
  </label>
316
  <?php if (!empty($option['details'])) : ?>
317
+ <input class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-option-details"
318
  type="text"
319
+ placeholder="<?php echo esc_attr($option['details']); ?>"/>
320
  <?php endif; ?>
321
  </div>
322
  <?php endforeach; ?>
323
  </div>
324
+ <div class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-footer">
325
  <button type="submit"
326
+ class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-submit button button-primary button-large"><?php echo esc_html__('Submit & Deactivate', $this->plugin_text_domain); ?></button>
327
  <a href="#"
328
+ class="<?php echo esc_attr($this->plugin); ?>-deactivate-survey-deactivate"><?php echo esc_html__('Skip & Deactivate', $this->plugin_text_domain); ?></a>
329
  </div>
330
  </form>
331
  </div>
v2/App/Helpers/Validation.php CHANGED
@@ -408,7 +408,8 @@ class Validation
408
  'wdr_override_custom_price',
409
  'disable_recalculate_total',
410
  'disable_recalculate_total_when_coupon_apply',
411
- 'wdr_hide_other_shipping'
 
412
  )
413
  );
414
  //validate slug may contains a-zA-Z0-9_-
408
  'wdr_override_custom_price',
409
  'disable_recalculate_total',
410
  'disable_recalculate_total_when_coupon_apply',
411
+ 'wdr_hide_other_shipping',
412
+ 'run_rebuild_on_sale_index_cron',
413
  )
414
  );
415
  //validate slug may contains a-zA-Z0-9_-
v2/App/Helpers/Woocommerce.php CHANGED
@@ -1754,7 +1754,8 @@ class Woocommerce
1754
  $product_id = self::getProductId($product);
1755
  if(self::productTypeIs($product, 'variation')){
1756
  $attributes = (array) self::getProductAttributes($product);
1757
- if (count($attributes) > 2) {
 
1758
  $variation_parent_id = self::getProductParentId($product);
1759
  $variation_parent_title = get_the_title($variation_parent_id);
1760
  $variation_separator = apply_filters('woocommerce_product_variation_title_attributes_separator', ' - ', $product);
1754
  $product_id = self::getProductId($product);
1755
  if(self::productTypeIs($product, 'variation')){
1756
  $attributes = (array) self::getProductAttributes($product);
1757
+ $modify_count = apply_filters('advanced_woo_discount_rules_variation_title_modify_count', 2);
1758
+ if (count($attributes) > $modify_count) {
1759
  $variation_parent_id = self::getProductParentId($product);
1760
  $variation_parent_title = get_the_title($variation_parent_id);
1761
  $variation_separator = apply_filters('woocommerce_product_variation_title_attributes_separator', ' - ', $product);
v2/App/Router.php CHANGED
@@ -7,6 +7,7 @@ use Wdr\App\Controllers\Admin\Tabs\AdvancedSection;
7
  use Wdr\App\Controllers\Admin\WDRAjax;
8
  use Wdr\App\Controllers\Admin\Tabs;
9
  use Wdr\App\Controllers\ManageDiscount;
 
10
  use Wdr\App\Controllers\ShortCodeManager;
11
 
12
  if (!defined('ABSPATH')) exit; // Exit if accessed directly
@@ -203,5 +204,13 @@ class Router
203
  //For loading snippets
204
  $advance_option = new AdvancedSection();
205
  $advance_option->runAdvancedOption($manage_discount_class::$config);
 
 
 
 
 
 
 
 
206
  }
207
  }
7
  use Wdr\App\Controllers\Admin\WDRAjax;
8
  use Wdr\App\Controllers\Admin\Tabs;
9
  use Wdr\App\Controllers\ManageDiscount;
10
+ use Wdr\App\Controllers\OnSaleShortCode;
11
  use Wdr\App\Controllers\ShortCodeManager;
12
 
13
  if (!defined('ABSPATH')) exit; // Exit if accessed directly
204
  //For loading snippets
205
  $advance_option = new AdvancedSection();
206
  $advance_option->runAdvancedOption($manage_discount_class::$config);
207
+
208
+ //For rebuild on sale index daily
209
+ $rebuild_on_sale_rules = $manage_discount_class::$config->getConfig('awdr_rebuild_on_sale_rules', array());
210
+ $run_rebuild_on_sale_index_cron = $manage_discount_class::$config->getConfig('run_rebuild_on_sale_index_cron', 0);
211
+ if (!empty($rebuild_on_sale_rules) && $run_rebuild_on_sale_index_cron) {
212
+ $shortcode_manager = new OnSaleShortCode();
213
+ add_action('advanced_woo_discount_rules_scheduled_rebuild_on_sale_index_event', array($shortcode_manager, 'rebuildOnSaleList'));
214
+ }
215
  }
216
  }
v2/App/Views/Admin/Menu.php CHANGED
@@ -1,5 +1,5 @@
1
  <?php
2
- if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
  ?>
4
  <div class="wdr">
5
  <div class="wdr-alert-top-right" id="notify-msg-holder"></div>
@@ -10,15 +10,15 @@
10
  'tab' => $tab_key
11
  );
12
  $target = '';
13
- $link = admin_url('admin.php?' . http_build_query($params));
14
- // if ($tab_key === 'help') {
15
- //$link = 'https://docs.flycart.org/en/collections/2195266-discount-rules-2-0?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=documentation';
16
- // $target = 'target="_blank"';
17
- // }
18
  ?>
19
- <a class="nav-tab <?php echo($tab_key === $current_tab ? 'nav-tab-active' : ''); ?>"
20
  style="<?php echo ($tab_key === 'help') ? 'background: cornflowerblue;color: white;' : ''; ?>"
21
- href="<?php echo $link; ?>" <?php echo $target; ?>><?php echo $tab_handler->title; ?></a>
22
  <?php } ?>
23
  <span class="awdr_version_text"> <?php echo 'v' . (defined('WDR_VERSION') ? WDR_VERSION : '2.0.0 + ') . ' '; ?> </span>
24
  <?php
@@ -28,9 +28,9 @@
28
  $additional_class_for_rebuild = ' need_attention';
29
  }
30
  ?>
31
- <span class="awdr_rebuild_on_sale_rule_page_con<?php echo $additional_class_for_rebuild; ?>">
32
  <button type="button" class="btn btn-danger"
33
- id="awdr_rebuild_on_sale_list_on_rule_page" data-awdr_nonce="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_rule_build_index'); ?>"><?php esc_html_e('Rebuild index', 'woo-discount-rules'); ?></button>
34
  </span>
35
  <?php
36
  }
1
  <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
  ?>
4
  <div class="wdr">
5
  <div class="wdr-alert-top-right" id="notify-msg-holder"></div>
10
  'tab' => $tab_key
11
  );
12
  $target = '';
13
+ $link = esc_url(admin_url('admin.php?' . http_build_query($params)));
14
+ // if ($tab_key === 'help') {
15
+ //$link = 'https://docs.flycart.org/en/collections/2195266-discount-rules-2-0?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=documentation';
16
+ // $target = 'target="_blank"';
17
+ // }
18
  ?>
19
+ <a class="nav-tab <?php echo esc_attr(($tab_key === $current_tab ? 'nav-tab-active' : '')); ?>"
20
  style="<?php echo ($tab_key === 'help') ? 'background: cornflowerblue;color: white;' : ''; ?>"
21
+ href="<?php echo esc_url($link); ?>" <?php echo esc_attr($target); ?>><?php echo esc_html($tab_handler->title); ?></a>
22
  <?php } ?>
23
  <span class="awdr_version_text"> <?php echo 'v' . (defined('WDR_VERSION') ? WDR_VERSION : '2.0.0 + ') . ' '; ?> </span>
24
  <?php
28
  $additional_class_for_rebuild = ' need_attention';
29
  }
30
  ?>
31
+ <span class="awdr_rebuild_on_sale_rule_page_con<?php echo esc_attr($additional_class_for_rebuild); ?>">
32
  <button type="button" class="btn btn-danger"
33
+ id="awdr_rebuild_on_sale_list_on_rule_page" data-awdr_nonce="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_rule_build_index')); ?>"><?php esc_html_e('Rebuild index', 'woo-discount-rules'); ?></button>
34
  </span>
35
  <?php
36
  }
v2/App/Views/Admin/Rules/Conditions/Cart/LineItemCount.php CHANGED
@@ -8,7 +8,7 @@ echo ($render_saved_condition == true) ? '' : '<div class="cart_line_items_count
8
  ?>
9
  <div class="wdr_cart_line_item_count_group wdr-condition-type-options">
10
  <div class="wdr-cart-subtotal wdr-select-filed-hight">
11
- <select name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][operator]" class="awdr-left-align">
12
  <option value="less_than" <?php echo ($operator == "less_than") ? "selected" : ""; ?>><?php _e('Less than ( &lt; )', 'woo-discount-rules') ?></option>
13
  <option value="less_than_or_equal" <?php echo ($operator == "less_than_or_equal") ? "selected" : ""; ?>><?php _e('Less than or equal ( &lt;= )', 'woo-discount-rules') ?></option>
14
  <option value="greater_than_or_equal" <?php echo ($operator == "greater_than_or_equal") ? "selected" : ""; ?>><?php _e('Greater than or equal ( &gt;= )', 'woo-discount-rules') ?></option>
@@ -18,12 +18,12 @@ echo ($render_saved_condition == true) ? '' : '<div class="cart_line_items_count
18
  </div>
19
 
20
  <div class="cart-subtotal-value wdr-input-filed-hight">
21
- <input name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][value]" type="text" class="float_only_field awdr-left-align"
22
- value="<?php echo (isset($options->value)) ? $options->value : '' ?>" placeholder="<?php _e('1', 'woo-discount-rules');?>">
23
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Line item count', 'woo-discount-rules'); ?></span>
24
  </div>
25
  <div class="cart-subtotal-methods wdr-select-filed-hight">
26
- <select name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][calculate_from]" class="calculate_cart_from awdr-left-align">
27
  <option value="from_cart" <?php echo ($calculate_from == "from_cart") ? "selected" : ""; ?>><?php _e('Count all items in cart', 'woo-discount-rules') ?></option>
28
  <option value="from_filter" <?php echo ($calculate_from == "from_filter") ? "selected" : ""; ?>><?php _e('Only count items chosen in the filters set for this rule', 'woo-discount-rules') ?></option>
29
  </select>
8
  ?>
9
  <div class="wdr_cart_line_item_count_group wdr-condition-type-options">
10
  <div class="wdr-cart-subtotal wdr-select-filed-hight">
11
+ <select name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][operator]" class="awdr-left-align">
12
  <option value="less_than" <?php echo ($operator == "less_than") ? "selected" : ""; ?>><?php _e('Less than ( &lt; )', 'woo-discount-rules') ?></option>
13
  <option value="less_than_or_equal" <?php echo ($operator == "less_than_or_equal") ? "selected" : ""; ?>><?php _e('Less than or equal ( &lt;= )', 'woo-discount-rules') ?></option>
14
  <option value="greater_than_or_equal" <?php echo ($operator == "greater_than_or_equal") ? "selected" : ""; ?>><?php _e('Greater than or equal ( &gt;= )', 'woo-discount-rules') ?></option>
18
  </div>
19
 
20
  <div class="cart-subtotal-value wdr-input-filed-hight">
21
+ <input name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][value]" type="text" class="float_only_field awdr-left-align"
22
+ value="<?php echo (isset($options->value)) ? esc_attr($options->value) : '' ?>" placeholder="<?php _e('1', 'woo-discount-rules');?>">
23
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Line item count', 'woo-discount-rules'); ?></span>
24
  </div>
25
  <div class="cart-subtotal-methods wdr-select-filed-hight">
26
+ <select name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][calculate_from]" class="calculate_cart_from awdr-left-align">
27
  <option value="from_cart" <?php echo ($calculate_from == "from_cart") ? "selected" : ""; ?>><?php _e('Count all items in cart', 'woo-discount-rules') ?></option>
28
  <option value="from_filter" <?php echo ($calculate_from == "from_filter") ? "selected" : ""; ?>><?php _e('Only count items chosen in the filters set for this rule', 'woo-discount-rules') ?></option>
29
  </select>
v2/App/Views/Admin/Rules/Conditions/Cart/Subtotal.php CHANGED
@@ -9,7 +9,7 @@ echo ($render_saved_condition == true) ? '' : '<div class="cart_subtotal">';
9
  <div class="wdr_cart_subtotal_group wdr-condition-type-options">
10
  <div class="wdr_cart_subtotal_group">
11
  <div class="cart-subtotal-methods wdr-select-filed-hight">
12
- <select name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][operator]" class="awdr-left-align subtotal_operator">
13
  <option value="less_than" <?php echo ($operator == "less_than") ? "selected" : ""; ?>><?php _e('Less than ( &lt; )', 'woo-discount-rules') ?></option>
14
  <option value="less_than_or_equal" <?php echo ($operator == "less_than_or_equal") ? "selected" : ""; ?>><?php _e('Less than or equal ( &lt;= )', 'woo-discount-rules') ?></option>
15
  <option value="greater_than_or_equal" <?php echo ($operator == "greater_than_or_equal") ? "selected" : ""; ?>><?php _e('Greater than or equal ( &gt;= )', 'woo-discount-rules') ?></option>
@@ -19,13 +19,13 @@ echo ($render_saved_condition == true) ? '' : '<div class="cart_subtotal">';
19
  </div>
20
 
21
  <div class="cart-subtotal-value wdr-input-filed-hight">
22
- <input name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][value]" type="text" class="float_only_field awdr-left-align"
23
- value="<?php echo (isset($options->value)) ? $options->value : '' ?>" placeholder="<?php _e('0.00', 'woo-discount-rules');?>" min="0">
24
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Subtotal Amount ', 'woo-discount-rules'); ?></span>
25
  </div>
26
 
27
  <div class="cart-subtotal-methods wdr-select-filed-hight">
28
- <select name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][calculate_from]" class="calculate_cart_from awdr-left-align">
29
  <option value="from_cart" <?php echo ($calculate_from == "from_cart") ? "selected" : ""; ?>><?php _e('Count all items in cart', 'woo-discount-rules') ?></option>
30
  <option value="from_filter" <?php echo ($calculate_from == "from_filter") ? "selected" : ""; ?>><?php _e('Only count items chosen in the filters set for this rule', 'woo-discount-rules') ?></option>
31
  </select>
9
  <div class="wdr_cart_subtotal_group wdr-condition-type-options">
10
  <div class="wdr_cart_subtotal_group">
11
  <div class="cart-subtotal-methods wdr-select-filed-hight">
12
+ <select name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][operator]" class="awdr-left-align subtotal_operator">
13
  <option value="less_than" <?php echo ($operator == "less_than") ? "selected" : ""; ?>><?php _e('Less than ( &lt; )', 'woo-discount-rules') ?></option>
14
  <option value="less_than_or_equal" <?php echo ($operator == "less_than_or_equal") ? "selected" : ""; ?>><?php _e('Less than or equal ( &lt;= )', 'woo-discount-rules') ?></option>
15
  <option value="greater_than_or_equal" <?php echo ($operator == "greater_than_or_equal") ? "selected" : ""; ?>><?php _e('Greater than or equal ( &gt;= )', 'woo-discount-rules') ?></option>
19
  </div>
20
 
21
  <div class="cart-subtotal-value wdr-input-filed-hight">
22
+ <input name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][value]" type="text" class="float_only_field awdr-left-align"
23
+ value="<?php echo (isset($options->value)) ? esc_attr($options->value) : '' ?>" placeholder="<?php _e('0.00', 'woo-discount-rules');?>" min="0">
24
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Subtotal Amount ', 'woo-discount-rules'); ?></span>
25
  </div>
26
 
27
  <div class="cart-subtotal-methods wdr-select-filed-hight">
28
+ <select name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][calculate_from]" class="calculate_cart_from awdr-left-align">
29
  <option value="from_cart" <?php echo ($calculate_from == "from_cart") ? "selected" : ""; ?>><?php _e('Count all items in cart', 'woo-discount-rules') ?></option>
30
  <option value="from_filter" <?php echo ($calculate_from == "from_filter") ? "selected" : ""; ?>><?php _e('Only count items chosen in the filters set for this rule', 'woo-discount-rules') ?></option>
31
  </select>
v2/App/Views/Admin/Rules/Conditions/Main.php CHANGED
@@ -45,9 +45,9 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
45
  $extra_params = isset($rule->available_conditions[$type]['extra_params']) ? $rule->available_conditions[$type]['extra_params'] : array();
46
  if (file_exists($template)) {
47
  $options = isset($condition->options) ? $condition->options : array(); ?>
48
- <div class="wdr-grid wdr-conditions-container wdr-condition-group" data-index="<?php echo $i; ?>">
49
  <div class="wdr-condition-type">
50
- <select name="conditions[<?php echo $i; ?>][type]"
51
  class="wdr-product-condition-type awdr-left-align"
52
  style="width: 100%"><?php
53
  if (isset($wdr_product_conditions) && !empty($wdr_product_conditions)) {
@@ -64,7 +64,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
64
  <?php
65
  } else {
66
  ?>
67
- value="<?php echo $key; ?>"
68
  <?php
69
  }
70
  ?>
@@ -94,13 +94,13 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
94
  $type_promotion = isset($condition->type) ? $condition->type : NULL;
95
  if($type_promotion == 'cart_subtotal' && $subtotal_promo == 1){
96
  $operator = isset($options->operator) ? $options->operator : 'greater_than_or_equal';?>
97
- <div class="wdr-grid wdr-conditions-container wdr-condition-group <?php echo 'promo_show_hide_'.$i; ?>" data-index="<?php echo $i; ?>" style="<?php echo ($operator == 'greater_than_or_equal' || $operator == 'greater_than') ? '': 'display: none'; ?>">
98
  <?php include(WDR_PLUGIN_PATH . 'App/Views/Admin/Rules/Others/SubtotalPromotion.php'); ?>
99
  </div>
100
  <?php
101
  }else if($type_promotion == 'cart_items_quantity' && $cart_quantity_promo == 1 && $is_pro){
102
  $operator = isset($options->operator) ? $options->operator : 'greater_than_or_equal';?>
103
- <div class="wdr-grid wdr-conditions-container wdr-condition-group <?php echo 'promo_show_hide_'.$i; ?>" data-index="<?php echo $i; ?>" style="<?php echo ($operator == 'greater_than_or_equal' || $operator == 'greater_than') ? '': 'display: none'; ?>">
104
  <?php include(WDR_PLUGIN_PATH . 'App/Views/Admin/Rules/Others/QuantityPromotion.php'); ?>
105
  </div>
106
  <?php
@@ -151,7 +151,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
151
  </span>
152
  <span class="awdr-rule-limit-timestamp "> <?php
153
  _e('Rule Used: ', 'woo-discount-rules');
154
- echo "<b class='awdr-used-limit-total'>".$used_limits."</b>"; ?>
155
  </span>
156
  </label>
157
 
@@ -160,7 +160,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
160
  <div class="wdr-rule-setting">
161
  <div class="wdr-apply-to" style="float:left;">
162
 
163
- <input type="number" name="usage_limits" value="<?php echo (!empty($usage_limits)) ? $usage_limits : '';?>" min="1" class="wdr-title number_only_field" id="select_usage_limits" placeholder="Unlimited">
164
 
165
  <span class="wdr_desc_text"><?php _e('Maximum usage limit', 'woo-discount-rules'); ?></span>
166
  </div>
@@ -170,11 +170,11 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
170
  name="date_from"
171
  class="wdr-condition-date wdr-title"
172
  data-class="start_datetimeonly"
173
- placeholder="<?php _e('Rule Vaild From', 'woo-discount-rules'); ?>"
174
  data-field="date"
175
  autocomplete="off"
176
  id="rule_datetime_from"
177
- value="<?php echo $rule->getStartDate(false, 'Y-m-d H:i'); ?>">
178
  <span class="wdr_desc_text"><?php _e('Vaild from', 'woo-discount-rules'); ?></span>
179
  </div>
180
  <div class="wdr-dateandtime-value">
@@ -182,10 +182,10 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
182
  name="date_to"
183
  class="wdr-condition-date wdr-title"
184
  data-class="end_datetimeonly"
185
- placeholder="<?php _e('Rule Valid To', 'woo-discount-rules'); ?>"
186
  data-field="date" autocomplete="off"
187
  id="rule_datetime_to"
188
- value="<?php echo $rule->getEndDate(false, 'Y-m-d H:i'); ?>">
189
  <span class="wdr_desc_text"><?php _e('Vaild to', 'woo-discount-rules'); ?></span>
190
  </div>
191
  </div>
@@ -197,14 +197,14 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
197
  class="edit-preloaded-values"
198
  data-list="site_languages"
199
  data-field="preloaded"
200
- data-placeholder="<?php _e('Select values', 'woo-discount-rules') ?>"
201
  name="rule_language[]"><?php
202
  $chosen_languages = $rule->getLanguages();
203
  foreach ($site_languages as $language_key => $name) {
204
  if (in_array($language_key, $chosen_languages)) {
205
  ?>
206
- <option value="<?php echo $language_key; ?>"
207
- selected><?php echo $name; ?></option>
208
  <?php
209
  }
210
  }
45
  $extra_params = isset($rule->available_conditions[$type]['extra_params']) ? $rule->available_conditions[$type]['extra_params'] : array();
46
  if (file_exists($template)) {
47
  $options = isset($condition->options) ? $condition->options : array(); ?>
48
+ <div class="wdr-grid wdr-conditions-container wdr-condition-group" data-index="<?php echo esc_attr($i); ?>">
49
  <div class="wdr-condition-type">
50
+ <select name="conditions[<?php echo esc_attr($i); ?>][type]"
51
  class="wdr-product-condition-type awdr-left-align"
52
  style="width: 100%"><?php
53
  if (isset($wdr_product_conditions) && !empty($wdr_product_conditions)) {
64
  <?php
65
  } else {
66
  ?>
67
+ value="<?php echo esc_attr($key); ?>"
68
  <?php
69
  }
70
  ?>
94
  $type_promotion = isset($condition->type) ? $condition->type : NULL;
95
  if($type_promotion == 'cart_subtotal' && $subtotal_promo == 1){
96
  $operator = isset($options->operator) ? $options->operator : 'greater_than_or_equal';?>
97
+ <div class="wdr-grid wdr-conditions-container wdr-condition-group <?php echo 'promo_show_hide_'.esc_attr($i); ?>" data-index="<?php echo esc_attr($i); ?>" style="<?php echo ($operator == 'greater_than_or_equal' || $operator == 'greater_than') ? '': 'display: none'; ?>">
98
  <?php include(WDR_PLUGIN_PATH . 'App/Views/Admin/Rules/Others/SubtotalPromotion.php'); ?>
99
  </div>
100
  <?php
101
  }else if($type_promotion == 'cart_items_quantity' && $cart_quantity_promo == 1 && $is_pro){
102
  $operator = isset($options->operator) ? $options->operator : 'greater_than_or_equal';?>
103
+ <div class="wdr-grid wdr-conditions-container wdr-condition-group <?php echo 'promo_show_hide_'.esc_attr($i); ?>" data-index="<?php echo esc_attr($i); ?>" style="<?php echo ($operator == 'greater_than_or_equal' || $operator == 'greater_than') ? '': 'display: none'; ?>">
104
  <?php include(WDR_PLUGIN_PATH . 'App/Views/Admin/Rules/Others/QuantityPromotion.php'); ?>
105
  </div>
106
  <?php
151
  </span>
152
  <span class="awdr-rule-limit-timestamp "> <?php
153
  _e('Rule Used: ', 'woo-discount-rules');
154
+ echo "<b class='awdr-used-limit-total'>". esc_html($used_limits) ."</b>"; ?>
155
  </span>
156
  </label>
157
 
160
  <div class="wdr-rule-setting">
161
  <div class="wdr-apply-to" style="float:left;">
162
 
163
+ <input type="number" name="usage_limits" value="<?php echo (!empty($usage_limits)) ? esc_attr($usage_limits) : '';?>" min="1" class="wdr-title number_only_field" id="select_usage_limits" placeholder="Unlimited">
164
 
165
  <span class="wdr_desc_text"><?php _e('Maximum usage limit', 'woo-discount-rules'); ?></span>
166
  </div>
170
  name="date_from"
171
  class="wdr-condition-date wdr-title"
172
  data-class="start_datetimeonly"
173
+ placeholder="<?php esc_attr_e('Rule Vaild From', 'woo-discount-rules'); ?>"
174
  data-field="date"
175
  autocomplete="off"
176
  id="rule_datetime_from"
177
+ value="<?php echo esc_attr($rule->getStartDate(false, 'Y-m-d H:i')); ?>">
178
  <span class="wdr_desc_text"><?php _e('Vaild from', 'woo-discount-rules'); ?></span>
179
  </div>
180
  <div class="wdr-dateandtime-value">
182
  name="date_to"
183
  class="wdr-condition-date wdr-title"
184
  data-class="end_datetimeonly"
185
+ placeholder="<?php esc_attr_e('Rule Valid To', 'woo-discount-rules'); ?>"
186
  data-field="date" autocomplete="off"
187
  id="rule_datetime_to"
188
+ value="<?php echo esc_attr($rule->getEndDate(false, 'Y-m-d H:i')); ?>">
189
  <span class="wdr_desc_text"><?php _e('Vaild to', 'woo-discount-rules'); ?></span>
190
  </div>
191
  </div>
197
  class="edit-preloaded-values"
198
  data-list="site_languages"
199
  data-field="preloaded"
200
+ data-placeholder="<?php esc_attr_e('Select values', 'woo-discount-rules') ?>"
201
  name="rule_language[]"><?php
202
  $chosen_languages = $rule->getLanguages();
203
  foreach ($site_languages as $language_key => $name) {
204
  if (in_array($language_key, $chosen_languages)) {
205
  ?>
206
+ <option value="<?php echo esc_attr($language_key); ?>"
207
+ selected><?php echo esc_html($name); ?></option>
208
  <?php
209
  }
210
  }
v2/App/Views/Admin/Rules/DiscountBatch/Main.php CHANGED
@@ -16,7 +16,7 @@ $is_pro = Helper::hasPro();
16
  <div class="awdr-discount-bar-content">
17
  <p><?php _e("It helps to display discount information in product pages.", 'woo-discount-rules'); ?> <a href="https://docs.flycart.org/en/articles/3946529-discount-bar?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=dicount_bar_inner" target="_blank" ><?php _e("Read docs.", 'woo-discount-rules'); ?></a> </p>
18
  <b><?php _e('Preview', 'woo-discount-rules'); ?></b><br><br>
19
- <div class="awdr_admin_discount_bar awdr_row_0" style="background-color:<?php echo ($badge_bg_color) ? $badge_bg_color : '#ffffff' ?>;color:<?php echo ($badge_text_color) ? $badge_text_color : '#000000' ?>;">
20
  <?php echo ($badge_text) ? $badge_text : 'Discount Text'; ?>
21
  </div>
22
  <p><b><?php _e('Note:', 'woo-discount-rules'); ?></b><?php _e('Preview contains sample result for original result see product page.', 'woo-discount-rules'); ?></p>
@@ -62,10 +62,10 @@ $is_pro = Helper::hasPro();
62
  <input type="color" id="badge_colorpicker"
63
  name="discount_badge[badge_color_picker]"
64
  pattern="^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"
65
- value="<?php echo ($badge_bg_color) ? $badge_bg_color : '#ffffff'; ?>">
66
  <input type="text" name="discount_badge[badge_color_picker]"
67
  pattern="^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"
68
- value="<?php echo ($badge_bg_color) ? $badge_bg_color : '#ffffff'; ?>"
69
  id="badge_hexcolor" class="wdr_color_picker">
70
  <?php } else {
71
  _e("Unlock this feature by <a href='https://www.flycart.org/products/wordpress/woocommerce-discount-rules' target='_blank'>Upgrading to Pro</a>", 'woo-discount-rules');
@@ -83,10 +83,10 @@ $is_pro = Helper::hasPro();
83
  <input type="color" id="text_colorpicker"
84
  name="discount_badge[badge_text_color_picker]"
85
  pattern="^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"
86
- value="<?php echo ($badge_text_color) ? $badge_text_color : '#000000'; ?>">
87
  <input type="text" name="discount_badge[badge_text_color_picker]"
88
  pattern="^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"
89
- value="<?php echo ($badge_text_color) ? $badge_text_color : '#000000'; ?>"
90
  id="text_hexcolor" class="wdr_color_picker">
91
  <?php } else {
92
  _e("Unlock this feature by <a href='https://www.flycart.org/products/wordpress/woocommerce-discount-rules' target='_blank'>Upgrading to Pro</a>", 'woo-discount-rules');
@@ -108,7 +108,7 @@ $is_pro = Helper::hasPro();
108
  id="awdr_discount_bar_content"
109
  rows="4"
110
  cols="50"
111
- placeholder="<?php _e('Discount Text', 'woo-discount-rules'); ?>"><?php echo ($badge_text) ? $badge_text : ''; ?></textarea>
112
  <br/><span class="wdr_adv_msg_shortcode_text">
113
  <b class="adv-msg-title">{{title}} -&gt; <?php _e(' Rule Title,', 'woo-discount-rules'); ?></b>&nbsp;&nbsp;&nbsp;&nbsp;
114
  <?php
16
  <div class="awdr-discount-bar-content">
17
  <p><?php _e("It helps to display discount information in product pages.", 'woo-discount-rules'); ?> <a href="https://docs.flycart.org/en/articles/3946529-discount-bar?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=dicount_bar_inner" target="_blank" ><?php _e("Read docs.", 'woo-discount-rules'); ?></a> </p>
18
  <b><?php _e('Preview', 'woo-discount-rules'); ?></b><br><br>
19
+ <div class="awdr_admin_discount_bar awdr_row_0" style="background-color:<?php echo ($badge_bg_color) ? esc_attr($badge_bg_color) : '#ffffff' ?>;color:<?php echo ($badge_text_color) ? esc_attr($badge_text_color) : '#000000' ?>;">
20
  <?php echo ($badge_text) ? $badge_text : 'Discount Text'; ?>
21
  </div>
22
  <p><b><?php _e('Note:', 'woo-discount-rules'); ?></b><?php _e('Preview contains sample result for original result see product page.', 'woo-discount-rules'); ?></p>
62
  <input type="color" id="badge_colorpicker"
63
  name="discount_badge[badge_color_picker]"
64
  pattern="^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"
65
+ value="<?php echo ($badge_bg_color) ? esc_attr($badge_bg_color) : '#ffffff'; ?>">
66
  <input type="text" name="discount_badge[badge_color_picker]"
67
  pattern="^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"
68
+ value="<?php echo ($badge_bg_color) ? esc_attr($badge_bg_color) : '#ffffff'; ?>"
69
  id="badge_hexcolor" class="wdr_color_picker">
70
  <?php } else {
71
  _e("Unlock this feature by <a href='https://www.flycart.org/products/wordpress/woocommerce-discount-rules' target='_blank'>Upgrading to Pro</a>", 'woo-discount-rules');
83
  <input type="color" id="text_colorpicker"
84
  name="discount_badge[badge_text_color_picker]"
85
  pattern="^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"
86
+ value="<?php echo ($badge_text_color) ? esc_attr($badge_text_color) : '#000000'; ?>">
87
  <input type="text" name="discount_badge[badge_text_color_picker]"
88
  pattern="^#+([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$"
89
+ value="<?php echo ($badge_text_color) ? esc_attr($badge_text_color) : '#000000'; ?>"
90
  id="text_hexcolor" class="wdr_color_picker">
91
  <?php } else {
92
  _e("Unlock this feature by <a href='https://www.flycart.org/products/wordpress/woocommerce-discount-rules' target='_blank'>Upgrading to Pro</a>", 'woo-discount-rules');
108
  id="awdr_discount_bar_content"
109
  rows="4"
110
  cols="50"
111
+ placeholder="<?php esc_attr_e('Discount Text', 'woo-discount-rules'); ?>"><?php echo ($badge_text) ? $badge_text : ''; ?></textarea>
112
  <br/><span class="wdr_adv_msg_shortcode_text">
113
  <b class="adv-msg-title">{{title}} -&gt; <?php _e(' Rule Title,', 'woo-discount-rules'); ?></b>&nbsp;&nbsp;&nbsp;&nbsp;
114
  <?php
v2/App/Views/Admin/Rules/Discounts/Bulk.php CHANGED
@@ -4,37 +4,37 @@ if (!defined('ABSPATH')) {
4
  }
5
  $is_pro = \Wdr\App\Helpers\Helper::hasPro();
6
  ?>
7
- <div class="wdr-discount-group awdr-bulk-group" data-index="<?php echo $bulk_index; ?>">
8
  <div class="range_setter_inner">
9
  <div class="bulk-row-main">
10
  <div class="bulk-row-start wdr-input-filed-hight bulk-row-inner">
11
  <div class="dashicons dashicons-menu awdr-sort-icon awdr-sortable-handle"></div>
12
  <div class="bulk-min">
13
  <input type="number"
14
- name="bulk_adjustments[ranges][<?php echo $bulk_index; ?>][from]"
15
  class="bulk_discount_min awdr_value_selector awdr_next_value"
16
  placeholder="<?php _e('min', 'woo-discount-rules'); ?>"
17
  min="0"
18
  step="any"
19
  value="<?php if (isset($range_value->from) && !empty($range_value->from)) {
20
- echo $range_value->from;
21
  } ?>">
22
  <span class="wdr_desc_text"><?php _e('Minimum Quantity ', 'woo-discount-rules'); ?></span>
23
  </div>
24
  <div class="bulk-max">
25
  <input type="number"
26
- name="bulk_adjustments[ranges][<?php echo $bulk_index; ?>][to]"
27
  class="bulk_discount_max awdr_value_selector awdr_auto_add_value"
28
  placeholder="<?php _e('max', 'woo-discount-rules'); ?>"
29
  min="0"
30
  step="any"
31
  value="<?php if (isset($range_value->to) && !empty($range_value->to)) {
32
- echo $range_value->to;
33
  } ?>">
34
  <span class="wdr_desc_text"><?php _e('Maximum Quantity ', 'woo-discount-rules'); ?></span>
35
  </div>
36
  <div class="bulk_gen_disc_type wdr-select-filed-hight">
37
- <select name="bulk_adjustments[ranges][<?php echo $bulk_index; ?>][type]"
38
  class="bulk-discount-type bulk_discount_select">
39
  <option value="percentage" <?php if (isset($range_value->type) && $range_value->type == 'percentage') {
40
  echo 'selected';
@@ -54,20 +54,20 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
54
  </div>
55
  <div class="bulk_amount">
56
  <input type="number"
57
- name="bulk_adjustments[ranges][<?php echo $bulk_index; ?>][value]"
58
  class="bulk_discount_value bulk_value_selector awdr_value_selector"
59
  placeholder="<?php _e('Discount', 'woo-discount-rules'); ?>"
60
  min="0"
61
  step="any"
62
- value="<?php echo (isset($range_value->value) && !empty($range_value->value)) ? $range_value->value : 0;?>">
63
  <span class="wdr_desc_text"><?php _e('Discount Value', 'woo-discount-rules'); ?></span>
64
  </div>
65
  <div class="bulk_amount">
66
- <input type="text" name="bulk_adjustments[ranges][<?php echo $bulk_index; ?>][label]"
67
  class="bulk_value_selector awdr_value_selector"
68
  placeholder="<?php _e('Label', 'woo-discount-rules'); ?>" min="0"
69
  value="<?php if (isset($range_value->label) && !empty($range_value->label)) {
70
- echo wp_unslash($range_value->label);
71
  } ?>">
72
  <span class="wdr_desc_text"><?php _e('Title column For Bulk Table', 'woo-discount-rules'); ?></span>
73
  </div>
4
  }
5
  $is_pro = \Wdr\App\Helpers\Helper::hasPro();
6
  ?>
7
+ <div class="wdr-discount-group awdr-bulk-group" data-index="<?php echo esc_attr($bulk_index); ?>">
8
  <div class="range_setter_inner">
9
  <div class="bulk-row-main">
10
  <div class="bulk-row-start wdr-input-filed-hight bulk-row-inner">
11
  <div class="dashicons dashicons-menu awdr-sort-icon awdr-sortable-handle"></div>
12
  <div class="bulk-min">
13
  <input type="number"
14
+ name="bulk_adjustments[ranges][<?php echo esc_attr($bulk_index); ?>][from]"
15
  class="bulk_discount_min awdr_value_selector awdr_next_value"
16
  placeholder="<?php _e('min', 'woo-discount-rules'); ?>"
17
  min="0"
18
  step="any"
19
  value="<?php if (isset($range_value->from) && !empty($range_value->from)) {
20
+ echo esc_attr($range_value->from);
21
  } ?>">
22
  <span class="wdr_desc_text"><?php _e('Minimum Quantity ', 'woo-discount-rules'); ?></span>
23
  </div>
24
  <div class="bulk-max">
25
  <input type="number"
26
+ name="bulk_adjustments[ranges][<?php echo esc_attr($bulk_index); ?>][to]"
27
  class="bulk_discount_max awdr_value_selector awdr_auto_add_value"
28
  placeholder="<?php _e('max', 'woo-discount-rules'); ?>"
29
  min="0"
30
  step="any"
31
  value="<?php if (isset($range_value->to) && !empty($range_value->to)) {
32
+ echo esc_attr($range_value->to);
33
  } ?>">
34
  <span class="wdr_desc_text"><?php _e('Maximum Quantity ', 'woo-discount-rules'); ?></span>
35
  </div>
36
  <div class="bulk_gen_disc_type wdr-select-filed-hight">
37
+ <select name="bulk_adjustments[ranges][<?php echo esc_attr($bulk_index); ?>][type]"
38
  class="bulk-discount-type bulk_discount_select">
39
  <option value="percentage" <?php if (isset($range_value->type) && $range_value->type == 'percentage') {
40
  echo 'selected';
54
  </div>
55
  <div class="bulk_amount">
56
  <input type="number"
57
+ name="bulk_adjustments[ranges][<?php echo esc_attr($bulk_index); ?>][value]"
58
  class="bulk_discount_value bulk_value_selector awdr_value_selector"
59
  placeholder="<?php _e('Discount', 'woo-discount-rules'); ?>"
60
  min="0"
61
  step="any"
62
+ value="<?php echo (isset($range_value->value) && !empty($range_value->value)) ? esc_attr($range_value->value) : 0;?>">
63
  <span class="wdr_desc_text"><?php _e('Discount Value', 'woo-discount-rules'); ?></span>
64
  </div>
65
  <div class="bulk_amount">
66
+ <input type="text" name="bulk_adjustments[ranges][<?php echo esc_attr($bulk_index); ?>][label]"
67
  class="bulk_value_selector awdr_value_selector"
68
  placeholder="<?php _e('Label', 'woo-discount-rules'); ?>" min="0"
69
  value="<?php if (isset($range_value->label) && !empty($range_value->label)) {
70
+ echo esc_attr(wp_unslash($range_value->label));
71
  } ?>">
72
  <span class="wdr_desc_text"><?php _e('Title column For Bulk Table', 'woo-discount-rules'); ?></span>
73
  </div>
v2/App/Views/Admin/Rules/Discounts/Cart.php CHANGED
@@ -27,7 +27,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
27
  <input name="cart_adjustments[value]"
28
  type="number"
29
  class="awdr_cart_discount_value awdr-left-align"
30
- value="<?php echo (isset($cart_adjustment->value)) ? $cart_adjustment->value : ''; ?>"
31
  placeholder="0.00" min="0" step="any"
32
  style="width: 100%;">
33
  <span class="wdr_desc_text awdr-clear"><?php _e('Value', 'woo-discount-rules'); ?></span>
@@ -36,7 +36,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
36
  <input name="cart_adjustments[label]"
37
  type="text"
38
  class="awdr-left-align"
39
- value="<?php echo (isset($cart_adjustment->label)) ? wp_unslash($cart_adjustment->label) : ''; ?>"
40
  placeholder="<?php _e('Discount label', 'woo-discount-rules'); ?>"
41
  style="width: 100%;">
42
  <span class="wdr_desc_text awdr-clear"><?php _e('Discount Label', 'woo-discount-rules'); ?></span>
27
  <input name="cart_adjustments[value]"
28
  type="number"
29
  class="awdr_cart_discount_value awdr-left-align"
30
+ value="<?php echo (isset($cart_adjustment->value)) ? esc_attr($cart_adjustment->value) : ''; ?>"
31
  placeholder="0.00" min="0" step="any"
32
  style="width: 100%;">
33
  <span class="wdr_desc_text awdr-clear"><?php _e('Value', 'woo-discount-rules'); ?></span>
36
  <input name="cart_adjustments[label]"
37
  type="text"
38
  class="awdr-left-align"
39
+ value="<?php echo (isset($cart_adjustment->label)) ? esc_attr(wp_unslash($cart_adjustment->label)) : ''; ?>"
40
  placeholder="<?php _e('Discount label', 'woo-discount-rules'); ?>"
41
  style="width: 100%;">
42
  <span class="wdr_desc_text awdr-clear"><?php _e('Discount Label', 'woo-discount-rules'); ?></span>
v2/App/Views/Admin/Rules/Discounts/Main.php CHANGED
@@ -98,8 +98,8 @@ If a customer buys 2 of Product A - Small, 4 of Product A - Medium, 6 of Prod
98
  <div class="simple_discount_value wdr-input-filed-hight apply_fee_coupon_label" style="<?php echo (isset($bulk_adj_as_cart) && !empty($bulk_adj_as_cart)) ? '' : 'display: none;' ?> <?php echo ($is_enabled_rtl) ? 'padding-top: 0px !important;' : ''; ?>">
99
  <input name="bulk_adjustments[cart_label]"
100
  type="text"
101
- value="<?php echo (isset($bulk_adj_as_cart_label)) ? wp_unslash($bulk_adj_as_cart_label) : ''; ?>"
102
- placeholder="<?php esc_attr('Discount Label', 'woo-discount-rules'); ?>">
103
  </div>
104
  </div>
105
  </div>
98
  <div class="simple_discount_value wdr-input-filed-hight apply_fee_coupon_label" style="<?php echo (isset($bulk_adj_as_cart) && !empty($bulk_adj_as_cart)) ? '' : 'display: none;' ?> <?php echo ($is_enabled_rtl) ? 'padding-top: 0px !important;' : ''; ?>">
99
  <input name="bulk_adjustments[cart_label]"
100
  type="text"
101
+ value="<?php echo (isset($bulk_adj_as_cart_label)) ? esc_attr(wp_unslash($bulk_adj_as_cart_label)) : ''; ?>"
102
+ placeholder="<?php _e('Discount Label', 'woo-discount-rules'); ?>">
103
  </div>
104
  </div>
105
  </div>
v2/App/Views/Admin/Rules/Discounts/simple.php CHANGED
@@ -26,7 +26,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
26
  <input name="product_adjustments[value]"
27
  type="number"
28
  class="product_discount_value"
29
- value="<?php echo (isset($product_adjustments->value)) ? $product_adjustments->value : ''; ?>"
30
  placeholder="0.00" min="0" step="any" style="width: 100%;">
31
  <span class="wdr_desc_text"><?php _e('Value', 'woo-discount-rules'); ?></span>
32
  </div>
@@ -44,8 +44,8 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
44
  <div class="simple_discount_value wdr-input-filed-hight apply_fee_coupon_label" style="<?php echo (isset($product_adjustments->apply_as_cart_rule) && !empty($product_adjustments->apply_as_cart_rule)) ? '' : 'display: none;' ?> <?php echo ($is_enabled_rtl) ? 'padding-top: 0px !important;' : ''; ?>">
45
  <input name="product_adjustments[cart_label]"
46
  type="text"
47
- value="<?php echo (isset($product_adjustments->cart_label)) ? wp_unslash($product_adjustments->cart_label) : ''; ?>"
48
- placeholder="<?php esc_attr('Discount Label', 'woo-discount-rules'); ?>">
49
  </div>
50
  </div>
51
  </div>
26
  <input name="product_adjustments[value]"
27
  type="number"
28
  class="product_discount_value"
29
+ value="<?php echo (isset($product_adjustments->value)) ? esc_attr($product_adjustments->value) : ''; ?>"
30
  placeholder="0.00" min="0" step="any" style="width: 100%;">
31
  <span class="wdr_desc_text"><?php _e('Value', 'woo-discount-rules'); ?></span>
32
  </div>
44
  <div class="simple_discount_value wdr-input-filed-hight apply_fee_coupon_label" style="<?php echo (isset($product_adjustments->apply_as_cart_rule) && !empty($product_adjustments->apply_as_cart_rule)) ? '' : 'display: none;' ?> <?php echo ($is_enabled_rtl) ? 'padding-top: 0px !important;' : ''; ?>">
45
  <input name="product_adjustments[cart_label]"
46
  type="text"
47
+ value="<?php echo (isset($product_adjustments->cart_label)) ? esc_attr(wp_unslash($product_adjustments->cart_label)) : ''; ?>"
48
+ placeholder="<?php esc_attr_e('Discount Label', 'woo-discount-rules'); ?>">
49
  </div>
50
  </div>
51
  </div>
v2/App/Views/Admin/Rules/Filters/Main.php CHANGED
@@ -9,20 +9,20 @@ if (!defined('ABSPATH')) {
9
  <div class="wdr-row">
10
  <div class="wdr-filter-group-items">
11
  <input type="hidden" name="edit_rule"
12
- value="<?php echo ($rule->getId()) ? $rule->getId() : ''; ?>"><?php
13
  if ($rule->hasFilter()) {
14
  $filters = $rule->getFilter();
15
  $filter_row_count = 1;
16
  foreach ($filters as $filter) {
17
  ?>
18
- <div class="wdr-grid wdr-filter-group" data-index="<?php echo $filter_row_count; ?>">
19
  <div class="wdr-filter-type">
20
- <select name="filters[<?php echo $filter_row_count; ?>][type]"
21
  class="wdr-product-filter-type"><?php
22
  if (isset($product_filters) && !empty($product_filters)) {
23
  foreach ($product_filters as $wdr_filter_key => $wdr_filter_value) {
24
  ?>
25
- <optgroup label="<?php _e($wdr_filter_key, 'woo-discount-rules'); ?>" ><?php
26
  foreach ($wdr_filter_value as $key => $value) {
27
  ?>
28
  <option
@@ -33,7 +33,7 @@ if (!defined('ABSPATH')) {
33
  <?php
34
  } else {
35
  ?>
36
- value="<?php echo $key; ?>"
37
  <?php
38
  }
39
  ?>
@@ -49,7 +49,7 @@ if (!defined('ABSPATH')) {
49
  if(in_array($filter->type, array('products'))){
50
  ?>
51
  <div class="wdr-product_filter_method">
52
- <select name="filters[<?php echo $filter_row_count; ?>][method]">
53
  <option value="in_list"
54
  <?php echo (isset($filter->method) && $filter->method == 'in_list') ? 'selected' : ''; ?>><?php _e('In List', 'woo-discount-rules'); ?></option>
55
  <option value="not_in_list" <?php echo (isset($filter->method) && $filter->method == 'not_in_list') ? 'selected' : ''; ?>><?php _e('Not In List', 'woo-discount-rules'); ?></option>
@@ -64,22 +64,23 @@ if (!defined('ABSPATH')) {
64
  foreach ($filter->value as $option) {
65
  switch ($filter->type) {
66
  case 'products':
67
- $item_name = '#'.$option.' '.\Wdr\App\Helpers\Woocommerce::getTitleOfProduct($option);
68
  $placeholder = __('Products', 'woo-discount-rules');
69
  break;
70
  }
71
  if (!empty($item_name)) {
72
- $selected_options .= "<option value={$option} selected>{$item_name}</option>";
 
73
  }
74
  }
75
  }
76
  ?>
77
  <select multiple
78
  class="edit-filters awdr_validation"
79
- data-list="<?php echo $filter->type; ?>"
80
  data-field="autocomplete"
81
- data-placeholder="<?php _e('Select ' . $placeholder, 'woo-discount-rules'); ?>"
82
- name="filters[<?php echo $filter_row_count; ?>][value][]">
83
  <?php echo $selected_options; ?>
84
  </select>
85
  </div>
@@ -131,7 +132,7 @@ if (!defined('ABSPATH')) {
131
  if (isset($product_filters) && !empty($product_filters)) {
132
  foreach ($product_filters as $wdr_filter_key => $wdr_filter_value) {
133
  ?>
134
- <optgroup label="<?php _e($wdr_filter_key, 'woo-discount-rules'); ?>"><?php
135
  foreach ($wdr_filter_value as $key => $value) {
136
  ?>
137
  <option
@@ -142,7 +143,7 @@ if (!defined('ABSPATH')) {
142
  <?php
143
  } else {
144
  ?>
145
- value="<?php echo $key; ?>"
146
  <?php
147
  }
148
  ?>
9
  <div class="wdr-row">
10
  <div class="wdr-filter-group-items">
11
  <input type="hidden" name="edit_rule"
12
+ value="<?php echo ($rule->getId()) ? esc_attr($rule->getId()) : ''; ?>"><?php
13
  if ($rule->hasFilter()) {
14
  $filters = $rule->getFilter();
15
  $filter_row_count = 1;
16
  foreach ($filters as $filter) {
17
  ?>
18
+ <div class="wdr-grid wdr-filter-group" data-index="<?php echo esc_attr($filter_row_count); ?>">
19
  <div class="wdr-filter-type">
20
+ <select name="filters[<?php echo esc_attr($filter_row_count); ?>][type]"
21
  class="wdr-product-filter-type"><?php
22
  if (isset($product_filters) && !empty($product_filters)) {
23
  foreach ($product_filters as $wdr_filter_key => $wdr_filter_value) {
24
  ?>
25
+ <optgroup label="<?php esc_attr_e($wdr_filter_key, 'woo-discount-rules'); ?>" ><?php
26
  foreach ($wdr_filter_value as $key => $value) {
27
  ?>
28
  <option
33
  <?php
34
  } else {
35
  ?>
36
+ value="<?php echo esc_attr($key); ?>"
37
  <?php
38
  }
39
  ?>
49
  if(in_array($filter->type, array('products'))){
50
  ?>
51
  <div class="wdr-product_filter_method">
52
+ <select name="filters[<?php echo esc_attr($filter_row_count); ?>][method]">
53
  <option value="in_list"
54
  <?php echo (isset($filter->method) && $filter->method == 'in_list') ? 'selected' : ''; ?>><?php _e('In List', 'woo-discount-rules'); ?></option>
55
  <option value="not_in_list" <?php echo (isset($filter->method) && $filter->method == 'not_in_list') ? 'selected' : ''; ?>><?php _e('Not In List', 'woo-discount-rules'); ?></option>
64
  foreach ($filter->value as $option) {
65
  switch ($filter->type) {
66
  case 'products':
67
+ $item_name = esc_attr('#'.$option.' '.\Wdr\App\Helpers\Woocommerce::getTitleOfProduct($option));
68
  $placeholder = __('Products', 'woo-discount-rules');
69
  break;
70
  }
71
  if (!empty($item_name)) {
72
+ $option_value = esc_attr($option);
73
+ $selected_options .= "<option value={$option_value} selected>{$item_name}</option>";
74
  }
75
  }
76
  }
77
  ?>
78
  <select multiple
79
  class="edit-filters awdr_validation"
80
+ data-list="<?php echo esc_attr($filter->type); ?>"
81
  data-field="autocomplete"
82
+ data-placeholder="<?php esc_attr_e('Select ' . $placeholder, 'woo-discount-rules'); ?>"
83
+ name="filters[<?php echo esc_attr($filter_row_count); ?>][value][]">
84
  <?php echo $selected_options; ?>
85
  </select>
86
  </div>
132
  if (isset($product_filters) && !empty($product_filters)) {
133
  foreach ($product_filters as $wdr_filter_key => $wdr_filter_value) {
134
  ?>
135
+ <optgroup label="<?php esc_attr_e($wdr_filter_key, 'woo-discount-rules'); ?>"><?php
136
  foreach ($wdr_filter_value as $key => $value) {
137
  ?>
138
  <option
143
  <?php
144
  } else {
145
  ?>
146
+ value="<?php echo esc_attr($key); ?>"
147
  <?php
148
  }
149
  ?>
v2/App/Views/Admin/Rules/Manage.php CHANGED
@@ -5,7 +5,7 @@
5
  <div class="awdr-container"><br/>
6
  <?php
7
  if(isset($wdr_404_found) && !empty($wdr_404_found)){
8
- echo "<h2 style='color: red;'>".$wdr_404_found."</h2>";
9
  }else{
10
  $current_time = '';
11
  if (function_exists('current_time')) {
@@ -65,7 +65,7 @@
65
  ?>
66
  <div class="notice inline notice-<?php echo esc_attr($notice_status); ?> notice-alt awdr-rule-notices">
67
  <p class="rule-notice">
68
- <?php
69
  if (!empty($notice_title)) {
70
  echo '<b>' . esc_html($notice_title) . ':</b> ';
71
  }
@@ -126,7 +126,7 @@
126
 
127
  if (isset($rule_id) && !empty($rule_id)) { ?>
128
  <span class="wdr_desc_text awdr_valide_date_in_desc">
129
- <?php esc_html_e('#Rule ID: ', 'woo-discount-rules'); ?><b><?php echo $rule_id; ?></b>
130
  </span><?php
131
  } ?>
132
  <div class="awdr-common-save">
@@ -134,7 +134,7 @@
134
  <?php _e('Save', 'woo-discount-rules'); ?></button>
135
  <button type="button" class="btn btn-success wdr_save_close">
136
  <?php _e('Save & Close', 'woo-discount-rules'); ?></button>
137
- <a href="<?php echo admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules'))); ?>"
138
  class="btn btn-danger" style="text-decoration: none">
139
  <?php _e('Cancel', 'woo-discount-rules'); ?></a>
140
  </div>
@@ -154,7 +154,7 @@
154
  if (isset($wdr_product_discount_types) && !empty($wdr_product_discount_types)) {
155
  foreach ($wdr_product_discount_types as $wdr_discount_key => $wdr_discount_value) {
156
  ?>
157
- <optgroup label="<?php echo $wdr_discount_key; ?>">
158
  <?php
159
  foreach ($wdr_discount_value as $key => $value) {
160
  $enable_option = true;
@@ -165,7 +165,7 @@
165
  <option
166
  <?php if ($enable_option) {
167
  ?>
168
- value="<?php echo $key; ?>"
169
  <?php
170
  } else {
171
  ?>
@@ -203,7 +203,7 @@
203
  <div id="wdr-save-rule" name="rule_generator">
204
  <input type="hidden" name="action" value="wdr_ajax">
205
  <input type="hidden" name="method" value="save_rule">
206
- <input type="hidden" name="awdr_nonce" value="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_save_rule'); ?>">
207
  <input type="hidden" name="wdr_save_close" value="">
208
  <div id="rule_template">
209
  <?php include 'Filters/Main.php'; ?>
@@ -284,7 +284,7 @@
284
  <!-- ------------------------Rule Discount Batch Section End------------------ -->
285
 
286
  </div>
287
- <input type="hidden" name="wdr_ajax_select2" value="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_select2'); ?>">
288
  </form><?php
289
 
290
  }?>
5
  <div class="awdr-container"><br/>
6
  <?php
7
  if(isset($wdr_404_found) && !empty($wdr_404_found)){
8
+ echo "<h2 style='color: red;'>" . esc_html($wdr_404_found) . "</h2>";
9
  }else{
10
  $current_time = '';
11
  if (function_exists('current_time')) {
65
  ?>
66
  <div class="notice inline notice-<?php echo esc_attr($notice_status); ?> notice-alt awdr-rule-notices">
67
  <p class="rule-notice">
68
+ <?php
69
  if (!empty($notice_title)) {
70
  echo '<b>' . esc_html($notice_title) . ':</b> ';
71
  }
126
 
127
  if (isset($rule_id) && !empty($rule_id)) { ?>
128
  <span class="wdr_desc_text awdr_valide_date_in_desc">
129
+ <?php esc_html_e('#Rule ID: ', 'woo-discount-rules'); ?><b><?php echo esc_html($rule_id); ?></b>
130
  </span><?php
131
  } ?>
132
  <div class="awdr-common-save">
134
  <?php _e('Save', 'woo-discount-rules'); ?></button>
135
  <button type="button" class="btn btn-success wdr_save_close">
136
  <?php _e('Save & Close', 'woo-discount-rules'); ?></button>
137
+ <a href="<?php echo esc_url(admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules')))); ?>"
138
  class="btn btn-danger" style="text-decoration: none">
139
  <?php _e('Cancel', 'woo-discount-rules'); ?></a>
140
  </div>
154
  if (isset($wdr_product_discount_types) && !empty($wdr_product_discount_types)) {
155
  foreach ($wdr_product_discount_types as $wdr_discount_key => $wdr_discount_value) {
156
  ?>
157
+ <optgroup label="<?php echo esc_attr($wdr_discount_key); ?>">
158
  <?php
159
  foreach ($wdr_discount_value as $key => $value) {
160
  $enable_option = true;
165
  <option
166
  <?php if ($enable_option) {
167
  ?>
168
+ value="<?php echo esc_attr($key); ?>"
169
  <?php
170
  } else {
171
  ?>
203
  <div id="wdr-save-rule" name="rule_generator">
204
  <input type="hidden" name="action" value="wdr_ajax">
205
  <input type="hidden" name="method" value="save_rule">
206
+ <input type="hidden" name="awdr_nonce" value="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_save_rule')); ?>">
207
  <input type="hidden" name="wdr_save_close" value="">
208
  <div id="rule_template">
209
  <?php include 'Filters/Main.php'; ?>
284
  <!-- ------------------------Rule Discount Batch Section End------------------ -->
285
 
286
  </div>
287
+ <input type="hidden" name="wdr_ajax_select2" value="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_select2')); ?>">
288
  </form><?php
289
 
290
  }?>
v2/App/Views/Admin/Rules/Others/CommonTemplates.php CHANGED
@@ -22,7 +22,7 @@ if (!defined('ABSPATH')) {
22
  if (isset($wdr_product_filters) && !empty($wdr_product_filters)) {
23
  foreach ($wdr_product_filters as $wdr_filter_key => $wdr_filter_value) {
24
  ?>
25
- <optgroup label="<?php echo $wdr_filter_key; ?>"><?php
26
  foreach ($wdr_filter_value as $key => $value) {
27
  ?>
28
  <option
@@ -33,7 +33,7 @@ if (!defined('ABSPATH')) {
33
  <?php
34
  } else {
35
  ?>
36
- value="<?php echo $key; ?>"
37
  <?php
38
  }
39
  ?>
@@ -61,7 +61,7 @@ if (!defined('ABSPATH')) {
61
  if (isset($wdr_product_conditions) && !empty($wdr_product_conditions)) {
62
  foreach ($wdr_product_conditions as $wdr_condition_key => $wdr_condition_value) {
63
  ?>
64
- <optgroup label="<?php echo $wdr_condition_key; ?>"><?php
65
  foreach ($wdr_condition_value as $key => $value) {
66
  ?>
67
  <option class="<?php echo ( $key == 'cart_item_product_onsale') ? 'wdr-hide awdr-free-shipping-special-condition' : ''; ?>"
@@ -72,7 +72,7 @@ if (!defined('ABSPATH')) {
72
  <?php
73
  } else {
74
  ?>
75
- value="<?php echo $key; ?>"
76
  <?php
77
  }
78
  ?>
22
  if (isset($wdr_product_filters) && !empty($wdr_product_filters)) {
23
  foreach ($wdr_product_filters as $wdr_filter_key => $wdr_filter_value) {
24
  ?>
25
+ <optgroup label="<?php echo esc_attr($wdr_filter_key); ?>"><?php
26
  foreach ($wdr_filter_value as $key => $value) {
27
  ?>
28
  <option
33
  <?php
34
  } else {
35
  ?>
36
+ value="<?php echo esc_attr($key); ?>"
37
  <?php
38
  }
39
  ?>
61
  if (isset($wdr_product_conditions) && !empty($wdr_product_conditions)) {
62
  foreach ($wdr_product_conditions as $wdr_condition_key => $wdr_condition_value) {
63
  ?>
64
+ <optgroup label="<?php echo esc_attr($wdr_condition_key); ?>"><?php
65
  foreach ($wdr_condition_value as $key => $value) {
66
  ?>
67
  <option class="<?php echo ( $key == 'cart_item_product_onsale') ? 'wdr-hide awdr-free-shipping-special-condition' : ''; ?>"
72
  <?php
73
  } else {
74
  ?>
75
+ value="<?php echo esc_attr($key); ?>"
76
  <?php
77
  }
78
  ?>
v2/App/Views/Admin/Rules/Others/QuantityPromotion.php CHANGED
@@ -11,14 +11,13 @@ if($render_saved_condition != true && isset($i)){
11
  $i = '{i}';
12
  }
13
  ?>
14
-
15
  <div class="wdr_cart_quantity_promotion_container" style="display: grid;">
16
  <label style="padding-bottom: 20px;"><b><?php _e('Promotion Message', 'woo-discount-rules'); ?></b></label>
17
  <div class="wdr_cart_cart_quantity_promo_from">
18
  <label class="awdr-left-align wdr_cart_quantity_promo_filed_name" style="padding-right: 5px;"><?php _e('Quantity from', 'woo-discount-rules'); ?></label>
19
- <input name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][cart_quantity_promotion_from]"
20
  type="text" class="float_only_field awdr-left-align"
21
- value="<?php echo ($cart_quantity_promotion_from) ? $cart_quantity_promotion_from : '' ?>"
22
  placeholder="<?php _e('0', 'woo-discount-rules');?>"
23
  min="0">
24
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Set a threshold from which you want to start showing promotion message', 'woo-discount-rules'); ?></span>
@@ -27,12 +26,12 @@ if($render_saved_condition != true && isset($i)){
27
  <div class="wdr_cart_quantity_promo_msg">
28
  <p class="wdr_cart_quantity_promo_filed_name"><?php _e('Message', 'woo-discount-rules'); ?></p>
29
  <textarea
30
- name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][cart_quantity_promotion_message]"
31
  style="height: 60px;"
32
  placeholder="<?php _e('Buy {{difference_quantity}} more products and get 10% discount', 'woo-discount-rules'); ?>"><?php echo ($cart_quantity_promotion_message) ? $cart_quantity_promotion_message : ''; ?></textarea>
33
- <span class="wdr_desc_text awdr-clear-both"><?php _e('{{difference_quantity}} -> Difference amount to get discount', 'woo-discount-rules'); ?></span>
34
- <span class="wdr_desc_text awdr-clear-both"><?php _e('<b>Eg:</b> Buy {{difference_quantity}} more products and get 10% discount', 'woo-discount-rules'); ?></span>
35
- </div>
36
- </div><?php
37
  echo ($render_saved_condition == true) ? '' : '</div>'; ?>
38
 
11
  $i = '{i}';
12
  }
13
  ?>
 
14
  <div class="wdr_cart_quantity_promotion_container" style="display: grid;">
15
  <label style="padding-bottom: 20px;"><b><?php _e('Promotion Message', 'woo-discount-rules'); ?></b></label>
16
  <div class="wdr_cart_cart_quantity_promo_from">
17
  <label class="awdr-left-align wdr_cart_quantity_promo_filed_name" style="padding-right: 5px;"><?php _e('Quantity from', 'woo-discount-rules'); ?></label>
18
+ <input name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][cart_quantity_promotion_from]"
19
  type="text" class="float_only_field awdr-left-align"
20
+ value="<?php echo ($cart_quantity_promotion_from) ? esc_attr($cart_quantity_promotion_from) : '' ?>"
21
  placeholder="<?php _e('0', 'woo-discount-rules');?>"
22
  min="0">
23
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Set a threshold from which you want to start showing promotion message', 'woo-discount-rules'); ?></span>
26
  <div class="wdr_cart_quantity_promo_msg">
27
  <p class="wdr_cart_quantity_promo_filed_name"><?php _e('Message', 'woo-discount-rules'); ?></p>
28
  <textarea
29
+ name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][cart_quantity_promotion_message]"
30
  style="height: 60px;"
31
  placeholder="<?php _e('Buy {{difference_quantity}} more products and get 10% discount', 'woo-discount-rules'); ?>"><?php echo ($cart_quantity_promotion_message) ? $cart_quantity_promotion_message : ''; ?></textarea>
32
+ <span class="wdr_desc_text awdr-clear-both"><?php _e('{{difference_quantity}} -> Difference amount to get discount', 'woo-discount-rules'); ?></span>
33
+ <span class="wdr_desc_text awdr-clear-both"><?php _e('<b>Eg:</b> Buy {{difference_quantity}} more products and get 10% discount', 'woo-discount-rules'); ?></span>
34
+ </div>
35
+ </div><?php
36
  echo ($render_saved_condition == true) ? '' : '</div>'; ?>
37
 
v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php CHANGED
@@ -17,10 +17,10 @@ if($render_saved_condition != true && isset($i)){
17
  <label style="padding-bottom: 20px;"><b><?php _e('Promotion Message', 'woo-discount-rules'); ?></b></label>
18
  <div class="wdr_cart_subtotal_promo_from">
19
  <label class="awdr-left-align wdr_subtotal_promo_filed_name" style="padding-right: 5px;"><?php _e('Subtotal from', 'woo-discount-rules'); ?></label>
20
- <input name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][subtotal_promotion_from]"
21
  type="text" class="float_only_field awdr-left-align"
22
- value="<?php echo ($subtotal_promotion_from) ? $subtotal_promotion_from : '' ?>"
23
- placeholder="<?php _e('0.00', 'woo-discount-rules');?>"
24
  min="0">
25
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Set a threshold from which you want to start showing promotion message', 'woo-discount-rules'); ?></span>
26
  <span class="wdr_desc_text awdr-clear-both"><?php _e("<b>Example:</b> Let's say you offer a 10% discount for 1000 and above. you may want to set 900 here. So that the customer can see the promo text when his cart subtotal reaches 900", 'woo-discount-rules'); ?></span>
@@ -28,9 +28,9 @@ if($render_saved_condition != true && isset($i)){
28
  <div class="wdr_cart_subtotal_promo_msg">
29
  <p class="wdr_subtotal_promo_filed_name"><?php _e('Message', 'woo-discount-rules'); ?></p>
30
  <textarea
31
- name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][subtotal_promotion_message]"
32
  style="height: 60px;"
33
- placeholder="<?php _e('Spend {{difference_amount}} more and get 10% discount', 'woo-discount-rules'); ?>"><?php echo ($subtotal_promotion_message) ? $subtotal_promotion_message : ''; ?></textarea>
34
  <span class="wdr_desc_text awdr-clear-both"><?php _e('{{difference_amount}} -> Difference amount to get discount', 'woo-discount-rules'); ?></span>
35
  <span class="wdr_desc_text awdr-clear-both"><?php _e('<b>Eg:</b> Spend {{difference_amount}} more and get 10% discount', 'woo-discount-rules'); ?></span>
36
  </div>
17
  <label style="padding-bottom: 20px;"><b><?php _e('Promotion Message', 'woo-discount-rules'); ?></b></label>
18
  <div class="wdr_cart_subtotal_promo_from">
19
  <label class="awdr-left-align wdr_subtotal_promo_filed_name" style="padding-right: 5px;"><?php _e('Subtotal from', 'woo-discount-rules'); ?></label>
20
+ <input name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][subtotal_promotion_from]"
21
  type="text" class="float_only_field awdr-left-align"
22
+ value="<?php echo ($subtotal_promotion_from) ? esc_attr($subtotal_promotion_from) : '' ?>"
23
+ placeholder="<?php esc_attr_e('0.00', 'woo-discount-rules');?>"
24
  min="0">
25
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Set a threshold from which you want to start showing promotion message', 'woo-discount-rules'); ?></span>
26
  <span class="wdr_desc_text awdr-clear-both"><?php _e("<b>Example:</b> Let's say you offer a 10% discount for 1000 and above. you may want to set 900 here. So that the customer can see the promo text when his cart subtotal reaches 900", 'woo-discount-rules'); ?></span>
28
  <div class="wdr_cart_subtotal_promo_msg">
29
  <p class="wdr_subtotal_promo_filed_name"><?php _e('Message', 'woo-discount-rules'); ?></p>
30
  <textarea
31
+ name="conditions[<?php echo (isset($i)) ? esc_attr($i) : '{i}' ?>][options][subtotal_promotion_message]"
32
  style="height: 60px;"
33
+ placeholder="<?php esc_attr_e('Spend {{difference_amount}} more and get 10% discount', 'woo-discount-rules'); ?>"><?php echo ($subtotal_promotion_message) ? esc_html($subtotal_promotion_message) : ''; ?></textarea>
34
  <span class="wdr_desc_text awdr-clear-both"><?php _e('{{difference_amount}} -> Difference amount to get discount', 'woo-discount-rules'); ?></span>
35
  <span class="wdr_desc_text awdr-clear-both"><?php _e('<b>Eg:</b> Spend {{difference_amount}} more and get 10% discount', 'woo-discount-rules'); ?></span>
36
  </div>
v2/App/Views/Admin/Tabs/AdvancedOptions.php CHANGED
@@ -61,7 +61,7 @@ if (!defined('ABSPATH')) {
61
  <div class="save-configuration">
62
  <input type="hidden" name="method" value="save_advanced_option">
63
  <input type="hidden" name="action" value="wdr_ajax">
64
- <input type="hidden" name="awdr_nonce" value="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_save_advanced_option_config'); ?>">
65
  <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary save-configuration-submit"
66
  value="Save"></p>
67
  </div>
61
  <div class="save-configuration">
62
  <input type="hidden" name="method" value="save_advanced_option">
63
  <input type="hidden" name="action" value="wdr_ajax">
64
+ <input type="hidden" name="awdr_nonce" value="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_save_advanced_option_config')); ?>">
65
  <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary save-configuration-submit"
66
  value="Save"></p>
67
  </div>
v2/App/Views/Admin/Tabs/DiscountRule.php CHANGED
@@ -6,14 +6,20 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
6
  ?>
7
  <br>
8
  <div id="wpbody-content" class="awdr-container">
9
- <div class="" style ="<?php if(!$is_pro){ echo "width: 71%; float: left;"; }?>" >
10
- <div class="col-md-6 col-lg-6 text-left awdr-list-header-btn" <?php if(!$is_pro){ echo 'style="width:100%; float: left"'; }?>>
 
 
 
 
11
  <h1 class="wp-heading-inline"><?php _e('Discount Rules', 'woo-discount-rules'); ?></h1>
12
- <a href="<?php echo admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'create'))); ?>"
13
  class="btn btn-primary"><?php _e('Add New Rule', 'woo-discount-rules'); ?></a>
14
- <?php if($has_migration == true) {
15
  ?>
16
- <a class="wdr-popup-link btn btn-primary"><span class="modal-trigger" data-modal="wdr_migration_popup"><?php _e("Migrate rules from v1", 'woo-discount-rules'); ?></a>
 
 
17
 
18
  <div class="modal" id="wdr_migration_popup">
19
  <div class="modal-sandbox"></div>
@@ -28,10 +34,10 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
28
  </h2>
29
  <div class="wdr_migration_text_con">
30
  <p>
31
- <b><?php esc_html_e('Available price rules', 'woo-discount-rules'); ?>:</b> <?php echo isset($migration_rule_count['price_rules'])? $migration_rule_count['price_rules']: 0;?>
32
  </p>
33
  <p>
34
- <b><?php esc_html_e('Available cart rules', 'woo-discount-rules'); ?>:</b> <?php echo isset($migration_rule_count['cart_rules'])? $migration_rule_count['cart_rules']: 0?>
35
  </p>
36
  <p>
37
  <?php _e('Once migration is completed, please open the rules and check their configuration once again to make sure it meets your discount scenario. If required, please adjust the rule configuration. If you need any help, just open a ticket at <a href="https://www.flycart.org/support" target="_blank">https://www.flycart.org/support</a>', 'woo-discount-rules'); ?>
@@ -39,7 +45,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
39
  </div>
40
  <div class="wdr_settings">
41
  <div class="wdr_migration_container">
42
- <button class="btn btn-primary" type="button" data-awdr_nonce="<?php echo \Wdr\App\Helpers\Helper::create_nonce('awdr_v2_migration'); ?>" id="awdr_do_v1_v2_migration"><?php esc_html_e('Migrate', 'woo-discount-rules'); ?></button>
43
  <span class="close-modal"><button class="btn btn-warning wdr-close-modal-box" type="button"><?php esc_html_e('Skip', 'woo-discount-rules'); ?></button></span>
44
  <div class="wdr_migration_process">
45
  </div>
@@ -50,20 +56,24 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
50
  </div>
51
  </div>
52
  </div>
53
- <?php
54
- }?>
55
- <a href="https://www.flycart.org/woocommerce-discount-rules-examples?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=examples#commonly-asked-scenarios" target="_blank"
56
- class="btn btn-info text-right" style="float: right"><?php _e('View Examples', 'woo-discount-rules'); ?></a>
57
- <a href="https://docs.flycart.org/en/collections/806883-woocommerce-discount-rules?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=documentation" target="_blank"
58
- class="btn btn-info text-right" style="float: right"><?php _e('Documentation', 'woo-discount-rules'); ?></a>
 
 
 
 
59
  </div>
60
 
61
  <br/>
62
  <form id="wdr-search-top" method="get" style="display: none">
63
  <input type="hidden" name="adminUrl"
64
- value="<?php echo admin_url('admin.php?page=woo_discount_rules'); ?>">
65
  <input type="hidden" name="name" value="" class="wdr-rule-search-key">
66
- <input type="hidden" name="awdr_nonce" value="<?php echo \Wdr\App\Helpers\Helper::create_nonce('awdr_ajax_search_rule'); ?>">
67
  <input type="submit" class="button" class="wdr-trigger-search-key"
68
  value="<?php _e('Search Rules', 'woo-discount-rules'); ?>">
69
  </form>
@@ -78,14 +88,17 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
78
  <option value="disable"><?php _e('Disable', 'woo-discount-rules'); ?></option>
79
  <option value="delete"><?php _e('Delete', 'woo-discount-rules'); ?></option>
80
  </select>
81
- <input type="submit" id="doaction" class="button action" value="<?php _e('Apply', 'woo-discount-rules');?>">
82
- <input type="search" name="awdr-hidden-name" class="awdr-hidden-name" value="<?php echo $input->get('name'); ?>">
83
- <input type="hidden" name="awdr_nonce" value="<?php echo \Wdr\App\Helpers\Helper::create_nonce('awdr_ajax_rule_bulk_actions'); ?>">
 
 
 
84
  <input type="button" class="button awdr-hidden-search"
85
  value="<?php _e('Search Rules', 'woo-discount-rules'); ?>">
86
  </div>
87
  <div class="tablenav-pages one-page">
88
- <span class="displaying-num"><?php echo $rules_count . ' ';
89
  ($rules_count == 0 || $rules_count == 1) ? _e('item', 'woo-discount-rules') : _e('items', 'woo-discount-rules'); ?></span>
90
  </div>
91
  <br class="clear">
@@ -132,66 +145,69 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
132
  <tbody class="wdr-ruleboard" id="sortable"><?php
133
  if ($rules) {
134
  foreach ($rules as $rule_row) { ?>
135
- <tr id="<?php echo $rule_row->getId(); ?>" class="awdr-listing-rule-tr">
136
  <th scope="row" class="check-column awdr-listing-rule-check-box-align">
137
  <span class="dashicons dashicons-menu awdr-sortable-handle" style="padding-left: 5px;"></span>
138
  </th>
139
  <th scope="row" class="check-column awdr-listing-rule-check-box-align">
140
- <input id="cb-select-<?php echo $rule_row->getId(); ?>" class="wdr-rules-selector"
141
  type="checkbox" name="saved_rules[]"
142
- value="<?php echo $rule_row->getId(); ?>">
143
  </th>
144
  <td class="title column-title has-row-actions column-primary page-title"
145
  data-colname="Title">
146
  <strong>
147
  <a class="row-title"
148
- href="<?php echo admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_row->getId()))); ?>"
149
- aria-label="“<?php echo $rule_row->getTitle(); ?>” (Edit)"><?php echo $rule_row->getTitle();
150
  if($rule_row->isExclusive()) {?>
151
  <span class="awdr-exclusive-disable-listing"><?php _e('Exclusive', 'woo-discount-rules'); ?></span> <?php
152
  }?></a>
153
  </strong>
154
  <div class="awdr_created_date_html">
155
- <?php
156
- $created_by = $rule_row->getRuleCreatedBy();
157
- if($created_by) {
158
- if (function_exists('get_userdata')) {
159
- if ($user = get_userdata($created_by)) {
160
- if (isset($user->data->display_name)) {
161
- $created_by = $user->data->display_name;
 
162
  }
163
  }
164
  }
165
- }
166
- $created_on = $rule_row->getRuleCreatedOn();
167
 
168
- $modified_by = $rule_row->getRuleModifiedBy();
169
- if($modified_by) {
170
- if (function_exists('get_userdata')) {
171
- if ($user = get_userdata($modified_by)) {
172
- if (isset($user->data->display_name)) {
173
- $modified_by = $user->data->display_name;
 
174
  }
175
  }
176
  }
177
- }
178
- $modified_on = $rule_row->getRuleModifiedOn();
179
- if($created_by && !empty($created_by) && !empty($created_on)){ ?>
180
- <span class="wdr_desc_text"><?php _e('Created by: ' .$created_by.'' , 'woo-discount-rules');?>,<?php _e(' On: ' . $created_on , 'woo-discount-rules'); ?> &nbsp;</span><?php }
181
- if($modified_by && !empty($modified_by) && !empty($modified_on)){?>
182
- <span class="wdr_desc_text"><?php _e('Modified by: ' .$modified_by.'' , 'woo-discount-rules');?>,<?php _e(' On: ' . $modified_on , 'woo-discount-rules'); ?> </span><?php
183
- }?>
 
 
184
  </div>
185
  </td>
186
  <td class="author column-author" data-colname="Author"><?php
187
  $get_discount_type = $rule_row->getRuleDiscountType();
188
  $discount_type_name = '-';
189
- switch ($get_discount_type){
190
  case'wdr_simple_discount':
191
  $discount_type_name = __('Product Adjustment', 'woo-discount-rules');
192
  break;
193
  case'wdr_cart_discount':
194
- $discount_type_name = __('Cart Adjustment', 'woo-discount-rules');
195
  break;
196
  case'wdr_free_shipping':
197
  $discount_type_name = __('Free Shipping', 'woo-discount-rules');
@@ -215,12 +231,12 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
215
  <td class="author column-author" data-colname="Author"><?php
216
  $get_start_date = $rule_row->getStartDate($timestamp = false, $format = "Y-m-d H:i");
217
  ?>
218
- <abbr><?php echo is_null($get_start_date) ? '-' : $get_start_date; ?></abbr>
219
  </td>
220
  <td class="date column-date" data-colname="Date"><?php
221
  $get_end_date = $rule_row->getEndDate($timestamp = false, $format = "Y-m-d H:i");
222
  ?>
223
- <abbr><?php echo is_null($get_end_date) ? '-' : $get_end_date; ?></abbr>
224
  </td>
225
  <?php
226
  if (count($site_languages) > 1) {
@@ -231,7 +247,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
231
  if (!empty($chosen_languages)) {
232
  $i = 1;
233
  foreach ($chosen_languages as $language) {
234
- echo isset($site_languages[$language]) ? $site_languages[$language] : '';
235
  if (count($chosen_languages) > $i) {
236
  echo ', ';
237
  }
@@ -245,11 +261,11 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
245
  <?php
246
  }
247
  ?>
248
- <!-- <td></td>-->
249
  <td class="date column-tag" data-colname="wdr-rule-status">
250
  <label class="switch switch-left-right">
251
- <input class="switch-input wdr_manage_status" name="toogle_action" type="checkbox" data-awdr_="<?php echo $rule_row->getId(); ?>" data-awdr_nonce="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_manage_status'.$rule_row->getId()); ?>" data-manage-status="<?php echo $rule_row->getId(); ?>" <?php echo ($rule_row->isEnabled()) ? 'checked' : '';?>/>
252
- <span class="switch-label" data-on="<?php _e('Enabled', 'woo-discount-rules'); ?>" data-off="<?php _e('Disabled', 'woo-discount-rules'); ?>"></span>
253
  <span class="switch-handle"></span>
254
  </label>
255
  <span class="awdr-enabled-status" style="<?php echo (!$rule_row->isEnabled()) ? 'display:none' : '';?>">
@@ -264,46 +280,54 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
264
  <span class="awdr-text-warning"><b><?php _e('Rule reached maximum usage limit', 'woo-discount-rules');?> </b>
265
  </span><?php
266
 
267
- } else{ ?>
268
- <span class="awdr-listing-status-text"><?php _e(' - ( Will run in future)', 'woo-discount-rules');?></span><br><?php
269
- if(isset($current_time) && !empty($current_time)) {
 
270
  ?>
271
- <span class="awdr-text-warning"><b><?php _e('Your server current date and time:', 'woo-discount-rules');?> </b><?php echo $current_time; ?>
272
  </span><?php
273
  }
274
  }
275
- }elseif ($rule_status == 'expired'){
276
  if ($check_rule_limit == 'Disabled') { ?>
277
- <span class="awdr-listing-status-text"><?php _e(' - ( Not running )', 'woo-discount-rules');?></span><br>
278
- <span class="awdr-text-warning"><b><?php _e('Rule reached maximum usage limit', 'woo-discount-rules');?> </b>
 
 
279
  </span><?php
280
- } else{ ?>
281
- <span class="awdr-listing-status-text"><?php _e(' - ( Not running - validity expired)', 'woo-discount-rules');?></span><br><?php
282
- if(isset($current_time) && !empty($current_time)) {
 
283
  ?>
284
- <span class="awdr-text-warning"><b><?php _e('Your server current date and time:', 'woo-discount-rules');?> </b><?php echo $current_time; ?>
285
  </span><?php
286
  }
287
  }
288
- }else{
289
  if ($check_rule_limit == 'Disabled') { ?>
290
- <span class="awdr-listing-status-text"><?php _e(' - ( Not running )', 'woo-discount-rules');?></span><br>
291
- <span class="awdr-text-warning"><b><?php _e('Rule reached maximum usage limit', 'woo-discount-rules');?> </b>
 
 
292
  </span><?php
293
- } else{ ?>
294
- <span class="awdr-listing-status-text"><?php _e(' - (Running)', 'woo-discount-rules');?></span><?php
295
  }
296
- }?>
297
  </span>
298
  </td>
299
  <td class="awdr-rule-buttons">
300
  <a class="btn btn-primary"
301
- href="<?php echo admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_row->getId()))); ?>">
302
  <?php _e('Edit', 'woo-discount-rules'); ?></a>
303
  <a class="btn btn-primary wdr_duplicate_rule"
304
- data-duplicate-rule="<?php echo $rule_row->getId(); ?>" data-awdr_nonce="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_duplicate_rule'.$rule_row->getId()); ?>"><?php _e('Duplicate', 'woo-discount-rules'); ?></a>
 
305
  <a class="btn btn-danger wdr_delete_rule"
306
- data-delete-rule="<?php echo $rule_row->getId(); ?>" data-awdr_nonce="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_delete_rule'.$rule_row->getId()); ?>">
 
307
  <?php _e('Delete', 'woo-discount-rules'); ?></a>
308
  </td>
309
  </tr>
@@ -315,7 +339,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
315
  <tr class="no-items">
316
  <td></td>
317
  <td></td>
318
- <td class="colspanchange" colspan="2"><?php _e('No rules found.', 'woo-discount-rules');?></td>
319
  </tr>
320
  <?php } ?>
321
  </tbody>
@@ -370,42 +394,47 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
370
  </div>
371
  <div class="alignleft actions">
372
  </div>
373
- <div class="tablenav-pages one-page"><span class="displaying-num"><?php echo $rules_count . ' ';
374
  ($rules_count == 0 || $rules_count == 1) ? _e('item', 'woo-discount-rules') : _e('items', 'woo-discount-rules'); ?></span></span>
375
  </div>
376
  <br class="clear">
377
  </div>
378
- <input type="hidden" name="awdr_rule_list_nonce" value="<?php echo \Wdr\App\Helpers\Helper::create_nonce('awdr_rule_list'); ?>">
379
  <input type="hidden" name="action" value="wdr_ajax">
380
  <input type="hidden" name="method" value="bulk_action">
381
- <input type="hidden" name="adminUrl" value="<?php echo admin_url('admin.php?page=woo_discount_rules') ?>">
382
  </form>
383
  <br class="clear">
384
  </div>
385
  <?php
386
- if(!$is_pro){ ?>
387
  <div class="col-md-6 col-lg-6 text-right" style="width: 27%; float: right;">
388
  <div class="col-md-12">
389
- <a href="https://docs.flycart.org/en/articles/3806305-upgrade-from-free-to-pro?utm_source=wpwoodiscountrules&utm_medium=plugin&utm_campaign=inline&utm_content=upgrade" target="_blank" class="btn btn-success"><?php esc_html_e('Looking for more features? Upgrade to PRO', 'woo-discount-rules'); ?></a>
 
 
390
  </div>
391
  <div class="woo-side-panel">
392
  <div class="panel">
393
  <div class="panel-body">
394
- <h3><?php esc_html_e('With PRO version, you can create:', 'woo-discount-rules')?></h3>
395
- <p><?php esc_html_e('- Categories based discounts', 'woo-discount-rules')?></p>
396
- <p><?php esc_html_e('- User roles based discounts', 'woo-discount-rules')?></p>
397
- <p><?php esc_html_e('- Buy One Get One Free deals', 'woo-discount-rules')?></p>
398
- <p><?php esc_html_e('- Buy X Get Y deals', 'woo-discount-rules')?></p>
399
- <p><?php esc_html_e('- Buy 2, get 1 at 50% discount', 'woo-discount-rules')?></p>
400
- <p><?php esc_html_e('- Buy 3 for $10 (Package / Bundle [Set] Discount)', 'woo-discount-rules')?></p>
401
- <p><?php esc_html_e('- Different discounts with one coupon code', 'woo-discount-rules')?></p>
402
- <p><?php esc_html_e('- Purchase history based discounts', 'woo-discount-rules')?></p>
403
- <p><?php esc_html_e('- Free product / gift', 'woo-discount-rules')?></p>
404
- <p><?php esc_html_e('- Discount for variants', 'woo-discount-rules')?></p>
405
- <p><?php esc_html_e('- Conditional discounts', 'woo-discount-rules')?></p>
406
- <p><?php esc_html_e('- Fixed cost discounts', 'woo-discount-rules')?></p>
407
- <p><?php esc_html_e('- Offer fixed price on certain conditions', 'woo-discount-rules')?></p>
408
- <p><a href="https://www.flycart.org/products/wordpress/woocommerce-discount-rules?utm_source=wpwoodiscountrules&amp;utm_medium=plugin&amp;utm_campaign=inline&amp;utm_content=woo-discount-rules" class="btn btn-success" target="_blank"><?php esc_html_e('Go PRO', 'woo-discount-rules'); ?></a></p>
 
 
 
409
  </div>
410
  </div>
411
  </div>
6
  ?>
7
  <br>
8
  <div id="wpbody-content" class="awdr-container">
9
+ <div class="" style="<?php if (!$is_pro) {
10
+ echo "width: 71%; float: left;";
11
+ } ?>">
12
+ <div class="col-md-6 col-lg-6 text-left awdr-list-header-btn" <?php if (!$is_pro) {
13
+ echo 'style="width:100%; float: left"';
14
+ } ?>>
15
  <h1 class="wp-heading-inline"><?php _e('Discount Rules', 'woo-discount-rules'); ?></h1>
16
+ <a href="<?php echo esc_url(admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'create')))); ?>"
17
  class="btn btn-primary"><?php _e('Add New Rule', 'woo-discount-rules'); ?></a>
18
+ <?php if ($has_migration == true) {
19
  ?>
20
+ <a class="wdr-popup-link btn btn-primary"><span class="modal-trigger"
21
+ data-modal="wdr_migration_popup"><?php _e("Migrate rules from v1", 'woo-discount-rules'); ?>
22
+ </a>
23
 
24
  <div class="modal" id="wdr_migration_popup">
25
  <div class="modal-sandbox"></div>
34
  </h2>
35
  <div class="wdr_migration_text_con">
36
  <p>
37
+ <b><?php esc_html_e('Available price rules', 'woo-discount-rules'); ?>:</b> <?php echo isset($migration_rule_count['price_rules']) ? esc_html($migration_rule_count['price_rules']) : 0; ?>
38
  </p>
39
  <p>
40
+ <b><?php esc_html_e('Available cart rules', 'woo-discount-rules'); ?>:</b> <?php echo isset($migration_rule_count['cart_rules']) ? esc_html($migration_rule_count['cart_rules']) : 0; ?>
41
  </p>
42
  <p>
43
  <?php _e('Once migration is completed, please open the rules and check their configuration once again to make sure it meets your discount scenario. If required, please adjust the rule configuration. If you need any help, just open a ticket at <a href="https://www.flycart.org/support" target="_blank">https://www.flycart.org/support</a>', 'woo-discount-rules'); ?>
45
  </div>
46
  <div class="wdr_settings">
47
  <div class="wdr_migration_container">
48
+ <button class="btn btn-primary" type="button" data-awdr_nonce="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('awdr_v2_migration')); ?>" id="awdr_do_v1_v2_migration"><?php esc_html_e('Migrate', 'woo-discount-rules'); ?></button>
49
  <span class="close-modal"><button class="btn btn-warning wdr-close-modal-box" type="button"><?php esc_html_e('Skip', 'woo-discount-rules'); ?></button></span>
50
  <div class="wdr_migration_process">
51
  </div>
56
  </div>
57
  </div>
58
  </div>
59
+ <?php
60
+ } ?>
61
+ <a href="https://www.flycart.org/woocommerce-discount-rules-examples?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=examples#commonly-asked-scenarios"
62
+ target="_blank"
63
+ class="btn btn-info text-right"
64
+ style="float: right"><?php _e('View Examples', 'woo-discount-rules'); ?></a>
65
+ <a href="https://docs.flycart.org/en/collections/806883-woocommerce-discount-rules?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=documentation"
66
+ target="_blank"
67
+ class="btn btn-info text-right"
68
+ style="float: right"><?php _e('Documentation', 'woo-discount-rules'); ?></a>
69
  </div>
70
 
71
  <br/>
72
  <form id="wdr-search-top" method="get" style="display: none">
73
  <input type="hidden" name="adminUrl"
74
+ value="<?php echo esc_url(admin_url('admin.php?page=woo_discount_rules')); ?>">
75
  <input type="hidden" name="name" value="" class="wdr-rule-search-key">
76
+ <input type="hidden" name="awdr_nonce" value="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('awdr_ajax_search_rule')); ?>">
77
  <input type="submit" class="button" class="wdr-trigger-search-key"
78
  value="<?php _e('Search Rules', 'woo-discount-rules'); ?>">
79
  </form>
88
  <option value="disable"><?php _e('Disable', 'woo-discount-rules'); ?></option>
89
  <option value="delete"><?php _e('Delete', 'woo-discount-rules'); ?></option>
90
  </select>
91
+ <input type="submit" id="doaction" class="button action"
92
+ value="<?php _e('Apply', 'woo-discount-rules'); ?>">
93
+ <input type="search" name="awdr-hidden-name" class="awdr-hidden-name"
94
+ value="<?php echo esc_attr($input->get('name')); ?>">
95
+ <input type="hidden" name="awdr_nonce"
96
+ value="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('awdr_ajax_rule_bulk_actions')); ?>">
97
  <input type="button" class="button awdr-hidden-search"
98
  value="<?php _e('Search Rules', 'woo-discount-rules'); ?>">
99
  </div>
100
  <div class="tablenav-pages one-page">
101
+ <span class="displaying-num"><?php echo esc_html($rules_count) . ' ';
102
  ($rules_count == 0 || $rules_count == 1) ? _e('item', 'woo-discount-rules') : _e('items', 'woo-discount-rules'); ?></span>
103
  </div>
104
  <br class="clear">
145
  <tbody class="wdr-ruleboard" id="sortable"><?php
146
  if ($rules) {
147
  foreach ($rules as $rule_row) { ?>
148
+ <tr id="<?php echo esc_attr($rule_row->getId()); ?>" class="awdr-listing-rule-tr">
149
  <th scope="row" class="check-column awdr-listing-rule-check-box-align">
150
  <span class="dashicons dashicons-menu awdr-sortable-handle" style="padding-left: 5px;"></span>
151
  </th>
152
  <th scope="row" class="check-column awdr-listing-rule-check-box-align">
153
+ <input id="cb-select-<?php echo esc_attr($rule_row->getId()); ?>" class="wdr-rules-selector"
154
  type="checkbox" name="saved_rules[]"
155
+ value="<?php echo esc_attr($rule_row->getId()); ?>">
156
  </th>
157
  <td class="title column-title has-row-actions column-primary page-title"
158
  data-colname="Title">
159
  <strong>
160
  <a class="row-title"
161
+ href="<?php echo esc_url(admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_row->getId())))); ?>"
162
+ aria-label="“<?php echo esc_attr($rule_row->getTitle()); ?>” (Edit)"><?php echo esc_html($rule_row->getTitle());
163
  if($rule_row->isExclusive()) {?>
164
  <span class="awdr-exclusive-disable-listing"><?php _e('Exclusive', 'woo-discount-rules'); ?></span> <?php
165
  }?></a>
166
  </strong>
167
  <div class="awdr_created_date_html">
168
+ <?php
169
+ $created_by = $rule_row->getRuleCreatedBy();
170
+ if ($created_by) {
171
+ if (function_exists('get_userdata')) {
172
+ if ($user = get_userdata($created_by)) {
173
+ if (isset($user->data->display_name)) {
174
+ $created_by = $user->data->display_name;
175
+ }
176
  }
177
  }
178
  }
179
+ $created_on = $rule_row->getRuleCreatedOn();
 
180
 
181
+ $modified_by = $rule_row->getRuleModifiedBy();
182
+ if ($modified_by) {
183
+ if (function_exists('get_userdata')) {
184
+ if ($user = get_userdata($modified_by)) {
185
+ if (isset($user->data->display_name)) {
186
+ $modified_by = $user->data->display_name;
187
+ }
188
  }
189
  }
190
  }
191
+ $modified_on = $rule_row->getRuleModifiedOn();
192
+ if ($created_by && !empty($created_by) && !empty($created_on)) { ?>
193
+ <span class="wdr_desc_text"><?php _e('Created by: ' . $created_by . '', 'woo-discount-rules'); ?>
194
+ ,<?php _e(' On: ' . $created_on, 'woo-discount-rules'); ?> &nbsp;</span><?php }
195
+ if ($modified_by && !empty($modified_by) && !empty($modified_on)) {
196
+ ?>
197
+ <span class="wdr_desc_text"><?php _e('Modified by: ' . $modified_by . '', 'woo-discount-rules'); ?>
198
+ ,<?php _e(' On: ' . $modified_on, 'woo-discount-rules'); ?> </span><?php
199
+ } ?>
200
  </div>
201
  </td>
202
  <td class="author column-author" data-colname="Author"><?php
203
  $get_discount_type = $rule_row->getRuleDiscountType();
204
  $discount_type_name = '-';
205
+ switch ($get_discount_type) {
206
  case'wdr_simple_discount':
207
  $discount_type_name = __('Product Adjustment', 'woo-discount-rules');
208
  break;
209
  case'wdr_cart_discount':
210
+ $discount_type_name = __('Cart Adjustment', 'woo-discount-rules');
211
  break;
212
  case'wdr_free_shipping':
213
  $discount_type_name = __('Free Shipping', 'woo-discount-rules');
231
  <td class="author column-author" data-colname="Author"><?php
232
  $get_start_date = $rule_row->getStartDate($timestamp = false, $format = "Y-m-d H:i");
233
  ?>
234
+ <abbr><?php echo is_null($get_start_date) ? '-' : esc_html($get_start_date); ?></abbr>
235
  </td>
236
  <td class="date column-date" data-colname="Date"><?php
237
  $get_end_date = $rule_row->getEndDate($timestamp = false, $format = "Y-m-d H:i");
238
  ?>
239
+ <abbr><?php echo is_null($get_end_date) ? '-' : esc_html($get_end_date); ?></abbr>
240
  </td>
241
  <?php
242
  if (count($site_languages) > 1) {
247
  if (!empty($chosen_languages)) {
248
  $i = 1;
249
  foreach ($chosen_languages as $language) {
250
+ echo isset($site_languages[$language]) ? esc_html($site_languages[$language]) : '';
251
  if (count($chosen_languages) > $i) {
252
  echo ', ';
253
  }
261
  <?php
262
  }
263
  ?>
264
+ <!-- <td></td>-->
265
  <td class="date column-tag" data-colname="wdr-rule-status">
266
  <label class="switch switch-left-right">
267
+ <input class="switch-input wdr_manage_status" name="toogle_action" type="checkbox" data-awdr_="<?php echo esc_attr($rule_row->getId()); ?>" data-awdr_nonce="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_manage_status'.$rule_row->getId())); ?>" data-manage-status="<?php echo esc_attr($rule_row->getId()); ?>" <?php echo ($rule_row->isEnabled()) ? 'checked' : '';?>/>
268
+ <span class="switch-label" data-on="<?php esc_attr_e('Enabled', 'woo-discount-rules'); ?>" data-off="<?php esc_attr_e('Disabled', 'woo-discount-rules'); ?>"></span>
269
  <span class="switch-handle"></span>
270
  </label>
271
  <span class="awdr-enabled-status" style="<?php echo (!$rule_row->isEnabled()) ? 'display:none' : '';?>">
280
  <span class="awdr-text-warning"><b><?php _e('Rule reached maximum usage limit', 'woo-discount-rules');?> </b>
281
  </span><?php
282
 
283
+ } else { ?>
284
+ <span class="awdr-listing-status-text"><?php _e(' - ( Will run in future)', 'woo-discount-rules'); ?></span>
285
+ <br><?php
286
+ if (isset($current_time) && !empty($current_time)) {
287
  ?>
288
+ <span class="awdr-text-warning"><b><?php _e('Your server current date and time:', 'woo-discount-rules');?> </b><?php echo esc_html($current_time); ?>
289
  </span><?php
290
  }
291
  }
292
+ } elseif ($rule_status == 'expired') {
293
  if ($check_rule_limit == 'Disabled') { ?>
294
+ <span class="awdr-listing-status-text"><?php _e(' - ( Not running )', 'woo-discount-rules'); ?></span>
295
+ <br>
296
+ <span class="awdr-text-warning">
297
+ <b><?php _e('Rule reached maximum usage limit', 'woo-discount-rules'); ?> </b>
298
  </span><?php
299
+ } else { ?>
300
+ <span class="awdr-listing-status-text"><?php _e(' - ( Not running - validity expired)', 'woo-discount-rules'); ?></span>
301
+ <br><?php
302
+ if (isset($current_time) && !empty($current_time)) {
303
  ?>
304
+ <span class="awdr-text-warning"><b><?php _e('Your server current date and time:', 'woo-discount-rules');?> </b><?php echo esc_html($current_time); ?>
305
  </span><?php
306
  }
307
  }
308
+ } else {
309
  if ($check_rule_limit == 'Disabled') { ?>
310
+ <span class="awdr-listing-status-text"><?php _e(' - ( Not running )', 'woo-discount-rules'); ?></span>
311
+ <br>
312
+ <span class="awdr-text-warning">
313
+ <b><?php _e('Rule reached maximum usage limit', 'woo-discount-rules'); ?> </b>
314
  </span><?php
315
+ } else { ?>
316
+ <span class="awdr-listing-status-text"><?php _e(' - (Running)', 'woo-discount-rules'); ?></span><?php
317
  }
318
+ } ?>
319
  </span>
320
  </td>
321
  <td class="awdr-rule-buttons">
322
  <a class="btn btn-primary"
323
+ href="<?php echo esc_url(admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_row->getId())))); ?>">
324
  <?php _e('Edit', 'woo-discount-rules'); ?></a>
325
  <a class="btn btn-primary wdr_duplicate_rule"
326
+ data-duplicate-rule="<?php echo esc_attr($rule_row->getId()); ?>"
327
+ data-awdr_nonce="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_duplicate_rule' . $rule_row->getId())); ?>"><?php _e('Duplicate', 'woo-discount-rules'); ?></a>
328
  <a class="btn btn-danger wdr_delete_rule"
329
+ data-delete-rule="<?php echo esc_attr($rule_row->getId()); ?>"
330
+ data-awdr_nonce="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_delete_rule' . $rule_row->getId())); ?>">
331
  <?php _e('Delete', 'woo-discount-rules'); ?></a>
332
  </td>
333
  </tr>
339
  <tr class="no-items">
340
  <td></td>
341
  <td></td>
342
+ <td class="colspanchange" colspan="2"><?php _e('No rules found.', 'woo-discount-rules'); ?></td>
343
  </tr>
344
  <?php } ?>
345
  </tbody>
394
  </div>
395
  <div class="alignleft actions">
396
  </div>
397
+ <div class="tablenav-pages one-page"><span class="displaying-num"><?php echo esc_html($rules_count) . ' ';
398
  ($rules_count == 0 || $rules_count == 1) ? _e('item', 'woo-discount-rules') : _e('items', 'woo-discount-rules'); ?></span></span>
399
  </div>
400
  <br class="clear">
401
  </div>
402
+ <input type="hidden" name="awdr_rule_list_nonce" value="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('awdr_rule_list')); ?>">
403
  <input type="hidden" name="action" value="wdr_ajax">
404
  <input type="hidden" name="method" value="bulk_action">
405
+ <input type="hidden" name="adminUrl" value="<?php echo esc_url(admin_url('admin.php?page=woo_discount_rules')); ?>">
406
  </form>
407
  <br class="clear">
408
  </div>
409
  <?php
410
+ if (!$is_pro) { ?>
411
  <div class="col-md-6 col-lg-6 text-right" style="width: 27%; float: right;">
412
  <div class="col-md-12">
413
+ <a href="https://docs.flycart.org/en/articles/3806305-upgrade-from-free-to-pro?utm_source=wpwoodiscountrules&utm_medium=plugin&utm_campaign=inline&utm_content=upgrade"
414
+ target="_blank"
415
+ class="btn btn-success"><?php esc_html_e('Looking for more features? Upgrade to PRO', 'woo-discount-rules'); ?></a>
416
  </div>
417
  <div class="woo-side-panel">
418
  <div class="panel">
419
  <div class="panel-body">
420
+ <h3><?php esc_html_e('With PRO version, you can create:', 'woo-discount-rules') ?></h3>
421
+ <p><?php esc_html_e('- Categories based discounts', 'woo-discount-rules') ?></p>
422
+ <p><?php esc_html_e('- User roles based discounts', 'woo-discount-rules') ?></p>
423
+ <p><?php esc_html_e('- Buy One Get One Free deals', 'woo-discount-rules') ?></p>
424
+ <p><?php esc_html_e('- Buy X Get Y deals', 'woo-discount-rules') ?></p>
425
+ <p><?php esc_html_e('- Buy 2, get 1 at 50% discount', 'woo-discount-rules') ?></p>
426
+ <p><?php esc_html_e('- Buy 3 for $10 (Package / Bundle [Set] Discount)', 'woo-discount-rules') ?></p>
427
+ <p><?php esc_html_e('- Different discounts with one coupon code', 'woo-discount-rules') ?></p>
428
+ <p><?php esc_html_e('- Purchase history based discounts', 'woo-discount-rules') ?></p>
429
+ <p><?php esc_html_e('- Free product / gift', 'woo-discount-rules') ?></p>
430
+ <p><?php esc_html_e('- Discount for variants', 'woo-discount-rules') ?></p>
431
+ <p><?php esc_html_e('- Conditional discounts', 'woo-discount-rules') ?></p>
432
+ <p><?php esc_html_e('- Fixed cost discounts', 'woo-discount-rules') ?></p>
433
+ <p><?php esc_html_e('- Offer fixed price on certain conditions', 'woo-discount-rules') ?></p>
434
+ <p>
435
+ <a href="https://www.flycart.org/products/wordpress/woocommerce-discount-rules?utm_source=wpwoodiscountrules&amp;utm_medium=plugin&amp;utm_campaign=inline&amp;utm_content=woo-discount-rules"
436
+ class="btn btn-success"
437
+ target="_blank"><?php esc_html_e('Go PRO', 'woo-discount-rules'); ?></a></p>
438
  </div>
439
  </div>
440
  </div>
v2/App/Views/Admin/Tabs/ImportExport.php CHANGED
@@ -14,7 +14,7 @@ $is_pro_activated = isset($is_pro_activated) ? $is_pro_activated : false;
14
  <div>
15
  <p>
16
  <form method="post">
17
- <input type="hidden" name="security" value="<?php echo wp_create_nonce('awdr_export_rules') ?>">
18
  <button type="submit" id="wdr-export" name="wdr-export" class="button button-primary">
19
  <?php _e('Export', 'woo-discount-rules'); ?>
20
  </button>
@@ -141,7 +141,7 @@ $is_pro_activated = isset($is_pro_activated) ? $is_pro_activated : false;
141
  }
142
  } ?>
143
  <form method="post" name="awdr-import-csv" id="awdr-import-csv" enctype="multipart/form-data">
144
- <input type="hidden" name="security" value="<?php echo wp_create_nonce('awdr_import_rules_csv') ?>">
145
  <input type="file" name="awdr_import_rule" id="awdr-file-uploader" accept=".csv"><br>
146
  <span id="awdr-upload-response"><?php echo $message; ?></span></br>
147
  <button type="submit" id="wdr-import" name="wdr-import" class="button button-primary">
14
  <div>
15
  <p>
16
  <form method="post">
17
+ <input type="hidden" name="security" value="<?php echo esc_attr(wp_create_nonce('awdr_export_rules')) ?>">
18
  <button type="submit" id="wdr-export" name="wdr-export" class="button button-primary">
19
  <?php _e('Export', 'woo-discount-rules'); ?>
20
  </button>
141
  }
142
  } ?>
143
  <form method="post" name="awdr-import-csv" id="awdr-import-csv" enctype="multipart/form-data">
144
+ <input type="hidden" name="security" value="<?php echo esc_attr(wp_create_nonce('awdr_import_rules_csv')) ?>">
145
  <input type="file" name="awdr_import_rule" id="awdr-file-uploader" accept=".csv"><br>
146
  <span id="awdr-upload-response"><?php echo $message; ?></span></br>
147
  <button type="submit" id="wdr-import" name="wdr-import" class="button button-primary">
v2/App/Views/Admin/Tabs/RecipeTypes/BogoDiscountRecipe.php CHANGED
@@ -6,13 +6,13 @@ if (!defined('ABSPATH')) {
6
  <div class="awdr_bogo_adjustment_card_group" style="display: none;">
7
  <div class="awdr_simple_discount awdr_common_border_class">
8
  <b><?php _e('Buy X get X - Buy 1 get 1 free - sample', 'woo-discount-rules');?></b>
9
- <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo $recipe_nonce;?>" data-select-recipe="buyx_gety_recipe_1"><?php _e('Create', 'woo-discount-rules');?></button>
10
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
11
 
12
  </div>
13
  <div class="awdr_simple_discount awdr_common_border_class">
14
  <b><?php _e('Buy X get Y - Buy 2 get 1 free - sample', 'woo-discount-rules');?></b>
15
- <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo $recipe_nonce;?>" data-select-recipe="buyx_gety_recipe_2"><?php _e('Create', 'woo-discount-rules');?></button>
16
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
17
  </div>
18
  </div>
6
  <div class="awdr_bogo_adjustment_card_group" style="display: none;">
7
  <div class="awdr_simple_discount awdr_common_border_class">
8
  <b><?php _e('Buy X get X - Buy 1 get 1 free - sample', 'woo-discount-rules');?></b>
9
+ <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo esc_attr($recipe_nonce); ?>" data-select-recipe="buyx_gety_recipe_1"><?php _e('Create', 'woo-discount-rules');?></button>
10
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
11
 
12
  </div>
13
  <div class="awdr_simple_discount awdr_common_border_class">
14
  <b><?php _e('Buy X get Y - Buy 2 get 1 free - sample', 'woo-discount-rules');?></b>
15
+ <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo esc_attr($recipe_nonce); ?>" data-select-recipe="buyx_gety_recipe_2"><?php _e('Create', 'woo-discount-rules');?></button>
16
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
17
  </div>
18
  </div>
v2/App/Views/Admin/Tabs/RecipeTypes/BundleDiscountRecipe.php CHANGED
@@ -6,7 +6,7 @@ if (!defined('ABSPATH')) {
6
  <div class="awdr_set_adjustment_card_group" style="display: none;">
7
  <div class="awdr_simple_discount awdr_common_border_class">
8
  <b><?php _e('Set Discount - sample', 'woo-discount-rules');?></b>
9
- <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo $recipe_nonce;?>" data-select-recipe="bundle_recipe_1"><?php _e('Create', 'woo-discount-rules');?></button>
10
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
11
 
12
  </div>
6
  <div class="awdr_set_adjustment_card_group" style="display: none;">
7
  <div class="awdr_simple_discount awdr_common_border_class">
8
  <b><?php _e('Set Discount - sample', 'woo-discount-rules');?></b>
9
+ <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo esc_attr($recipe_nonce); ?>" data-select-recipe="bundle_recipe_1"><?php _e('Create', 'woo-discount-rules');?></button>
10
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
11
 
12
  </div>
v2/App/Views/Admin/Tabs/RecipeTypes/SimpleDiscountRecipe.php CHANGED
@@ -7,15 +7,15 @@ if (!defined('ABSPATH')) {
7
  <div class="awdr_product_adjustment_card_group">
8
  <div class="awdr_simple_discount awdr_common_border_class">
9
  <b><?php _e('Coupon based user role discount - sample', 'woo-discount-rules');?></b>
10
- <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo $recipe_nonce;?>" data-select-recipe="simple_recipe_1"><?php _e('Create', 'woo-discount-rules');?></button>
11
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
12
 
13
  </div>
14
  <div class="awdr_simple_discount awdr_common_border_class">
15
  <b><?php _e('Subtotal tiered discount - sample', 'woo-discount-rules');?></b>
16
- <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo $recipe_nonce;?>" data-select-recipe="simple_recipe_2"><?php _e('Create', 'woo-discount-rules');?></button>
17
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
18
  </div>
19
  </div>
20
-
21
 
7
  <div class="awdr_product_adjustment_card_group">
8
  <div class="awdr_simple_discount awdr_common_border_class">
9
  <b><?php _e('Coupon based user role discount - sample', 'woo-discount-rules');?></b>
10
+ <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo esc_attr($recipe_nonce); ?>" data-select-recipe="simple_recipe_1"><?php _e('Create', 'woo-discount-rules');?></button>
11
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
12
 
13
  </div>
14
  <div class="awdr_simple_discount awdr_common_border_class">
15
  <b><?php _e('Subtotal tiered discount - sample', 'woo-discount-rules');?></b>
16
+ <button class="button awdr_recipe_content" type="button" data-recipe-nonce="<?php echo esc_attr($recipe_nonce); ?>" data-select-recipe="simple_recipe_2"><?php _e('Create', 'woo-discount-rules');?></button>
17
  <a style="display: none;" class="button awdr_recipe_rule_edit" href="" target="_blank" ><?php _e('View & edit Rule', 'woo-discount-rules');?></a>
18
  </div>
19
  </div>
20
+
21
 
v2/App/Views/Admin/Tabs/Statistics.php CHANGED
@@ -47,10 +47,10 @@ if (!defined('ABSPATH')) {
47
  <input type="text"
48
  name="from"
49
  class="wdr-condition-date wdr-title chart-period-start" data-class="start_dateonly"
50
- placeholder="<?php _e('From: yyyy/mm/dd', 'woo-discount-rules'); ?>" data-field="date"
51
  autocomplete="off"
52
  id="rule_datetime_from" value="<?php if (isset($date[0]) && !empty($date[0])) {
53
- echo $date[0];
54
  } ?>" style="height: 34px;">
55
  <!--<span class="wdr_desc_text"><?php /*_e('From', 'woo-discount-rules'); */?></span>-->
56
  </div>
@@ -61,16 +61,16 @@ if (!defined('ABSPATH')) {
61
  placeholder="<?php _e('To: yyyy/mm/dd', 'woo-discount-rules'); ?>"
62
  data-field="date" autocomplete="off"
63
  id="rule_datetime_to" value="<?php if (isset($date[1]) && !empty($date[1])) {
64
- echo $date[1];
65
  } ?>" style="height: 34px;">
66
  <!--<span class="wdr_desc_text"><?php /*_e('To', 'woo-discount-rules'); */?></span>-->
67
  </div>
68
  <div class="awdr-report-type" >
69
  <select name="type" class="chart-type awdr-show-report-limit" style="height: 33px">
70
  <?php foreach ( $charts as $group => $charts_by_group ): ?>
71
- <optgroup label="<?php echo $group ?>">
72
  <?php foreach ( $charts_by_group as $key => $name ): ?>
73
- <option value="<?php echo $key ?>"><?php echo $name ?></option>
74
  <?php endforeach; ?>
75
  </optgroup>
76
  <?php endforeach; ?>
@@ -88,7 +88,7 @@ if (!defined('ABSPATH')) {
88
  <span class="wdr_desc_text"><?php /*_e('Report Limit (Eg: Top 5)', 'woo-discount-rules'); */?></span>
89
  </div>-->
90
  <div> <!--class="awdr-toggle-report-update"--> <!--style="display: none;>"-->
91
- <input type="hidden" name="awdr_nonce" value="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_report'); ?>">
92
  <button type="submit" class="update-chart btn btn-success"><?php _e('Update Chart', 'woo-discount-rules'); ?></button>
93
  </div>
94
  </div>
47
  <input type="text"
48
  name="from"
49
  class="wdr-condition-date wdr-title chart-period-start" data-class="start_dateonly"
50
+ placeholder="<?php esc_attr_e('From: yyyy/mm/dd', 'woo-discount-rules'); ?>" data-field="date"
51
  autocomplete="off"
52
  id="rule_datetime_from" value="<?php if (isset($date[0]) && !empty($date[0])) {
53
+ echo esc_attr($date[0]);
54
  } ?>" style="height: 34px;">
55
  <!--<span class="wdr_desc_text"><?php /*_e('From', 'woo-discount-rules'); */?></span>-->
56
  </div>
61
  placeholder="<?php _e('To: yyyy/mm/dd', 'woo-discount-rules'); ?>"
62
  data-field="date" autocomplete="off"
63
  id="rule_datetime_to" value="<?php if (isset($date[1]) && !empty($date[1])) {
64
+ echo esc_attr($date[1]);
65
  } ?>" style="height: 34px;">
66
  <!--<span class="wdr_desc_text"><?php /*_e('To', 'woo-discount-rules'); */?></span>-->
67
  </div>
68
  <div class="awdr-report-type" >
69
  <select name="type" class="chart-type awdr-show-report-limit" style="height: 33px">
70
  <?php foreach ( $charts as $group => $charts_by_group ): ?>
71
+ <optgroup label="<?php echo esc_attr($group); ?>">
72
  <?php foreach ( $charts_by_group as $key => $name ): ?>
73
+ <option value="<?php echo esc_attr($key) ?>"><?php echo esc_html($name) ?></option>
74
  <?php endforeach; ?>
75
  </optgroup>
76
  <?php endforeach; ?>
88
  <span class="wdr_desc_text"><?php /*_e('Report Limit (Eg: Top 5)', 'woo-discount-rules'); */?></span>
89
  </div>-->
90
  <div> <!--class="awdr-toggle-report-update"--> <!--style="display: none;>"-->
91
+ <input type="hidden" name="awdr_nonce" value="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_report')); ?>">
92
  <button type="submit" class="update-chart btn btn-success"><?php _e('Update Chart', 'woo-discount-rules'); ?></button>
93
  </div>
94
  </div>
v2/App/Views/Admin/Tabs/settings.php CHANGED
@@ -347,7 +347,7 @@
347
  </td>
348
  <td>
349
  <input type="text" name="discount_label_for_combined_discounts"
350
- value="<?php echo $configuration->getConfig('discount_label_for_combined_discounts', 'Cart discount'); ?>">
351
  </td>
352
  </tr>
353
  <?php
@@ -510,13 +510,13 @@
510
  foreach ($rules as $rule){
511
  if($rule->rule->enabled == 1){
512
  ?>
513
- <option value="<?php echo $rule->rule->id; ?>"
514
  <?php if(!empty($awdr_rebuild_on_sale_rules) && is_array($awdr_rebuild_on_sale_rules)){
515
  if(in_array($rule->rule->id, $awdr_rebuild_on_sale_rules)){
516
  echo ' selected ';
517
  }
518
  } ?>
519
- ><?php echo $rule->rule->title; ?></option>
520
  <?php
521
  }
522
  }
@@ -527,13 +527,30 @@
527
  <div class="awdr_rebuild_on_sale_list_notice">
528
  </div>
529
  </div>
530
- <button type="button" class="btn btn-warning" id="awdr_rebuild_on_sale_list" data-awdr_nonce="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_rule_build_index'); ?>"><?php _e('Save and Build Index', 'woo-discount-rules' ); ?></button>
531
  <?php } else {
532
  _e("Unlock this feature by <a href='https://www.flycart.org/products/wordpress/woocommerce-discount-rules?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=unlock_pro' target='_blank'>Upgrading to Pro</a>", 'woo-discount-rules');
533
  }?>
534
  </td>
535
  </tr>
536
  <?php if($is_pro){ ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
537
  <tr>
538
  <td scope="row" colspan="2">
539
  <?php
@@ -651,7 +668,7 @@
651
  <input type="checkbox" name="table_title_column" value="1" class="bulk_table_customizer_show_hide_column"
652
  data-colname="popup_table_title_column"
653
  <?php echo($configuration->getConfig('table_title_column', 1) ? 'checked' : '') ?>>
654
- <input type="text" style="width: 90% !important;" class="awdr_popup_col_name_text_box awdr_popup_col_title_keyup" data-keyup="title_on_keyup" name="table_title_column_name" value="<?php echo $configuration->getConfig('table_title_column_name', 'Title');?>">
655
  </td>
656
  </tr>
657
  <tr class="">
@@ -663,7 +680,7 @@
663
  <input type="checkbox" name="table_discount_column" value="1" class="bulk_table_customizer_show_hide_column"
664
  data-colname="popup_table_discount_column"
665
  <?php echo($configuration->getConfig('table_discount_column', 1) ? 'checked' : '') ?>>
666
- <input type="text" style="width: 90% !important;" class="awdr_popup_col_name_text_box" data-keyup="discount_on_keyup" name="table_discount_column_name" value="<?php echo $configuration->getConfig('table_discount_column_name', 'Discount');?>">
667
  </td>
668
  </tr>
669
  <tr class="">
@@ -675,7 +692,7 @@
675
  <input type="checkbox" name="table_range_column" value="1" class="bulk_table_customizer_show_hide_column"
676
  data-colname="popup_table_range_column"
677
  <?php echo($configuration->getConfig('table_range_column', 1) ? 'checked' : '') ?>>
678
- <input type="text" style="width: 90% !important;" class="awdr_popup_col_name_text_box" data-keyup="range_on_keyup" name="table_range_column_name" value="<?php echo $configuration->getConfig('table_range_column_name', 'Range');?>">
679
  </td>
680
  </tr>
681
  <tr class="">
@@ -985,14 +1002,14 @@
985
 
986
  <div class="save-configuration">
987
  <input type="hidden" class="customizer_save_alert" name="customizer_save_alert" value="">
988
- <input type="hidden" name="customize_bulk_table_title" class="customize_bulk_table_title" value="<?php echo $configuration->getConfig('customize_bulk_table_title', 0); ?>">
989
- <input type="hidden" name="customize_bulk_table_discount" class="customize_bulk_table_discount" value="<?php echo $configuration->getConfig('customize_bulk_table_discount', 2); ?>">
990
- <input type="hidden" name="customize_bulk_table_range" class="customize_bulk_table_range" value="<?php echo $configuration->getConfig('customize_bulk_table_range', 1); ?>">
991
 
992
  <input type="hidden" name="method" value="save_configuration">
993
  <!-- <input type="hidden" class="customize_banner_content" name="customize_banner_content" value="">-->
994
  <input type="hidden" name="action" value="wdr_ajax">
995
- <input type="hidden" name="awdr_nonce" value="<?php echo \Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_save_configuration'); ?>">
996
  <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary save-configuration-submit"
997
  value="Save Changes"></p>
998
  </div>
347
  </td>
348
  <td>
349
  <input type="text" name="discount_label_for_combined_discounts"
350
+ value="<?php echo esc_attr($configuration->getConfig('discount_label_for_combined_discounts', 'Cart discount')); ?>">
351
  </td>
352
  </tr>
353
  <?php
510
  foreach ($rules as $rule){
511
  if($rule->rule->enabled == 1){
512
  ?>
513
+ <option value="<?php echo esc_attr($rule->rule->id); ?>"
514
  <?php if(!empty($awdr_rebuild_on_sale_rules) && is_array($awdr_rebuild_on_sale_rules)){
515
  if(in_array($rule->rule->id, $awdr_rebuild_on_sale_rules)){
516
  echo ' selected ';
517
  }
518
  } ?>
519
+ ><?php echo esc_html($rule->rule->title); ?></option>
520
  <?php
521
  }
522
  }
527
  <div class="awdr_rebuild_on_sale_list_notice">
528
  </div>
529
  </div>
530
+ <button type="button" class="btn btn-warning" id="awdr_rebuild_on_sale_list" data-awdr_nonce="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_rule_build_index')); ?>"><?php _e('Save and Build Index', 'woo-discount-rules' ); ?></button>
531
  <?php } else {
532
  _e("Unlock this feature by <a href='https://www.flycart.org/products/wordpress/woocommerce-discount-rules?utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=unlock_pro' target='_blank'>Upgrading to Pro</a>", 'woo-discount-rules');
533
  }?>
534
  </td>
535
  </tr>
536
  <?php if($is_pro){ ?>
537
+ <tr>
538
+ <td scope="row">
539
+ <label for="" class="awdr-left-align"><?php _e('Select cron to run daily', 'woo-discount-rules') ?></label>
540
+ <span class="wdr_settings_desc_text awdr-clear-both"><?php _e('This setting will be useful for validity based rules.', 'woo-discount-rules'); ?></span>
541
+ </td>
542
+ <td>
543
+ <input type="radio" name="run_rebuild_on_sale_index_cron" class="settings_option_show_hide"
544
+ id="awdr_run_rebuild_on_sale_index_cron_1"
545
+ value="1" <?php echo($configuration->getConfig('run_rebuild_on_sale_index_cron', 0) ? 'checked' : '') ?>><label
546
+ for="awdr_run_rebuild_on_sale_index_cron_1"><?php _e('Yes', 'woo-discount-rules'); ?></label>
547
+
548
+ <input type="radio" name="run_rebuild_on_sale_index_cron" class="settings_option_show_hide"
549
+ id="awdr_run_rebuild_on_sale_index_cron_0"
550
+ value="0" <?php echo(!$configuration->getConfig('run_rebuild_on_sale_index_cron', 0) ? 'checked' : '') ?>><label
551
+ for="awdr_run_rebuild_on_sale_index_cron_0"><?php _e('No', 'woo-discount-rules'); ?></label>
552
+ </td>
553
+ </tr>
554
  <tr>
555
  <td scope="row" colspan="2">
556
  <?php
668
  <input type="checkbox" name="table_title_column" value="1" class="bulk_table_customizer_show_hide_column"
669
  data-colname="popup_table_title_column"
670
  <?php echo($configuration->getConfig('table_title_column', 1) ? 'checked' : '') ?>>
671
+ <input type="text" style="width: 90% !important;" class="awdr_popup_col_name_text_box awdr_popup_col_title_keyup" data-keyup="title_on_keyup" name="table_title_column_name" value="<?php echo esc_attr($configuration->getConfig('table_title_column_name', 'Title'));?>">
672
  </td>
673
  </tr>
674
  <tr class="">
680
  <input type="checkbox" name="table_discount_column" value="1" class="bulk_table_customizer_show_hide_column"
681
  data-colname="popup_table_discount_column"
682
  <?php echo($configuration->getConfig('table_discount_column', 1) ? 'checked' : '') ?>>
683
+ <input type="text" style="width: 90% !important;" class="awdr_popup_col_name_text_box" data-keyup="discount_on_keyup" name="table_discount_column_name" value="<?php echo esc_attr($configuration->getConfig('table_discount_column_name', 'Discount'));?>">
684
  </td>
685
  </tr>
686
  <tr class="">
692
  <input type="checkbox" name="table_range_column" value="1" class="bulk_table_customizer_show_hide_column"
693
  data-colname="popup_table_range_column"
694
  <?php echo($configuration->getConfig('table_range_column', 1) ? 'checked' : '') ?>>
695
+ <input type="text" style="width: 90% !important;" class="awdr_popup_col_name_text_box" data-keyup="range_on_keyup" name="table_range_column_name" value="<?php echo esc_attr($configuration->getConfig('table_range_column_name', 'Range'));?>">
696
  </td>
697
  </tr>
698
  <tr class="">
1002
 
1003
  <div class="save-configuration">
1004
  <input type="hidden" class="customizer_save_alert" name="customizer_save_alert" value="">
1005
+ <input type="hidden" name="customize_bulk_table_title" class="customize_bulk_table_title" value="<?php echo esc_attr($configuration->getConfig('customize_bulk_table_title', 0)); ?>">
1006
+ <input type="hidden" name="customize_bulk_table_discount" class="customize_bulk_table_discount" value="<?php echo esc_attr($configuration->getConfig('customize_bulk_table_discount', 2)); ?>">
1007
+ <input type="hidden" name="customize_bulk_table_range" class="customize_bulk_table_range" value="<?php echo esc_attr($configuration->getConfig('customize_bulk_table_range', 1)); ?>">
1008
 
1009
  <input type="hidden" name="method" value="save_configuration">
1010
  <!-- <input type="hidden" class="customize_banner_content" name="customize_banner_content" value="">-->
1011
  <input type="hidden" name="action" value="wdr_ajax">
1012
+ <input type="hidden" name="awdr_nonce" value="<?php echo esc_attr(\Wdr\App\Helpers\Helper::create_nonce('wdr_ajax_save_configuration')); ?>">
1013
  <p class="submit"><input type="submit" name="submit" id="submit" class="button button-primary save-configuration-submit"
1014
  value="Save Changes"></p>
1015
  </div>
v2/App/Views/Templates/discount_table.php CHANGED
@@ -45,10 +45,11 @@ if (!empty($ranges) && !empty($woocommerce)) {
45
  }
46
  $existing_rule_id = $current_rule_id;
47
  ?>
48
- <div class="awdr_discount_bar awdr_row_<?php echo $i;?>" style="<?php if($badge_bg_color){
49
- echo "background-color:".$badge_bg_color.';';
 
50
  }if($badge_text_color) {
51
- echo "color:".$badge_text_color.';';
52
  }?>">
53
  <?php
54
  }
@@ -176,20 +177,20 @@ if (!empty($ranges) && !empty($woocommerce)) {
176
  $j=1;
177
  foreach ($table_sort_by_columns as $column => $order) {
178
  if ($column == "tbl_title") {?>
179
- <td class="wdr_bulk_table_td wdr_bulk_title col_index_<?php echo $j;?>" data-colindex="<?php echo $j;?>"
180
  style="<?php echo (!$base::$config->getConfig('table_title_column', 0)) ? 'display:none' : '';?>">
181
- <?php echo isset($range['rule_title']) ? $range['rule_title'] : '-' ?>
182
  </td><?php
183
 
184
  } elseif ($column == "tbl_discount") {?>
185
- <td class="wdr_bulk_table_td wdr_bulk_table_discount col_index_<?php echo $j;?>" data-colindex="<?php echo $j;?>"
186
  style="<?php echo (!$base::$config->getConfig('table_discount_column', 0)) ? 'display:none' : '';?>">
187
  <span class="wdr_table_discounted_value" style="<?php echo ( !$base::$config->getConfig('table_discount_column_value', 0)) ? 'display: none' : '';?>"><?php echo $discount_value; ?></span>
188
  <span class="wdr_table_discounted_price" style="<?php echo ( $base::$config->getConfig('table_discount_column_value', 0)) ? 'display: none' : '';?>"><?php echo $discounted_price_for_customizer; ?></span>
189
  </td><?php
190
  } else {?>
191
  <td class="wdr_bulk_table_td wdr_bulk_range col_index_<?php echo $j;?>" data-colindex="<?php echo $j;?>"
192
- style="<?php echo (!$base::$config->getConfig('table_range_column', 0) || isset($range['discount_method']) && in_array($range['discount_method'], array('product', 'cart'))) ? 'display:none':'';?>"><?php echo $discount_range ?></td><?php
193
  }
194
  $j++;
195
  }?>
45
  }
46
  $existing_rule_id = $current_rule_id;
47
  ?>
48
+
49
+ <div class="awdr_discount_bar awdr_row_<?php echo esc_attr($i); ?>" style="<?php if($badge_bg_color){
50
+ echo "background-color:". esc_attr($badge_bg_color) . ';';
51
  }if($badge_text_color) {
52
+ echo "color:". esc_attr($badge_text_color) . ';';
53
  }?>">
54
  <?php
55
  }
177
  $j=1;
178
  foreach ($table_sort_by_columns as $column => $order) {
179
  if ($column == "tbl_title") {?>
180
+ <td class="wdr_bulk_table_td wdr_bulk_title col_index_<?php echo esc_attr($j);?>" data-colindex="<?php echo esc_attr($j);?>"
181
  style="<?php echo (!$base::$config->getConfig('table_title_column', 0)) ? 'display:none' : '';?>">
182
+ <?php echo isset($range['rule_title']) ? esc_html($range['rule_title']) : '-' ?>
183
  </td><?php
184
 
185
  } elseif ($column == "tbl_discount") {?>
186
+ <td class="wdr_bulk_table_td wdr_bulk_table_discount col_index_<?php echo esc_attr($j);?>" data-colindex="<?php echo esc_attr($j);?>"
187
  style="<?php echo (!$base::$config->getConfig('table_discount_column', 0)) ? 'display:none' : '';?>">
188
  <span class="wdr_table_discounted_value" style="<?php echo ( !$base::$config->getConfig('table_discount_column_value', 0)) ? 'display: none' : '';?>"><?php echo $discount_value; ?></span>
189
  <span class="wdr_table_discounted_price" style="<?php echo ( $base::$config->getConfig('table_discount_column_value', 0)) ? 'display: none' : '';?>"><?php echo $discounted_price_for_customizer; ?></span>
190
  </td><?php
191
  } else {?>
192
  <td class="wdr_bulk_table_td wdr_bulk_range col_index_<?php echo $j;?>" data-colindex="<?php echo $j;?>"
193
+ style="<?php echo (!$base::$config->getConfig('table_range_column', 0) || isset($range['discount_method']) && in_array($range['discount_method'], array('product', 'cart'))) ? 'display:none':'';?>"><?php echo esc_html($discount_range); ?></td><?php
194
  }
195
  $j++;
196
  }?>
v2/Assets/Js/admin-statistics.min.js CHANGED
@@ -1 +1 @@
1
- var response_content,isjQueryReady=!1,isGoogleChartsReady=!1,isInitialized=!1;function googleChartsLoadCallback(){isGoogleChartsReady=!0,init()}function init(){isjQueryReady&&isGoogleChartsReady&&!isInitialized&&(isInitialized=!0,jQuery(".chart-period").change(function(){var t=jQuery(".chart-period").val(),e=new Date;if("this_week"===t)e.setDate(e.getDate()-e.getDay()+1),jQuery(".chart-period-start").val(format_date(e)),e.setDate(e.getDate()+6),jQuery(".chart-period-end").val(format_date(e));else if("this_month"===t){var a=new Date(e.getFullYear(),e.getMonth(),1);jQuery(".chart-period-start").val(format_date(a));var r=new Date(e.getFullYear(),e.getMonth()+1,-1);jQuery(".chart-period-end").val(format_date(r))}}),jQuery(".chart-period-start, .chart-period-end").change(function(){jQuery(".chart-period").val("custom")}),jQuery(".chart-options").submit(function(t){return t.preventDefault(),showChart(jQuery(this).serialize()),!1}),jQuery(window).resize(function(){response_content.data.columns.length>1&&renderChart(response_content.data)}),jQuery(".chart-period").change(),jQuery(".chart-options").submit())}function renderChart(t){var e=new google.visualization.DataTable;(t.columns&&t.columns.forEach(function(t,a){e.addColumn(0===a?"string":"number",t)}),t.rows)&&(e.addRows(Object.values(t.rows)),new google.visualization.NumberFormat({fractionDigits:2}).format(e,1));var a=jQuery("#chart-container").width(),r=jQuery(window).height()-jQuery("#chart-container").offset().top;200>r&&(r=200);var o={chart:{title:t.title?t.title:"",subtitle:t.subtitle?t.subtitle:""},width:a,height:r};new google.charts.Line(document.getElementById("chart-container")).draw(e,o)}function showChart(t){let e=jQuery(".woo_discount_loader");e.show(),jQuery.post(ajaxurl,{action:"wdr_admin_statistics",method:"get_chart_data",params:t},function(t){e.hide(),t.success&&t.data.columns.length>1?(response_content=t,renderChart(t.data)):jQuery("#chart-container").html(wdr_data.localization_data.chart_data)},"json")}function to2Digits(t){return t<10?"0"+t:t}function format_date(t){return[to2Digits(t.getFullYear()),to2Digits(t.getMonth()+1),to2Digits(t.getDate())].join("-")}google.charts.load("current",{packages:["line"]}),google.charts.setOnLoadCallback(googleChartsLoadCallback),jQuery(document).ready(function(){isjQueryReady=!0,jQuery(".chart-type").select2(),init()});
1
+ var response_content,isjQueryReady=!1,isGoogleChartsReady=!1,isInitialized=!1;function googleChartsLoadCallback(){isGoogleChartsReady=!0,init()}function init(){isjQueryReady&&isGoogleChartsReady&&!isInitialized&&(isInitialized=!0,jQuery(".chart-period").change(function(){var b=jQuery(".chart-period").val(),a=new Date;if("this_week"===b)a.setDate(a.getDate()-a.getDay()+1),jQuery(".chart-period-start").val(format_date(a)),a.setDate(a.getDate()+6),jQuery(".chart-period-end").val(format_date(a));else if("this_month"===b){var c=new Date(a.getFullYear(),a.getMonth(),1);jQuery(".chart-period-start").val(format_date(c));var d=new Date(a.getFullYear(),a.getMonth()+1,-1);jQuery(".chart-period-end").val(format_date(d))}}),jQuery(".chart-period-start, .chart-period-end").change(function(){jQuery(".chart-period").val("custom")}),jQuery(".chart-options").submit(function(a){return a.preventDefault(),showChart(jQuery(this).serialize()),!1}),jQuery(window).resize(function(){response_content.data.columns.length>1&&renderChart(response_content.data)}),jQuery(".chart-period").change(),jQuery(".chart-options").submit())}function renderChart(a){var b=new google.visualization.DataTable;a.columns&&a.columns.forEach(function(a,c){b.addColumn(0===c?"string":"number",a)}),a.rows&&(b.addRows(Object.values(a.rows)),new google.visualization.NumberFormat({fractionDigits:2}).format(b,1));var d=jQuery("#chart-container").width(),c=jQuery(window).height()-jQuery("#chart-container").offset().top;200>c&&(c=200);var e={chart:{title:a.title?a.title:"",subtitle:a.subtitle?a.subtitle:""},width:d,height:c},f=new google.charts.Line(document.getElementById("chart-container"));f.draw(b,e)}function showChart(a){let b=jQuery(".woo_discount_loader");b.show(),jQuery.post(ajaxurl,{action:"wdr_admin_statistics",method:"get_chart_data",params:a},function(a){b.hide(),a.success&&a.data.columns.length>1?(response_content=a,renderChart(a.data)):jQuery("#chart-container").html(wdr_data.localization_data.chart_data)},"json")}function to2Digits(a){return a<10?"0"+a:a}function format_date(a){return[to2Digits(a.getFullYear()),to2Digits(a.getMonth()+1),to2Digits(a.getDate())].join("-")}google.charts.load("current",{packages:["line"]}),google.charts.setOnLoadCallback(googleChartsLoadCallback),jQuery(document).ready(function(){isjQueryReady=!0,jQuery(".chart-type").select2(),init()})
v2/Assets/Js/admin_script.js CHANGED
@@ -338,7 +338,7 @@ jQuery(document).ready(function ($) {
338
  if (rules != null) {
339
  $("#awdr_rebuild_on_sale_list").attr('disabled', "disabled");
340
  $("#awdr_rebuild_on_sale_list").html(wdr_data.localization_data.rebuild_on_sale_list_processing_text);
341
- awdr_process_on_sale_list(rules, $(this));
342
  } else {
343
  $(".awdr_rebuild_on_sale_list_notice").html(wdr_data.localization_data.rebuild_on_sale_list_error_please_select_rule);
344
  }
@@ -350,16 +350,17 @@ jQuery(document).ready(function ($) {
350
  $(document).on('click', '#awdr_rebuild_on_sale_list_on_rule_page', function () {
351
  $(this).attr('disabled', "disabled");
352
  $(this).html(wdr_data.localization_data.rebuild_on_sale_list_processing_text);
353
- awdr_process_on_sale_list(null, $(this));
354
  //$(".awdr_rebuild_on_sale_rule_page_con").removeClass("need_attention");
355
  });
356
 
357
- function awdr_process_on_sale_list(rules, current_obj) {
358
  $.ajax({
359
  data: {
360
  method: 'rebuild_onsale_list',
361
  action: 'wdr_ajax',
362
  rules: rules,
 
363
  awdr_nonce: current_obj.attr('data-awdr_nonce')
364
  },
365
  type: 'post',
@@ -485,13 +486,20 @@ jQuery(document).ready(function ($) {
485
  notify(wdr_data.localization_data.error, 'error', alert_counter);
486
  },
487
  success: function (data) {
488
- if (data === 'failed') {
489
- notify(wdr_data.localization_data.error, 'error', alert_counter);
 
 
 
 
 
 
 
 
 
 
490
  } else {
491
- notify(wdr_data.localization_data.deleted_rule, 'success', alert_counter);
492
- wdr_delete_rule_row.hide(500, function () {
493
- wdr_delete_rule_row.remove();
494
- });
495
  }
496
  }
497
  });
@@ -530,21 +538,41 @@ jQuery(document).ready(function ($) {
530
  notify(wdr_data.localization_data.error, 'error', alert_counter);
531
  },
532
  success: function (data) {
533
- if (data === 'failed') {
534
- notify(wdr_data.localization_data.error, 'error', alert_counter);
535
- } else {
536
- if (change_status == 1) {
537
- $(parent_tr).find('.awdr-enabled-status').show();
538
- notify(wdr_data.localization_data.enabled_rule, 'success', alert_counter);
539
  } else {
540
- $(parent_tr).find('.awdr-enabled-status').hide();
541
- notify(wdr_data.localization_data.disabled_rule, 'success', alert_counter);
 
 
 
 
 
 
 
 
542
  }
 
 
543
  }
544
  }
545
  });
546
  });
547
 
 
 
 
 
 
 
 
 
 
 
 
 
 
548
  /**
549
  * ajax search function
550
  * @param $el
@@ -827,11 +855,7 @@ jQuery(document).ready(function ($) {
827
  var data = response.data;
828
  if (response.success) {
829
  if (data.build_index != undefined) {
830
- if (data.build_index.required_rebuild != undefined) {
831
- if (data.build_index.required_rebuild == true) {
832
- $(".awdr_rebuild_on_sale_rule_page_con").addClass("need_attention");
833
- }
834
- }
835
  }
836
  if (data.redirect) {
837
  window.location.href = data.redirect;
@@ -1460,7 +1484,7 @@ jQuery(document).ready(function ($) {
1460
  }
1461
  break;
1462
  case 'order_days':
1463
- let order_days = $(element).find('.order_days').val();
1464
  if (order_days.length == 0) {
1465
  condition_array.push("fails");
1466
  $(element).find('.select2-selection').css("border", "1px solid red");
338
  if (rules != null) {
339
  $("#awdr_rebuild_on_sale_list").attr('disabled', "disabled");
340
  $("#awdr_rebuild_on_sale_list").html(wdr_data.localization_data.rebuild_on_sale_list_processing_text);
341
+ awdr_process_on_sale_list(rules, $(this), true);
342
  } else {
343
  $(".awdr_rebuild_on_sale_list_notice").html(wdr_data.localization_data.rebuild_on_sale_list_error_please_select_rule);
344
  }
350
  $(document).on('click', '#awdr_rebuild_on_sale_list_on_rule_page', function () {
351
  $(this).attr('disabled', "disabled");
352
  $(this).html(wdr_data.localization_data.rebuild_on_sale_list_processing_text);
353
+ awdr_process_on_sale_list(null, $(this), false);
354
  //$(".awdr_rebuild_on_sale_rule_page_con").removeClass("need_attention");
355
  });
356
 
357
+ function awdr_process_on_sale_list(rules, current_obj, update=false) {
358
  $.ajax({
359
  data: {
360
  method: 'rebuild_onsale_list',
361
  action: 'wdr_ajax',
362
  rules: rules,
363
+ update: update ? 1 : 0,
364
  awdr_nonce: current_obj.attr('data-awdr_nonce')
365
  },
366
  type: 'post',
486
  notify(wdr_data.localization_data.error, 'error', alert_counter);
487
  },
488
  success: function (data) {
489
+ if (data) {
490
+ if (data.status === 'failed') {
491
+ notify(wdr_data.localization_data.error, 'error', alert_counter);
492
+ } else {
493
+ notify(wdr_data.localization_data.deleted_rule, 'success', alert_counter);
494
+ wdr_delete_rule_row.hide(500, function () {
495
+ wdr_delete_rule_row.remove();
496
+ });
497
+ }
498
+ if (data.build_index !== undefined) {
499
+ awdr_may_display_rebuild_index_button(data.build_index);
500
+ }
501
  } else {
502
+ notify(wdr_data.localization_data.error, 'error', alert_counter);
 
 
 
503
  }
504
  }
505
  });
538
  notify(wdr_data.localization_data.error, 'error', alert_counter);
539
  },
540
  success: function (data) {
541
+ if (data) {
542
+ if (data.status === 'failed') {
543
+ notify(wdr_data.localization_data.error, 'error', alert_counter);
 
 
 
544
  } else {
545
+ if (change_status == 1) {
546
+ $(parent_tr).find('.awdr-enabled-status').show();
547
+ notify(wdr_data.localization_data.enabled_rule, 'success', alert_counter);
548
+ } else {
549
+ $(parent_tr).find('.awdr-enabled-status').hide();
550
+ notify(wdr_data.localization_data.disabled_rule, 'success', alert_counter);
551
+ }
552
+ if (data.build_index !== undefined) {
553
+ awdr_may_display_rebuild_index_button(data.build_index);
554
+ }
555
  }
556
+ } else {
557
+ notify(wdr_data.localization_data.error, 'error', alert_counter);
558
  }
559
  }
560
  });
561
  });
562
 
563
+ /**
564
+ * Display rebuild index button on rule page
565
+ * @param build_index
566
+ */
567
+ function awdr_may_display_rebuild_index_button(build_index) {
568
+ if (build_index.required_rebuild !== undefined) {
569
+ if (build_index.required_rebuild == true) {
570
+ $("#awdr_rebuild_on_sale_list_on_rule_page").html(wdr_data.localization_data.rebuild_on_sale_list_build_text);
571
+ $(".awdr_rebuild_on_sale_rule_page_con").addClass("need_attention");
572
+ }
573
+ }
574
+ }
575
+
576
  /**
577
  * ajax search function
578
  * @param $el
855
  var data = response.data;
856
  if (response.success) {
857
  if (data.build_index != undefined) {
858
+ awdr_may_display_rebuild_index_button(data.build_index);
 
 
 
 
859
  }
860
  if (data.redirect) {
861
  window.location.href = data.redirect;
1484
  }
1485
  break;
1486
  case 'order_days':
1487
+ let order_days = $(element).find('.wdr_order_days').val();
1488
  if (order_days.length == 0) {
1489
  condition_array.push("fails");
1490
  $(element).find('.select2-selection').css("border", "1px solid red");
v2/Assets/Js/admin_script.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(e){const t={counts:1};function d(t){let d=t.val(),a=t.parents(".wdr-conditions-container").attr("data-index");"greater_than_or_equal"==d||"greater_than"==d?e(".promo_show_hide_"+a).show():e(".promo_show_hide_"+a).hide()}function a(d,a){e.ajax({data:{method:"rebuild_onsale_list",action:"wdr_ajax",rules:d,awdr_nonce:a.attr("data-awdr_nonce")},type:"post",url:ajaxurl,error:function(e,d){l(wdr_data.localization_data.error,"error",t),a.removeAttr("disabled")},success:function(e){a.html(wdr_data.localization_data.rebuild_on_sale_list_processed_text),a.removeAttr("disabled")}})}function o(t){t.selectWoo({width:"100%",minimumInputLength:1,placeholder:t.data("placeholder"),escapeMarkup:function(e){return e},language:{noResults:function(){return wdr_data.labels.select2_no_results},errorLoading:function(){return wdr_data.labels.searching_text}},ajax:{url:ajaxurl,type:"POST",dataType:"json",delay:250,data:function(d){return{query:d.term,action:"wdr_ajax",method:t.data("list")||"products",awdr_nonce:e("input[name=wdr_ajax_select2]").val()||"",taxonomy:t.data("taxonomy")||"",selected:t.val()}},processResults:function(e){return{results:e.data||[]}}}}),t.parent().find(".select2-search__field").css("width","100%")}function i(e){return 0===e?0:parseInt(e)+1}function r(){let t=[];return e(".wdr-filter-group").each(function(d,a){let o=e(a).find(".wdr-product-filter-type").val(),i=e(a).find(".awdr_validation").val();switch(o){case"all_products":break;case"products":case"product_category":case"product_attributes":case"product_tags":case"product_sku":0==i.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993");break;case"product_on_sale":break;default:0==i.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993")}}),t}function s(t){let d=[];switch(t){case"wdr_simple_discount":let a=e(".product_discount_value").val();""!=a&&a?e(".product_discount_value").css("border","1px solid #7e8993"):(d.push("fails"),e(".product_discount_value").css("border","1px solid red"),e(".product_discount_value").focus());break;case"wdr_cart_discount":let o=e(".awdr_cart_discount_value").val();""!=o&&o?e(".awdr_cart_discount_value").css("border","1px solid #7e8993"):(d.push("fails"),e(".awdr_cart_discount_value").css("border","1px solid red"),e(".awdr_cart_discount_value").focus());break;case"wdr_free_shipping":break;case"wdr_bulk_discount":e(".bulk_range_setter").find(".awdr-bulk-group").each(function(t,a){let o=e(a).find(".bulk_discount_min").val(),i=e(a).find(".bulk_discount_max").val(),r=e(a).find(".bulk_discount_value").val();""==o&&""==i?(d.push("fails"),e(a).find(".bulk_discount_min").css("border","1px solid red"),e(a).find(".bulk_discount_min").focus(),e(a).find(".bulk_discount_max").css("border","1px solid red"),e(a).find(".bulk_discount_max").focus()):(e(a).find(".bulk_discount_min").css("border","1px solid #7e8993"),e(a).find(".bulk_discount_max").css("border","1px solid #7e8993"));let s=parseInt(r);""==r||s<0?(d.push("fails"),e(a).find(".bulk_discount_value").css("border","1px solid red"),e(a).find(".bulk_discount_value").focus()):e(a).find(".bulk_discount_value").css("border","1px solid #7e8993")});break;case"wdr_set_discount":e(".set_range_setter").find(".bundle-set-range-main").each(function(t,a){let o=e(a).find(".set_discount_min").val(),i=e(a).find(".set_discount_value").val();""==o?(d.push("fails"),e(a).find(".set_discount_min").css("border","1px solid red"),e(a).find(".set_discount_min").focus()):e(a).find(".set_discount_min").css("border","1px solid #7e8993"),""==i?(d.push("fails"),e(a).find(".set_discount_value").css("border","1px solid red"),e(a).find(".set_discount_value").focus()):e(a).find(".set_discount_value").css("border","1px solid #7e8993")});break;case"wdr_buy_x_get_x_discount":e(".buyx_getx_range_setter").find(".buyx_getx_individual_range").each(function(t,a){let o=e(a).find(".bxgx-min").val(),i=e(a).find(".bxgx-max").val(),r=e(a).find(".bxgx-qty").val(),s=e(a).find(".buyx_getx_discount_select").val(),n=e(a).find(".bxgx-value").val();1==e(a).find(".awdr-bogo-recurcive").prop("checked")&&(""==o?(d.push("fails"),e(a).find(".bxgx-min").css("border","1px solid red"),e(a).find(".bxgx-min").focus()):e(a).find(".bxgx-min").css("border","1px solid #7e8993")),""==o&&""==i?(d.push("fails"),e(a).find(".bxgx-min").css("border","1px solid red"),e(a).find(".bxgx-min").focus(),e(a).find(".bxgx-max").css("border","1px solid red"),e(a).find(".bxgx-max").focus()):(e(a).find(".bxgx-min").css("border","1px solid #7e8993"),e(a).find(".bxgx-max").css("border","1px solid #7e8993")),""==r?(d.push("fails"),e(a).find(".bxgx-qty").css("border","1px solid red"),e(a).find(".bxgx-qty").focus()):e(a).find(".bxgx-qty").css("border","1px solid #7e8993"),"free_product"!=s&&""==n?(d.push("fails"),e(a).find(".bxgx-value").css("border","1px solid red"),e(a).find(".bxgx-value").focus()):e(a).find(".bxgx-value").css("border","1px solid #7e8993")});break;case"wdr_buy_x_get_y_discount":let i=e(".select_bxgy_type").val();e(".awdr_buyx_gety_range_setter").find(".buyx_gety_individual_range").each(function(t,a){let o=e(a).find(".bxgy-min").val(),r=e(a).find(".bxgy-max").val(),s=e(a).find(".bxgy-product-selector").val(),n=e(a).find(".bxgy-category-selector").val(),l=e(a).find(".bxgy-qty").val(),c=e(a).find(".buyx_gety_discount_select").val(),_=e(a).find(".bxgy-val").val();"bxgy_product"==i?0==s.length?(d.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"):"bxgy_category"==i?0==n.length?(d.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"):"0"!=i&&i?e(".select_bxgy_type").css("border","1px solid #7e8993"):(d.push("fails"),e(".select_bxgy_type").css("border","1px solid red"),e(".select_bxgy_type").focus()),1==e(a).find(".awdr-bogo-recurcive").prop("checked")&&(""==o?(d.push("fails"),e(a).find(".bxgy-min").css("border","1px solid red"),e(a).find(".bxgy-min").focus()):e(a).find(".bxgy-min").css("border","1px solid #7e8993")),""==o&&""==r?(d.push("fails"),e(a).find(".bxgy-min").css("border","1px solid red"),e(a).find(".bxgy-min").focus(),e(a).find(".bxgy-max").css("border","1px solid red"),e(a).find(".bxgy-max").focus()):(e(a).find(".bxgy-min").css("border","1px solid #7e8993"),e(a).find(".bxgy-max").css("border","1px solid #7e8993")),""==l?(d.push("fails"),e(a).find(".bxgy-qty").css("border","1px solid red"),e(a).find(".bxgy-qty").focus()):e(a).find(".bxgy-qty").css("border","1px solid #7e8993"),"free_product"!=c&&""==_?(d.push("fails"),e(a).find(".bxgy-val").css("border","1px solid red"),e(a).find(".bxgy-val").focus()):e(a).find(".bxgy-val").css("border","1px solid #7e8993")});break;default:case"not_selected":d.push("fails")}return d}function n(){let t=[];return e(".wdr-condition-group").each(function(d,a){let o=e(a).find(".wdr-product-condition-type").val();if(void 0!==o)switch(o){case"cart_subtotal":""==e(a).find(".float_only_field").val()?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"cart_items_quantity":""==e(a).find(".float_only_field").val()?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"cart_coupon":let d=e(a).find(".wdr_copon_type").val(),i=e(a).find(".coupon_name_msg").val(),r=e(a).find("#rm-coupon").val();"custom_coupon"==d?""==i?(t.push("fails"),e(a).find(".coupon_name_msg").css("border","1px solid red"),e(a).find(".coupon_name_msg").focus()):e(a).find(".coupon_name_msg").css("border","1px solid #7e8993"):r?e(a).find(".select2-selection").css("border","1px solid #7e8993"):(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus());break;case"cart_items_weight":""==e(a).find(".float_only_field").val()?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"cart_payment_method":0==e(a).find(".select2-hidden-accessible").val().length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993");break;case"cart_line_items_count":""==e(a).find(".float_only_field").val()?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"cart_item_product_attributes":let s=e(a).find(".awdr-attribute-validation").val(),n=e(a).find(".awdr-num-validation").val();0==s.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),""==n?(t.push("fails"),e(a).find(".awdr-num-validation").css("border","1px solid red"),e(a).find(".awdr-num-validation").focus()):e(a).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_category":let l=e(a).find(".awdr-category-validation").val(),c=e(a).find(".awdr-num-validation").val();0==l.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),""==c?(t.push("fails"),e(a).find(".awdr-num-validation").css("border","1px solid red"),e(a).find(".awdr-num-validation").focus()):e(a).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_combination":let _=e(a).find(".awdr-product-validation").val(),u=e(a).find(".product_from_qty").val(),p=e(a).find(".product_to_qty").val(),f=e(a).find(".combination_operator").val();0==_.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),"in_range"==f?""==u&&""==p?(t.push("fails"),e(a).find(".product_from_qty").css("border","1px solid red"),e(a).find(".product_from_qty").focus(),e(a).find(".product_to_qty").css("border","1px solid red"),e(a).find(".product_to_qty").focus()):(e(a).find(".product_from_qty").css("border","1px solid #7e8993"),e(a).find(".product_to_qty").css("border","1px solid #7e8993")):""==u?(t.push("fails"),e(a).find(".product_from_qty").css("border","1px solid red"),e(a).find(".product_from_qty").focus()):e(a).find(".product_from_qty").css("border","1px solid #7e8993");break;case"cart_item_product_sku":let w=e(a).find(".awdr-sku-validation").val(),h=e(a).find(".awdr-num-validation").val();0==w.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),""==h?(t.push("fails"),e(a).find(".awdr-num-validation").css("border","1px solid red"),e(a).find(".awdr-num-validation").focus()):e(a).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_tags":let b=e(a).find(".awdr-tag-validation").val(),m=e(a).find(".awdr-num-validation").val();0==b.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),""==m?(t.push("fails"),e(a).find(".awdr-num-validation").css("border","1px solid red"),e(a).find(".awdr-num-validation").focus()):e(a).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_products":let g=e(a).find(".awdr-product-validation").val(),v=e(a).find(".awdr-num-validation").val();0==g.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),""==v?(t.push("fails"),e(a).find(".awdr-num-validation").css("border","1px solid red"),e(a).find(".awdr-num-validation").focus()):e(a).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_category_combination":let x=e(a).find(".awdr-cat-validation").val(),y=e(a).find(".cat_from_qty").val(),k=e(a).find(".cat_to_qty").val(),z=e(a).find(".cat_combination_operator").val();0==x.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),"in_range"==z?""==y&&""==k?(t.push("fails"),e(a).find(".cat_from_qty").css("border","1px solid red"),e(a).find(".cat_from_qty").focus(),e(a).find(".cat_to_qty").css("border","1px solid red"),e(a).find(".cat_to_qty").focus()):(e(a).find(".cat_from_qty").css("border","1px solid #7e8993"),e(a).find(".cat_to_qty").css("border","1px solid #7e8993")):""==y?(t.push("fails"),e(a).find(".cat_from_qty").css("border","1px solid red"),e(a).find(".cat_from_qty").focus()):e(a).find(".cat_from_qty").css("border","1px solid #7e8993");break;case"order_date":let q=e(a).find(".awdr-from-date").val(),j=e(a).find(".awdr-end-date").val();""==q&&""==j?(t.push("fails"),e(a).find(".awdr-from-date").css("border","1px solid red"),e(a).find(".awdr-from-date").focus(),e(a).find(".awdr-end-date").css("border","1px solid red"),e(a).find(".awdr-end-date").focus()):(e(a).find(".awdr-from-date").css("border","1px solid #7e8993"),e(a).find(".awdr-end-date").css("border","1px solid #7e8993"));break;case"order_date_and_time":let I=e(a).find(".awdr-from-date").val(),O=e(a).find(".awdr-end-date").val();""==I&&""==O?(t.push("fails"),e(a).find(".awdr-from-date").css("border","1px solid red"),e(a).find(".awdr-from-date").focus(),e(a).find(".awdr-end-date").css("border","1px solid red"),e(a).find(".awdr-end-date").focus()):(e(a).find(".awdr-from-date").css("border","1px solid #7e8993"),e(a).find(".awdr-end-date").css("border","1px solid #7e8993"));break;case"order_days":0==e(a).find(".order_days").val().length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993");break;case"order_time":let T=e(a).find(".wdr-from-time").val(),C=e(a).find(".wdr-to-time").val();""==T&&""==C?(t.push("fails"),e(a).find(".wdr-from-time").css("border","1px solid red"),e(a).find(".wdr-from-time").focus(),e(a).find(".wdr-to-time").css("border","1px solid red"),e(a).find(".wdr-to-time").focus()):(e(a).find(".wdr-from-time").css("border","1px solid #7e8993"),e(a).find(".wdr-to-time").css("border","1px solid #7e8993"));break;case"purchase_last_order":0==e(a).find(".wdr-wc-order-status").val().length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993");break;case"purchase_last_order_amount":let S=e(a).find(".wdr-wc-order-status").val(),R=e(a).find(".float_only_field").val();0==S.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),""==R?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_previous_orders":let A=e(a).find(".wdr-wc-order-status").val(),D=e(a).find(".float_only_field").val();0==A.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),""==D?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_previous_orders_for_specific_product":let M=e(a).find(".wdr-wc-order-status").val(),$=e(a).find(".float_only_field").val();0==e(a).find(".specific_product").val().length?(t.push("fails"),e(a).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid red"),e(a).find(".wdr-previous-order-product-selector .select2-selection").focus()):e(a).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid #7e8993"),0==M.length?(t.push("fails"),e(a).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid red"),e(a).find(".wdr-previous-order-product-status .select2-selection").focus()):e(a).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid #7e8993"),""==$?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_quantities_for_specific_product":let F=e(a).find(".wdr-wc-order-status").val(),B=e(a).find(".float_only_field").val();e(a).find(".specific_product").val()?e(a).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid #7e8993"):(t.push("fails"),e(a).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid red"),e(a).find(".wdr-previous-order-product-selector .select2-selection").focus()),0==F.length?(t.push("fails"),e(a).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid red"),e(a).find(".wdr-previous-order-product-status .select2-selection").focus()):e(a).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid #7e8993"),""==B?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_spent":let E=e(a).find(".wdr-wc-order-status").val(),L=e(a).find(".float_only_field").val();0==E.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),""==L?(t.push("fails"),e(a).find(".float_only_field").css("border","1px solid red"),e(a).find(".float_only_field").focus()):e(a).find(".float_only_field").css("border","1px solid #7e8993");break;case"shipping_city":""==e(a).find(".awdr-validation").val()?(t.push("fails"),e(a).find(".awdr-validation").css("border","1px solid red"),e(a).find(".awdr-validation").focus()):e(a).find(".awdr-validation").css("border","1px solid #7e8993");break;case"shipping_country":0==e(a).find(".get_awdr_shipping_country").val().length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993");break;case"shipping_state":let Y=e(a).find(".get_awdr_shipping_state").val(),H=e(a).find(".get_awdr_state_based_country").val();0==Y.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993"),0==H.length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993");break;case"shipping_zipcode":""==e(a).find(".awdr-validation").val()?(t.push("fails"),e(a).find(".awdr-validation").css("border","1px solid red"),e(a).find(".awdr-validation").focus()):e(a).find(".awdr-validation").css("border","1px solid #7e8993");break;case"Billing_city":""==e(a).find(".awdr-validation").val()?(t.push("fails"),e(a).find(".awdr-validation").css("border","1px solid red"),e(a).find(".awdr-validation").focus()):e(a).find(".awdr-validation").css("border","1px solid #7e8993");break;case"user_email":""==e(a).find(".awdr-validation").val()?(t.push("fails"),e(a).find(".awdr-validation").css("border","1px solid red"),e(a).find(".awdr-validation").focus()):e(a).find(".awdr-validation").css("border","1px solid #7e8993");break;case"user_list":0==e(a).find(".wdr_user_list").val().length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993");break;case"user_role":0==e(a).find(".wdr_user_role").val().length?(t.push("fails"),e(a).find(".select2-selection").css("border","1px solid red"),e(a).find(".select2-selection").focus()):e(a).find(".select2-selection").css("border","1px solid #7e8993")}}),t}function l(t,d="success",a=null){switch(d){case"error":var o="wdr-alert-error";break;case"warning":o="wdr-alert-warning";break;default:case"success":o="wdr-alert-success"}let i="wdr-notify-msg-"+a.counts,r='<div style="display: none;" class="wdr-alert '+o+'" id="'+i+'">'+t+"</div>";e("#notify-msg-holder").append(r);let s=e("#"+i);var n=a.counts;a.counts=parseInt(n)+parseInt(1),s.fadeIn(500),setTimeout(function(){s.fadeOut(500),s.remove()},5e3)}e(".wdr-btn-add-product-filter").click(function(){wdr_buildrule.show_hide_rule_block({showBlockId:".wdr-filter-block",hideBlockId:".wdr-discount-template, .wdr-advanced-layout-block",thisObject:this})}),e(".add-product-filter").click(function(){var t=e(".wdr-filter-group-items").children().last().attr("data-index");t=i(t),wdr_buildrule.wdr_clone_field({addFilterType:".wdr-build-filter-type",addFilterMethod:".products",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-filter-group-items",newIndex:t}),o(e('.wdr-filter-group[data-index="'+t+'"]').find('[data-field="autocomplete"]')),e(".wdr-filter-group[data-index="+t+"]").append("<div class='wdr_filter_desc_text'>"+wdr_data.localization_data.filter_products+"</div>")}),e(document).on("click",".remove-current-row",function(){e(".wdr-filter-group-items > div").length>=2&&wdr_buildrule.remove_wdr_field_group({parentsRow:".wdr-filter-group",thisObject:this})}),e(document).on("change",".wdr-product-filter-type",function(){let t=e(this).parents(".wdr-filter-group").data("index"),d=e(this).val();switch(wdr_buildrule.remove_wdr_field_group({parentRow:e(this).parent()}),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+d,addRemoveIcon:".wdr-icon-remove",ruleAppendTo:e(this).parents(".wdr-filter-group"),newIndex:t}),d){case"products":e('.wdr-filter-group[data-index="'+t+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_products+"</div>");break;case"product_category":e('.wdr-filter-group[data-index="'+t+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_Category+"</div>");break;case"product_attributes":e('.wdr-filter-group[data-index="'+t+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_Attributes+"</div>");break;case"product_tags":e('.wdr-filter-group[data-index="'+t+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_Tags+"</div>");break;case"product_sku":e('.wdr-filter-group[data-index="'+t+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_SKUs+"</div>");break;case"product_on_sale":e('.wdr-filter-group[data-index="'+t+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_On_sale_products+"</div>");break;case"all_products":e('.wdr-filter-group[data-index="'+t+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_all_products+"</div>");break;default:e('.wdr-filter-group[data-index="'+t+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_custom_taxonomies+"</div>")}o(e(this).parents(".wdr-filter-group").find('[data-field="autocomplete"]'))}),e(".wdr-btn-add-condition").click(function(){wdr_buildrule.show_hide_rule_block({showBlockId:".wdr-condition-template",hideBlockId:".wdr-filter-block, .wdr-discount-template, .wdr-advanced-layout-block",thisObject:this})}),e(".add-product-condition").click(function(){var t=e(".wdr-condition-group-items").children().last().attr("data-index");t=i(t),wdr_buildrule.wdr_clone_field({addConditionType:".wdr-build-condition-type",addFilterMethod:".cart_subtotal",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-condition-group-items",newIndex:t}),"1"==wdr_data.enable_subtotal_promo_text&&wdr_buildrule.wdr_clone_field({addConditionType:"empty-promo",addFilterMethod:".wdr-subtotal-promo-messeage-main",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-condition-group-items",newIndex:t}),e(".subtotal_operator").trigger("change")}),e(document).on("change",".subtotal_operator",function(){"1"==wdr_data.enable_subtotal_promo_text&&d(e(this))}),e(document).on("change",".wdr_quantity_operator",function(){"1"==wdr_data.enable_cart_quantity_promo_text&&d(e(this))}),e(document).on("click",".remove-current-row",function(){if(e(".wdr-condition-group-items > div").length>=2&&(wdr_buildrule.remove_wdr_field_group({parentsRow:".wdr-conditions-container",thisObject:this}),"1"==wdr_data.enable_subtotal_promo_text||"1"==wdr_data.enable_cart_quantity_promo_text)){let t=e(this).parent(".wdr-btn-remove").siblings(".wdr-condition-type").find(".wdr-product-condition-type").val();if("cart_subtotal"==t){let t=e(this).parents(".wdr-conditions-container").attr("data-index");e(".promo_show_hide_"+t).remove()}if("cart_items_quantity"==t){let t=e(this).parents(".wdr-conditions-container").attr("data-index");e(".promo_show_hide_"+t).remove()}}}),e(document).on("change",".wdr-product-condition-type",function(){var t=e(this).parents(".wdr-condition-group").data("index"),d=e(this).val();wdr_buildrule.remove_wdr_field_group({parentRow:e(this).parent()}),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+d,addRemoveIcon:".wdr-icon-remove",ruleAppendTo:e(this).parents(".wdr-conditions-container"),newIndex:t});var a=e(this).parents(".wdr-conditions-container").attr("data-index");"undefined"!=e(".promo_show_hide_"+a)[0]&&e(".promo_show_hide_"+a).remove(),"order_time"==d?e(".wdr_time_picker").datetimepicker({datepicker:!1,format:"H:i"}):"cart_subtotal"==d?("1"==wdr_data.enable_subtotal_promo_text&&wdr_buildrule.wdr_clone_field({addConditionType:"empty-promo",addFilterMethod:".wdr-subtotal-promo-messeage-main",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-condition-group-items",newIndex:t}),e(".subtotal_operator").trigger("change")):"cart_items_quantity"==d&&("1"==wdr_data.enable_cart_quantity_promo_text&&wdr_buildrule.wdr_clone_field({addConditionType:"empty-promo",addFilterMethod:".wdr-cart-quantity-promo-messeage-main",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-condition-group-items",newIndex:t}),e(".wdr_quantity_operator").trigger("change")),o(e(this).parents(".wdr-conditions-container").find('[data-field="autocomplete"]')),e(this).parents(".wdr-conditions-container").find('[data-field="preloaded"]').each(function(t,d){var a=e(d),o=wdr_data.lists[a.data("list")];a.selectWoo({width:"100%",escapeMarkup:function(e){return e},minimumInputLength:1,placeholder:a.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:o}),a.parent().find(".select2-search__field").css("width","100%")}),function(t){t.each(function(t,d){var a=e(d),o=wdr_data.lists[a.data("list")];a.selectWoo({width:"100%",escapeMarkup:function(e){return e},placeholder:a.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:o}),a.parent().find(".select2-search__field").css("width","100%")})}(e(this).parents(".wdr-conditions-container").find('[data-field="autoloaded"]')),function(t){t.each(function(t,d){var a=e(d),o=a.data("class");"start_dateonly"==o?e('[data-class="'+o+'"]').datetimepicker({format:"Y-m-d",onShow:function(t){this.setOptions({maxDate:!!e('[data-class="end_dateonly"]').val()&&e('[data-class="end_dateonly"]').val()})},timepicker:!1}):"end_dateonly"==o?e('[data-class="'+o+'"]').datetimepicker({format:"Y-m-d",onShow:function(t){this.setOptions({minDate:!!e('[data-class="start_dateonly"]').val()&&e('[data-class="start_dateonly"]').val()})},timepicker:!1}):"start_datetimeonly"==o?e('[data-class="'+o+'"]').datetimepicker({timepicker:!0,format:"Y-m-d H:i",onShow:function(t){this.setOptions({maxDate:!!e('[data-class="end_datetimeonly"]').val()&&e('[data-class="end_datetimeonly"]').val()})}}):"end_datetimeonly"==o&&e('[data-class="'+o+'"]').datetimepicker({timepicker:!0,format:"Y-m-d H:i",onShow:function(t){this.setOptions({minDate:!!e('[data-class="start_datetimeonly"]').val()&&e('[data-class="start_datetimeonly"]').val()})}})})}(e(this).parents(".wdr-conditions-container").find('[data-field="date"]'))}),e(document).on("change",".wdr_copon_type",function(){var t=e(this).val();"at_least_one_any"===t?(e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search").css("display","none"),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-value").css("display","none")):"none_at_all"===t?(e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search").css("display","none"),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-value").css("display","none")):"custom_coupon"===t?(e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search").css("display","none"),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-value").css("display","block")):(e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-value").css("display","none"),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search").css("display","block"),o(e(this).parents(".wdr-conditions-container").find('[data-field="autocomplete"]')))}),e(".wdr-btn-add-discount").click(function(){wdr_buildrule.show_hide_rule_block({showBlockId:".wdr-discount-template",hideBlockId:".wdr-filter-block, .wdr-advanced-layout-block",thisObject:this})}),e(document).on("click",".add_discount_elements",function(){var t=e(this).data("append"),d=e(this).data("discount-method"),a=e(this).data("next-starting-value"),r=e("."+t).children().last().attr("data-index");if(r=i(r),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+d,ruleAppendTo:"."+t,addDiscountElement:"enable",newIndex:r}),""!=a&&"undefined"!=a){e("."+t+" "+a+":last-child").find(".awdr_value_selector").val("");let d=e("."+t+" "+a+":nth-last-child(2)").find(".awdr_auto_add_value").val();""==(d=parseInt(d)+1)||isNaN(d)||e("."+t+" "+a+":nth-last-child(1)").find(".awdr_next_value").val(d)}"add_buyx_gety_range"==d?(e(".buyx_gety_individual_range[data-index="+r+"]").find(".awdr-buyx-gety-max").show(),e(".buyx_gety_individual_range[data-index="+r+"]").find(".awdr-bogo-recurcive").prop("checked",!1),e(".wdr-buyx-gety-discount-inner").css("border-bottom","1px solid #ddd")):"add_buyx_getx_range"==d&&(e(".buyx_getx_individual_range[data-index="+r+"]").find(".awdr-buyx-getx-max").show(),e(".buyx_getx_individual_range[data-index="+r+"]").find(".awdr-bogo-recurcive").prop("checked",!1),e(".buyx_getx_individual_range").css("border-bottom","1px solid #ddd")),o(e("."+t+" div:last-child").find('[data-field="autocomplete"]')),o(e("."+t+" div:last-child").find('[data-list="product_category"]'))}),e(document).on("click",".wdr_discount_remove",function(){wdr_buildrule.remove_wdr_field_group({parentsRow:".wdr-discount-group",thisObject:this})}),e(document).on("click",'[data-click="wdr-bottombar"]',function(){var t=e(this).data("dtype");e(this).hide(),e("."+t).show()}),e(document).on("click","#awdr_rebuild_on_sale_list",function(){var t=e("#awdr_rebuild_on_sale_rules").val();e(".awdr_rebuild_on_sale_list_notice").html(""),null!=t?(e("#awdr_rebuild_on_sale_list").attr("disabled","disabled"),e("#awdr_rebuild_on_sale_list").html(wdr_data.localization_data.rebuild_on_sale_list_processing_text),a(t,e(this))):e(".awdr_rebuild_on_sale_list_notice").html(wdr_data.localization_data.rebuild_on_sale_list_error_please_select_rule)}),e(document).on("click","#awdr_rebuild_on_sale_list_on_rule_page",function(){e(this).attr("disabled","disabled"),e(this).html(wdr_data.localization_data.rebuild_on_sale_list_processing_text),a(null,e(this))}),e(document).on("click","#awdr_do_v1_v2_migration",function(){e(".wdr_migration_process").append(wdr_data.localization_data.processing_migration_text),function d(a){e.ajax({data:{method:"do_v1_v2_migration",action:"wdr_ajax",awdr_nonce:a},type:"post",url:ajaxurl,error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(o){null!=o.data.status?("completed"==o.data.status?(l(wdr_data.localization_data.processing_migration_success_message,"success",t),location.reload()):d(a),e(".wdr_migration_process_status").html(o.data.display_text)):location.reload()}})}(e(this).attr("data-awdr_nonce"))}),e(document).on("click","#awdr_skip_v1_v2_migration",function(){e(".wdr_migration_process").append(wdr_data.localization_data.skip_migration_text),e.ajax({data:{method:"skip_v1_v2_migration",action:"wdr_ajax"},type:"post",url:ajaxurl,error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(d){"failed"===d?l(wdr_data.localization_data.error,"error",t):!0===d.data&&(e(".wdr_migration_process").append(wdr_data.localization_data.skip_migration_success_message),l(wdr_data.localization_data.skip_migration_success_message,"success",t)),location.reload()}})}),e(".awdr-switch-version-button").on("click",function(t){t.preventDefault();var d=e(this).attr("data-version"),a=e(this).attr("data-page"),o=e(this).attr("data-nonce");e.ajax({url:ajaxurl,type:"POST",data:{action:"awdr_switch_version",version:d,page:a,wdr_nonce:o},success:function(t){1==t.data.status&&window.location.replace(t.data.url),e(".wdr_switch_message").html(t.data.message)}})}),e(document).on("click",".wdr_duplicate_rule",function(){let d=e(".woo_discount_loader");e.ajax({data:{rowid:e(this).data("duplicate-rule"),awdr_nonce:e(this).data("awdr_nonce"),method:"duplicate_rule",action:"wdr_ajax"},type:"post",url:ajaxurl,beforeSend:function(){d.show()},complete:function(){d.hide()},error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(e){"failed"===e?l(wdr_data.localization_data.error,"error",t):l(wdr_data.localization_data.duplicate_rule,"success",t),location.reload()}})}),e(document).on("click",".wdr_delete_rule",function(){var d=e(this).closest("tr");if(confirm(wdr_data.localization_data.delete_confirm)){let a=e(".woo_discount_loader");e.ajax({data:{rowid:e(this).data("delete-rule"),awdr_nonce:e(this).data("awdr_nonce"),method:"delete_rule",action:"wdr_ajax"},type:"post",url:ajaxurl,beforeSend:function(){a.show()},complete:function(){a.hide()},error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(e){"failed"===e?l(wdr_data.localization_data.error,"error",t):(l(wdr_data.localization_data.deleted_rule,"success",t),d.hide(500,function(){d.remove()}))}})}}),e(document).on("change",".wdr_manage_status",function(){let d="",a=e(this).closest("tr");d=1==e(this).prop("checked")?1:0;let o=e(".woo_discount_loader");e.ajax({data:{rowid:e(this).data("manage-status"),awdr_nonce:e(this).data("awdr_nonce"),method:"manage_status",action:"wdr_ajax",changeto:d},type:"post",url:ajaxurl,beforeSend:function(){o.show()},complete:function(){o.hide()},error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(o){"failed"===o?l(wdr_data.localization_data.error,"error",t):1==d?(e(a).find(".awdr-enabled-status").show(),l(wdr_data.localization_data.enabled_rule,"success",t)):(e(a).find(".awdr-enabled-status").hide(),l(wdr_data.localization_data.disabled_rule,"success",t))}})}),e(".edit-filters").selectWoo({width:"100%",minimumInputLength:1,placeholder:wdr_data.labels.placeholders,language:{noResults:function(){return wdr_data.labels.select2_no_results}},ajax:{url:ajaxurl,type:"POST",dataType:"json",delay:250,data:function(t){return{query:t.term,action:"wdr_ajax",method:e(this).data("list")||"products",awdr_nonce:e("input[name=wdr_ajax_select2]").val()||"",taxonomy:e(this).data("taxonomy")||"",selected:e(this).val()}},processResults:function(e){return{results:e.data||[]}}}}),e(".edit-filters").parent().find(".select2-search__field").css("width","100%"),e(".edit-preloaded-values").each(function(t,d){var a=e(d),o=wdr_data.lists[a.data("list")];a.selectWoo({width:"100%",escapeMarkup:function(e){return e},minimumInputLength:1,placeholder:a.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:o}),a.parent().find(".select2-search__field").css("width","100%")}),e(".edit-all-loaded-values").each(function(t,d){var a=e(d),o=wdr_data.lists[a.data("list")];a.selectWoo({width:"100%",escapeMarkup:function(e){return e},placeholder:a.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:o}),a.parent().find(".select2-search__field").css("width","100%")}),e("#wdr-save-rule").submit(function(d){if(d.preventDefault(),!function(t){let d=e(".awdr-product-discount-type").val(),a=[],o=[],i=[];switch(d){case"wdr_simple_discount":case"wdr_cart_discount":a=r(),o=s(d),i=n();break;case"wdr_free_shipping":i=n();break;case"wdr_bulk_discount":case"wdr_set_discount":case"wdr_buy_x_get_x_discount":case"wdr_buy_x_get_y_discount":a=r(),o=s(d),i=n();break;default:case"not_selected":}if(-1!==a.indexOf("fails"))return!1;if(-1!==o.indexOf("fails"))return!1;if(-1!==i.indexOf("fails"))return!1;return!0}(e(this)))return!1;let a=e(".woo_discount_loader");e.ajax({data:e(this).serialize(),type:"post",url:ajaxurl,beforeSend:function(){a.show()},complete:function(){a.hide()},error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(d){var a=d.data;if(d.success)null!=a.build_index&&null!=a.build_index.required_rebuild&&1==a.build_index.required_rebuild&&e(".awdr_rebuild_on_sale_rule_page_con").addClass("need_attention"),a.redirect?(window.location.href=a.redirect,l(wdr_data.localization_data.save_rule,"success",t)):(e(".wdr_desc_text.coupon_error_msg").hide(),e(".coupon_name_msg").css("border",""),l(wdr_data.localization_data.save_rule,"success",t));else if(a.coupon_message)e(".coupon_name_msg").css("border","1px solid #FF0000").focus(),l(wdr_data.localization_data.coupon_exists,"error",t);else for(const[e,d]of Object.entries(a))a.hasOwnProperty(e)&&d.forEach(function(e){l(e,"error",t)})}})}),e(document).on("click",".wdr_save_close",function(){e("input[name=wdr_save_close]").val("1"),e(".wdr_save_stay").click()}),e("#configuration-form").submit(function(d){d.preventDefault();let a=e(this).serialize(),o=e(".woo_discount_loader");e.ajax({data:a,type:"post",url:ajaxurl,beforeSend:function(){o.show()},complete:function(){o.hide()},error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(d){switch(d.data.save_popup){case"alert_in_popup":"alert_in_popup"==d.data.save_popup&&"passed"==d.data.security_pass?(e(".awdr-save-green").show(),setTimeout(function(){e(".awdr-save-green").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=settings")},2e3)):"alert_in_popup"==d.data.save_popup&&"fails"==d.data.security_pass&&(e(".awdr-error-red").show(),setTimeout(function(){e(".awdr-error-red").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=settings")},2e3));break;case"alert_in_normal":"alert_in_normal"==d.data.save_popup&&"passed"==d.data.security_pass?(l(wdr_data.localization_data.save_settings,"success",t),setTimeout(function(){window.location.replace(wdr_data.admin_url+"&tab=settings")},1e3)):"alert_in_normal"==d.data.save_popup&&"fails"==d.data.security_pass&&(l(wdr_data.localization_data.error,"error",t),setTimeout(function(){window.location.replace(wdr_data.admin_url+"&tab=settings")},1e3));break;default:e(".awdr-error-red").show(),l(wdr_data.localization_data.error,"error",t),setTimeout(function(){e(".awdr-error-red").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=settings")},1e3)}}})}),e("#awdr_advanced_configuration_form").submit(function(d){d.preventDefault();let a=e(this).serialize(),o=e(".woo_discount_loader");e.ajax({data:a,type:"post",url:ajaxurl,beforeSend:function(){o.show()},complete:function(){o.hide()},error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(t){"passed"==t.data.security_pass?(e(".awdr-save-green").show(),setTimeout(function(){e(".awdr-save-green").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=advanced_section")},2e3)):"fails"==t.data.security_pass&&(e(".awdr-error-red").show(),setTimeout(function(){e(".awdr-error-red").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=advanced_section")},2e3))}})}),e(document).on("click",".bulk-table-customized-setting",function(){e("input[name=customizer_save_alert]").val("1"),e(".save-configuration-submit").click()}),e("#sort_customizable_table").dragtable({persistState:function(t){t.el.find("th").each(function(d){""!=this.id&&(t.sortOrder[this.id]=d,"customize-bulk-table-title"==this.id?e(".customize_bulk_table_title").val(d):"customize-bulk-table-discount"==this.id?e(".customize_bulk_table_discount").val(d):"customize-bulk-table-range"==this.id&&e(".customize_bulk_table_range").val(d))})}}),e("#wdr-bulk-action-top").submit(function(d){if(d.preventDefault(),!(e('input[name="saved_rules[]"]:checked').length>0))return!1;{let t,d=e("#bulk-action-selector-top").val();if("enable"==d)t=confirm("Are you sure to enable the selected rules?");else if("disable"==d)t=confirm("Are you sure to disable the selected rules?");else{if("delete"!=d)return!1;t=confirm("Are you sure to delete the selected rules?")}if(0==t)return!1}let a=e(".woo_discount_loader");e.ajax({data:e(this).serialize(),type:"post",url:ajaxurl,beforeSend:function(){a.show()},complete:function(){a.hide()},error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(e){"disabled"==e.disable?l(wdr_data.localization_data.disabled_rule,"success",t):"enabled"==e.enable?l(wdr_data.localization_data.enabled_rule,"success",t):"deleted"==e.delete?l(wdr_data.localization_data.deleted_rule,"success",t):l(wdr_data.localization_data.error,"error",t),window.location.replace(wdr_data.admin_url)}})}),e("#wdr-search-top").submit(function(t){t.preventDefault();var d=e(this).serializeArray(),a=d[0].value+"&name="+d[1].value;window.location.replace(a)}),e(document).on("keypress keyup blur",".float_only_field",function(t){e(this).val(e(this).val().replace(/[^0-9\.]/g,"")),46===t.which&&-1===e(this).val().indexOf(".")||!(t.which<48||t.which>57)||t.preventDefault()}),e(document).on("keypress keyup blur",".number_only_field",function(e){(e.which<48||e.which>57)&&e.preventDefault()}),e('[data-class="start_dateonly"]').datetimepicker({timepicker:!1,format:"Y-m-d",onShow:function(t){this.setOptions({maxDate:!!e('[data-class="end_dateonly"]').val()&&e('[data-class="end_dateonly"]').val()})}}),e('[data-class="end_dateonly"]').datetimepicker({timepicker:!1,format:"Y-m-d",onShow:function(t){this.setOptions({minDate:!!e('[data-class="start_dateonly"]').val()&&e('[data-class="start_dateonly"]').val()})}}),e('[data-class="start_datetimeonly"]').datetimepicker({timepicker:!0,format:"Y-m-d H:i",onShow:function(t){this.setOptions({maxDate:!!e('[data-class="end_datetimeonly"]').val()&&e('[data-class="end_datetimeonly"]').val()})}}),e('[data-class="end_datetimeonly"]').datetimepicker({timepicker:!0,format:"Y-m-d H:i",onShow:function(t){this.setOptions({minDate:!!e('[data-class="start_datetimeonly"]').val()&&e('[data-class="start_datetimeonly"]').val()})}}),e(".wdr_time_picker").datetimepicker({datepicker:!1,format:"H:i"}),e(document).on("change",".wdr-bulk-type",function(){"product_selected_categories"==e(this).val()?e(".wdr-bulk-cat-selector").show():e(".wdr-bulk-cat-selector").hide()}),e(".settings_option_show_hide").click(function(){var t=e(this).data("name");"1"==e(this).val()?(e("."+t).show(),"hide_table_position"==t&&e(".wdr-popup-link").show()):(e("."+t).hide(),"hide_table_position"==t&&e(".wdr-popup-link").hide())}),e(".bulk_table_customizer_preview").click(function(){var t=e(this).data("colname");"show"==e(this).data("showhide")?e("."+t).show():e("."+t).hide()}),e(".settings_option_show_hide_on_change").change(function(){"disabled"==e(this).val()?e(".display_you_saved_text").hide():e(".display_you_saved_text").show()}),e(document).on("change",".wdr-rules-select",function(){var t=e(".wdr-rules-select"),d=e(this).val();"off"==d?(t.val("on"),e(".wdr-rules-selector").prop("checked",!0)):"on"==d&&(t.val("off"),e(".wdr-rules-selector").prop("checked",!1))}),e(document).on("change",".wdr-rules-selector",function(){var t=e(".wdr-rules-select"),d=e(".wdr-ruleboard input:checkbox").length,a=e(".wdr-ruleboard input:checkbox:checked").length;d==a?(t.val("on"),t.prop("checked",!0)):d!=a&&(t.val("off"),t.prop("checked",!1))});document.getElementById("ruleHeader");var c=!1;function _(){e("#sortable").sortable({handle:".awdr-sortable-handle",delay:150,stop:function(t,d){var a=new Array;e("#sortable>tr").each(function(){a.push(e(this).attr("id"))}),u(a)}})}function u(d){e.ajax({data:{position:d,method:"update_priority_order",action:"wdr_ajax",awdr_nonce:e("input[name=awdr_rule_list_nonce]").val()},type:"post",url:ajaxurl,error:function(e,d){l(wdr_data.localization_data.error,"error",t)},success:function(e){!1===e?l(wdr_data.localization_data.error,"error",t):l(wdr_data.localization_data.save_priority,"success",t)}})}if((/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))&&(c=!0),e(window).width()>1024?1==c?_():e("#sortable").sortable({delay:150,stop:function(t,d){var a=new Array;e("#sortable>tr").each(function(){a.push(e(this).attr("id"))}),u(a)}}):_(),e("#sortable").disableSelection(),e(document).on("click",".help-popup",function(){var t="#"+e(this).attr("data-id");e(t).dialog({modal:!0,closeText:""})}),e(document).on("click",".remove-clicked-discount-block",function(){var t=e(this).data("showblock"),d=e(this).data("removeval"),a=e(this).data("removeopt");e("."+t).hide(),e("."+d).removeAttr("value"),e("."+a).prop("selectedIndex",0),e("[data-dtype="+t+"]").show(),"wdr-bulk-discount"==t&&(e(".bulk_product_category_selector option:selected").remove(),e(".wdr-bulk-cat-selector").hide())}),e(".wdr-btn-add-message").click(function(){wdr_buildrule.show_hide_rule_block({showBlockId:".wdr-advanced-layout-block",hideBlockId:".wdr-discount-template, .wdr-filter-block",thisObject:this})}),e(".bulk-min").length>=2){var p=e(".bulk_discount_min").val(),f=e(".bulk_discount_max").val(),w=e(".bulk_discount_value").val();(p||f||w)&&e(".adv-msg-min-qty, .adv-msg-max-qty").show()}if(e(".set-min").length>=2){p=e(".set_discount_min").val(),w=e(".set_discount_value").val();(p||w)&&(e(".adv-msg-min-qty").show(),e(".adv-msg-max-qty").hide())}function h(){e(".wdr-condition-group").each(function(t,d){let a=e(d).find(".wdr-product-condition-type").val();if(void 0!==a)switch(a){case"cart_item_product_onsale":e(this).remove()}})}e(".popup_table_discount_column_value").click(function(){1==e(this).val()?(e(".wdr_table_discounted_value").show(),e(".wdr_table_discounted_price").hide()):(e(".wdr_table_discounted_value").hide(),e(".wdr_table_discounted_price").show())}),e(".modal-trigger").click(function(t){t.preventDefault(),dataModal=e(this).attr("data-modal"),e("#"+dataModal).css({display:"block"})}),e(".close-modal, .modal-sandbox").click(function(){e(".modal").css({display:"none"})}),e("#badge_colorpicker").on("change",function(){e("#badge_hexcolor").val(this.value)}),e("#badge_hexcolor").on("change",function(){e("#badge_colorpicker").val(this.value)}),e("#text_colorpicker").on("change",function(){e("#text_hexcolor").val(this.value)}),e("#text_hexcolor").on("change",function(){e("#text_colorpicker").val(this.value)}),e("#awdr_shortcode_copy_btn").on("click",function(){var t,d;t="#awdr_shortcode_text",d=e("<input>"),e("body").append(d),d.val(e(t).text()).select(),document.execCommand("copy"),d.remove();var a=e(this);a.html(wdr_data.localization_data.copied),setTimeout(function(){a.html(wdr_data.localization_data.copy_shortcode)},2e3)}),e(".tips, .help_tip, .woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),e(".awdr_popup_col_name_text_box").keyup(function(){var t=e(this).val(),d=e(this).data("keyup");e("."+d).html(t)}),e(".awdr_popup_col_name_text_box").blur(function(){var t=e(this).val(),d=e(this).data("keyup");e("."+d).html(t)}),e(".apply_product_and_cart_discount_to").change(function(){let t=e(this).data("subsequent");"all"==e(this).val()?e("."+t).show():e("."+t).hide()}),e(document).on("change",".awdr-bogo-discount-type",function(){let t=e(this).val(),d=e(this).attr("data-parent"),a=e(this).attr("data-siblings");switch(t){case"flat":e(this).parent("."+d).siblings("."+a).show(),e(this).parent("."+d).siblings("."+a).find(".wdr_desc_text").text(wdr_data.localization_data.buyx_getx_value);break;case"percentage":e(this).parent("."+d).siblings("."+a).show(),e(this).parent("."+d).siblings("."+a).find(".wdr_desc_text").text(wdr_data.localization_data.buyx_getx_percentage);break;case"free_product":default:e(this).parent("."+d).siblings("."+a).hide()}}),e(document).on("change",".awdr-bogo-recurcive",function(){let t=e(this).attr("data-recursive-row"),d=e(this).attr("data-recursive-parent"),a=e(this).attr("data-hide-add-range"),o=e(this).attr("data-bogo-max-range"),i=e(this).attr("data-bogo-min-range"),r=e(this).attr("data-bogo-border"),s=e("."+t).length,n=e(this).attr("data-ranges-row-parent");if(0==e(this).prop("checked"))return e(this).parents("."+n).siblings("."+a).show(),""!=o&&(e(this).parents("."+d).siblings("."+o).show(),e(this).parents("."+d).siblings().find("."+o).show()),e(this).parents("."+d).siblings("."+i).find(".wdr_desc_text").text(wdr_data.localization_data.recursive_min_qty),void e("."+r).css("border-bottom","1px solid #ddd");if(s>3){confirm(wdr_data.localization_data.recursive_warning)?e(this).parents("."+t).siblings().remove():e(this).prop("checked",!1)}1==e(this).prop("checked")&&(e(this).parents("."+n).siblings("."+a).hide(),""!=o&&(e(this).parents("."+d).siblings("."+o).hide(),e(this).parents("."+d).siblings().find("."+o).hide()),e(this).parents("."+d).siblings("."+i).find(".wdr_desc_text").text(wdr_data.localization_data.recursive_qty),e("."+r).css("border-bottom","unset"))}),e(document).on("change",".awdr_mode_of_operator",function(){let t=e(this).val();"wdr_buy_x_get_y_discount"!=e(".awdr-product-discount-type").val()?"variation"==t?(e(".awdr-discount-content").html(wdr_data.localization_data.bulk_variants_discount_description),e(".awdr-example").html(wdr_data.localization_data.mode_variation_cumulative_example)):"product"==t?(e(".awdr-discount-content").html(wdr_data.localization_data.bulk_individual_product_discount_description),e(".awdr-example").html("")):(e(".awdr-discount-content").html(wdr_data.localization_data.bulk_filter_together_discount_description),e(".awdr-example").html("")):"variation"==t?(e(".awdr-bxgy-dynamic-tip").attr("title",wdr_data.localization_data.bulk_variants_discount_description_tool_tip),e(".awdr-example").html(wdr_data.localization_data.mode_variation_cumulative_example)):"product"==t?(e(".awdr-bxgy-dynamic-tip").attr("title",wdr_data.localization_data.bulk_individual_product_discount_description_tool_tip),e(".awdr-example").html("")):(e(".awdr-bxgy-dynamic-tip").attr("title",wdr_data.localization_data.bulk_filter_together_discount_description_tool_tip),e(".awdr-example").html(""))}),e(document).on("change",".awdr-product-discount-type",function(){e(".awdr-example").html("");var t=e(this).data("placement");let d=e(this).val();switch(d){case"wdr_simple_discount":e(".awdr_doc_"+d).show(),e(".awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_cart_discount":e(".awdr_doc_"+d).show(),e(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_free_shipping":e(".awdr_doc_"+d).show(),e(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_bulk_discount":e(".awdr_doc_"+d).show(),e(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_set_discount":e(".awdr_doc_"+d).show(),e(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_buy_x_get_x_discount":e(".awdr_doc_"+d).show(),e(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_buy_x_get_y_discount":e(".awdr_doc_"+d).show(),e(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount").hide();break;default:case"not_selected":e(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide()}"not_selected"!=e(this).val()&&"wdr_free_shipping"!=e(this).val()?(wdr_buildrule.wdr_clone_field({addFilterMethod:"."+e(this).val(),ruleAppendTo:"."+t,addDiscountType:"enable"}),e(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||e(".awdr-free-shipping-special-condition").addClass("wdr-hide"),h(),e(".calculate_cart_from option[value='from_filter']").show(),e(".adv-msg-discount, .adv-msg-discount-price").show(),e(".awdr-hidden-new-rule").fadeIn(500),e(".awdr-filter-section").fadeIn(500),e("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!1).removeClass("wdr_save_btn_disabled"),o(e("."+t).find('[data-field="autocomplete"]')),e(".awdr-discount-container").show(),e("."+t).find(".bulk_range_setter_group").addClass("bulk_range_setter").attr("id","bulk_adjustment_sortable"),e("."+t).find(".set_range_setter_group").addClass("set_range_setter").attr("id","bulk_adjustment_sortable"),e(window).width()>1024?1==c?e("#bulk_adjustment_sortable").sortable({handle:".awdr-sortable-handle"}):e("#bulk_adjustment_sortable").sortable():e("#bulk_adjustment_sortable").sortable({handle:".awdr-sortable-handle"}),e("#bulk_adjustment_sortable").disableSelection(),e(".awdr-filter-heading").html(wdr_data.localization_data.common_filter_heading),e(".awdr-filter-content").html(wdr_data.localization_data.common_filter_description),e(".awdr-discount-heading").html(wdr_data.localization_data.common_discount_heading),e(".awdr-discount-content").html(wdr_data.localization_data.common_discount_description),e(".awdr-rules-content").html(wdr_data.localization_data.common_rules_description),"wdr_buy_x_get_y_discount"==e(this).val()&&(e(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||e(".awdr-free-shipping-special-condition").addClass("wdr-hide"),h(),e(".awdr-discount-heading").html(wdr_data.localization_data.two_column_bxgy_discount_heading),o(e("."+t).find('[data-list="product_category"]')),e(".adv-msg-min-qty, .adv-msg-max-qty, .adv-msg-discount, .adv-msg-discount-price").hide()),"wdr_buy_x_get_x_discount"==e(this).val()&&(e(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||e(".awdr-free-shipping-special-condition").addClass("wdr-hide"),h(),e(".adv-msg-min-qty, .adv-msg-max-qty, .adv-msg-discount, .adv-msg-discount-price").hide()),"wdr_bulk_discount"==e(this).val()?(e(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||e(".awdr-free-shipping-special-condition").addClass("wdr-hide"),h(),e(".awdr-discount-heading").html(wdr_data.localization_data.two_column_bulk_discount_heading),e(".awdr_mode_of_operator").trigger("change"),e(".adv-msg-min-qty, .adv-msg-max-qty, .adv-msg-discount, .adv-msg-discount-price").show()):"wdr_set_discount"==e(this).val()&&(e(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||e(".awdr-free-shipping-special-condition").addClass("wdr-hide"),h(),e(".awdr_mode_of_operator").trigger("change"),e(".awdr-discount-heading").html(wdr_data.localization_data.two_column_set_discount_heading),e(".adv-msg-min-qty, .adv-msg-discount, .adv-msg-discount-price").show(),e(".adv-msg-max-qty").hide())):"wdr_free_shipping"==e(this).val()?(e(".awdr-free-shipping-special-condition").removeClass("wdr-hide"),e(".awdr-hidden-new-rule").fadeIn(500),e(".awdr-filter-section").fadeOut(),e("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!1).removeClass("wdr_save_btn_disabled"),e("."+t).html(""),e(".awdr-discount-container").hide(),e(".adv-msg-min-qty, .adv-msg-max-qty, .adv-msg-discount, .adv-msg-discount-price").hide(),e(".calculate_cart_from option[value='from_filter']").hide()):(e(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||e(".awdr-free-shipping-special-condition").addClass("wdr-hide"),h(),e("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!0).addClass("wdr_save_btn_disabled"),e(".awdr-hidden-new-rule").fadeOut(500)),e(this).trigger("advanced_woo_discount_rules_on_change_adjustment_type",[e(this).val()])}),e(".awdr-product-discount-type").trigger("change"),"view"==wdr_data.rule_id?e("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!1).removeClass("wdr_save_btn_disabled"):e("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!0).addClass("wdr_save_btn_disabled"),e(document).on("change",".apply_fee_coupon_checkbox",function(){1==e(this).prop("checked")?e(this).parents(".awdr_rtl_compatible").siblings(".apply_fee_coupon_label").show():e(this).parents(".awdr_rtl_compatible").siblings(".apply_fee_coupon_label").hide()}),e(document).on("change",".bulk_table_customizer_show_hide_column",function(){var t=e(this).data("colname");1==e(this).prop("checked")?e("."+t).show():e("."+t).hide()});var b,m=document.getElementsByClassName("awdr-accordion");for(b=0;b<m.length;b++)m[b].addEventListener("click",function(t){t.preventDefault(),this.classList.toggle("awdr-accordion-active");var d=this.nextElementSibling;"block"===d.style.display?e(d).slideUp(1e3):e(d).slideDown(1e3)});e(document).on("change",".on_sale_badge_condition",function(){"disabled"===e(this).val()?(e(".sale_badge_toggle").hide(),e(".sale_badge_customizer,.sale_badge_percentage_customizer").hide()):(e(".sale_badge_toggle").show(),1==e("#customize_on_sale_badge").prop("checked")?(e(".sale_badge_customizer").show(),e(".display_percentage_on_sale_badge_con").show()):(e(".sale_badge_customizer").hide(),e("#display_percentage_on_sale_badge").prop("checked",!1).trigger("change"),e(".display_percentage_on_sale_badge_con").hide()),1==e("#display_percentage_on_sale_badge").prop("checked")?e(".sale_badge_percentage_customizer").show():e(".sale_badge_percentage_customizer").hide())}),e(document).on("change","#customize_on_sale_badge",function(){1==e(this).prop("checked")?(e(".sale_badge_customizer").show(),e(".display_percentage_on_sale_badge_con").show()):(e(".sale_badge_customizer").hide(),e("#display_percentage_on_sale_badge").prop("checked",!1).trigger("change"),e(".display_percentage_on_sale_badge_con").hide())}),e(document).on("change","#display_percentage_on_sale_badge",function(){1==e(this).prop("checked")?e(".sale_badge_percentage_customizer").show():e(".sale_badge_percentage_customizer").hide()}),e(document).on("change","#badge_colorpicker",function(){let t=e(this).val();e(".awdr_admin_discount_bar").css("background-color",t)}),e(document).on("change","#badge_hexcolor",function(){let t=e(this).val();e(".awdr_admin_discount_bar").css("background-color",t)}),e(document).on("change","#text_colorpicker",function(){let t=e(this).val();e(".awdr_admin_discount_bar").css("color",t)}),e(document).on("change","#text_hexcolor",function(){let t=e(this).val();e(".awdr_admin_discount_bar").css("color",t)}),e(document).on("change","#awdr_discount_bar_content",function(){let t=e(this).val();e(".awdr_admin_discount_bar").html(t)}),e(document).on("click",".awdr-hidden-search",function(){let t=e(".awdr-hidden-name").val();e(".wdr-rule-search-key").val(t),e("#wdr-search-top").submit()}),e(document).on("change","#select_usage_limits",function(){let t=e("#select_usage_limits").val();if(""==t)e(".awdr-rule-limit-disabled-outer .rule_limit_msg_outer").hide(),e(".awdr-rule-limit-disabled").hide();else{var d=e(".awdr-used-limit-total").html();t<=parseInt(d)?(e(".awdr-rule-limit-disabled").hide(),e(".awdr-rule-limit-disabled-outer").show(),e(".awdr-rule-limit-disabled-outer .rule_limit_msg_outer").html(wdr_data.localization_data.invalid_rule_limit)):(e(".awdr-rule-limit-disabled").hide(),e(".awdr-rule-limit-disabled-outer").hide())}}),e("#awdr-import-csv").on("submit",function(){return!!new RegExp("([a-zA-Z0-9s_\\.-:])+(.csv)$").test(e("#awdr-file-uploader").val().toLowerCase())||(e("#awdr-upload-response").html(wdr_data.localization_data.invalid_file_type),!1)}),e(document).on("change",".get_awdr_state_based_country",function(){let t=e(this).val();if(!t||""==t||0==t.length)return!1;let d=e(this).parents(".wdr-conditions-container").attr("data-index"),a=e(this).parents(".wdr_shipping_state_group"),o=e(this).parent().siblings(".wdr-shipping-state-value"),i=e(".woo_discount_loader");var r={action:"wdr_ajax",method:"get_state_details",selected_country:t,selected_state:e(this).parent().siblings(".wdr-shipping-state-value").find(".get_awdr_shipping_state").val(),selected_index:d,awdr_nonce:e("input[name=wdr_ajax_select2]").val()||""};e.ajax({url:ajaxurl,data:r,type:"POST",beforeSend:function(){i.show()},complete:function(){i.hide()},success:function(t){o.remove(),a.append("<div class='wdr-shipping-state-value wdr-select-filed-hight wdr-search-box' style='width: min-content;'>"+t.data+"<span class='wdr_select2_desc_text'>"+wdr_data.localization_data.select_state+"</span> </div>"),e(".append-preloaded-values").selectWoo()},error:function(e){console.log("error")}})}),e(".get_awdr_state_based_country").trigger("change"),e(document).on("change",".wdr_copon_type",function(){var t=e(this).val();"custom_coupon"===t?(e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one, .wdr-cart-coupon-url-all").css("display","none"),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom").css("display","block")):"at_least_one"===t?(e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom, .wdr-cart-coupon-url-all").css("display","none"),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one").css("display","block")):"all"===t&&(e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom, .wdr-cart-coupon-url-one").css("display","none"),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-all").css("display","block"))}),e(document).on("click",".wdr-copy-coupon-url",function(d){d.preventDefault(),e(this).parents(".wdr-coupon-url-group").find("input[type=url]").select(),document.execCommand("copy")?(e(this).html(wdr_data.localization_data.coupon_url_copied),l(wdr_data.localization_data.coupon_url_success,"success",t)):l(wdr_data.localization_data.error,"error",t)}),e(document).on("change",".wdr-cart-coupon-url-enable",function(t){t.preventDefault(),e(this).closest(".wdr-cart-coupon-url").find(".wdr-cart-coupon-url-lists").slideToggle()}),e(document).on("change keyup",".wdr-cart-coupon-value input",function(){var t=wdr_data.home_url,d=e(this).val();""!==d?($group='<span class="wdr-coupon-url-group"><label>',$group+=' <input type="url" value="'+t+"?wdr_coupon="+encodeURIComponent(d)+'"></label>',$group+='<button class="wdr-copy-coupon-url">'+wdr_data.localization_data.coupon_url_copy+"</button></span>",e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom").html($group),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom").css("display","block")):e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom").css("display","none")}),e(document).on("change",".wdr-cart-coupon-search select, select.wdr_copon_type",function(){var t=wdr_data.home_url,d=e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search select").val(),a=e(this).parents(".wdr_cart_coupon_group").find("select.wdr_copon_type").val();if(0!==d.length){if("at_least_one"===a)$groups="",d.forEach(function(e){$groups+='<span class="wdr-coupon-url-group"><label>',$groups+=' <input type="url" value="'+t+"?wdr_coupon="+encodeURIComponent(e)+'"></label>',$groups+='<button class="wdr-copy-coupon-url">'+wdr_data.localization_data.coupon_url_copy+"</button></span><br>"}),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one").html($groups),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one").css("display","block");else if("all"===a){var o="";t+="?wdr_coupon=",d.forEach(function(e){o+=e+", ",t+=encodeURIComponent(e)+","}),o=o.replace(/(^, )|(, $)/g,""),t=t.replace(/(^,)|(,$)/g,""),$group='<span class="wdr-coupon-url-group"><label>',$group+=' <input type="url" value="'+t+'"></label>',$group+='<button class="wdr-copy-coupon-url">'+wdr_data.localization_data.coupon_url_copy+"</button></span>",e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-all").html($group),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-all").css("display","block")}}else e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one").css("display","none"),e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-all").css("display","none")})});
1
+ jQuery(document).ready(function($){let i={counts:1};function j(a){let b=a.val(),c=a.parents(".wdr-conditions-container").attr("data-index");"greater_than_or_equal"==b||"greater_than"==b?$(".promo_show_hide_"+c).show():$(".promo_show_hide_"+c).hide()}function k(a){$.ajax({data:{method:"do_v1_v2_migration",action:"wdr_ajax",awdr_nonce:a},type:"post",url:ajaxurl,error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(b){void 0!=b.data.status?("completed"==b.data.status?(q(wdr_data.localization_data.processing_migration_success_message,"success",i),location.reload()):k(a),$(".wdr_migration_process_status").html(b.data.display_text)):location.reload()}})}function l(a,b,c=!1){$.ajax({data:{method:"rebuild_onsale_list",action:"wdr_ajax",rules:a,update:c?1:0,awdr_nonce:b.attr("data-awdr_nonce")},type:"post",url:ajaxurl,error:function(a,c){q(wdr_data.localization_data.error,"error",i),b.removeAttr("disabled")},success:function(a){b.html(wdr_data.localization_data.rebuild_on_sale_list_processed_text),b.removeAttr("disabled")}})}function m(a){void 0!==a.required_rebuild&& !0==a.required_rebuild&&($("#awdr_rebuild_on_sale_list_on_rule_page").html(wdr_data.localization_data.rebuild_on_sale_list_build_text),$(".awdr_rebuild_on_sale_rule_page_con").addClass("need_attention"))}function n(a){a.selectWoo({width:"100%",minimumInputLength:1,placeholder:a.data("placeholder"),escapeMarkup:function(a){return a},language:{noResults:function(){return wdr_data.labels.select2_no_results},errorLoading:function(){return wdr_data.labels.searching_text}},ajax:{url:ajaxurl,type:"POST",dataType:"json",delay:250,data:function(b){return{query:b.term,action:"wdr_ajax",method:a.data("list")||"products",awdr_nonce:$("input[name=wdr_ajax_select2]").val()||"",taxonomy:a.data("taxonomy")||"",selected:a.val()}},processResults:function(a){return{results:a.data||[]}}}}),a.parent().find(".select2-search__field").css("width","100%")}function o(a){return 0===a?0:parseInt(a)+1}$(".wdr-btn-add-product-filter").click(function(){wdr_buildrule.show_hide_rule_block({showBlockId:".wdr-filter-block",hideBlockId:".wdr-discount-template, .wdr-advanced-layout-block",thisObject:this})}),$(".add-product-filter").click(function(){var a=$(".wdr-filter-group-items").children().last().attr("data-index");a=o(a),wdr_buildrule.wdr_clone_field({addFilterType:".wdr-build-filter-type",addFilterMethod:".products",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-filter-group-items",newIndex:a}),n($('.wdr-filter-group[data-index="'+a+'"]').find('[data-field="autocomplete"]')),$(".wdr-filter-group[data-index="+a+"]").append("<div class='wdr_filter_desc_text'>"+wdr_data.localization_data.filter_products+"</div>")}),$(document).on("click",".remove-current-row",function(){$(".wdr-filter-group-items > div").length>=2&&wdr_buildrule.remove_wdr_field_group({parentsRow:".wdr-filter-group",thisObject:this})}),$(document).on("change",".wdr-product-filter-type",function(){let a=$(this).parents(".wdr-filter-group").data("index"),b=$(this).val();switch(wdr_buildrule.remove_wdr_field_group({parentRow:$(this).parent()}),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+b,addRemoveIcon:".wdr-icon-remove",ruleAppendTo:$(this).parents(".wdr-filter-group"),newIndex:a}),b){case"products":$('.wdr-filter-group[data-index="'+a+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_products+"</div>");break;case"product_category":$('.wdr-filter-group[data-index="'+a+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_Category+"</div>");break;case"product_attributes":$('.wdr-filter-group[data-index="'+a+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_Attributes+"</div>");break;case"product_tags":$('.wdr-filter-group[data-index="'+a+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_Tags+"</div>");break;case"product_sku":$('.wdr-filter-group[data-index="'+a+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_SKUs+"</div>");break;case"product_on_sale":$('.wdr-filter-group[data-index="'+a+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_On_sale_products+"</div>");break;case"all_products":$('.wdr-filter-group[data-index="'+a+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_all_products+"</div>");break;default:$('.wdr-filter-group[data-index="'+a+'"]').append('<div class="wdr_filter_desc_text">'+wdr_data.localization_data.filter_custom_taxonomies+"</div>")}n($(this).parents(".wdr-filter-group").find('[data-field="autocomplete"]'))}),$(".wdr-btn-add-condition").click(function(){wdr_buildrule.show_hide_rule_block({showBlockId:".wdr-condition-template",hideBlockId:".wdr-filter-block, .wdr-discount-template, .wdr-advanced-layout-block",thisObject:this})}),$(".add-product-condition").click(function(){var a=$(".wdr-condition-group-items").children().last().attr("data-index");a=o(a),wdr_buildrule.wdr_clone_field({addConditionType:".wdr-build-condition-type",addFilterMethod:".cart_subtotal",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-condition-group-items",newIndex:a}),"1"==wdr_data.enable_subtotal_promo_text&&wdr_buildrule.wdr_clone_field({addConditionType:"empty-promo",addFilterMethod:".wdr-subtotal-promo-messeage-main",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-condition-group-items",newIndex:a}),$(".subtotal_operator").trigger("change")}),$(document).on("change",".subtotal_operator",function(){"1"==wdr_data.enable_subtotal_promo_text&&j($(this))}),$(document).on("change",".wdr_quantity_operator",function(){"1"==wdr_data.enable_cart_quantity_promo_text&&j($(this))}),$(document).on("click",".remove-current-row",function(){if($(".wdr-condition-group-items > div").length>=2&&(wdr_buildrule.remove_wdr_field_group({parentsRow:".wdr-conditions-container",thisObject:this}),"1"==wdr_data.enable_subtotal_promo_text||"1"==wdr_data.enable_cart_quantity_promo_text)){let a=$(this).parent(".wdr-btn-remove").siblings(".wdr-condition-type").find(".wdr-product-condition-type").val();if("cart_subtotal"==a){let b=$(this).parents(".wdr-conditions-container").attr("data-index");$(".promo_show_hide_"+b).remove()}if("cart_items_quantity"==a){let c=$(this).parents(".wdr-conditions-container").attr("data-index");$(".promo_show_hide_"+c).remove()}}}),$(document).on("change",".wdr-product-condition-type",function(){var b=$(this).parents(".wdr-condition-group").data("index"),a=$(this).val();wdr_buildrule.remove_wdr_field_group({parentRow:$(this).parent()}),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+a,addRemoveIcon:".wdr-icon-remove",ruleAppendTo:$(this).parents(".wdr-conditions-container"),newIndex:b});var c=$(this).parents(".wdr-conditions-container").attr("data-index");"undefined"!=$(".promo_show_hide_"+c)[0]&&$(".promo_show_hide_"+c).remove(),"order_time"==a?$(".wdr_time_picker").datetimepicker({datepicker:!1,format:"H:i"}):"cart_subtotal"==a?("1"==wdr_data.enable_subtotal_promo_text&&wdr_buildrule.wdr_clone_field({addConditionType:"empty-promo",addFilterMethod:".wdr-subtotal-promo-messeage-main",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-condition-group-items",newIndex:b}),$(".subtotal_operator").trigger("change")):"cart_items_quantity"==a&&("1"==wdr_data.enable_cart_quantity_promo_text&&wdr_buildrule.wdr_clone_field({addConditionType:"empty-promo",addFilterMethod:".wdr-cart-quantity-promo-messeage-main",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-condition-group-items",newIndex:b}),$(".wdr_quantity_operator").trigger("change")),n($(this).parents(".wdr-conditions-container").find('[data-field="autocomplete"]')),function(a){a.each(function(d,b){var a=$(b),c=wdr_data.lists[a.data("list")];a.selectWoo({width:"100%",escapeMarkup:function(a){return a},minimumInputLength:1,placeholder:a.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:c}),a.parent().find(".select2-search__field").css("width","100%")})}($(this).parents(".wdr-conditions-container").find('[data-field="preloaded"]')),function(a){a.each(function(d,b){var a=$(b),c=wdr_data.lists[a.data("list")];a.selectWoo({width:"100%",escapeMarkup:function(a){return a},placeholder:a.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:c}),a.parent().find(".select2-search__field").css("width","100%")})}($(this).parents(".wdr-conditions-container").find('[data-field="autoloaded"]')),function b(a){a.each(function(c,b){var a=$(b).data("class");"start_dateonly"==a?$('[data-class="'+a+'"]').datetimepicker({format:"Y-m-d",onShow:function(a){this.setOptions({maxDate:!!$('[data-class="end_dateonly"]').val()&&$('[data-class="end_dateonly"]').val()})},timepicker:!1}):"end_dateonly"==a?$('[data-class="'+a+'"]').datetimepicker({format:"Y-m-d",onShow:function(a){this.setOptions({minDate:!!$('[data-class="start_dateonly"]').val()&&$('[data-class="start_dateonly"]').val()})},timepicker:!1}):"start_datetimeonly"==a?$('[data-class="'+a+'"]').datetimepicker({timepicker:!0,format:"Y-m-d H:i",onShow:function(a){this.setOptions({maxDate:!!$('[data-class="end_datetimeonly"]').val()&&$('[data-class="end_datetimeonly"]').val()})}}):"end_datetimeonly"==a&&$('[data-class="'+a+'"]').datetimepicker({timepicker:!0,format:"Y-m-d H:i",onShow:function(a){this.setOptions({minDate:!!$('[data-class="start_datetimeonly"]').val()&&$('[data-class="start_datetimeonly"]').val()})}})})}($(this).parents(".wdr-conditions-container").find('[data-field="date"]'))}),$(document).on("change",".wdr_copon_type",function(){var a=$(this).val();"at_least_one_any"===a?($(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search").css("display","none"),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-value").css("display","none")):"none_at_all"===a?($(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search").css("display","none"),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-value").css("display","none")):"custom_coupon"===a?($(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search").css("display","none"),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-value").css("display","block")):($(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-value").css("display","none"),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search").css("display","block"),n($(this).parents(".wdr-conditions-container").find('[data-field="autocomplete"]')))}),$(".wdr-btn-add-discount").click(function(){wdr_buildrule.show_hide_rule_block({showBlockId:".wdr-discount-template",hideBlockId:".wdr-filter-block, .wdr-advanced-layout-block",thisObject:this})}),$(document).on("click",".add_discount_elements",function(){var a=$(this).data("append"),e=$(this).data("discount-method"),c=$(this).data("next-starting-value"),b=$("."+a).children().last().attr("data-index");if(b=o(b),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+e,ruleAppendTo:"."+a,addDiscountElement:"enable",newIndex:b}),""!=c&&"undefined"!=c){$("."+a+" "+c+":last-child").find(".awdr_value_selector").val("");let d=$("."+a+" "+c+":nth-last-child(2)").find(".awdr_auto_add_value").val();""==(d=parseInt(d)+1)||isNaN(d)||$("."+a+" "+c+":nth-last-child(1)").find(".awdr_next_value").val(d)}"add_buyx_gety_range"==e?($(".buyx_gety_individual_range[data-index="+b+"]").find(".awdr-buyx-gety-max").show(),$(".buyx_gety_individual_range[data-index="+b+"]").find(".awdr-bogo-recurcive").prop("checked",!1),$(".wdr-buyx-gety-discount-inner").css("border-bottom","1px solid #ddd")):"add_buyx_getx_range"==e&&($(".buyx_getx_individual_range[data-index="+b+"]").find(".awdr-buyx-getx-max").show(),$(".buyx_getx_individual_range[data-index="+b+"]").find(".awdr-bogo-recurcive").prop("checked",!1),$(".buyx_getx_individual_range").css("border-bottom","1px solid #ddd")),n($("."+a+" div:last-child").find('[data-field="autocomplete"]')),n($("."+a+" div:last-child").find('[data-list="product_category"]'))}),$(document).on("click",".wdr_discount_remove",function(){wdr_buildrule.remove_wdr_field_group({parentsRow:".wdr-discount-group",thisObject:this})}),$(document).on("click",'[data-click="wdr-bottombar"]',function(){var a=$(this).data("dtype");$(this).hide(),$("."+a).show()}),$(document).on("click","#awdr_rebuild_on_sale_list",function(){var a=$("#awdr_rebuild_on_sale_rules").val();$(".awdr_rebuild_on_sale_list_notice").html(""),null!=a?($("#awdr_rebuild_on_sale_list").attr("disabled","disabled"),$("#awdr_rebuild_on_sale_list").html(wdr_data.localization_data.rebuild_on_sale_list_processing_text),l(a,$(this),!0)):$(".awdr_rebuild_on_sale_list_notice").html(wdr_data.localization_data.rebuild_on_sale_list_error_please_select_rule)}),$(document).on("click","#awdr_rebuild_on_sale_list_on_rule_page",function(){$(this).attr("disabled","disabled"),$(this).html(wdr_data.localization_data.rebuild_on_sale_list_processing_text),l(null,$(this),!1)}),$(document).on("click","#awdr_do_v1_v2_migration",function(){$(".wdr_migration_process").append(wdr_data.localization_data.processing_migration_text),k($(this).attr("data-awdr_nonce"))}),$(document).on("click","#awdr_skip_v1_v2_migration",function(){$(".wdr_migration_process").append(wdr_data.localization_data.skip_migration_text),$.ajax({data:{method:"skip_v1_v2_migration",action:"wdr_ajax"},type:"post",url:ajaxurl,error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(a){"failed"===a?q(wdr_data.localization_data.error,"error",i):!0===a.data&&($(".wdr_migration_process").append(wdr_data.localization_data.skip_migration_success_message),q(wdr_data.localization_data.skip_migration_success_message,"success",i)),location.reload()}})}),$(".awdr-switch-version-button").on("click",function(a){a.preventDefault();var b=$(this).attr("data-version"),c=$(this).attr("data-page"),d=$(this).attr("data-nonce");$.ajax({url:ajaxurl,type:"POST",data:{action:"awdr_switch_version",version:b,page:c,wdr_nonce:d},success:function(a){!0==a.data.status&&window.location.replace(a.data.url),$(".wdr_switch_message").html(a.data.message)}})}),$(document).on("click",".wdr_duplicate_rule",function(){let a=$(".woo_discount_loader");$.ajax({data:{rowid:$(this).data("duplicate-rule"),awdr_nonce:$(this).data("awdr_nonce"),method:"duplicate_rule",action:"wdr_ajax"},type:"post",url:ajaxurl,beforeSend:function(){a.show()},complete:function(){a.hide()},error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(a){"failed"===a?q(wdr_data.localization_data.error,"error",i):q(wdr_data.localization_data.duplicate_rule,"success",i),location.reload()}})}),$(document).on("click",".wdr_delete_rule",function(){var a=$(this).closest("tr");if(confirm(wdr_data.localization_data.delete_confirm)){let b=$(".woo_discount_loader");$.ajax({data:{rowid:$(this).data("delete-rule"),awdr_nonce:$(this).data("awdr_nonce"),method:"delete_rule",action:"wdr_ajax"},type:"post",url:ajaxurl,beforeSend:function(){b.show()},complete:function(){b.hide()},error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(b){b?("failed"===b.status?q(wdr_data.localization_data.error,"error",i):(q(wdr_data.localization_data.deleted_rule,"success",i),a.hide(500,function(){a.remove()})),void 0!==b.build_index&&m(b.build_index)):q(wdr_data.localization_data.error,"error",i)}})}}),$(document).on("change",".wdr_manage_status",function(){let a="",b=$(this).closest("tr");a=!0==$(this).prop("checked")?1:0;let c=$(".woo_discount_loader");$.ajax({data:{rowid:$(this).data("manage-status"),awdr_nonce:$(this).data("awdr_nonce"),method:"manage_status",action:"wdr_ajax",changeto:a},type:"post",url:ajaxurl,beforeSend:function(){c.show()},complete:function(){c.hide()},error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(c){c?"failed"===c.status?q(wdr_data.localization_data.error,"error",i):(1==a?($(b).find(".awdr-enabled-status").show(),q(wdr_data.localization_data.enabled_rule,"success",i)):($(b).find(".awdr-enabled-status").hide(),q(wdr_data.localization_data.disabled_rule,"success",i)),void 0!==c.build_index&&m(c.build_index)):q(wdr_data.localization_data.error,"error",i)}})}),$(".edit-filters").selectWoo({width:"100%",minimumInputLength:1,placeholder:wdr_data.labels.placeholders,language:{noResults:function(){return wdr_data.labels.select2_no_results}},ajax:{url:ajaxurl,type:"POST",dataType:"json",delay:250,data:function(a){return{query:a.term,action:"wdr_ajax",method:$(this).data("list")||"products",awdr_nonce:$("input[name=wdr_ajax_select2]").val()||"",taxonomy:$(this).data("taxonomy")||"",selected:$(this).val()}},processResults:function(a){return{results:a.data||[]}}}}),$(".edit-filters").parent().find(".select2-search__field").css("width","100%"),$(".edit-preloaded-values").each(function(d,b){var a=$(b),c=wdr_data.lists[a.data("list")];a.selectWoo({width:"100%",escapeMarkup:function(a){return a},minimumInputLength:1,placeholder:a.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:c}),a.parent().find(".select2-search__field").css("width","100%")});function p(){let a=[];return $(".wdr-condition-group").each(function(S,b){let c=$(b).find(".wdr-product-condition-type").val();if(void 0!==c)switch(c){case"cart_subtotal":case"cart_items_quantity":case"cart_items_weight":case"cart_line_items_count":""==$(b).find(".float_only_field").val()?(a.push("fails"),$(b).find(".float_only_field").css("border","1px solid red"),$(b).find(".float_only_field").focus()):$(b).find(".float_only_field").css("border","1px solid #7e8993");break;case"cart_coupon":let f=$(b).find(".wdr_copon_type").val(),g=$(b).find(".coupon_name_msg").val(),h=$(b).find("#rm-coupon").val();"custom_coupon"==f?""==g?(a.push("fails"),$(b).find(".coupon_name_msg").css("border","1px solid red"),$(b).find(".coupon_name_msg").focus()):$(b).find(".coupon_name_msg").css("border","1px solid #7e8993"):h?$(b).find(".select2-selection").css("border","1px solid #7e8993"):(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus());break;case"cart_payment_method":0==$(b).find(".select2-hidden-accessible").val().length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993");break;case"cart_item_product_attributes":let i=$(b).find(".awdr-attribute-validation").val(),j=$(b).find(".awdr-num-validation").val();0==i.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),""==j?(a.push("fails"),$(b).find(".awdr-num-validation").css("border","1px solid red"),$(b).find(".awdr-num-validation").focus()):$(b).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_category":let k=$(b).find(".awdr-category-validation").val(),l=$(b).find(".awdr-num-validation").val();0==k.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),""==l?(a.push("fails"),$(b).find(".awdr-num-validation").css("border","1px solid red"),$(b).find(".awdr-num-validation").focus()):$(b).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_combination":let m=$(b).find(".awdr-product-validation").val(),d=$(b).find(".product_from_qty").val(),n=$(b).find(".product_to_qty").val(),o=$(b).find(".combination_operator").val();0==m.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),"in_range"==o?""==d&&""==n?(a.push("fails"),$(b).find(".product_from_qty").css("border","1px solid red"),$(b).find(".product_from_qty").focus(),$(b).find(".product_to_qty").css("border","1px solid red"),$(b).find(".product_to_qty").focus()):($(b).find(".product_from_qty").css("border","1px solid #7e8993"),$(b).find(".product_to_qty").css("border","1px solid #7e8993")):""==d?(a.push("fails"),$(b).find(".product_from_qty").css("border","1px solid red"),$(b).find(".product_from_qty").focus()):$(b).find(".product_from_qty").css("border","1px solid #7e8993");break;case"cart_item_product_sku":let p=$(b).find(".awdr-sku-validation").val(),q=$(b).find(".awdr-num-validation").val();0==p.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),""==q?(a.push("fails"),$(b).find(".awdr-num-validation").css("border","1px solid red"),$(b).find(".awdr-num-validation").focus()):$(b).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_tags":let r=$(b).find(".awdr-tag-validation").val(),s=$(b).find(".awdr-num-validation").val();0==r.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),""==s?(a.push("fails"),$(b).find(".awdr-num-validation").css("border","1px solid red"),$(b).find(".awdr-num-validation").focus()):$(b).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_products":let t=$(b).find(".awdr-product-validation").val(),u=$(b).find(".awdr-num-validation").val();0==t.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),""==u?(a.push("fails"),$(b).find(".awdr-num-validation").css("border","1px solid red"),$(b).find(".awdr-num-validation").focus()):$(b).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_category_combination":let v=$(b).find(".awdr-cat-validation").val(),e=$(b).find(".cat_from_qty").val(),w=$(b).find(".cat_to_qty").val(),x=$(b).find(".cat_combination_operator").val();0==v.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),"in_range"==x?""==e&&""==w?(a.push("fails"),$(b).find(".cat_from_qty").css("border","1px solid red"),$(b).find(".cat_from_qty").focus(),$(b).find(".cat_to_qty").css("border","1px solid red"),$(b).find(".cat_to_qty").focus()):($(b).find(".cat_from_qty").css("border","1px solid #7e8993"),$(b).find(".cat_to_qty").css("border","1px solid #7e8993")):""==e?(a.push("fails"),$(b).find(".cat_from_qty").css("border","1px solid red"),$(b).find(".cat_from_qty").focus()):$(b).find(".cat_from_qty").css("border","1px solid #7e8993");break;case"order_date":let y=$(b).find(".awdr-from-date").val(),z=$(b).find(".awdr-end-date").val();""==y&&""==z?(a.push("fails"),$(b).find(".awdr-from-date").css("border","1px solid red"),$(b).find(".awdr-from-date").focus(),$(b).find(".awdr-end-date").css("border","1px solid red"),$(b).find(".awdr-end-date").focus()):($(b).find(".awdr-from-date").css("border","1px solid #7e8993"),$(b).find(".awdr-end-date").css("border","1px solid #7e8993"));break;case"order_date_and_time":let A=$(b).find(".awdr-from-date").val(),B=$(b).find(".awdr-end-date").val();""==A&&""==B?(a.push("fails"),$(b).find(".awdr-from-date").css("border","1px solid red"),$(b).find(".awdr-from-date").focus(),$(b).find(".awdr-end-date").css("border","1px solid red"),$(b).find(".awdr-end-date").focus()):($(b).find(".awdr-from-date").css("border","1px solid #7e8993"),$(b).find(".awdr-end-date").css("border","1px solid #7e8993"));break;case"order_days":0==$(b).find(".wdr_order_days").val().length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993");break;case"order_time":let C=$(b).find(".wdr-from-time").val(),D=$(b).find(".wdr-to-time").val();""==C&&""==D?(a.push("fails"),$(b).find(".wdr-from-time").css("border","1px solid red"),$(b).find(".wdr-from-time").focus(),$(b).find(".wdr-to-time").css("border","1px solid red"),$(b).find(".wdr-to-time").focus()):($(b).find(".wdr-from-time").css("border","1px solid #7e8993"),$(b).find(".wdr-to-time").css("border","1px solid #7e8993"));break;case"purchase_last_order":0==$(b).find(".wdr-wc-order-status").val().length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993");break;case"purchase_last_order_amount":let E=$(b).find(".wdr-wc-order-status").val(),F=$(b).find(".float_only_field").val();0==E.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),""==F?(a.push("fails"),$(b).find(".float_only_field").css("border","1px solid red"),$(b).find(".float_only_field").focus()):$(b).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_previous_orders":let G=$(b).find(".wdr-wc-order-status").val(),H=$(b).find(".float_only_field").val();0==G.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),""==H?(a.push("fails"),$(b).find(".float_only_field").css("border","1px solid red"),$(b).find(".float_only_field").focus()):$(b).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_previous_orders_for_specific_product":let I=$(b).find(".wdr-wc-order-status").val(),J=$(b).find(".float_only_field").val(),K=$(b).find(".specific_product").val();0==K.length?(a.push("fails"),$(b).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid red"),$(b).find(".wdr-previous-order-product-selector .select2-selection").focus()):$(b).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid #7e8993"),0==I.length?(a.push("fails"),$(b).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid red"),$(b).find(".wdr-previous-order-product-status .select2-selection").focus()):$(b).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid #7e8993"),""==J?(a.push("fails"),$(b).find(".float_only_field").css("border","1px solid red"),$(b).find(".float_only_field").focus()):$(b).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_quantities_for_specific_product":let L=$(b).find(".wdr-wc-order-status").val(),M=$(b).find(".float_only_field").val(),N=$(b).find(".specific_product").val();N?$(b).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid #7e8993"):(a.push("fails"),$(b).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid red"),$(b).find(".wdr-previous-order-product-selector .select2-selection").focus()),0==L.length?(a.push("fails"),$(b).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid red"),$(b).find(".wdr-previous-order-product-status .select2-selection").focus()):$(b).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid #7e8993"),""==M?(a.push("fails"),$(b).find(".float_only_field").css("border","1px solid red"),$(b).find(".float_only_field").focus()):$(b).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_spent":let O=$(b).find(".wdr-wc-order-status").val(),P=$(b).find(".float_only_field").val();0==O.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),""==P?(a.push("fails"),$(b).find(".float_only_field").css("border","1px solid red"),$(b).find(".float_only_field").focus()):$(b).find(".float_only_field").css("border","1px solid #7e8993");break;case"shipping_city":case"shipping_zipcode":case"Billing_city":case"user_email":""==$(b).find(".awdr-validation").val()?(a.push("fails"),$(b).find(".awdr-validation").css("border","1px solid red"),$(b).find(".awdr-validation").focus()):$(b).find(".awdr-validation").css("border","1px solid #7e8993");break;case"shipping_country":0==$(b).find(".get_awdr_shipping_country").val().length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993");break;case"shipping_state":let Q=$(b).find(".get_awdr_shipping_state").val(),R=$(b).find(".get_awdr_state_based_country").val();0==Q.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"),0==R.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993");break;case"user_list":0==$(b).find(".wdr_user_list").val().length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993");break;case"user_role":0==$(b).find(".wdr_user_role").val().length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993")}}),a}function q(d,e="success",a=null){switch(e){case"error":var b="wdr-alert-error";break;case"warning":var b="wdr-alert-warning";break;default:var b="wdr-alert-success"}let c="wdr-notify-msg-"+a.counts,f='<div style="display: none;" class="wdr-alert '+b+'" id="'+c+'">'+d+"</div>";$("#notify-msg-holder").append(f);let g=$("#"+c);var h=a.counts;a.counts=parseInt(h)+parseInt(1),g.fadeIn(500),setTimeout(function(){g.fadeOut(500),g.remove()},5e3)}$(".edit-all-loaded-values").each(function(d,b){var a=$(b),c=wdr_data.lists[a.data("list")];a.selectWoo({width:"100%",escapeMarkup:function(a){return a},placeholder:a.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:c}),a.parent().find(".select2-search__field").css("width","100%")}),$("#wdr-save-rule").submit(function(a){if(a.preventDefault(),!function(f){let b=$(".awdr-product-discount-type").val(),c=[],d=[],a=[];switch(b){case"wdr_simple_discount":case"wdr_cart_discount":case"wdr_bulk_discount":case"wdr_set_discount":case"wdr_buy_x_get_x_discount":case"wdr_buy_x_get_y_discount":let e;c=(e=[],$(".wdr-filter-group").each(function(d,a){let b=$(a).find(".wdr-product-filter-type").val(),c=$(a).find(".awdr_validation").val();switch(b){case"all_products":case"product_on_sale":break;default:0==c.length?(e.push("fails"),$(a).find(".select2-selection").css("border","1px solid red"),$(a).find(".select2-selection").focus()):$(a).find(".select2-selection").css("border","1px solid #7e8993")}}),e),d=function e(d){let a=[];switch(d){case"wdr_simple_discount":let b=$(".product_discount_value").val();""!=b&&b?$(".product_discount_value").css("border","1px solid #7e8993"):(a.push("fails"),$(".product_discount_value").css("border","1px solid red"),$(".product_discount_value").focus());break;case"wdr_cart_discount":let c=$(".awdr_cart_discount_value").val();""!=c&&c?$(".awdr_cart_discount_value").css("border","1px solid #7e8993"):(a.push("fails"),$(".awdr_cart_discount_value").css("border","1px solid red"),$(".awdr_cart_discount_value").focus());break;case"wdr_free_shipping":break;case"wdr_bulk_discount":$(".bulk_range_setter").find(".awdr-bulk-group").each(function(g,b){let d=$(b).find(".bulk_discount_min").val(),e=$(b).find(".bulk_discount_max").val(),c=$(b).find(".bulk_discount_value").val();""==d&&""==e?(a.push("fails"),$(b).find(".bulk_discount_min").css("border","1px solid red"),$(b).find(".bulk_discount_min").focus(),$(b).find(".bulk_discount_max").css("border","1px solid red"),$(b).find(".bulk_discount_max").focus()):($(b).find(".bulk_discount_min").css("border","1px solid #7e8993"),$(b).find(".bulk_discount_max").css("border","1px solid #7e8993"));let f=parseInt(c);""==c||f<0?(a.push("fails"),$(b).find(".bulk_discount_value").css("border","1px solid red"),$(b).find(".bulk_discount_value").focus()):$(b).find(".bulk_discount_value").css("border","1px solid #7e8993")});break;case"wdr_set_discount":$(".set_range_setter").find(".bundle-set-range-main").each(function(e,b){let c=$(b).find(".set_discount_min").val(),d=$(b).find(".set_discount_value").val();""==c?(a.push("fails"),$(b).find(".set_discount_min").css("border","1px solid red"),$(b).find(".set_discount_min").focus()):$(b).find(".set_discount_min").css("border","1px solid #7e8993"),""==d?(a.push("fails"),$(b).find(".set_discount_value").css("border","1px solid red"),$(b).find(".set_discount_value").focus()):$(b).find(".set_discount_value").css("border","1px solid #7e8993")});break;case"wdr_buy_x_get_x_discount":$(".buyx_getx_range_setter").find(".buyx_getx_individual_range").each(function(h,b){let c=$(b).find(".bxgx-min").val(),d=$(b).find(".bxgx-max").val(),e=$(b).find(".bxgx-qty").val(),f=$(b).find(".buyx_getx_discount_select").val(),g=$(b).find(".bxgx-value").val();!0==$(b).find(".awdr-bogo-recurcive").prop("checked")&&(""==c?(a.push("fails"),$(b).find(".bxgx-min").css("border","1px solid red"),$(b).find(".bxgx-min").focus()):$(b).find(".bxgx-min").css("border","1px solid #7e8993")),""==c&&""==d?(a.push("fails"),$(b).find(".bxgx-min").css("border","1px solid red"),$(b).find(".bxgx-min").focus(),$(b).find(".bxgx-max").css("border","1px solid red"),$(b).find(".bxgx-max").focus()):($(b).find(".bxgx-min").css("border","1px solid #7e8993"),$(b).find(".bxgx-max").css("border","1px solid #7e8993")),""==e?(a.push("fails"),$(b).find(".bxgx-qty").css("border","1px solid red"),$(b).find(".bxgx-qty").focus()):$(b).find(".bxgx-qty").css("border","1px solid #7e8993"),"free_product"!=f&&""==g?(a.push("fails"),$(b).find(".bxgx-value").css("border","1px solid red"),$(b).find(".bxgx-value").focus()):$(b).find(".bxgx-value").css("border","1px solid #7e8993")});break;case"wdr_buy_x_get_y_discount":let f=$(".select_bxgy_type").val();$(".awdr_buyx_gety_range_setter").find(".buyx_gety_individual_range").each(function(k,b){let c=$(b).find(".bxgy-min").val(),d=$(b).find(".bxgy-max").val(),e=$(b).find(".bxgy-product-selector").val(),g=$(b).find(".bxgy-category-selector").val(),h=$(b).find(".bxgy-qty").val(),i=$(b).find(".buyx_gety_discount_select").val(),j=$(b).find(".bxgy-val").val();"bxgy_product"==f?0==e.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"):"bxgy_category"==f?0==g.length?(a.push("fails"),$(b).find(".select2-selection").css("border","1px solid red"),$(b).find(".select2-selection").focus()):$(b).find(".select2-selection").css("border","1px solid #7e8993"):"0"!=f&&f?$(".select_bxgy_type").css("border","1px solid #7e8993"):(a.push("fails"),$(".select_bxgy_type").css("border","1px solid red"),$(".select_bxgy_type").focus()),!0==$(b).find(".awdr-bogo-recurcive").prop("checked")&&(""==c?(a.push("fails"),$(b).find(".bxgy-min").css("border","1px solid red"),$(b).find(".bxgy-min").focus()):$(b).find(".bxgy-min").css("border","1px solid #7e8993")),""==c&&""==d?(a.push("fails"),$(b).find(".bxgy-min").css("border","1px solid red"),$(b).find(".bxgy-min").focus(),$(b).find(".bxgy-max").css("border","1px solid red"),$(b).find(".bxgy-max").focus()):($(b).find(".bxgy-min").css("border","1px solid #7e8993"),$(b).find(".bxgy-max").css("border","1px solid #7e8993")),""==h?(a.push("fails"),$(b).find(".bxgy-qty").css("border","1px solid red"),$(b).find(".bxgy-qty").focus()):$(b).find(".bxgy-qty").css("border","1px solid #7e8993"),"free_product"!=i&&""==j?(a.push("fails"),$(b).find(".bxgy-val").css("border","1px solid red"),$(b).find(".bxgy-val").focus()):$(b).find(".bxgy-val").css("border","1px solid #7e8993")});break;default:a.push("fails")}return a}(b),a=p();break;case"wdr_free_shipping":a=p()}return -1===c.indexOf("fails")&& -1===d.indexOf("fails")&& -1===a.indexOf("fails")}($(this)))return!1;let b=$(".woo_discount_loader");$.ajax({data:$(this).serialize(),type:"post",url:ajaxurl,beforeSend:function(){b.show()},complete:function(){b.hide()},error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(b){var a=b.data;if(b.success)void 0!=a.build_index&&m(a.build_index),a.redirect?(window.location.href=a.redirect,q(wdr_data.localization_data.save_rule,"success",i)):($(".wdr_desc_text.coupon_error_msg").hide(),$(".coupon_name_msg").css("border",""),q(wdr_data.localization_data.save_rule,"success",i));else if(a.coupon_message)$(".coupon_name_msg").css("border","1px solid #FF0000").focus(),q(wdr_data.localization_data.coupon_exists,"error",i);else for(let[c,d]of Object.entries(a))a.hasOwnProperty(c)&&d.forEach(function(a){q(a,"error",i)})}})}),$(document).on("click",".wdr_save_close",function(){$("input[name=wdr_save_close]").val("1"),$(".wdr_save_stay").click()}),$("#configuration-form").submit(function(a){a.preventDefault();let b=$(this).serialize(),c=$(".woo_discount_loader");$.ajax({data:b,type:"post",url:ajaxurl,beforeSend:function(){c.show()},complete:function(){c.hide()},error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(a){switch(a.data.save_popup){case"alert_in_popup":"alert_in_popup"==a.data.save_popup&&"passed"==a.data.security_pass?($(".awdr-save-green").show(),setTimeout(function(){$(".awdr-save-green").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=settings")},2e3)):"alert_in_popup"==a.data.save_popup&&"fails"==a.data.security_pass&&($(".awdr-error-red").show(),setTimeout(function(){$(".awdr-error-red").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=settings")},2e3));break;case"alert_in_normal":"alert_in_normal"==a.data.save_popup&&"passed"==a.data.security_pass?(q(wdr_data.localization_data.save_settings,"success",i),setTimeout(function(){window.location.replace(wdr_data.admin_url+"&tab=settings")},1e3)):"alert_in_normal"==a.data.save_popup&&"fails"==a.data.security_pass&&(q(wdr_data.localization_data.error,"error",i),setTimeout(function(){window.location.replace(wdr_data.admin_url+"&tab=settings")},1e3));break;default:$(".awdr-error-red").show(),q(wdr_data.localization_data.error,"error",i),setTimeout(function(){$(".awdr-error-red").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=settings")},1e3)}}})}),$("#awdr_advanced_configuration_form").submit(function(a){a.preventDefault();let b=$(this).serialize(),c=$(".woo_discount_loader");$.ajax({data:b,type:"post",url:ajaxurl,beforeSend:function(){c.show()},complete:function(){c.hide()},error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(a){"passed"==a.data.security_pass?($(".awdr-save-green").show(),setTimeout(function(){$(".awdr-save-green").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=advanced_section")},2e3)):"fails"==a.data.security_pass&&($(".awdr-error-red").show(),setTimeout(function(){$(".awdr-error-red").fadeOut(500),window.location.replace(wdr_data.admin_url+"&tab=advanced_section")},2e3))}})}),$(document).on("click",".bulk-table-customized-setting",function(){$("input[name=customizer_save_alert]").val("1"),$(".save-configuration-submit").click()}),$("#sort_customizable_table").dragtable({persistState:function(a){a.el.find("th").each(function(b){""!=this.id&&(a.sortOrder[this.id]=b,"customize-bulk-table-title"==this.id?$(".customize_bulk_table_title").val(b):"customize-bulk-table-discount"==this.id?$(".customize_bulk_table_discount").val(b):"customize-bulk-table-range"==this.id&&$(".customize_bulk_table_range").val(b))})}}),$("#wdr-bulk-action-top").submit(function(c){if(c.preventDefault(),!($('input[name="saved_rules[]"]:checked').length>0))return!1;{let b=$("#bulk-action-selector-top").val(),a;if("enable"==b)a=confirm("Are you sure to enable the selected rules?");else if("disable"==b)a=confirm("Are you sure to disable the selected rules?");else{if("delete"!=b)return!1;a=confirm("Are you sure to delete the selected rules?")}if(!1==a)return!1}let d=$(".woo_discount_loader");$.ajax({data:$(this).serialize(),type:"post",url:ajaxurl,beforeSend:function(){d.show()},complete:function(){d.hide()},error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(a){"disabled"==a.disable?q(wdr_data.localization_data.disabled_rule,"success",i):"enabled"==a.enable?q(wdr_data.localization_data.enabled_rule,"success",i):"deleted"==a.delete?q(wdr_data.localization_data.deleted_rule,"success",i):q(wdr_data.localization_data.error,"error",i),window.location.replace(wdr_data.admin_url)}})}),$("#wdr-search-top").submit(function(b){b.preventDefault();var a=$(this).serializeArray(),c=a[0].value,d=a[1].value;window.location.replace(c+"&name="+d)}),$(document).on("keypress keyup blur",".float_only_field",function(a){$(this).val($(this).val().replace(/[^0-9\.]/g,"")),(46!==a.which|| -1!==$(this).val().indexOf("."))&&(a.which<48||a.which>57)&&a.preventDefault()}),$(document).on("keypress keyup blur",".number_only_field",function(a){(a.which<48||a.which>57)&&a.preventDefault()}),$('[data-class="start_dateonly"]').datetimepicker({timepicker:!1,format:"Y-m-d",onShow:function(a){this.setOptions({maxDate:!!$('[data-class="end_dateonly"]').val()&&$('[data-class="end_dateonly"]').val()})}}),$('[data-class="end_dateonly"]').datetimepicker({timepicker:!1,format:"Y-m-d",onShow:function(a){this.setOptions({minDate:!!$('[data-class="start_dateonly"]').val()&&$('[data-class="start_dateonly"]').val()})}}),$('[data-class="start_datetimeonly"]').datetimepicker({timepicker:!0,format:"Y-m-d H:i",onShow:function(a){this.setOptions({maxDate:!!$('[data-class="end_datetimeonly"]').val()&&$('[data-class="end_datetimeonly"]').val()})}}),$('[data-class="end_datetimeonly"]').datetimepicker({timepicker:!0,format:"Y-m-d H:i",onShow:function(a){this.setOptions({minDate:!!$('[data-class="start_datetimeonly"]').val()&&$('[data-class="start_datetimeonly"]').val()})}}),$(".wdr_time_picker").datetimepicker({datepicker:!1,format:"H:i"}),$(document).on("change",".wdr-bulk-type",function(){"product_selected_categories"==$(this).val()?$(".wdr-bulk-cat-selector").show():$(".wdr-bulk-cat-selector").hide()}),$(".settings_option_show_hide").click(function(){var a=$(this).data("name");"1"==$(this).val()?($("."+a).show(),"hide_table_position"==a&&$(".wdr-popup-link").show()):($("."+a).hide(),"hide_table_position"==a&&$(".wdr-popup-link").hide())}),$(".bulk_table_customizer_preview").click(function(){var a=$(this).data("colname");"show"==$(this).data("showhide")?$("."+a).show():$("."+a).hide()}),$(".settings_option_show_hide_on_change").change(function(){"disabled"==$(this).val()?$(".display_you_saved_text").hide():$(".display_you_saved_text").show()}),$(document).on("change",".wdr-rules-select",function(){var a=$(".wdr-rules-select"),b=$(this).val();"off"==b?(a.val("on"),$(".wdr-rules-selector").prop("checked",!0)):"on"==b&&(a.val("off"),$(".wdr-rules-selector").prop("checked",!1))}),$(document).on("change",".wdr-rules-selector",function(){var a=$(".wdr-rules-select"),b=$(".wdr-ruleboard input:checkbox").length,c=$(".wdr-ruleboard input:checkbox:checked").length;b==c?(a.val("on"),a.prop("checked",!0)):b!=c&&(a.val("off"),a.prop("checked",!1))}),document.getElementById("ruleHeader");var a,e=!1;function f(){$("#sortable").sortable({handle:".awdr-sortable-handle",delay:150,stop:function(b,c){var a=new Array;$("#sortable>tr").each(function(){a.push($(this).attr("id"))}),r(a)}})}function r(a){$.ajax({data:{position:a,method:"update_priority_order",action:"wdr_ajax",awdr_nonce:$("input[name=awdr_rule_list_nonce]").val()},type:"post",url:ajaxurl,error:function(a,b){q(wdr_data.localization_data.error,"error",i)},success:function(a){!1===a?q(wdr_data.localization_data.error,"error",i):q(wdr_data.localization_data.save_priority,"success",i)}})}(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))&&(e=!0),$(window).width()>1024?!0==e?f():$("#sortable").sortable({delay:150,stop:function(b,c){var a=new Array;$("#sortable>tr").each(function(){a.push($(this).attr("id"))}),r(a)}}):f(),$("#sortable").disableSelection(),$(document).on("click",".help-popup",function(){var a="#"+$(this).attr("data-id");$(a).dialog({modal:!0,closeText:""})}),$(document).on("click",".remove-clicked-discount-block",function(){var a=$(this).data("showblock"),b=$(this).data("removeval"),c=$(this).data("removeopt");$("."+a).hide(),$("."+b).removeAttr("value"),$("."+c).prop("selectedIndex",0),$("[data-dtype="+a+"]").show(),"wdr-bulk-discount"==a&&($(".bulk_product_category_selector option:selected").remove(),$(".wdr-bulk-cat-selector").hide())}),$(".wdr-btn-add-message").click(function(){wdr_buildrule.show_hide_rule_block({showBlockId:".wdr-advanced-layout-block",hideBlockId:".wdr-discount-template, .wdr-filter-block",thisObject:this})});var b=$(".bulk-min").length;if(b>=2){var c=$(".bulk_discount_min").val(),h=$(".bulk_discount_max").val(),d=$(".bulk_discount_value").val();(c||h||d)&&$(".adv-msg-min-qty, .adv-msg-max-qty").show()}var b=$(".set-min").length;if(b>=2){var c=$(".set_discount_min").val(),d=$(".set_discount_value").val();(c||d)&&($(".adv-msg-min-qty").show(),$(".adv-msg-max-qty").hide())}function s(){$(".wdr-condition-group").each(function(c,b){let a=$(b).find(".wdr-product-condition-type").val();void 0!==a&&"cart_item_product_onsale"===a&&$(this).remove()})}$(".popup_table_discount_column_value").click(function(){1==$(this).val()?($(".wdr_table_discounted_value").show(),$(".wdr_table_discounted_price").hide()):($(".wdr_table_discounted_value").hide(),$(".wdr_table_discounted_price").show())}),$(".modal-trigger").click(function(a){a.preventDefault(),dataModal=$(this).attr("data-modal"),$("#"+dataModal).css({display:"block"})}),$(".close-modal, .modal-sandbox").click(function(){$(".modal").css({display:"none"})}),$("#badge_colorpicker").on("change",function(){$("#badge_hexcolor").val(this.value)}),$("#badge_hexcolor").on("change",function(){$("#badge_colorpicker").val(this.value)}),$("#text_colorpicker").on("change",function(){$("#text_hexcolor").val(this.value)}),$("#text_hexcolor").on("change",function(){$("#text_colorpicker").val(this.value)}),$("#awdr_shortcode_copy_btn").on("click",function(){b="#awdr_shortcode_text",c=$("<input>"),$("body").append(c),c.val($(b).text()).select(),document.execCommand("copy"),c.remove();var b,c,a=$(this);a.html(wdr_data.localization_data.copied),setTimeout(function(){a.html(wdr_data.localization_data.copy_shortcode)},2e3)}),$(".tips, .help_tip, .woocommerce-help-tip").tipTip({attribute:"data-tip",fadeIn:50,fadeOut:50,delay:200}),$(".awdr_popup_col_name_text_box").keyup(function(){var a=$(this).val(),b=$(this).data("keyup");$("."+b).html(a)}),$(".awdr_popup_col_name_text_box").blur(function(){var a=$(this).val(),b=$(this).data("keyup");$("."+b).html(a)}),$(".apply_product_and_cart_discount_to").change(function(){let a=$(this).data("subsequent");"all"==$(this).val()?$("."+a).show():$("."+a).hide()}),$(document).on("change",".awdr-bogo-discount-type",function(){let c=$(this).val(),a=$(this).attr("data-parent"),b=$(this).attr("data-siblings");switch(c){case"flat":$(this).parent("."+a).siblings("."+b).show(),$(this).parent("."+a).siblings("."+b).find(".wdr_desc_text").text(wdr_data.localization_data.buyx_getx_value);break;case"percentage":$(this).parent("."+a).siblings("."+b).show(),$(this).parent("."+a).siblings("."+b).find(".wdr_desc_text").text(wdr_data.localization_data.buyx_getx_percentage);break;default:$(this).parent("."+a).siblings("."+b).hide()}}),$(document).on("change",".awdr-bogo-recurcive",function(){let c=$(this).attr("data-recursive-row"),a=$(this).attr("data-recursive-parent"),d=$(this).attr("data-hide-add-range"),b=$(this).attr("data-bogo-max-range"),e=$(this).attr("data-bogo-min-range"),f=$(this).attr("data-bogo-border"),h=$("."+c).length,g=$(this).attr("data-ranges-row-parent");if(!1==$(this).prop("checked")){$(this).parents("."+g).siblings("."+d).show(),""!=b&&($(this).parents("."+a).siblings("."+b).show(),$(this).parents("."+a).siblings().find("."+b).show()),$(this).parents("."+a).siblings("."+e).find(".wdr_desc_text").text(wdr_data.localization_data.recursive_min_qty),$("."+f).css("border-bottom","1px solid #ddd");return}h>3&&(confirm(wdr_data.localization_data.recursive_warning)?$(this).parents("."+c).siblings().remove():$(this).prop("checked",!1)),!0==$(this).prop("checked")&&($(this).parents("."+g).siblings("."+d).hide(),""!=b&&($(this).parents("."+a).siblings("."+b).hide(),$(this).parents("."+a).siblings().find("."+b).hide()),$(this).parents("."+a).siblings("."+e).find(".wdr_desc_text").text(wdr_data.localization_data.recursive_qty),$("."+f).css("border-bottom","unset"))}),$(document).on("change",".awdr_mode_of_operator",function(){let a=$(this).val();if("wdr_buy_x_get_y_discount"==$(".awdr-product-discount-type").val()){"variation"==a?($(".awdr-bxgy-dynamic-tip").attr("title",wdr_data.localization_data.bulk_variants_discount_description_tool_tip),$(".awdr-example").html(wdr_data.localization_data.mode_variation_cumulative_example)):"product"==a?($(".awdr-bxgy-dynamic-tip").attr("title",wdr_data.localization_data.bulk_individual_product_discount_description_tool_tip),$(".awdr-example").html("")):($(".awdr-bxgy-dynamic-tip").attr("title",wdr_data.localization_data.bulk_filter_together_discount_description_tool_tip),$(".awdr-example").html(""));return}"variation"==a?($(".awdr-discount-content").html(wdr_data.localization_data.bulk_variants_discount_description),$(".awdr-example").html(wdr_data.localization_data.mode_variation_cumulative_example)):"product"==a?($(".awdr-discount-content").html(wdr_data.localization_data.bulk_individual_product_discount_description),$(".awdr-example").html("")):($(".awdr-discount-content").html(wdr_data.localization_data.bulk_filter_together_discount_description),$(".awdr-example").html(""))}),$(document).on("change",".awdr-product-discount-type",function(){$(".awdr-example").html("");var c=$(this).data("placement");let a=$(this).val(),b="awdr_doc_";switch(a){case"wdr_simple_discount":$("."+b+a).show(),$(".awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_cart_discount":$("."+b+a).show(),$(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_free_shipping":$("."+b+a).show(),$(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_bulk_discount":$("."+b+a).show(),$(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_set_discount":$("."+b+a).show(),$(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_buy_x_get_x_discount":$("."+b+a).show(),$(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide();break;case"wdr_buy_x_get_y_discount":$("."+b+a).show(),$(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount").hide();break;default:$(".awdr_doc_wdr_simple_discount,.awdr_doc_wdr_cart_discount,.awdr_doc_wdr_free_shipping,.awdr_doc_wdr_bulk_discount,.awdr_doc_wdr_set_discount,.awdr_doc_wdr_buy_x_get_x_discount,.awdr_doc_wdr_buy_x_get_y_discount").hide()}"not_selected"!=$(this).val()&&"wdr_free_shipping"!=$(this).val()?(wdr_buildrule.wdr_clone_field({addFilterMethod:"."+$(this).val(),ruleAppendTo:"."+c,addDiscountType:"enable"}),$(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||$(".awdr-free-shipping-special-condition").addClass("wdr-hide"),s(),$(".calculate_cart_from option[value='from_filter']").show(),$(".adv-msg-discount, .adv-msg-discount-price").show(),$(".awdr-hidden-new-rule").fadeIn(500),$(".awdr-filter-section").fadeIn(500),$("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!1).removeClass("wdr_save_btn_disabled"),n($("."+c).find('[data-field="autocomplete"]')),$(".awdr-discount-container").show(),$("."+c).find(".bulk_range_setter_group").addClass("bulk_range_setter").attr("id","bulk_adjustment_sortable"),$("."+c).find(".set_range_setter_group").addClass("set_range_setter").attr("id","bulk_adjustment_sortable"),$(window).width()>1024?!0==e?$("#bulk_adjustment_sortable").sortable({handle:".awdr-sortable-handle"}):$("#bulk_adjustment_sortable").sortable():$("#bulk_adjustment_sortable").sortable({handle:".awdr-sortable-handle"}),$("#bulk_adjustment_sortable").disableSelection(),$(".awdr-filter-heading").html(wdr_data.localization_data.common_filter_heading),$(".awdr-filter-content").html(wdr_data.localization_data.common_filter_description),$(".awdr-discount-heading").html(wdr_data.localization_data.common_discount_heading),$(".awdr-discount-content").html(wdr_data.localization_data.common_discount_description),$(".awdr-rules-content").html(wdr_data.localization_data.common_rules_description),"wdr_buy_x_get_y_discount"==$(this).val()&&($(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||$(".awdr-free-shipping-special-condition").addClass("wdr-hide"),s(),$(".awdr-discount-heading").html(wdr_data.localization_data.two_column_bxgy_discount_heading),n($("."+c).find('[data-list="product_category"]')),$(".adv-msg-min-qty, .adv-msg-max-qty, .adv-msg-discount, .adv-msg-discount-price").hide()),"wdr_buy_x_get_x_discount"==$(this).val()&&($(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||$(".awdr-free-shipping-special-condition").addClass("wdr-hide"),s(),$(".adv-msg-min-qty, .adv-msg-max-qty, .adv-msg-discount, .adv-msg-discount-price").hide()),"wdr_bulk_discount"==$(this).val()?($(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||$(".awdr-free-shipping-special-condition").addClass("wdr-hide"),s(),$(".awdr-discount-heading").html(wdr_data.localization_data.two_column_bulk_discount_heading),$(".awdr_mode_of_operator").trigger("change"),$(".adv-msg-min-qty, .adv-msg-max-qty, .adv-msg-discount, .adv-msg-discount-price").show()):"wdr_set_discount"==$(this).val()&&($(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||$(".awdr-free-shipping-special-condition").addClass("wdr-hide"),s(),$(".awdr_mode_of_operator").trigger("change"),$(".awdr-discount-heading").html(wdr_data.localization_data.two_column_set_discount_heading),$(".adv-msg-min-qty, .adv-msg-discount, .adv-msg-discount-price").show(),$(".adv-msg-max-qty").hide())):"wdr_free_shipping"==$(this).val()?($(".awdr-free-shipping-special-condition").removeClass("wdr-hide"),$(".awdr-hidden-new-rule").fadeIn(500),$(".awdr-filter-section").fadeOut(),$("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!1).removeClass("wdr_save_btn_disabled"),$("."+c).html(""),$(".awdr-discount-container").hide(),$(".adv-msg-min-qty, .adv-msg-max-qty, .adv-msg-discount, .adv-msg-discount-price").hide(),$(".calculate_cart_from option[value='from_filter']").hide()):($(".awdr-free-shipping-special-condition").hasClass("wdr-hide")||$(".awdr-free-shipping-special-condition").addClass("wdr-hide"),s(),$("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!0).addClass("wdr_save_btn_disabled"),$(".awdr-hidden-new-rule").fadeOut(500)),$(this).trigger("advanced_woo_discount_rules_on_change_adjustment_type",[$(this).val()])}),$(".awdr-product-discount-type").trigger("change"),"view"==wdr_data.rule_id?$("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!1).removeClass("wdr_save_btn_disabled"):$("button.wdr_save_stay, button.wdr_save_close").attr("disabled",!0).addClass("wdr_save_btn_disabled"),$(document).on("change",".apply_fee_coupon_checkbox",function(){!0==$(this).prop("checked")?$(this).parents(".awdr_rtl_compatible").siblings(".apply_fee_coupon_label").show():$(this).parents(".awdr_rtl_compatible").siblings(".apply_fee_coupon_label").hide()}),$(document).on("change",".bulk_table_customizer_show_hide_column",function(){var a=$(this).data("colname");!0==$(this).prop("checked")?$("."+a).show():$("."+a).hide()});var g=document.getElementsByClassName("awdr-accordion");for(a=0;a<g.length;a++)g[a].addEventListener("click",function(b){b.preventDefault(),this.classList.toggle("awdr-accordion-active");var a=this.nextElementSibling;"block"===a.style.display?$(a).slideUp(1e3):$(a).slideDown(1e3)});$(document).on("change",".on_sale_badge_condition",function(){"disabled"===$(this).val()?($(".sale_badge_toggle").hide(),$(".sale_badge_customizer,.sale_badge_percentage_customizer").hide()):($(".sale_badge_toggle").show(),!0==$("#customize_on_sale_badge").prop("checked")?($(".sale_badge_customizer").show(),$(".display_percentage_on_sale_badge_con").show()):($(".sale_badge_customizer").hide(),$("#display_percentage_on_sale_badge").prop("checked",!1).trigger("change"),$(".display_percentage_on_sale_badge_con").hide()),!0==$("#display_percentage_on_sale_badge").prop("checked")?$(".sale_badge_percentage_customizer").show():$(".sale_badge_percentage_customizer").hide())}),$(document).on("change","#customize_on_sale_badge",function(){!0==$(this).prop("checked")?($(".sale_badge_customizer").show(),$(".display_percentage_on_sale_badge_con").show()):($(".sale_badge_customizer").hide(),$("#display_percentage_on_sale_badge").prop("checked",!1).trigger("change"),$(".display_percentage_on_sale_badge_con").hide())}),$(document).on("change","#display_percentage_on_sale_badge",function(){!0==$(this).prop("checked")?$(".sale_badge_percentage_customizer").show():$(".sale_badge_percentage_customizer").hide()}),$(document).on("change","#badge_colorpicker",function(){let a=$(this).val();$(".awdr_admin_discount_bar").css("background-color",a)}),$(document).on("change","#badge_hexcolor",function(){let a=$(this).val();$(".awdr_admin_discount_bar").css("background-color",a)}),$(document).on("change","#text_colorpicker",function(){let a=$(this).val();$(".awdr_admin_discount_bar").css("color",a)}),$(document).on("change","#text_hexcolor",function(){let a=$(this).val();$(".awdr_admin_discount_bar").css("color",a)}),$(document).on("change","#awdr_discount_bar_content",function(){let a=$(this).val();$(".awdr_admin_discount_bar").html(a)}),$(document).on("click",".awdr-hidden-search",function(){let a=$(".awdr-hidden-name").val();$(".wdr-rule-search-key").val(a),$("#wdr-search-top").submit()}),$(document).on("change","#select_usage_limits",function(){let a=$("#select_usage_limits").val();if(""==a)$(".awdr-rule-limit-disabled-outer .rule_limit_msg_outer").hide(),$(".awdr-rule-limit-disabled").hide();else{var b=$(".awdr-used-limit-total").html();a<=parseInt(b)?($(".awdr-rule-limit-disabled").hide(),$(".awdr-rule-limit-disabled-outer").show(),$(".awdr-rule-limit-disabled-outer .rule_limit_msg_outer").html(wdr_data.localization_data.invalid_rule_limit)):($(".awdr-rule-limit-disabled").hide(),$(".awdr-rule-limit-disabled-outer").hide())}}),$("#awdr-import-csv").on("submit",function(){return!!new RegExp("([a-zA-Z0-9s_\\.-:])+(.csv)$").test($("#awdr-file-uploader").val().toLowerCase())||($("#awdr-upload-response").html(wdr_data.localization_data.invalid_file_type),!1)}),$(document).on("change",".get_awdr_state_based_country",function(){let a=$(this).val();if(!a||""==a||0==a.length)return!1;let b=$(this).parents(".wdr-conditions-container").attr("data-index"),e=$(this).parents(".wdr_shipping_state_group"),f=$(this).parent().siblings(".wdr-shipping-state-value"),g=$(".woo_discount_loader"),c=$(this).parent().siblings(".wdr-shipping-state-value").find(".get_awdr_shipping_state").val();var d={action:"wdr_ajax",method:"get_state_details",selected_country:a,selected_state:c,selected_index:b,awdr_nonce:$("input[name=wdr_ajax_select2]").val()||""};$.ajax({url:ajaxurl,data:d,type:"POST",beforeSend:function(){g.show()},complete:function(){g.hide()},success:function(a){f.remove(),e.append("<div class='wdr-shipping-state-value wdr-select-filed-hight wdr-search-box' style='width: min-content;'>"+a.data+"<span class='wdr_select2_desc_text'>"+wdr_data.localization_data.select_state+"</span> </div>"),$(".append-preloaded-values").selectWoo()},error:function(a){console.log("error")}})}),$(".get_awdr_state_based_country").trigger("change"),$(document).on("change",".wdr_copon_type",function(){var a=$(this).val();"custom_coupon"===a?($(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one, .wdr-cart-coupon-url-all").css("display","none"),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom").css("display","block")):"at_least_one"===a?($(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom, .wdr-cart-coupon-url-all").css("display","none"),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one").css("display","block")):"all"===a&&($(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom, .wdr-cart-coupon-url-one").css("display","none"),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-all").css("display","block"))}),$(document).on("click",".wdr-copy-coupon-url",function(a){a.preventDefault(),$(this).parents(".wdr-coupon-url-group").find("input[type=url]").select(),document.execCommand("copy")?($(this).html(wdr_data.localization_data.coupon_url_copied),q(wdr_data.localization_data.coupon_url_success,"success",i)):q(wdr_data.localization_data.error,"error",i)}),$(document).on("change",".wdr-cart-coupon-url-enable",function(a){a.preventDefault(),$(this).closest(".wdr-cart-coupon-url").find(".wdr-cart-coupon-url-lists").slideToggle()}),$(document).on("change keyup",".wdr-cart-coupon-value input",function(){var b=wdr_data.home_url,a=$(this).val();""!==a?($group='<span class="wdr-coupon-url-group"><label>',$group+=' <input type="url" value="'+b+"?wdr_coupon="+encodeURIComponent(a)+'"></label>',$group+='<button class="wdr-copy-coupon-url">'+wdr_data.localization_data.coupon_url_copy+"</button></span>",$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom").html($group),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom").css("display","block")):$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-custom").css("display","none")}),$(document).on("change",".wdr-cart-coupon-search select, select.wdr_copon_type",function(){var a=wdr_data.home_url,b=$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search select").val(),c=$(this).parents(".wdr_cart_coupon_group").find("select.wdr_copon_type").val();if(0!==b.length){if("at_least_one"===c)$groups="",b.forEach(function(b){$groups+='<span class="wdr-coupon-url-group"><label>',$groups+=' <input type="url" value="'+a+"?wdr_coupon="+encodeURIComponent(b)+'"></label>',$groups+='<button class="wdr-copy-coupon-url">'+wdr_data.localization_data.coupon_url_copy+"</button></span><br>"}),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one").html($groups),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one").css("display","block");else if("all"===c){var d="";a+="?wdr_coupon=",b.forEach(function(b){d+=b+", ",a+=encodeURIComponent(b)+","}),d=d.replace(/(^, )|(, $)/g,""),a=a.replace(/(^,)|(,$)/g,""),$group='<span class="wdr-coupon-url-group"><label>',$group+=' <input type="url" value="'+a+'"></label>',$group+='<button class="wdr-copy-coupon-url">'+wdr_data.localization_data.coupon_url_copy+"</button></span>",$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-all").html($group),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-all").css("display","block")}}else $(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-one").css("display","none"),$(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-url-all").css("display","none")})})
v2/Assets/Js/awdr-dynamic-price.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){t.extend({AdvanceWooDiscountRules:{form:null,product_id:null,quantity:0,options:[],target:null,getDynamicDiscountPriceFromCartForm:function(t,o,r){void 0!==r&&(this.options=r),void 0!==o&&(this.target=o),void 0!==t&&t.is("form")?this.form=t:this.logError("Incorrect form provided"),this.product_id=this.getProductIdFromForm(),this.quantity=this.getProductQuantityFromForm(),this.getDiscountPriceForProduct()},getDiscountPriceForProduct:function(){if(null===this.product_id||0==this.product_id)return this.logError("Invalid product"),[];var o={action:"awdr_get_product_discount",product_id:this.product_id,qty:this.quantity,awdr_nonce:awdr_params.nonce};void 0!==this.options.custom_price&&(o.custom_price=this.options.custom_price);var r=this.target,i=this.options;t.ajax({url:awdr_params.ajaxurl,data:o,type:"POST",success:function(o){t(document.body).trigger("advanced_woo_discount_rules_on_get_response_for_dynamic_discount",[o,r,i])},error:function(t){}})},getProductIdFromForm:function(){var t=this.form.find('[name="variation_id"]'),o=this.form.find('[name="add-to-cart"]');return t.length?parseInt(t.val()):!!o.length&&parseInt(o.val())},getProductQuantityFromForm:function(){var t=this.form.find('input[name="quantity"]');return 0===t.length?0:t.val()},logError:function(t){console.error("Advance discount rule error: %s",t)}}})}(jQuery);
1
+ !function($){$.extend({AdvanceWooDiscountRules:{form:null,product_id:null,quantity:0,options:[],target:null,getDynamicDiscountPriceFromCartForm:function(a,b,c){void 0!==c&&(this.options=c),void 0!==b&&(this.target=b),void 0!==a&&a.is("form")?this.form=a:this.logError("Incorrect form provided"),this.product_id=this.getProductIdFromForm(),this.quantity=this.getProductQuantityFromForm(),this.getDiscountPriceForProduct()},getDiscountPriceForProduct:function(){if(null===this.product_id||0==this.product_id)return this.logError("Invalid product"),[];var a={action:"awdr_get_product_discount",product_id:this.product_id,qty:this.quantity,awdr_nonce:awdr_params.nonce};void 0!==this.options.custom_price&&(a.custom_price=this.options.custom_price);var b=this.target,c=this.options;$.ajax({url:awdr_params.ajaxurl,data:a,type:"POST",success:function(a){$(document.body).trigger("advanced_woo_discount_rules_on_get_response_for_dynamic_discount",[a,b,c])},error:function(a){}})},getProductIdFromForm:function(){var a=this.form.find('[name="variation_id"]'),b=this.form.find('[name="add-to-cart"]');return a.length?parseInt(a.val()):!!b.length&&parseInt(b.val())},getProductQuantityFromForm:function(){var a=this.form.find('input[name="quantity"]');return 0===a.length?0:a.val()},logError:function(a){console.error("Advance discount rule error: %s",a)}}})}(jQuery)
v2/Assets/Js/awdr_recipe.min.js CHANGED
@@ -1 +1 @@
1
- jQuery(document).ready(function(r){r(".awdr_recipe_main_card").click(function(){let e=r(this).attr("data-recipe-group");r("."+e).show(),r(".awdr_recipe_main_card").each(function(a,t){let c=r(t).attr("data-recipe-group");e!=c?(r("."+c).hide(),r(t).css({"background-color":"#ffffff",color:"#444444"})):r(t).css({"background-color":"#6495ed",color:"#ffffff"})})}),r(document).on("click",".awdr_recipe_content",function(){var e=r(this).attr("data-recipe-nonce"),a=r(this).attr("data-select-recipe"),t=r(this).next();r.ajax({data:{method:"create_rule_recipe",action:"wdr_ajax",awdr_nonce:e,awdr_recipe_type:a},type:"post",url:ajaxurl,error:function(r,e){notify(wdr_data.localization_data.error,"error",alert_counter)},success:function(e){var a=e.data;e.success?a.redirect&&0!=parseInt(a.rule_id)?(t.attr("href",a.redirect),t.show(),t.css({"background-color":"#f3f5f6",color:"#0071a1","border-color":"#7e8993"})):(r(".wdr_desc_text.coupon_error_msg").hide(),r(".coupon_name_msg").css("border",""),notify(wdr_data.localization_data.save_rule,"success",alert_counter)):notify(wdr_data.localization_data.save_priority,"success",alert_counter)}})})});
1
+ jQuery(document).ready(function($){$(".awdr_recipe_main_card").click(function(){let a=$(this).attr("data-recipe-group");$("."+a).show(),$(".awdr_recipe_main_card").each(function(d,b){let c=$(b).attr("data-recipe-group");a!=c?($("."+c).hide(),$(b).css({"background-color":"#ffffff",color:"#444444"})):$(b).css({"background-color":"#6495ed",color:"#ffffff"})})}),$(document).on("click",".awdr_recipe_content",function(){var a=$(this).attr("data-recipe-nonce"),b=$(this).attr("data-select-recipe"),c=$(this).next();$.ajax({data:{method:"create_rule_recipe",action:"wdr_ajax",awdr_nonce:a,awdr_recipe_type:b},type:"post",url:ajaxurl,error:function(a,b){notify(wdr_data.localization_data.error,"error",alert_counter)},success:function(b){var a=b.data;b.success?a.redirect&&0!=parseInt(a.rule_id)?(c.attr("href",a.redirect),c.show(),c.css({"background-color":"#f3f5f6",color:"#0071a1","border-color":"#7e8993"})):($(".wdr_desc_text.coupon_error_msg").hide(),$(".coupon_name_msg").css("border",""),notify(wdr_data.localization_data.save_rule,"success",alert_counter)):notify(wdr_data.localization_data.save_priority,"success",alert_counter)}})})})
v2/Assets/Js/rulebuilder.min.js CHANGED
@@ -1 +1 @@
1
- var wdr_buildrule;!function(e){wdr_buildrule={wdr_clone_field:function(l){var d=e.extend({addFilterType:null,addFilterMethod:null,ruleAppendTo:null,addConditionType:null,addRemoveIcon:null,addDiscountElement:null,addDiscountType:null,newIndex:null},l),n=e(d.addRemoveIcon).html(),i=e(d.addFilterMethod).html();if(null===d.addDiscountElement&&null!==d.addFilterType&&null!==d.addFilterMethod&&null!==d.ruleAppendTo){var o=e(d.addFilterType).html();o=o.replace(new RegExp("{i}","g"),d.newIndex),i=i.replace(new RegExp("{i}","g"),d.newIndex),e(d.ruleAppendTo).append('<div class="wdr-grid wdr-filter-group" data-index="'+d.newIndex+'">'+o+i+n+"</div>")}else if(null===d.addDiscountType&&null===d.addDiscountElement&&null===d.addFilterType&&null!==d.addFilterMethod&&null!==d.ruleAppendTo&&null===d.addConditionType)i=i.replace(new RegExp("{i}","g"),d.newIndex),e(d.ruleAppendTo).append(i+n);else if(null===d.addDiscountElement&&null!==d.addConditionType&&null!==d.addFilterMethod&&null!==d.ruleAppendTo){var t=e(d.addConditionType).html();let l="",i="";var a=e(d.addFilterMethod).html();a=a.replace(new RegExp("{i}","g"),d.newIndex),t&&"undefined"!=t?(t=t.replace(new RegExp("{i}","g"),d.newIndex),e(d.ruleAppendTo).append('<div class="'+i+' wdr-conditions-container wdr-condition-group" style="'+l+'" data-index="'+d.newIndex+'">'+t+a+n+"</div>")):(t="",l="display:none",i="promo_show_hide_"+d.newIndex,n="",e(d.ruleAppendTo+" [data-index='"+d.newIndex+"']").after('<div class="'+i+' wdr-conditions-container wdr-condition-group" style="'+l+'" data-index="'+d.newIndex+'">'+t+a+n+"</div>"))}else null==d.addDiscountType&&null!==d.addDiscountElement&&null!==d.addFilterMethod&&null!==d.ruleAppendTo?(i=i.replace(new RegExp("{i}","g"),d.newIndex),e(d.ruleAppendTo).append(i)):null!==d.addDiscountType&&null!==d.ruleAppendTo&&e(d.ruleAppendTo).html(i)},remove_wdr_field_group:function(l){var d=e.extend({parentRow:null,parentsRow:null,siblingElements:null,thisObject:null},l);null!==d.parentsRow&&null!==d.thisObject&&e(d.thisObject).parents(d.parentsRow).remove(),null!==d.parentRow&&null===d.siblingElements&&e(d.parentRow).siblings().remove()},show_hide_rule_block:function(l){var d=e.extend({showBlockId:null,hideBlockId:null,thisObject:null,discountTab:null,showTabId:null},l);null!==d.showBlockId&&null===d.hideBlockId&&e(d.showBlockId).show(),null!==d.showBlockId&&null!==d.hideBlockId&&(e(d.showBlockId).show(),e(d.hideBlockId).hide(),e(d.thisObject).siblings(".wdr-active").removeClass("wdr-active wdr-inactive").prop("disabled",!1).addClass("wdr-inactive"),e(d.thisObject).removeClass("wdr-inactive").addClass("wdr-active")),null!==d.showBlockId&&null!==d.hideBlockId&&(e(d.showBlockId).show(),e(d.hideBlockId).hide(),e(d.thisObject).siblings(".wdr-active").removeClass("wdr-active").prop("disabled",!1),e(d.thisObject).addClass("wdr-active"))}}}(jQuery);
1
+ var wdr_buildrule;!function($){wdr_buildrule={wdr_clone_field:function(i){var a=$.extend({addFilterType:null,addFilterMethod:null,ruleAppendTo:null,addConditionType:null,addRemoveIcon:null,addDiscountElement:null,addDiscountType:null,newIndex:null},i),d=$(a.addRemoveIcon).html(),b=$(a.addFilterMethod).html();if(null===a.addDiscountElement&&null!==a.addFilterType&&null!==a.addFilterMethod&&null!==a.ruleAppendTo){var f=$(a.addFilterType).html();f=f.replace(/{i}/g,a.newIndex),b=b.replace(/{i}/g,a.newIndex),$(a.ruleAppendTo).append('<div class="wdr-grid wdr-filter-group" data-index="'+a.newIndex+'">'+f+b+d+"</div>")}else if(null===a.addDiscountType&&null===a.addDiscountElement&&null===a.addFilterType&&null!==a.addFilterMethod&&null!==a.ruleAppendTo&&null===a.addConditionType)b=b.replace(/{i}/g,a.newIndex),$(a.ruleAppendTo).append(b+d);else if(null===a.addDiscountElement&&null!==a.addConditionType&&null!==a.addFilterMethod&&null!==a.ruleAppendTo){var c=$(a.addConditionType).html();let g="",h="";var e=$(a.addFilterMethod).html();e=e.replace(/{i}/g,a.newIndex),c&&"undefined"!=c?(c=c.replace(/{i}/g,a.newIndex),$(a.ruleAppendTo).append('<div class="'+h+' wdr-conditions-container wdr-condition-group" style="'+g+'" data-index="'+a.newIndex+'">'+c+e+d+"</div>")):(c="",g="display:none",h="promo_show_hide_"+a.newIndex,d="",$(a.ruleAppendTo+" [data-index='"+a.newIndex+"']").after('<div class="'+h+' wdr-conditions-container wdr-condition-group" style="'+g+'" data-index="'+a.newIndex+'">'+c+e+d+"</div>"))}else null==a.addDiscountType&&null!==a.addDiscountElement&&null!==a.addFilterMethod&&null!==a.ruleAppendTo?(b=b.replace(/{i}/g,a.newIndex),$(a.ruleAppendTo).append(b)):null!==a.addDiscountType&&null!==a.ruleAppendTo&&$(a.ruleAppendTo).html(b)},remove_wdr_field_group:function(b){var a=$.extend({parentRow:null,parentsRow:null,siblingElements:null,thisObject:null},b);null!==a.parentsRow&&null!==a.thisObject&&$(a.thisObject).parents(a.parentsRow).remove(),null!==a.parentRow&&null===a.siblingElements&&$(a.parentRow).siblings().remove()},show_hide_rule_block:function(b){var a=$.extend({showBlockId:null,hideBlockId:null,thisObject:null,discountTab:null,showTabId:null},b);null!==a.showBlockId&&null===a.hideBlockId&&$(a.showBlockId).show(),null!==a.showBlockId&&null!==a.hideBlockId&&($(a.showBlockId).show(),$(a.hideBlockId).hide(),$(a.thisObject).siblings(".wdr-active").removeClass("wdr-active wdr-inactive").prop("disabled",!1).addClass("wdr-inactive"),$(a.thisObject).removeClass("wdr-inactive").addClass("wdr-active")),null!==a.showBlockId&&null!==a.hideBlockId&&($(a.showBlockId).show(),$(a.hideBlockId).hide(),$(a.thisObject).siblings(".wdr-active").removeClass("wdr-active").prop("disabled",!1),$(a.thisObject).addClass("wdr-active"))}}}(jQuery)
v2/Assets/Js/site_main.min.js CHANGED
@@ -1 +1 @@
1
- !function(a){function t(){a("body").trigger("update_checkout")}"1"==awdr_params.refresh_order_review&&(a(document).on("change",'input[name="payment_method"],input[name="billing_city"],input[name="billing_postcode"]',function(){t()}),a(document).on("blur",'input[name="billing_email"], select#billing_state',function(){t()})),a(document).ready(function(a){function t(){"show_dynamically"==awdr_params.enable_update_price_with_qty&&a(document).on("change",'[name="quantity"]',function(){var t=a(this);setTimeout(function(){var r=t.val(),i=0,_="",e=t.closest("form");if(e.find('button[name="add-to-cart"]').length){i=e.find('button[name="add-to-cart"]').val();var o="div.product p.price";null!=awdr_params.custom_target_simple_product&&""!=awdr_params.custom_target_simple_product&&(o=awdr_params.custom_target_simple_product),_=a(o).first()}else if(e.find('input[name="variation_id"]').length){i=e.find('input[name="variation_id"]').val();o="div.product .woocommerce-variation-price";null!=awdr_params.custom_target_variable_product&&""!=awdr_params.custom_target_variable_product&&(o=awdr_params.custom_target_variable_product),_=a(o),a(o+" .price").length||_.html("<div class='price'></div>"),_=a(o+" .price")}if(!i||0==i){if(null!=awdr_params.custom_simple_product_id_selector&&""!=awdr_params.custom_simple_product_id_selector){let t=awdr_params.custom_simple_product_id_selector;i=a(t).val();let r="div.product p.price";null!=awdr_params.custom_target_simple_product&&""!=awdr_params.custom_target_simple_product&&(r=awdr_params.custom_target_simple_product),_=a(r).first()}if(null!=awdr_params.custom_variable_product_id_selector&&""!=awdr_params.custom_variable_product_id_selector){let t=awdr_params.custom_variable_product_id_selector;i=a(t).val();let r="div.product .woocommerce-variation-price";null!=awdr_params.custom_target_variable_product&&""!=awdr_params.custom_target_variable_product&&(r=awdr_params.custom_target_variable_product),a(r+" .price").length||_.html("<div class='price'></div>"),_=a(r+" .price")}}if(i&&_&&0!=i){var c={action:"wdr_ajax",method:"get_price_html",product_id:i,qty:r,awdr_nonce:awdr_params.nonce};a.ajax({url:awdr_params.ajaxurl,data:c,type:"POST",success:function(a){a.price_html?_.html(a.price_html):null!=a.original_price_html&&_.html(a.original_price_html)},error:function(a){_.html("")}})}},0)})}if(awdr_params.js_init_trigger&&a(document).on(awdr_params.js_init_trigger,function(){t()}),t(),"1"==awdr_params.awdr_dynamic_bulk_table_status&&"on"==awdr_params.awdr_dynamic_bulk_table_off){function r(t){setTimeout(function(){if(""!=t&&"0"!=t){var r={action:"wdr_ajax",method:"get_variable_product_bulk_table",product_id:t,awdr_nonce:awdr_params.nonce};let i="div.awdr-bulk-customizable-table";null!=awdr_params.awdr_opacity_to_bulk_table&&""!=awdr_params.awdr_opacity_to_bulk_table&&(i=awdr_params.awdr_opacity_to_bulk_table),a.ajax({url:awdr_params.ajaxurl,data:r,type:"POST",beforeSend:function(){a(i).css("opacity","0.5")},complete:function(){a(i).css("opacity","1")},success:function(t){t.bulk_table&&a(".awdr-bulk-customizable-table").html(t.bulk_table)},error:function(t){a(".awdr-bulk-customizable-table").html("")}})}},100)}a(".single_variation_wrap").on("hide_variation",function(t){r(a(this).closest("form").find('input[name="product_id"]').val())}),a(".single_variation_wrap").on("show_variation",function(a,t,i){let _=t.variation_id;null!=t.is_bundled&&1==t.is_bundled||r(_)})}})}(jQuery);
1
+ !function($){function a(){$("body").trigger("update_checkout")}"1"==awdr_params.refresh_order_review&&($(document).on("change",'input[name="payment_method"],input[name="billing_city"],input[name="billing_postcode"]',function(){a()}),$(document).on("blur",'input[name="billing_email"], select#billing_state',function(){a()})),$(document).ready(function($){function a(){"show_dynamically"==awdr_params.enable_update_price_with_qty&&$(document).on("change",'[name="quantity"]',function(){var a=$(this);setTimeout(function(){var h=a.val(),b=0,c="",e=a.closest("form");if(e.find('button[name="add-to-cart"]').length){b=e.find('button[name="add-to-cart"]').val();var d="div.product p.price";void 0!=awdr_params.custom_target_simple_product&&""!=awdr_params.custom_target_simple_product&&(d=awdr_params.custom_target_simple_product),c=$(d).first()}else if(e.find('input[name="variation_id"]').length){b=e.find('input[name="variation_id"]').val();var d="div.product .woocommerce-variation-price";void 0!=awdr_params.custom_target_variable_product&&""!=awdr_params.custom_target_variable_product&&(d=awdr_params.custom_target_variable_product),c=$(d),$(d+" .price").length||c.html("<div class='price'></div>"),c=$(d+" .price")}if(!b||0==b){if(void 0!=awdr_params.custom_simple_product_id_selector&&""!=awdr_params.custom_simple_product_id_selector){b=$(awdr_params.custom_simple_product_id_selector).val();let g="div.product p.price";void 0!=awdr_params.custom_target_simple_product&&""!=awdr_params.custom_target_simple_product&&(g=awdr_params.custom_target_simple_product),c=$(g).first()}if(void 0!=awdr_params.custom_variable_product_id_selector&&""!=awdr_params.custom_variable_product_id_selector){b=$(awdr_params.custom_variable_product_id_selector).val();let f="div.product .woocommerce-variation-price";void 0!=awdr_params.custom_target_variable_product&&""!=awdr_params.custom_target_variable_product&&(f=awdr_params.custom_target_variable_product),$(f+" .price").length||c.html("<div class='price'></div>"),c=$(f+" .price")}}if(b&&c&&0!=b){var i={action:"wdr_ajax",method:"get_price_html",product_id:b,qty:h,awdr_nonce:awdr_params.nonce};$.ajax({url:awdr_params.ajaxurl,data:i,type:"POST",success:function(a){a.price_html?c.html(a.price_html):void 0!=a.original_price_html&&c.html(a.original_price_html)},error:function(a){c.html("")}})}},0)})}if(awdr_params.js_init_trigger&&$(document).on(awdr_params.js_init_trigger,function(){a()}),a(),"1"==awdr_params.awdr_dynamic_bulk_table_status&&"on"==awdr_params.awdr_dynamic_bulk_table_off){function b(a){setTimeout(function(){if(""!=a&&"0"!=a){var b={action:"wdr_ajax",method:"get_variable_product_bulk_table",product_id:a,awdr_nonce:awdr_params.nonce};let c="div.awdr-bulk-customizable-table";void 0!=awdr_params.awdr_opacity_to_bulk_table&&""!=awdr_params.awdr_opacity_to_bulk_table&&(c=awdr_params.awdr_opacity_to_bulk_table),$.ajax({url:awdr_params.ajaxurl,data:b,type:"POST",beforeSend:function(){$(c).css("opacity","0.5")},complete:function(){$(c).css("opacity","1")},success:function(a){a.bulk_table&&$(".awdr-bulk-customizable-table").html(a.bulk_table)},error:function(a){$(".awdr-bulk-customizable-table").html("")}})}},100)}$(".single_variation_wrap").on("hide_variation",function(a){b($(this).closest("form").find('input[name="product_id"]').val())}),$(".single_variation_wrap").on("show_variation",function(d,a,e){let c=a.variation_id;(void 0==a.is_bundled|| !0!=a.is_bundled)&&b(c)})}})}(jQuery)
woo-discount-rules.php CHANGED
@@ -5,13 +5,13 @@
5
  * Description: Simple to complex discount rules for your WooCommerce store. Core package.
6
  * Author: Flycart
7
  * Author URI: https://www.flycart.org
8
- * Version: 2.4.1
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/
12
  * Requires at least: 4.6.1
13
  * WC requires at least: 3.0
14
- * WC tested up to: 6.5
15
  */
16
  if (!defined('ABSPATH')) {
17
  exit;
@@ -21,7 +21,7 @@ if (!defined('ABSPATH')) {
21
  * Current version of our app
22
  */
23
  if (!defined('WDR_VERSION')) {
24
- define('WDR_VERSION', '2.4.1');
25
  }
26
 
27
  global $awdr_load_version;
@@ -148,13 +148,20 @@ if ($awdr_load_version == "v2") {
148
  \Wdr\App\Helpers\Migration::checkAndCreateSampleRules();
149
  }
150
  }
 
151
  /**
152
- * Check plugin dependency while activate plugin.
153
  */
154
  register_activation_hook(__FILE__, function () {
155
  awdr_check_compatible();
156
  awdr_create_required_tables();
 
 
 
 
 
157
  });
 
158
  if (isset($_GET['awdr_switch_plugin_to']) && in_array($_GET['awdr_switch_plugin_to'], array('v1', 'v2'))) {
159
  if(is_admin() && $_GET['awdr_switch_plugin_to'] === "v2"){
160
  awdr_create_required_tables();
5
  * Description: Simple to complex discount rules for your WooCommerce store. Core package.
6
  * Author: Flycart
7
  * Author URI: https://www.flycart.org
8
+ * Version: 2.4.2
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/
12
  * Requires at least: 4.6.1
13
  * WC requires at least: 3.0
14
+ * WC tested up to: 6.6
15
  */
16
  if (!defined('ABSPATH')) {
17
  exit;
21
  * Current version of our app
22
  */
23
  if (!defined('WDR_VERSION')) {
24
+ define('WDR_VERSION', '2.4.2');
25
  }
26
 
27
  global $awdr_load_version;
148
  \Wdr\App\Helpers\Migration::checkAndCreateSampleRules();
149
  }
150
  }
151
+
152
  /**
153
+ * Check plugin dependency and init scheduler while activate plugin.
154
  */
155
  register_activation_hook(__FILE__, function () {
156
  awdr_check_compatible();
157
  awdr_create_required_tables();
158
+ \Wdr\App\Helpers\Schedule::mayRunRebuildOnSaleIndex();
159
+ });
160
+ // clear scheduler while deactivate plugin
161
+ register_deactivation_hook(__FILE__, function () {
162
+ \Wdr\App\Helpers\Schedule::stopRebuildOnSaleIndex();
163
  });
164
+
165
  if (isset($_GET['awdr_switch_plugin_to']) && in_array($_GET['awdr_switch_plugin_to'], array('v1', 'v2'))) {
166
  if(is_admin() && $_GET['awdr_switch_plugin_to'] === "v2"){
167
  awdr_create_required_tables();