Discount Rules for WooCommerce - Version 2.4.5

Version Description

  • 27/09/22 =
  • Improvement: Additional param on the event advanced_woo_discount_rules_strikeout_price_html [Core].
  • Improvement: Backend field validation [Core and Pro].
  • Improvement: Condition and filter matches on any operation [Core and Pro].
  • Fix: Applying discount more than discount quantity on set and BXGY [Pro]
  • Fix: Quantity issue on set discount while manual request [Pro].
Download this release

Release Info

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

Code changes from version 2.4.4 to 2.4.5

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-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
 
@@ -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:1261
292
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:59
293
  #: v2/App/Views/Admin/Rules/Manage.php:242
294
  msgid "Discount"
@@ -624,7 +624,7 @@ msgstr ""
624
  msgid "Authentication required"
625
  msgstr ""
626
 
627
- #: v2/App/Controllers/Admin/WDRAjax.php:769
628
  msgid "Search State"
629
  msgstr ""
630
 
@@ -670,35 +670,35 @@ msgstr ""
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,7 +966,7 @@ msgstr ""
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 ""
@@ -1049,7 +1049,7 @@ 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
 
@@ -1070,153 +1070,183 @@ msgstr ""
1070
  msgid "Accepts only hex color code"
1071
  msgstr ""
1072
 
1073
- #: v2/App/Helpers/Validation.php:349
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1074
  msgid "Accept only yes, on, 1, true"
1075
  msgstr ""
1076
 
1077
- #: v2/App/Helpers/Validation.php:350
1078
  msgid "Should not contain any tags"
1079
  msgstr ""
1080
 
1081
- #: v2/App/Helpers/Validation.php:351
1082
  msgid "Should not contain any tags and special characters"
1083
  msgstr ""
1084
 
1085
- #: v2/App/Helpers/Validation.php:352 v2/App/Helpers/Validation.php:353
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
 
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-09-27\n"
8
+ "PO-Revision-Date: 2022-09-27"
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:812
16
  msgid "Invalid request"
17
  msgstr ""
18
 
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:1204
292
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:59
293
  #: v2/App/Views/Admin/Rules/Manage.php:242
294
  msgid "Discount"
624
  msgid "Authentication required"
625
  msgstr ""
626
 
627
+ #: v2/App/Controllers/Admin/WDRAjax.php:773
628
  msgid "Search State"
629
  msgstr ""
630
 
670
  msgid "<span class=\"onsale\">Sale!</span>"
671
  msgstr ""
672
 
673
+ #: v2/App/Controllers/ManageDiscount.php:787
674
+ #: v2/App/Controllers/ManageDiscount.php:1007
675
+ #: v2/App/Controllers/ManageDiscount.php:1010 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:1076
681
  #, php-format
682
  msgid "Coupon \"%s\" is currently not available!"
683
  msgstr ""
684
 
685
+ #: v2/App/Controllers/ManageDiscount.php:1291
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:1305
693
  msgid "Coupon code applied successfully."
694
  msgstr ""
695
 
696
+ #: v2/App/Controllers/ManageDiscount.php:1733
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:1863
702
  msgid "You saved {{total_discount}}"
703
  msgstr ""
704
 
966
  msgid "Bundle (Set) Discount - PRO -"
967
  msgstr ""
968
 
969
+ #: v2/App/Helpers/Rule.php:1282 v2/App/Helpers/Rule.php:1383
970
  #: v2/App/Views/Admin/Tabs/ImportExport.php:101
971
  msgid "Untitled Rule"
972
  msgstr ""
1049
  msgstr ""
1050
 
1051
  #: v2/App/Helpers/Validation.php:146 v2/App/Helpers/Validation.php:151
1052
+ #: v2/App/Helpers/Validation.php:463 v2/App/Helpers/Validation.php:660
1053
  msgid "Invalid characters"
1054
  msgstr ""
1055
 
1070
  msgid "Accepts only hex color code"
1071
  msgstr ""
1072
 
1073
+ #: v2/App/Helpers/Validation.php:285 v2/App/Helpers/Validation.php:300
1074
+ #: v2/App/Helpers/Validation.php:369
1075
+ msgid "Invalid date range"
1076
+ msgstr ""
1077
+
1078
+ #: v2/App/Helpers/Validation.php:289 v2/App/Helpers/Validation.php:339
1079
+ #: v2/App/Helpers/Validation.php:361
1080
+ msgid "Invalid input range"
1081
+ msgstr ""
1082
+
1083
+ #: v2/App/Helpers/Validation.php:295
1084
+ msgid "Invalid input"
1085
+ msgstr ""
1086
+
1087
+ #: v2/App/Helpers/Validation.php:326 v2/App/Helpers/Validation.php:334
1088
+ msgid "Percentage discount value must be no more than 100"
1089
+ msgstr ""
1090
+
1091
+ #: v2/App/Helpers/Validation.php:373
1092
+ msgid "Invalid domain"
1093
+ msgstr ""
1094
+
1095
+ #: v2/App/Helpers/Validation.php:376
1096
+ msgid "Invalid city name"
1097
+ msgstr ""
1098
+
1099
+ #: v2/App/Helpers/Validation.php:379
1100
+ msgid "Invalid zipcode"
1101
+ msgstr ""
1102
+
1103
+ #: v2/App/Helpers/Validation.php:464
1104
  msgid "Accept only yes, on, 1, true"
1105
  msgstr ""
1106
 
1107
+ #: v2/App/Helpers/Validation.php:465
1108
  msgid "Should not contain any tags"
1109
  msgstr ""
1110
 
1111
+ #: v2/App/Helpers/Validation.php:466
1112
  msgid "Should not contain any tags and special characters"
1113
  msgstr ""
1114
 
1115
+ #: v2/App/Helpers/Validation.php:467 v2/App/Helpers/Validation.php:468
1116
  msgid "Invalid inputs"
1117
  msgstr ""
1118
 
1119
+ #: v2/App/Helpers/Validation.php:634
1120
  msgid "Validation error"
1121
  msgstr ""
1122
 
1123
+ #: v2/App/Helpers/Woocommerce.php:1009
1124
  msgid "Sunday"
1125
  msgstr ""
1126
 
1127
+ #: v2/App/Helpers/Woocommerce.php:1010
1128
  msgid "Monday"
1129
  msgstr ""
1130
 
1131
+ #: v2/App/Helpers/Woocommerce.php:1011
1132
  msgid "Tuesday"
1133
  msgstr ""
1134
 
1135
+ #: v2/App/Helpers/Woocommerce.php:1012
1136
  msgid "Wednesday"
1137
  msgstr ""
1138
 
1139
+ #: v2/App/Helpers/Woocommerce.php:1013
1140
  msgid "Thursday"
1141
  msgstr ""
1142
 
1143
+ #: v2/App/Helpers/Woocommerce.php:1014
1144
  msgid "Friday"
1145
  msgstr ""
1146
 
1147
+ #: v2/App/Helpers/Woocommerce.php:1015
1148
  msgid "Saturday"
1149
  msgstr ""
1150
 
1151
+ #: v2/App/Helpers/Woocommerce.php:1026
1152
  msgid ""
1153
  "Woocommerce before main content(Archive / Shop / Cat Pages / single product)"
1154
  msgstr ""
1155
 
1156
+ #: v2/App/Helpers/Woocommerce.php:1027
1157
  msgid "Woocommerce archive description(Archive / Shop / Cat Pages)"
1158
  msgstr ""
1159
 
1160
+ #: v2/App/Helpers/Woocommerce.php:1028
1161
  msgid "Woocommerce before shop loop(Archive / Shop / Cat Pages)"
1162
  msgstr ""
1163
 
1164
+ #: v2/App/Helpers/Woocommerce.php:1029
1165
  msgid "Woocommerce after shop loop(Archive / Shop / Cat Pages)"
1166
  msgstr ""
1167
 
1168
+ #: v2/App/Helpers/Woocommerce.php:1030
1169
  msgid ""
1170
  "Woocommerce after main content(Archive / Shop / Cat Pages / single product)"
1171
  msgstr ""
1172
 
1173
+ #: v2/App/Helpers/Woocommerce.php:1031 v2/App/Views/Admin/Tabs/settings.php:230
1174
  #: v2/App/Views/Admin/Tabs/settings.php:248
1175
  msgid "Woocommerce before single product"
1176
  msgstr ""
1177
 
1178
+ #: v2/App/Helpers/Woocommerce.php:1032 v2/App/Views/Admin/Tabs/settings.php:232
1179
  #: v2/App/Views/Admin/Tabs/settings.php:250
1180
  msgid "Woocommerce before single product summary"
1181
  msgstr ""
1182
 
1183
+ #: v2/App/Helpers/Woocommerce.php:1033 v2/App/Views/Admin/Tabs/settings.php:231
1184
  #: v2/App/Views/Admin/Tabs/settings.php:249
1185
  msgid "Woocommerce after single product summary"
1186
  msgstr ""
1187
 
1188
+ #: v2/App/Helpers/Woocommerce.php:1034 v2/App/Views/Admin/Tabs/settings.php:229
1189
  #: v2/App/Views/Admin/Tabs/settings.php:247
1190
  msgid "Woocommerce after single product"
1191
  msgstr ""
1192
 
1193
+ #: v2/App/Helpers/Woocommerce.php:1035
1194
  msgid "Woocommerce before cart"
1195
  msgstr ""
1196
 
1197
+ #: v2/App/Helpers/Woocommerce.php:1036
1198
  msgid "Woocommerce before cart table"
1199
  msgstr ""
1200
 
1201
+ #: v2/App/Helpers/Woocommerce.php:1037
1202
  msgid "Woocommerce before cart contents"
1203
  msgstr ""
1204
 
1205
+ #: v2/App/Helpers/Woocommerce.php:1038
1206
  msgid "Woocommerce cart contents"
1207
  msgstr ""
1208
 
1209
+ #: v2/App/Helpers/Woocommerce.php:1039
1210
  msgid "Woocommerce after cart contents"
1211
  msgstr ""
1212
 
1213
+ #: v2/App/Helpers/Woocommerce.php:1040
1214
  msgid "Woocommerce after cart table"
1215
  msgstr ""
1216
 
1217
+ #: v2/App/Helpers/Woocommerce.php:1041
1218
  msgid "Woocommerce after cart"
1219
  msgstr ""
1220
 
1221
+ #: v2/App/Helpers/Woocommerce.php:1042
1222
  msgid "Woocommerce before checkout form"
1223
  msgstr ""
1224
 
1225
+ #: v2/App/Helpers/Woocommerce.php:1044
1226
  msgid "Woocommerce before checkout billing form"
1227
  msgstr ""
1228
 
1229
+ #: v2/App/Helpers/Woocommerce.php:1045
1230
  msgid "Woocommerce after checkout billing form"
1231
  msgstr ""
1232
 
1233
+ #: v2/App/Helpers/Woocommerce.php:1046
1234
  msgid "Woocommerce before checkout shipping form"
1235
  msgstr ""
1236
 
1237
+ #: v2/App/Helpers/Woocommerce.php:1047
1238
  msgid "Woocommerce after checkout shipping form"
1239
  msgstr ""
1240
 
1241
+ #: v2/App/Helpers/Woocommerce.php:1048
1242
  msgid "Woocommerce before order notes"
1243
  msgstr ""
1244
 
1245
+ #: v2/App/Helpers/Woocommerce.php:1049
1246
  msgid "Woocommerce after order notes"
1247
  msgstr ""
1248
 
1249
+ #: v2/App/Helpers/Woocommerce.php:1583
1250
  msgid "Coupon already exists in WooCommerce. Please select another name"
1251
  msgstr ""
1252
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.4
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -336,6 +336,13 @@ Note : Enable recursive checkbox if the discounts should be applied in sequentia
336
 
337
  == Changelog ==
338
 
 
 
 
 
 
 
 
339
  = 2.4.4 - 09/08/22 =
340
  * Improvement: Event: advanced_woo_discount_rules_is_valid_filter_type
341
  * Improvement: Event: advanced_woo_discount_rules_after_delete_rule
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.5
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.5 - 27/09/22 =
340
+ * Improvement: Additional param on the event advanced_woo_discount_rules_strikeout_price_html [Core].
341
+ * Improvement: Backend field validation [Core and Pro].
342
+ * Improvement: Condition and filter matches on any operation [Core and Pro].
343
+ * Fix: Applying discount more than discount quantity on set and BXGY [Pro]
344
+ * Fix: Quantity issue on set discount while manual request [Pro].
345
+
346
  = 2.4.4 - 09/08/22 =
347
  * Improvement: Event: advanced_woo_discount_rules_is_valid_filter_type
348
  * Improvement: Event: advanced_woo_discount_rules_after_delete_rule
v2/App/Conditions/Base.php CHANGED
@@ -236,8 +236,12 @@ abstract class Base
236
  $result = ($operand1 <= $operand2);
237
  break;
238
  case 'in_range';
239
- if (!empty($operand3)) {
240
  $result = (($operand1 >= $operand2) && ($operand1 <= $operand3));
 
 
 
 
241
  }
242
  break;
243
  default:
236
  $result = ($operand1 <= $operand2);
237
  break;
238
  case 'in_range';
239
+ if (!empty($operand2) && !empty($operand3)) {
240
  $result = (($operand1 >= $operand2) && ($operand1 <= $operand3));
241
+ } elseif (!empty($operand2) && empty($operand3)) {
242
+ $result = $operand1 >= $operand2;
243
+ } elseif (empty($operand2) && !empty($operand3)) {
244
+ $result = $operand1 <= $operand3;
245
  }
246
  break;
247
  default:
v2/App/Conditions/CartLineItemsCount.php CHANGED
@@ -24,7 +24,7 @@ class CartLineItemsCount extends Base
24
  return false;
25
  }
26
 
27
- if (isset($options->operator) && $options->value) {
28
  $operator = sanitize_text_field($options->operator);
29
  $value = $options->value;
30
  if($options->calculate_from == 'from_filter'){
24
  return false;
25
  }
26
 
27
+ if (isset($options->operator) && $options->value >= 0) {
28
  $operator = sanitize_text_field($options->operator);
29
  $value = $options->value;
30
  if($options->calculate_from == 'from_filter'){
v2/App/Controllers/Admin/WDRAjax.php CHANGED
@@ -117,17 +117,19 @@ class WDRAjax extends Base
117
  if($product){
118
  $price = Woocommerce::getProductPrice($product);
119
  $custom_price = $this->input->post('custom_price', '');
120
- $custom_price = str_replace('&nbsp;', '', $custom_price);
121
- //A non breaking space is U+00A0 (Unicode) but encoded as C2A0 in UTF-8
122
- $custom_price = preg_replace('~\x{00a0}~siu', '', $custom_price);
123
- $custom_price = trim($custom_price);
124
- if(function_exists('wc_get_price_thousand_separator')){
125
- $price_thousand_separator = wc_get_price_thousand_separator();
126
- $custom_price = str_replace($price_thousand_separator, "", $custom_price);
127
- }
128
- if(function_exists('wc_get_price_decimal_separator')){
129
- $price_decimal_separator = wc_get_price_decimal_separator();
130
- $custom_price = str_replace($price_decimal_separator, ".", $custom_price);
 
 
131
  }
132
  $custom_price = floatval($custom_price);
133
  $result = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $price, $product, $quantity, $custom_price, 'all', true);
117
  if($product){
118
  $price = Woocommerce::getProductPrice($product);
119
  $custom_price = $this->input->post('custom_price', '');
120
+ if (!is_numeric($custom_price)) { // parse price only if is not a numeric value
121
+ $custom_price = str_replace('&nbsp;', '', $custom_price);
122
+ //A non breaking space is U+00A0 (Unicode) but encoded as C2A0 in UTF-8
123
+ $custom_price = preg_replace('~\x{00a0}~siu', '', $custom_price);
124
+ $custom_price = trim($custom_price);
125
+ if(function_exists('wc_get_price_thousand_separator')){
126
+ $price_thousand_separator = wc_get_price_thousand_separator();
127
+ $custom_price = str_replace($price_thousand_separator, "", $custom_price);
128
+ }
129
+ if(function_exists('wc_get_price_decimal_separator')){
130
+ $price_decimal_separator = wc_get_price_decimal_separator();
131
+ $custom_price = str_replace($price_decimal_separator, ".", $custom_price);
132
+ }
133
  }
134
  $custom_price = floatval($custom_price);
135
  $result = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $price, $product, $quantity, $custom_price, 'all', true);
v2/App/Controllers/DiscountCalculator.php CHANGED
@@ -739,13 +739,13 @@ class DiscountCalculator extends Base
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{
745
  if(!isset(self::$total_discounts[$matched_item_key][$rule_id])){
746
  self::$total_discounts[$matched_item_key][$rule_id] = array();
747
  }
748
- self::$total_discounts[$matched_item_key][$rule_id] = apply_filters('advanced_woo_discount_rules_calculated_discounts_of_each_rule', self::$total_discounts[$matched_item_key][$rule_id], $product_id, $rule_id, $filter_passed, $cart_item, $is_cart, $rule);
749
  $discounts[$rule_id] = $discounted_price;
750
  }
751
  }
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, $manual_request);
743
  $ajax_discounts[$rule_id] = $discounted_price;
744
  }else{
745
  if(!isset(self::$total_discounts[$matched_item_key][$rule_id])){
746
  self::$total_discounts[$matched_item_key][$rule_id] = array();
747
  }
748
+ self::$total_discounts[$matched_item_key][$rule_id] = apply_filters('advanced_woo_discount_rules_calculated_discounts_of_each_rule', self::$total_discounts[$matched_item_key][$rule_id], $product_id, $rule_id, $filter_passed, $cart_item, $is_cart, $rule, $manual_request);
749
  $discounts[$rule_id] = $discounted_price;
750
  }
751
  }
v2/App/Controllers/ManageDiscount.php CHANGED
@@ -576,6 +576,8 @@ class ManageDiscount extends Base
576
  function getStrikeoutPrice($original_price, $discounted_price, $format_price = true, $is_variable_product = false, $initial_price_html=false)
577
  {
578
  $separator = ($is_variable_product) ? '<br>' : '&nbsp;';
 
 
579
  if ($original_price == $discounted_price) {
580
  if ($format_price) {
581
  $discounted_price = self::$woocommerce_helper->formatPrice($discounted_price);
@@ -595,7 +597,7 @@ class ManageDiscount extends Base
595
  $html = '<del>' . $original_price . '</del>' . $separator . '<ins>' . $discounted_price . '</ins>';
596
  }
597
  }
598
- return apply_filters('advanced_woo_discount_rules_strikeout_price_html', $html, $original_price, $discounted_price, $is_variable_product, $initial_price_html, $separator);
599
  }
600
 
601
  /**
576
  function getStrikeoutPrice($original_price, $discounted_price, $format_price = true, $is_variable_product = false, $initial_price_html=false)
577
  {
578
  $separator = ($is_variable_product) ? '<br>' : '&nbsp;';
579
+ $original_price_raw = $original_price;
580
+ $discounted_price_raw = $discounted_price;
581
  if ($original_price == $discounted_price) {
582
  if ($format_price) {
583
  $discounted_price = self::$woocommerce_helper->formatPrice($discounted_price);
597
  $html = '<del>' . $original_price . '</del>' . $separator . '<ins>' . $discounted_price . '</ins>';
598
  }
599
  }
600
+ return apply_filters('advanced_woo_discount_rules_strikeout_price_html', $html, $original_price, $discounted_price, $is_variable_product, $initial_price_html, $separator, $original_price_raw, $discounted_price_raw);
601
  }
602
 
603
  /**
v2/App/Helpers/Helper.php CHANGED
@@ -332,9 +332,9 @@ class Helper
332
 
333
  public static function displayCompatibleCheckMessages()
334
  {
335
- if (version_compare(WDR_VERSION, '2.4.4', '>=')) {
336
  if (defined('WDR_PRO_VERSION')) {
337
- if (version_compare(WDR_PRO_VERSION, '2.4.4', '<')) {
338
  $url = esc_url(admin_url() . "plugins.php");
339
  $plugin_page = '<a target="_blank" href="' . $url . '">' . __('Update now', 'woo-discount-rules') . '</a>';
340
  ?>
332
 
333
  public static function displayCompatibleCheckMessages()
334
  {
335
+ if (version_compare(WDR_VERSION, '2.4.5', '>=')) {
336
  if (defined('WDR_PRO_VERSION')) {
337
+ if (version_compare(WDR_PRO_VERSION, '2.4.5', '<')) {
338
  $url = esc_url(admin_url() . "plugins.php");
339
  $plugin_page = '<a target="_blank" href="' . $url . '">' . __('Update now', 'woo-discount-rules') . '</a>';
340
  ?>
v2/App/Helpers/Rule.php CHANGED
@@ -392,84 +392,14 @@ class Rule
392
  $extra_data = apply_filters('advanced_woo_discount_rules_load_custom_filter_data', array(), $this);
393
  $filter_passed = $filter_helper->matchFilters($product, $filters, $sale_badge, $product_table, $extra_data);
394
  $conditions = $this->getConditions();
395
- $purchase_first_order_passed = $filter_passed_purchase_first_order = $filter_passed_user_logged_in = $user_logged_in_passed = $filter_passed_user_role = $filter_passed_user_list = $user_role_passed = $user_list_passed = $has_other_conditions = false;
396
- $condition_relationship = $this->getRelationship('condition', 'and');
397
  if($filter_passed){
398
- if(!empty($conditions)){
399
- foreach($conditions as $condition){
400
- $cart = array();
401
- $options = isset($condition->options) ? $condition->options : array();
402
- $condition_type = isset($condition->type) ? $condition->type : array();
403
- if( !empty($condition_type) ){
404
- if (!empty($options) && isset($this->available_conditions[$condition_type]['object']) && is_object($this->available_conditions[$condition_type]['object']) && method_exists($this->available_conditions[$condition_type]['object'], 'check')) {
405
- $this->available_conditions[$condition_type]['object']->rule = $this;
406
- switch ($condition_type){
407
- case 'user_role':
408
- $user_role_passed = true;
409
- $filter_passed_user_role = $this->available_conditions[$condition_type]['object']->check($cart, $options);
410
- break;
411
- case 'user_list':
412
- $user_list_passed = true;
413
- $filter_passed_user_list = $this->available_conditions[$condition_type]['object']->check($cart, $options);
414
- break;
415
- case 'user_logged_in':
416
- $user_logged_in_passed = true;
417
- $filter_passed_user_logged_in = $this->available_conditions[$condition_type]['object']->check($cart, $options);
418
- break;
419
- case 'purchase_first_order':
420
- $purchase_first_order_passed = true;
421
- $filter_passed_purchase_first_order = $this->available_conditions[$condition_type]['object']->check($cart, $options);
422
- break;
423
- }
424
- }
425
- }
426
-
427
- if( !empty($condition_type) && !in_array($condition_type, array('user_role', 'user_list', 'user_logged_in', 'purchase_first_order'))){
428
- $has_other_conditions = true;
429
- }
430
- }
431
  }
432
- if($user_role_passed || $user_list_passed || $user_logged_in_passed || $purchase_first_order_passed){
433
- if($filter_passed_user_role || $filter_passed_user_list || $filter_passed_user_logged_in || $filter_passed_purchase_first_order){
434
- if($condition_relationship == 'and'){
435
- if($user_role_passed && $user_logged_in_passed){
436
- if($filter_passed_user_role && $filter_passed_user_logged_in){
437
- }else{
438
- $filter_passed = false;
439
- $conditionFailed = true;
440
- }
441
- }
442
- if($user_list_passed && $user_logged_in_passed){
443
- if($filter_passed_user_list && $filter_passed_user_logged_in){
444
- }else{
445
- $filter_passed = false;
446
- $conditionFailed = true;
447
- }
448
- }
449
- if($purchase_first_order_passed && $user_logged_in_passed){
450
- if($filter_passed_purchase_first_order && $filter_passed_user_logged_in){
451
- }else{
452
- $filter_passed = false;
453
- $conditionFailed = true;
454
- }
455
- }
456
- //$this -> rule
457
- $filter_passed = apply_filters('advanced_woo_discount_rules_customer_condition_filter_passed', $filter_passed, $this, $product, $sale_badge, $product_table, $conditions);
458
- }
459
- } else {
460
- if($condition_relationship == 'or'){
461
- if($has_other_conditions){
462
- } else {
463
- $filter_passed = false;
464
- $conditionFailed = true;
465
- }
466
- } else {
467
- $filter_passed = false;
468
- $conditionFailed = true;
469
- }
470
- }
471
- }
472
-
473
  }
474
  } else {
475
  $filter_passed = false;
@@ -693,7 +623,7 @@ class Rule
693
  'product_bulk_discount' => $product_bulk_discount
694
  );
695
 
696
- $discounts = apply_filters('advanced_woo_discount_rules_discounts_of_each_rule', $discounts, $rule, $product_price, $quantity, $product, $ajax_price, $cart_item, $price_display_condition, $is_cart);
697
 
698
  $total_discount = array_sum($discounts);
699
  if ($total_discount <= 0) {
@@ -1052,16 +982,26 @@ class Rule
1052
  $value = floatval($value);
1053
  switch ($type) {
1054
  case 'fixed_price':
1055
- $discount = $original_value - self::$woocommerce_helper->getConvertedFixedPrice($value, 'fixed_price');
 
 
 
 
1056
  break;
1057
  case 'percentage':
1058
  if (!empty($value)) {
 
 
 
1059
  $discount = $original_value * ($value / 100);
1060
  }
1061
  break;
1062
  default:
1063
  case 'flat':
1064
  $discount = self::$woocommerce_helper->getConvertedFixedPrice($value, 'flat');
 
 
 
1065
  break;
1066
  }
1067
  return $discount;
392
  $extra_data = apply_filters('advanced_woo_discount_rules_load_custom_filter_data', array(), $this);
393
  $filter_passed = $filter_helper->matchFilters($product, $filters, $sale_badge, $product_table, $extra_data);
394
  $conditions = $this->getConditions();
 
 
395
  if($filter_passed){
396
+ $cart = array();
397
+ $additional_conditions_passed = $this->isSpecificConditionsPassed(['user_role', 'user_list', 'user_logged_in', 'purchase_first_order'], $cart);
398
+ if (!$additional_conditions_passed) {
399
+ $filter_passed = false;
400
+ $conditionFailed = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
401
  }
402
+ $filter_passed = apply_filters('advanced_woo_discount_rules_customer_condition_filter_passed', $filter_passed, $this, $product, $sale_badge, $product_table, $conditions);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
403
  }
404
  } else {
405
  $filter_passed = false;
623
  'product_bulk_discount' => $product_bulk_discount
624
  );
625
 
626
+ $discounts = apply_filters('advanced_woo_discount_rules_discounts_of_each_rule', $discounts, $rule, $product_price, $quantity, $product, $ajax_price, $cart_item, $price_display_condition, $is_cart, $manual_request);
627
 
628
  $total_discount = array_sum($discounts);
629
  if ($total_discount <= 0) {
982
  $value = floatval($value);
983
  switch ($type) {
984
  case 'fixed_price':
985
+ $discount_value = self::$woocommerce_helper->getConvertedFixedPrice($value, 'fixed_price');
986
+ if ($discount_value > $original_value) {
987
+ $discount_value = $original_value;
988
+ }
989
+ $discount = $original_value - $discount_value;
990
  break;
991
  case 'percentage':
992
  if (!empty($value)) {
993
+ if ($value > 100) {
994
+ $value = 100;
995
+ }
996
  $discount = $original_value * ($value / 100);
997
  }
998
  break;
999
  default:
1000
  case 'flat':
1001
  $discount = self::$woocommerce_helper->getConvertedFixedPrice($value, 'flat');
1002
+ if ($discount > $original_value) {
1003
+ $discount = $original_value;
1004
+ }
1005
  break;
1006
  }
1007
  return $discount;
v2/App/Helpers/Validation.php CHANGED
@@ -261,6 +261,12 @@ class Validation
261
  'discount_badge.badge_color_picker',
262
  'discount_badge.badge_text_color_picker',
263
  ));
 
 
 
 
 
 
264
  if ($input_validator->validate()) {
265
  return true;
266
  } else {
@@ -268,6 +274,115 @@ class Validation
268
  }
269
  }
270
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  /**
272
  * validate Radio Button And Select Box
273
  *
261
  'discount_badge.badge_color_picker',
262
  'discount_badge.badge_text_color_picker',
263
  ));
264
+
265
+ // to run additional rule validation scripts
266
+ $run_additional_rule_validations = apply_filters('advanced_woo_discount_rules_run_additional_rule_validations', true);
267
+ if ($run_additional_rule_validations) {
268
+ $input_validator = self::runAdditionalRuleValidations($input_validator, $post_values);
269
+ }
270
  if ($input_validator->validate()) {
271
  return true;
272
  } else {
274
  }
275
  }
276
 
277
+ /**
278
+ * To run additional rule validation scripts
279
+ */
280
+ protected static function runAdditionalRuleValidations($validator, $post)
281
+ {
282
+ // rules
283
+ Validator::addRule('checkDateRange', function ($field, $value, array $params) {
284
+ return isset($params[0]) && strtotime($value) >= strtotime($params[0]);
285
+ }, __('Invalid date range', 'woo-discount-rules'));
286
+
287
+ Validator::addRule('checkRange', function ($field, $value, array $params) {
288
+ return isset($params[0]) && $value >= $params[0];
289
+ }, __('Invalid input range', 'woo-discount-rules'));
290
+
291
+ Validator::addRule('checkIsNotEmpty', function ($field, $value) {
292
+ $values = explode(',', $value);
293
+ $passes = array_map(function($value) { return !empty(trim($value)); }, $values);
294
+ return !in_array(false, $passes);
295
+ }, __('Invalid input', 'woo-discount-rules'));
296
+
297
+ // validate date
298
+ if (!empty($post['date_from']) && !empty($post['date_to'])) {
299
+ $validator->rule('checkDateRange', 'date_to', $post['date_from'])
300
+ ->message(__('Invalid date range', 'woo-discount-rules'));
301
+ }
302
+
303
+ // validate discounts
304
+ $validator = self::validateRuleDiscounts($validator, $post, [
305
+ 'product_adjustments', 'cart_adjustments',
306
+ 'bulk_adjustments', 'set_adjustments',
307
+ 'buyx_getx_adjustments', 'buyx_gety_adjustments',
308
+ ]);
309
+
310
+ // validate conditions
311
+ $validator = self::validateRuleConditions($validator, $post);
312
+
313
+ return $validator;
314
+ }
315
+
316
+ /**
317
+ * Validate rule discounts
318
+ */
319
+ protected static function validateRuleDiscounts($validator, $post, $fields)
320
+ {
321
+ foreach ($fields as $field) {
322
+ if (in_array($field, ['product_adjustments', 'cart_adjustments']) && !empty($post[$field]['type'])) {
323
+ // validate percentage
324
+ if ($post[$field]['type'] == 'percentage') {
325
+ $validator->rule('max', $field . '.value', 100)
326
+ ->message(__('Percentage discount value must be no more than 100', 'woo-discount-rules'));
327
+ }
328
+ } elseif (!empty($post[$field]['ranges'])) {
329
+ $prefix = strpos($field, 'buyx_') !== false ? 'free_' : '';
330
+ foreach ($post[$field]['ranges'] as $key => $range) {
331
+ // validate percentage
332
+ if (isset($range[$prefix . 'type']) && $range[$prefix . 'type'] == 'percentage') {
333
+ $validator->rule('max', $field . '.ranges.' . $key . '.' . $prefix . 'value', 100)
334
+ ->message(__('Percentage discount value must be no more than 100', 'woo-discount-rules'));
335
+ }
336
+ // validate range
337
+ if (!isset($range['recursive']) && isset($range['from']) && $range['from'] != '' && isset($range['to']) && $range['to'] != '') {
338
+ $validator->rule('checkRange', $field . '.ranges.' . $key . '.to', $range['from'])
339
+ ->message(__('Invalid input range', 'woo-discount-rules'));
340
+ }
341
+ }
342
+ }
343
+ }
344
+ return $validator;
345
+ }
346
+
347
+ /**
348
+ * Validate rule conditions
349
+ */
350
+ protected static function validateRuleConditions($validator, $post)
351
+ {
352
+ if (isset($post['conditions'])) {
353
+ foreach ($post['conditions'] as $key => $condition) {
354
+ if (!isset($condition['type'])) { continue; }
355
+ $type = $condition['type'];
356
+
357
+ // validate based on range
358
+ if (isset($condition['options']['operator']) && $condition['options']['operator'] == 'in_range') {
359
+ if ($condition['options']['from'] != '' && $condition['options']['to'] != '') {
360
+ $validator->rule('checkRange', 'conditions.' . $key . '.options.to', $condition['options']['from'])
361
+ ->message(__('Invalid input range', 'woo-discount-rules'));
362
+ }
363
+ }
364
+
365
+ // validate based on type
366
+ if (in_array($type, ['order_date', 'order_date_and_time', /*'order_time'*/])) { // validate date range
367
+ if (!empty($condition['options']['from']) && !empty($condition['options']['to'])) {
368
+ $validator->rule('checkDateRange', 'conditions.' . $key . '.options.to', $condition['options']['from'])
369
+ ->message(__('Invalid date range', 'woo-discount-rules'));
370
+ }
371
+ } elseif ($type == 'user_email') { // validate domain
372
+ $validator->rule('checkIsNotEmpty', 'conditions.' . $key . '.options.value', $condition['options']['operator'])
373
+ ->message(__('Invalid domain', 'woo-discount-rules'));
374
+ } elseif (in_array($type, ['shipping_city', 'Billing_city'])) { // validate city
375
+ $validator->rule('checkIsNotEmpty', 'conditions.' . $key . '.options.value')
376
+ ->message(__('Invalid city name', 'woo-discount-rules'));
377
+ } elseif ($type == 'shipping_zipcode') { // validate zipcode
378
+ $validator->rule('checkIsNotEmpty', 'conditions.' . $key . '.options.value')
379
+ ->message(__('Invalid zipcode', 'woo-discount-rules'));
380
+ }
381
+ }
382
+ }
383
+ return $validator;
384
+ }
385
+
386
  /**
387
  * validate Radio Button And Select Box
388
  *
v2/Assets/Css/admin_style.min.css CHANGED
@@ -1 +1 @@
1
- .btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.wdr-status-alert{padding:8px;border:1px solid transparent;border-radius:4px}.awdr-container .status-alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.awdr-container .status-alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.awdr-container .btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.awdr-container .btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.awdr-container .btn-danger,.wdr .btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.awdr-container .btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.awdr-container .btn-warning{color:#fff;background-color:#ffc100;border-color:#ffc100}.text-right{float:right;margin:2px;text-decoration:none}.wdr-rule-menu{float:left;width:19%;background-color:#fff;padding:10px 10px 0 10px}.wdr-rule-menu button{background-color:#6495ed;padding:8px;margin-top:7px;display:block;width:100%;color:#fff;text-decoration:none;border-radius:3px;border:1px solid #92b4f2}.main{float:left;width:80%;background-color:#fff;clear:right}.right{background-color:#e5e5e5;float:left;width:20%;padding:15px;margin-top:7px;text-align:center}.wdr-block{border:1px solid #dcdcdc;font-size:12px;line-height:24px;padding:5px 10px 10px 10px;color:#555;margin-top:5px;margin-bottom:10px;background-color:#fff}.wdr-grid{width:100%}.grid-container1{width:100%;display:table}.wdr-general-grid-container{display:grid;grid-template-columns:auto;grid-gap:10px}.wdr-general-grid-container>div{text-align:left;padding:5px 0}.wdr-rule-setting{display:grid;grid-template-columns:14% auto 30%;grid-gap:10px}.wdr-rule-date-valid{display:grid;grid-template-columns:49% 49%;grid-gap:10px}.wdr-rule-setting>div{padding:5px 0}.wdr-title{width:100%;box-sizing:border-box;border:1px solid #ccc;border-radius:4px;background-color:#fff;padding:8px 10px 8px 10px;height:40px}.wdr-discount-type-selector{box-sizing:border-box;border:1px solid #ccc;border-radius:4px;background-color:#fff;padding:8px 10px 8px 10px;height:40px}.wdr-save-rule{background-color:#6495ed!important;color:#fff!important;border:1px solid #92b4f2!important}.wdr-add-condition{line-height:24px;margin-top:10px}.wdr-column{margin-right:10px}.wdr-active{cursor:no-drop;background-color:#fff!important;color:#6495ed!important}.wdr-inactive:hover{cursor:pointer;background-color:#92b4f2!important}.wdr-conditions-container[data-index="1"]{display:none}.wdr-conditions-container{padding:10px 0 20px 0;list-style:none;display:flex;margin:10px 0;border-bottom:1px solid #ddd}.wdr-condition-types{width:22%;padding-right:5px}.wdr-condition-container{width:75%;display:flex;flex-wrap:nowrap}.wdr-discount-tabs{width:100%;display:table}.wdr-discount-tabs a{text-decoration:none;display:table-cell;padding:5px}.wdr-simple-discount-main{display:table;width:100%}.wdr-simple-discount-inner div{padding:5px;display:table-cell;width:auto;vertical-align:middle}.wdr-cart-discount-main{display:grid;width:100%}.wdr-cart-discount-inner div{padding:5px;display:inline-grid;width:auto}.wdr-discount-block{font-size:12px;line-height:24px;padding:5px 10px 10px 10px;color:#555;margin-bottom:10px}.wdr_desc_text{color:#a9a9a9;display:inline-block;font-size:12px;float:left;padding-top:5px}.wdr_settings_desc_text{color:#a9a9a9;display:inline-block;font-size:12px;float:left;padding-top:5px}.wdr_save_btn_disabled{opacity:.3;cursor:default}.awdr-container .toggle{--uiToggleSize:var(--toggleSize, 20px);--uiToggleIndent:var(--toggleIndent, .4em);--uiToggleBorderWidth:var(--toggleBorderWidth, 2px);--uiToggleColor:var(--toggleColor, #000);--uiToggleDisabledColor:var(--toggleDisabledColor, #868e96);--uiToggleBgColor:var(--toggleBgColor, #fff);--uiToggleArrowWidth:var(--toggleArrowWidth, 2px);--uiToggleArrowColor:var(--toggleArrowColor, #fff);display:inline-block;position:relative}.awdr-container .toggle__input{position:absolute;left:-99999px}.awdr-container .toggle__label{display:inline-flex;cursor:pointer;min-height:var(--uiToggleSize);padding-left:calc(var(--uiToggleSize) + var(--uiToggleIndent))}.awdr-container .toggle__label:before,.toggle__label:after{content:"";box-sizing:border-box;width:1em;height:1em;font-size:var(--uiToggleSize);position:absolute;left:0;top:0}.awdr-container .toggle__label:before{border:var(--uiToggleBorderWidth) solid var(--uiToggleColor);z-index:2}.awdr-container .toggle__input:disabled~.toggle__label:before{border-color:var(--uiToggleDisabledColor)}.awdr-container .toggle__input:focus~.toggle__label:before{box-shadow:0 0 0 2px var(--uiToggleBgColor),0 0 0 4px var(--uiToggleColor)}.awdr-container .toggle__input:not(:disabled):checked:focus~.toggle__label:after{box-shadow:0 0 0 2px var(--uiToggleBgColor),0 0 0 4px var(--uiToggleColor)}.awdr-container .toggle__input:not(:disabled)~.toggle__label:after{background-color:var(--uiToggleColor);opacity:0}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label:after{opacity:1}.awdr-container .toggle__text{margin-top:auto;margin-bottom:auto}.awdr-container .toggle__text:before{content:"";box-sizing:border-box;width:0;height:0;font-size:var(--uiToggleSize);border-left-width:0;border-bottom-width:0;border-left-style:solid;border-bottom-style:solid;border-color:var(--uiToggleArrowColor);position:absolute;top:.5428em;left:.2em;z-index:3;transform-origin:left top;transform:rotate(-40deg) skew(10deg)}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label .toggle__text:before{width:.5em;height:.25em;border-left-width:var(--uiToggleArrowWidth);border-bottom-width:var(--uiToggleArrowWidth);will-change:width,height;transition:width .1s ease-out .2s,height .2s ease-out}.awdr-container .toggle__label:before,.toggle__label:after{border-radius:2px}.awdr-container .toggle__input:not(:disabled)~.toggle__label:after,.awdr-container .toggle__input:not(:disabled)~.toggle__label:before{opacity:1;transform-origin:center center;will-change:transform;transition:transform .2s ease-out}.awdr-container .toggle__input:not(:disabled)~.toggle__label:before{transform:rotateY(0);transition-delay:.2s}.awdr-container .toggle__input:not(:disabled)~.toggle__label:after{transform:rotateY(90deg)}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label:before{transform:rotateY(-90deg);transition-delay:0s}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label:after{transform:rotateY(0);transition-delay:.2s}.awdr-container .toggle__text:before{opacity:0}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label .toggle__text:before{opacity:1;transition:opacity .1s ease-out .3s,width .1s ease-out .5s,height .2s ease-out .3s}.awdr-container .toggle{--toggleColor:#6495ed;--toggleBgColor:#6495ed;--toggleSize:25px}.awdr-container .page__toggle{padding-left:20px;padding-top:7px}.wdr-enable-rule .wdr-discount-type{width:19.7%}.wdr-enable-rule{display:flex;padding:10px 30px 20px 2px}@media only screen and (max-width:620px){.main,.right,.wdr-rule-menu{width:100%}}.wdr-sticky-header{background-color:#fff;padding:20px;margin-bottom:20px}.wdr-sticky{position:fixed;top:33px;width:87%;overflow:hidden;background-color:#eee;z-index:1}.nav-tab.nav-tab-active{background-color:#fff}.awdr-product-selector{width:100%!important;margin-bottom:10px;padding-left:4px}.wdr-filter-type select{height:34px}.wdr-product_filter_method select{height:34px}.wdr-product-filter-type{min-width:100px}.wdr-alert-top-right{position:fixed;top:116px;right:30px;width:300px;z-index:9999}.wdr-alert-success{color:#fff;background:green;font-weight:bolder}.wdr-alert-error{color:#fff;background:red;font-weight:bolder}.wdr-alert-warning{color:#fff;background:#f4a460;font-weight:bolder}.wdr-alert{border-radius:5px;padding:10px;margin-bottom:10px;width:100%!important;z-index:9999}.wdr-general-setting.form-table th{padding:20px 10px 20px 10px;width:300px}.wdr-filter-type{display:inline-block}.wdr-filter-group-items .wdr-filter-group .wdr-products_group{padding-right:10px;display:inline-flex;flex-wrap:nowrap;width:60%}.wdr_filter_remove{display:inline-block}.wdr-cart-search_box{min-width:500px}.wdr-coupon-search_box{min-width:400px}.wdr-search-box{min-width:250px;vertical-align:super}.wdr-filter-group{margin-bottom:10px;padding:15px 0 15px 0;border-bottom:1px solid #ddd}.wdr-condition-type select{height:34px}.wdr-select-filed-hight select{height:34px}.wdr-input-filed-hight input{height:34px!important}.add-condition-and-filters{margin-top:15px}.wdr-tool-tip{background-color:gray;color:#fff;display:inline-block;padding-left:5px;padding-right:5px;text-align:center;border-radius:50%;font-size:10px;font-weight:bolder;cursor:help}.wdr-hide{display:none}.padding10{padding:10px}.wdr-rule-statistics{display:flex}.wdr-rule-statistics>div{padding:10px}.awdr-container .button.bottom-tabs{margin-right:5px}.awdr-container .remove-clicked-discount-block:hover,.awdr-container .remove-current-row:hover,.awdr-container .wdr_discount_remove:hover{cursor:pointer}.wdr-ruleboard{cursor:move}.wdr-loader{display:none!important;width:64px;height:64px;position:absolute;left:0;right:0;z-index:999;margin:auto;top:0;bottom:0}.wdr-loader:after{content:" ";display:block;width:46px;height:46px;margin:1px;border-radius:50%;border:5px solid #333;border-color:#333 transparent #333 transparent;animation:wdr-loader 1.2s linear infinite}@keyframes wdr-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.awdr-container textarea{width:100%;height:150px;padding:10px 20px;box-sizing:border-box;border:1px solid #ddd;border-radius:4px;background-color:#f8f8f8;resize:none}.adv-msg-max-qty,.adv-msg-min-qty{display:none}.wdr-customizer-container{width:100%}.wdr-customizer-grid{display:grid;grid-template-columns:53% 47%;grid-gap:10px;padding:10px}.wdr-customizer-grid>div{padding:0 0}.popup-bulk-table{padding:0 0;margin-top:0}.popup-bulk-table tr th{padding:20px 20px}.wdr_bulk_table_msg{width:100%}.awdr-container .modal,.awdr-container .modal-box{z-index:9999;visibility:unset;opacity:1}.awdr-container .modal-sandbox{position:fixed;width:100%;height:100%;top:0;left:0;background:0 0}.awdr-container .modal{display:none;position:fixed;width:100%;height:100%;left:0;top:0;background:#000;background:rgba(0,0,0,.8);overflow:auto}.awdr-container .modal-box{position:relative;width:80%;max-width:920px;margin:100px auto;animation-name:modalbox;animation-duration:.4s;animation-timing-function:cubic-bezier(0,0,.3,1.6)}.awdr-container .modal-header{padding:20px 40px;background:#6495ed;color:#fff}.awdr-container .modal-body{background:#eceff1;padding:50px 15px}.awdr-container .close-modal{text-align:right;cursor:pointer}@-webkit-keyframes modalbox{0%{top:-250px;opacity:0}100%{top:0;opacity:1}}@keyframes modalbox{0%{top:-250px;opacity:0}100%{top:0;opacity:1}}.awdr-configuration-form .modal-trigger{top:50%;left:50%;background:0 0;border:1px solid #fff;text-decoration:none}.wdr-modal-header-title{color:#fff}.wdr-model-bottom-btn{float:right;margin:5px}.wdr-popup-link{cursor:pointer}table.wdr_bulk_table_msg,td.wdr_bulk_table_td,th.wdr_bulk_table_td,tr.wdr_bulk_table_tr{padding:10px}.wdr-customizer-notes{padding:0 10px}.wdr-red-text{color:red}.wdr-cart-coupon-value .coupon_name_msg{text-transform:uppercase}span#awdr_shortcode_text{font-weight:700}.awdr-list-header-btn a.text-right{float:right;margin-left:10px;text-decoration:none}.wdr-rule-options-con{width:80%;float:left}.awdr-clear{height:inherit;clear:both}.wdr-rule-filters-and-options-con{background-color:#fff;display:flex;padding:10px}.wdr-btn-remove .wdr_discount_remove,.wdr-condition-group .remove-current-row,.wdr-discount-block-remove .remove-clicked-discount-block,.wdr_filter_remove .remove-current-row{color:#fff;background-color:#d9534f;border-radius:3px}.wdr-condition-group .remove-current-row{margin-top:5px}.wdp-block.add-condition{margin-top:10px}.set_range_setter{margin-bottom:15px}.bulk_range_setter .wdr-simple-discount-inner,.range_setter_inner .wdr-simple-discount-inner,.wdr-cart-discount-placement .wdr-simple-discount-inner{border-bottom:1px solid #ddd;padding:5px 0}.buyx_getx_individual_range{padding:5px 0}.wdr-conditions-container .float_only_field,.wdr-conditions-container .number_only_field,.wdr-conditions-container input[type=number]{width:100px}.wdr-condition-type-options div{display:inline-block;margin:0 2px}.wdr-condition-type-options{margin:0 5px}#configuration-form table tbody tr>td:first-child{width:400px}.wdr_color_picker{letter-spacing:.2rem}.wdr_adv_msg_shortcode_text{color:#a9a9a9;font-size:12px}.awdr_popup_col_name_text_box{width:100%!important}#customize-bulk-table-title{width:40%;text-align:left}#customize-bulk-table-discount,#customize-bulk-table-range{width:30%;text-align:left}table.wdr_bulk_table_msg{border-collapse:collapse}table.wdr_bulk_table_msg,td.wdr_bulk_table_td,th.wdr_bulk_table_td,tr.wdr_bulk_table_tr{border:1px solid #bfc6cb}.awdr-dragable{cursor:ew-resize;word-break:break-all}.awdr_valide_date_in_desc{line-height:28px;font-size:14px;padding-left:20px}.wdr_customize_table table tbody tr>td:first-child{width:auto!important}.awdr-listing-rule-tr:hover{background-color:#ddf2ff}tr.awdr-listing-rule-tr td{vertical-align:middle}.awdr-text-warning{color:#8a6d3b}.updates-table tbody td.check-column,.widefat tbody th.check-column,.widefat tfoot td.check-column,.widefat thead td.check-column{padding:0!important}.widefat tbody th.check-column{padding:0!important}.widefat .check-column{width:2.2em!important;padding:0!important;vertical-align:middle!important}.awdr-save-green{border-radius:5px;padding:10px;width:98%;z-index:9999}.awdr-error-red{border-radius:5px;padding:10px;width:98%;z-index:9999}.banner-short-code-setting{vertical-align:middle;line-height:39px}.awdr-condition-container,.awdr-discount-container{background-color:#fff;margin:20px 0;clear:both}.awdr-discount-batch-container{background-color:#fff;clear:both}.awdr-condition-container h2,.awdr-discount-container h2,.wdr-advanced-layout-groups h2,.wdr-rule-menu h2{color:#6495ed;margin:auto}.awdr-sub-heading-description{font-size:smaller;color:gray}.woocommerce table.form-table.awdr-discount-badge{table-layout:auto!important}.woocommerce table.form-table.awdr-discount-badge input[type=text]{width:auto}.awdr-exclusive-enable-listing{color:#4cae4c;font-size:10px;border:1px solid #4cae4c;padding:2px;margin:8px;border-radius:3px}.awdr-exclusive-disable-listing{color:#d43f3a;font-size:10px;border:1px solid #d43f3a;padding:2px;margin:8px;border-radius:3px}.switch{position:relative;display:block;vertical-align:top;width:84px;height:30px;padding:3px;margin:0 5px 10px 0;border-radius:0;cursor:pointer;box-sizing:content-box}.switch-input{position:absolute;top:0;left:0;opacity:0;box-sizing:content-box}.switch-label{position:relative;display:block;height:inherit;font-size:13px;background:grey;border-radius:4px;box-sizing:content-box}.switch-label:after,.switch-label:before{position:absolute;top:50%;margin-top:-.5em;line-height:1;-webkit-transition:inherit;-moz-transition:inherit;-o-transition:inherit;transition:inherit;box-sizing:content-box}.switch-label:before{content:attr(data-off);right:11px;color:#fff;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label:after{content:attr(data-on);left:11px;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-input:checked~.switch-label{background:#5cb85c;box-shadow:inset 0 1px 2px rgba(0,0,0,.15),inset 0 0 3px rgba(0,0,0,.2)}.switch-input:checked~.switch-label:before{opacity:0}.switch-input:checked~.switch-label:after{opacity:1}.switch-handle{position:absolute;top:4px;left:4px;width:12px;height:28px;background:linear-gradient(to bottom,#fff 40%,#f0f0f0);background-image:-webkit-linear-gradient(top,#fff 40%,#f0f0f0);border-radius:4px;box-shadow:1px 1px 5px rgba(0,0,0,.2)}.switch-handle:before{content:"";position:absolute;top:50%;left:50%;margin:-6px 0 0 -6px;width:12px;height:12px;background:linear-gradient(to bottom,#eee,#fff);background-image:-webkit-linear-gradient(top,#eee,#fff);border-radius:6px;box-shadow:inset 0 1px rgba(0,0,0,.02)}.switch-input:checked~.switch-handle{left:74px;box-shadow:-1px 1px 5px rgba(0,0,0,.2)}.switch-handle,.switch-label{transition:All .3s ease;-webkit-transition:All .3s ease;-moz-transition:All .3s ease;-o-transition:All .3s ease}.awdr-container input[type=color]{padding:2px}.awdr-common-save{margin-left:auto}.wdr-buyx-getx-discount-main,.wdr-buyx-gety-discount-main{display:grid;width:100%}.awdr-buyx-getx-number-box,.awdr-buyx-gety-number-box{width:150px}.wdr-buyx-getx-discount-inner div,.wdr-buyx-gety-discount-inner div{display:inline-grid;width:auto;padding:5px}.awdr-discount-add-row{padding-left:14px}.awdr-listing-status-text{padding-left:10px}.awdr-get-y-general-settings{display:flex;width:auto}.awdr-left-align{float:left}.awdr-clear-both{clear:both}.awdr_check_styles{display:flex}.awdr_discount_type_section{padding-bottom:20px}.awdr-rules-sub-menu{padding-top:42px!important}.awdr-rule-limit-timestamp{color:#a9a9a9;display:inline-block;font-size:12px;text-transform:capitalize;line-height:34px;padding-left:15px}#wpfooter{position:relative;z-index:-1}.wdr-buyx-gety-discount-inner{padding:5px}.page__toggle.apply_as_cart_checkbox{padding-left:11px;padding-top:20px}.apply_as_cart_checkbox .toggle__label:after,.apply_as_cart_checkbox .toggle__label:before{width:.8em!important;height:.8em!important}.toggle_tic.toggle__text:before{top:.43em!important;left:.1em!important}.apply_discount_as_cart_section{display:flex}.apply_fee_coupon_label{padding-left:15px;padding-top:13px}.bulk-row-start{border-bottom:1px solid #ddd;padding:5px 0}.bulk-row-start div{padding:5px;display:table-cell;width:min-content}.woocommerce table.form-table.popup-bulk-table th{padding-right:0!important}.awdr_table_columns{display:flex}.awdr-accordion{background-color:#fff;color:#6495ed;cursor:pointer;padding:18px;width:100%;border:none;text-align:left;outline:0;font-weight:600;font-size:1.3em;transition:.4s}.awdr-accordion-active,.awdr-accordion:hover{background-color:grey;color:#fff}.awdr-accordion-panel{display:none;background-color:#fff;overflow:hidden}.awdr-accordion:after{content:'\02795';font-size:13px;color:#777;float:right;margin-left:5px}.awdr-accordion-active:after{content:"\2796"}.wdr_filter_desc_text{color:#a9a9a9;display:block;font-size:12px;padding-top:5px}.wdr_select2_desc_text{color:#a9a9a9;display:inline-block;font-size:12px;text-transform:capitalize;padding-top:5px}.awdr-sort-icon{padding-top:12px!important}.bulk_range_setter{cursor:move}.dashicons-menu{color:#a9a9a9!important}.dashicons-menu:hover{color:#000!important}.awdr_admin_discount_bar{padding:10px;margin-bottom:10px;border-radius:4px}.wdr_migration_container{margin:10px 0}.wdr_settings .woo_discount_loader{display:none;position:absolute;background-color:rgba(255,255,255,.5);top:0;left:0;width:100%;height:100%;text-align:center}.woo_discount_loader .lds-ripple{display:inline-block;position:relative;top:50%;width:64px;height:64px}.woo_discount_loader .lds-ripple div{position:absolute;border:4px solid #257af0;opacity:1;border-radius:50%;animation:lds-ripple 1s cubic-bezier(0,.2,.8,1) infinite}.woo_discount_loader .lds-ripple div:nth-child(2){animation-delay:-.5s}@keyframes lds-ripple{0%{top:28px;left:28px;width:0;height:0;opacity:1}100%{top:-1px;left:-1px;width:58px;height:58px;opacity:0}}.awdr-product-selector span.select2-selection{max-height:100px;overflow:auto}.bulk_discount_max,.bulk_discount_min,.bulk_discount_value,.set_discount_min,.set_discount_value{max-width:106px}.set-for{padding-bottom:32px!important}.set-discount-row-main{display:grid;width:100%}.set-discount-row-inner>div{display:inline-grid;width:auto;padding:5px}.bulk-row-main{display:grid;width:100%}.bulk-row-inner>div{display:inline-grid;width:auto;padding:5px}fieldset{border:1px solid #a9a9a9!important;float:left;margin:5px}.awdr-switch-version-button-on-tab{float:right;background:#5bc0de;color:#fff}.awdr_version_text{font-size:12px;display:inline-block;position:relative;top:10px;left:8px;font-weight:400;padding-right:10px}.awdr_rebuild_on_sale_list_notice{color:red;padding:8px 0}.awdr_rebuild_on_sale_rule_page_con{display:none}.awdr_rebuild_on_sale_rule_page_con.need_attention{display:contents}div.wdr{margin-top:30px;margin-right:20px}.awdr-common-save>button,.awdr-rule-buttons>a{margin-bottom:2px}@media (min-width:320px) and (max-width:480px){.wdr_settings{position:absolute}.wdr-rule-filters-and-options-con{display:contents}.wdr-enable-rule{display:inline-grid}.wdr-rule-setting{display:grid;grid-template-columns:unset}.wdr-conditions-container{display:contents}.wdr-rule-menu{width:80%}.wdr-rule-options-con{width:83%}#wpfooter{position:fixed}}@media (min-width:481px) and (max-width:767px){.wdr_settings{position:absolute}.wdr-rule-filters-and-options-con{display:contents}.wdr-rule-setting{display:grid;grid-template-columns:unset}.wdr-conditions-container{display:contents}.wdr-rule-menu{width:80%}.wdr-rule-options-con{width:83%}#wpfooter{position:fixed}}#wdr-search-top{position:relative;margin-left:189px;margin-bottom:-48px}.awdr_rebuild_on_sale_list_con .select2-search{width:120%}.wdr_subtotal_promo_filed_name{color:#000}.awdr-bullet-style{list-style-type:disc}.awdr-bullet-style li a{color:#444}.awdr-bulk-three-column{display:grid!important;grid-template-columns:10% 30% 50%!important;grid-gap:10px;padding:10px}.awdr-count-by-description{background-color:#f5de9c;padding:10px}.awdr_normal_enable_check_box,.awdr_normal_exclusive_check_box{padding:10px}.wdr_settings_desc_text.text-warning{color:#f0ad4e}.awdr_promotion_message_display_pages .select2-search__field{width:225%!important}.awdr_recipe_container{background-color:#fff;display:flex;padding:0 10px}.awdr_recipe_left{float:left;width:19%;background-color:#fff;padding:10px 10px 0 10px}.awdr_recipe_right{width:80%;float:left;margin:21px}div.awdr_recipe_main_card{cursor:pointer}.awdr_recipe_main_card{transition:.3s;width:100%;border-radius:5px;margin-top:20px;margin-bottom:20px;border-radius:5px;border:1px solid #6495ed}.awdr_recipe_main_card:first-child{background-color:#6495ed;color:#fff}.awdr_recipe_main_card div{padding:2px 16px;border-radius:5px}.card:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}.awdr_common_border_class{padding:10px;margin:10px;border:1px solid #6495ed;border-radius:5px}.awdr_recipe_main_content .button{background-color:#6495ed;border:none;color:#fff;padding:0 32px;text-align:center;text-decoration:none;display:inline-block;cursor:pointer;border-radius:5px;margin-left:10px}.awdr-three-column-document-head{display:grid;grid-template-columns:auto auto auto auto;background-color:#f0f0f1;padding:5px}.awdr-three-column-inner{padding:15px;font-size:large}.awdr-first-column{background-color:#fff;border:3px solid #f0f0f1}.awdr-second-column{background-color:#fff;border:3px solid #f0f0f1}.awdr-third-column{background-color:#fff;border:3px solid #f0f0f1}.wdr_read_documentation{text-decoration:none}.wdr_read_documentation_con{padding:10px 0 10px 0}.awdr-hr-line{padding:10px}.awdr-header_text_recipe{padding:0 20px;font-weight:700}.awdr-compatible-field{clear:both;padding-top:15px}.wdr-cart-coupon-url{display:inline-grid!important;width:100%}.wdr-cart-coupon-url-lists{margin-top:10px!important}.wdr-cart-coupon-url-all,.wdr-cart-coupon-url-custom,.wdr-cart-coupon-url-one,.wdr-coupon-url-group{margin-left:0}.wdr-coupon-url-group label{vertical-align:top}.wdr-coupon-url-group button{height:30px;padding-left:8px;padding-right:8px;border-radius:0 4px 4px 0;background:#f0f0f1;margin-left:-8px;margin-bottom:10px;color:#0a4b78;border:1px dashed #0a4b78}.wdr-coupon-url-group button:hover{background:#f0f0f1;border:1px dashed #0a4b78;cursor:pointer}.wdr-coupon-url-group input,.wdr-coupon-url-group input:focus{border:1px dashed #0a4b78;box-shadow:none}
1
+ .btn,.right,.wdr-tool-tip{text-align:center}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;white-space:nowrap;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.wdr-block,.wdr-discount-block{font-size:12px;line-height:24px}.wdr-status-alert{padding:8px;border:1px solid transparent;border-radius:4px}.awdr-container .status-alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.awdr-container .status-alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.awdr-container .btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.awdr-container .btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.awdr-container .btn-danger,.wdr .btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.awdr-container .btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.awdr-container .btn-warning{color:#fff;background-color:#ffc100;border-color:#ffc100}.text-right{float:right;margin:2px;text-decoration:none}.awdr_recipe_left,.wdr-rule-menu{float:left;width:19%;background-color:#fff;padding:10px 10px 0}.wdr-rule-menu button{background-color:#6495ed;padding:8px;margin-top:7px;display:block;width:100%;color:#fff;text-decoration:none;border-radius:3px;border:1px solid #92b4f2}.main{float:left;width:80%;background-color:#fff;clear:right}.right{background-color:#e5e5e5;float:left;width:20%;padding:15px;margin-top:7px}.wdr-customizer-container,.wdr-grid,.wdr-title,.wdr_bulk_table_msg{width:100%}.wdr-block{border:1px solid #dcdcdc;padding:5px 10px 10px;color:#555;margin-top:5px;margin-bottom:10px;background-color:#fff}.grid-container1,.wdr-discount-tabs{width:100%;display:table}.wdr-general-grid-container{display:grid;grid-template-columns:auto;grid-gap:10px}.wdr-general-grid-container>div{text-align:left;padding:5px 0}.wdr-rule-setting{display:grid;grid-template-columns:14% auto 30%;grid-gap:10px}.wdr-rule-date-valid{display:grid;grid-template-columns:49% 49%;grid-gap:10px}.buyx_getx_individual_range,.wdr-rule-setting>div{padding:5px 0}.wdr-discount-type-selector,.wdr-title{background-color:#fff;padding:8px 10px;height:40px;box-sizing:border-box}.wdr-discount-type-selector,.wdr-title{border:1px solid #ccc;border-radius:4px}.wdr-save-rule{background-color:#6495ed!important;color:#fff!important;border:1px solid #92b4f2!important}.wdr-add-condition{line-height:24px;margin-top:10px}.wdr-column{margin-right:10px}.wdr-active{cursor:no-drop;background-color:#fff!important;color:#6495ed!important}.wdr-inactive:hover{cursor:pointer;background-color:#92b4f2!important}.nav-tab.nav-tab-active,.wdr-sticky-header{background-color:#fff}.adv-msg-max-qty,.adv-msg-min-qty,.awdr_rebuild_on_sale_rule_page_con,.wdr-conditions-container[data-index="1"],.wdr-hide{display:none}.wdr-conditions-container{padding:10px 0 20px;list-style:none;display:flex;margin:10px 0;border-bottom:1px solid #ddd}.wdr-condition-types{width:22%;padding-right:5px}.wdr-condition-container{width:75%;display:flex;flex-wrap:nowrap}.wdr-discount-tabs a{text-decoration:none;display:table-cell;padding:5px}.wdr-simple-discount-main{display:table;width:100%}.wdr-simple-discount-inner div{padding:5px;display:table-cell;width:auto;vertical-align:middle}.bulk-row-main,.set-discount-row-main,.wdr-buyx-getx-discount-main,.wdr-buyx-gety-discount-main,.wdr-cart-discount-main{display:grid;width:100%}.wdr-cart-discount-inner div{padding:5px;display:inline-grid;width:auto}.wdr-discount-block{padding:5px 10px 10px;color:#555;margin-bottom:10px}.wdr_desc_text,.wdr_settings_desc_text{color:#a9a9a9;display:inline-block;font-size:12px;float:left;padding-top:5px}.wdr_save_btn_disabled{opacity:.3;cursor:default}.awdr-container .toggle{--uiToggleSize:var(--toggleSize, 20px);--uiToggleIndent:var(--toggleIndent, .4em);--uiToggleBorderWidth:var(--toggleBorderWidth, 2px);--uiToggleColor:var(--toggleColor, #000);--uiToggleDisabledColor:var(--toggleDisabledColor, #868e96);--uiToggleBgColor:var(--toggleBgColor, #fff);--uiToggleArrowWidth:var(--toggleArrowWidth, 2px);--uiToggleArrowColor:var(--toggleArrowColor, #fff);display:inline-block;position:relative;--toggleColor:#6495ed;--toggleBgColor:#6495ed;--toggleSize:25px}.awdr-container .toggle__input{position:absolute;left:-99999px}.awdr-container .toggle__label{display:inline-flex;cursor:pointer;min-height:var(--uiToggleSize);padding-left:calc(var(--uiToggleSize) + var(--uiToggleIndent))}.awdr-container .toggle__label:before,.toggle__label:after{content:"";box-sizing:border-box;width:1em;height:1em;font-size:var(--uiToggleSize);position:absolute;left:0;top:0}.awdr-container .toggle__label:before{border:var(--uiToggleBorderWidth) solid var(--uiToggleColor);z-index:2}.awdr-container .toggle__input:disabled~.toggle__label:before{border-color:var(--uiToggleDisabledColor)}.awdr-container .toggle__input:focus~.toggle__label:before,.awdr-container .toggle__input:not(:disabled):checked:focus~.toggle__label:after{box-shadow:0 0 0 2px var(--uiToggleBgColor),0 0 0 4px var(--uiToggleColor)}.awdr-container .toggle__input:not(:disabled)~.toggle__label:after{background-color:var(--uiToggleColor);opacity:0}.awdr-container .toggle__text{margin-top:auto;margin-bottom:auto}.awdr-container .toggle__text:before{content:"";box-sizing:border-box;width:0;height:0;font-size:var(--uiToggleSize);border-left-width:0;border-bottom-width:0;border-left-style:solid;border-bottom-style:solid;border-color:var(--uiToggleArrowColor);position:absolute;top:.5428em;left:.2em;z-index:3;transform-origin:left top;transform:rotate(-40deg) skew(10deg)}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label .toggle__text:before{width:.5em;height:.25em;border-left-width:var(--uiToggleArrowWidth);border-bottom-width:var(--uiToggleArrowWidth);will-change:width,height}.awdr-container .toggle__label:before,.toggle__label:after{border-radius:2px}.awdr-container .toggle__input:not(:disabled)~.toggle__label:after,.awdr-container .toggle__input:not(:disabled)~.toggle__label:before{opacity:1;transform-origin:center center;will-change:transform;transition:transform .2s ease-out}.awdr-container .toggle__input:not(:disabled)~.toggle__label:before{transform:rotateY(0);transition-delay:.2s}.awdr-container .toggle__input:not(:disabled)~.toggle__label:after{transform:rotateY(90deg)}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label:before{transform:rotateY(-90deg);transition-delay:0s}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label:after{opacity:1;transform:rotateY(0);transition-delay:.2s}.awdr-container .toggle__text:before,.switch-input:checked~.switch-label:before{opacity:0}.awdr-container .toggle__input:not(:disabled):checked~.toggle__label .toggle__text:before{opacity:1;transition:opacity .1s ease-out .3s,width .1s ease-out .5s,height .2s ease-out .3s}.awdr-container .page__toggle{padding-left:20px;padding-top:7px}.wdr-enable-rule .wdr-discount-type{width:19.7%}.wdr-enable-rule{display:flex;padding:10px 30px 20px 2px}.wdr-filter-type,.wdr-tool-tip,.wdr_filter_remove{display:inline-block}@media only screen and (max-width:620px){.main,.right,.wdr-rule-menu{width:100%}}.wdr-sticky-header{padding:20px;margin-bottom:20px}.wdr-sticky{position:fixed;top:33px;width:87%;overflow:hidden;background-color:#eee;z-index:1}.awdr-product-selector{width:100%!important;margin-bottom:10px;padding-left:4px}.wdr-condition-type select,.wdr-filter-type select,.wdr-product_filter_method select,.wdr-select-filed-hight select{height:34px}.wdr-product-filter-type{min-width:100px}.wdr-alert-top-right{position:fixed;top:116px;right:30px;width:300px;z-index:9999}.wdr-alert-success{color:#fff;background:green;font-weight:bolder}.wdr-alert-error{color:#fff;background:red;font-weight:bolder}.wdr-alert-warning{color:#fff;background:#f4a460;font-weight:bolder}.wdr-alert{border-radius:5px;padding:10px;margin-bottom:10px;width:100%!important;z-index:9999}.wdr-general-setting.form-table th{padding:20px 10px;width:300px}.wdr-filter-group-items .wdr-filter-group .wdr-products_group{padding-right:10px;display:inline-flex;flex-wrap:nowrap;width:60%}.wdr-cart-search_box{min-width:500px}.wdr-coupon-search_box{min-width:400px}.wdr-search-box{min-width:250px;vertical-align:super}.wdr-filter-group{margin-bottom:10px;padding:15px 0;border-bottom:1px solid #ddd}.wdr-input-filed-hight input{height:34px!important}.add-condition-and-filters{margin-top:15px}.wdr-tool-tip{background-color:gray;color:#fff;padding-left:5px;padding-right:5px;border-radius:50%;font-size:10px;font-weight:bolder;cursor:help}.awdr-hr-line,.awdr_normal_enable_check_box,.awdr_normal_exclusive_check_box,.padding10,.wdr-rule-statistics>div{padding:10px}.apply_discount_as_cart_section,.awdr_check_styles,.awdr_table_columns,.wdr-rule-statistics{display:flex}.awdr-container .button.bottom-tabs{margin-right:5px}.awdr-container .remove-clicked-discount-block:hover,.awdr-container .remove-current-row:hover,.awdr-container .wdr_discount_remove:hover,.wdr-popup-link,div.awdr_recipe_main_card{cursor:pointer}.bulk_range_setter,.wdr-ruleboard{cursor:move}.wdr-loader{display:none!important;width:64px;height:64px;position:absolute;left:0;right:0;z-index:999;margin:auto;top:0;bottom:0}.wdr-loader:after{content:" ";display:block;width:46px;height:46px;margin:1px;border-radius:50%;border:5px solid #333;border-color:#333 transparent;animation:1.2s linear infinite wdr-loader}@keyframes wdr-loader{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}.awdr-container textarea{width:100%;height:150px;padding:10px 20px;box-sizing:border-box;border:1px solid #ddd;border-radius:4px;background-color:#f8f8f8;resize:none}.wdr-customizer-grid{display:grid;grid-template-columns:53% 47%;grid-gap:10px;padding:10px}.wdr-customizer-grid>div{padding:0}.popup-bulk-table{padding:0;margin-top:0}.popup-bulk-table tr th{padding:20px}.awdr-container .modal,.awdr-container .modal-box{z-index:9999;visibility:unset;opacity:1}.awdr-container .modal-sandbox{position:fixed;width:100%;height:100%;top:0;left:0;background:0 0}.awdr-container .modal{display:none;position:fixed;width:100%;height:100%;left:0;top:0;background:rgba(0,0,0,.8);overflow:auto}.awdr-container .modal-box{position:relative;width:80%;max-width:920px;margin:100px auto;animation-name:modalbox;animation-duration:.4s;animation-timing-function:cubic-bezier(0,0,.3,1.6)}.awdr-container .modal-header{padding:20px 40px;background:#6495ed;color:#fff}.awdr-container .modal-body{background:#eceff1;padding:50px 15px}.awdr-container .close-modal{text-align:right;cursor:pointer}@-webkit-keyframes modalbox{0%{top:-250px;opacity:0}100%{top:0;opacity:1}}@keyframes modalbox{0%{top:-250px;opacity:0}100%{top:0;opacity:1}}.awdr-configuration-form .modal-trigger{top:50%;left:50%;background:0 0;border:1px solid #fff;text-decoration:none}.wdr-modal-header-title{color:#fff}.wdr-model-bottom-btn{float:right;margin:5px}.awdr-left-align,fieldset{float:left}.wdr-customizer-notes{padding:0 10px}.wdr-red-text{color:red}.wdr-cart-coupon-value .coupon_name_msg{text-transform:uppercase}span#awdr_shortcode_text{font-weight:700}.awdr-list-header-btn a.text-right{float:right;margin-left:10px;text-decoration:none}.wdr-rule-options-con{width:80%;float:left}.awdr-clear{height:inherit;clear:both}.wdr-rule-filters-and-options-con{background-color:#fff;display:flex;padding:10px}.switch,.switch-label{display:block;box-sizing:content-box}.wdr-btn-remove .wdr_discount_remove,.wdr-condition-group .remove-current-row,.wdr-discount-block-remove .remove-clicked-discount-block,.wdr_filter_remove .remove-current-row{color:#fff;background-color:#d9534f;border-radius:3px}.wdr-condition-group .remove-current-row{margin-top:5px}.wdp-block.add-condition{margin-top:10px}.set_range_setter{margin-bottom:15px}.bulk-row-start,.bulk_range_setter .wdr-simple-discount-inner,.range_setter_inner .wdr-simple-discount-inner,.wdr-cart-discount-placement .wdr-simple-discount-inner{border-bottom:1px solid #ddd;padding:5px 0}.wdr-conditions-container .float_only_field,.wdr-conditions-container .number_only_field,.wdr-conditions-container input[type=number]{width:100px}.wdr-condition-type-options div{display:inline-block;margin:0 2px}.wdr-condition-type-options{margin:0 5px}#configuration-form table tbody tr>td:first-child{width:400px}.wdr_color_picker{letter-spacing:.2rem}.wdr_adv_msg_shortcode_text{color:#a9a9a9;font-size:12px}.awdr_popup_col_name_text_box{width:100%!important}#customize-bulk-table-title{width:40%;text-align:left}#customize-bulk-table-discount,#customize-bulk-table-range{width:30%;text-align:left}table.wdr_bulk_table_msg{border-collapse:collapse}table.wdr_bulk_table_msg,td.wdr_bulk_table_td,th.wdr_bulk_table_td,tr.wdr_bulk_table_tr{padding:10px;border:1px solid #bfc6cb}.awdr-dragable{cursor:ew-resize;word-break:break-all}.awdr_valide_date_in_desc{line-height:28px;font-size:14px;padding-left:20px}.wdr_customize_table table tbody tr>td:first-child{width:auto!important}.awdr-listing-rule-tr:hover{background-color:#ddf2ff}tr.awdr-listing-rule-tr td{vertical-align:middle}.awdr-text-warning{color:#8a6d3b}.updates-table tbody td.check-column,.widefat tbody th.check-column,.widefat tfoot td.check-column,.widefat thead td.check-column{padding:0!important}.widefat .check-column{width:2.2em!important;padding:0!important;vertical-align:middle!important}.awdr-error-red,.awdr-save-green{border-radius:5px;padding:10px;width:98%;z-index:9999}.banner-short-code-setting{vertical-align:middle;line-height:39px}.switch,.wdr-coupon-url-group label{vertical-align:top}.awdr-condition-container,.awdr-discount-container{background-color:#fff;margin:20px 0;clear:both}.awdr-discount-batch-container{background-color:#fff;clear:both}.awdr-condition-container h2,.awdr-discount-container h2,.wdr-advanced-layout-groups h2,.wdr-rule-menu h2{color:#6495ed;margin:auto}.awdr-sub-heading-description{font-size:smaller;color:gray}.woocommerce table.form-table.awdr-discount-badge{table-layout:auto!important}.woocommerce table.form-table.awdr-discount-badge input[type=text]{width:auto}.awdr-exclusive-enable-listing{color:#4cae4c;font-size:10px;border:1px solid #4cae4c;padding:2px;margin:8px;border-radius:3px}.awdr-exclusive-disable-listing{color:#d43f3a;font-size:10px;border:1px solid #d43f3a;padding:2px;margin:8px;border-radius:3px}.switch{position:relative;width:84px;height:30px;padding:3px;margin:0 5px 10px 0;border-radius:0;cursor:pointer}.switch-input{position:absolute;top:0;left:0;opacity:0;box-sizing:content-box}.switch-label{position:relative;height:inherit;font-size:13px;background:grey;border-radius:4px}.switch-label:after,.switch-label:before{position:absolute;top:50%;margin-top:-.5em;line-height:1;-webkit-transition:inherit;-moz-transition:inherit;-o-transition:inherit;transition:inherit;box-sizing:content-box}.switch-label:before{content:attr(data-off);right:11px;color:#fff;text-shadow:0 1px rgba(255,255,255,.5)}.switch-label:after{content:attr(data-on);left:11px;color:#fff;text-shadow:0 1px rgba(0,0,0,.2);opacity:0}.switch-input:checked~.switch-label{background:#5cb85c;box-shadow:inset 0 1px 2px rgba(0,0,0,.15),inset 0 0 3px rgba(0,0,0,.2)}.switch-input:checked~.switch-label:after{opacity:1}.switch-handle{position:absolute;top:4px;left:4px;width:12px;height:28px;background:linear-gradient(to bottom,#fff 40%,#f0f0f0);background-image:-webkit-linear-gradient(top,#fff 40%,#f0f0f0);border-radius:4px;box-shadow:1px 1px 5px rgba(0,0,0,.2)}.switch-handle:before{content:"";position:absolute;top:50%;left:50%;margin:-6px 0 0 -6px;width:12px;height:12px;background:linear-gradient(to bottom,#eee,#fff);background-image:-webkit-linear-gradient(top,#eee,#fff);border-radius:6px;box-shadow:inset 0 1px rgba(0,0,0,.02)}.switch-input:checked~.switch-handle{left:74px;box-shadow:-1px 1px 5px rgba(0,0,0,.2)}.switch-handle,.switch-label{transition:All .3s;-webkit-transition:All .3s;-moz-transition:All .3s;-o-transition:All .3s}.awdr-container input[type=color]{padding:2px}.awdr-common-save{margin-left:auto}.awdr-buyx-getx-number-box,.awdr-buyx-gety-number-box{width:150px}.bulk-row-inner>div,.set-discount-row-inner>div,.wdr-buyx-getx-discount-inner div,.wdr-buyx-gety-discount-inner div{display:inline-grid;width:auto;padding:5px}.awdr-discount-add-row{padding-left:14px}.awdr-listing-status-text{padding-left:10px}.awdr-get-y-general-settings{display:flex;width:auto}.awdr-clear-both{clear:both}.awdr_discount_type_section{padding-bottom:20px}.awdr-rules-sub-menu{padding-top:42px!important}.awdr-rule-limit-timestamp{color:#a9a9a9;display:inline-block;font-size:12px;text-transform:capitalize;line-height:34px;padding-left:15px}#wpfooter{position:relative;z-index:-1}.wdr-buyx-gety-discount-inner{padding:5px}.page__toggle.apply_as_cart_checkbox{padding-left:11px;padding-top:20px}.apply_as_cart_checkbox .toggle__label:after,.apply_as_cart_checkbox .toggle__label:before{width:.8em!important;height:.8em!important}.toggle_tic.toggle__text:before{top:.43em!important;left:.1em!important}.apply_fee_coupon_label{padding-left:15px;padding-top:13px}.bulk-row-start div{padding:5px;display:table-cell;width:min-content}.woocommerce table.form-table.popup-bulk-table th{padding-right:0!important}.awdr-accordion{background-color:#fff;color:#6495ed;cursor:pointer;padding:18px;width:100%;border:none;text-align:left;outline:0;font-weight:600;font-size:1.3em;transition:.4s}.awdr-accordion-active,.awdr-accordion:hover{background-color:grey;color:#fff}.wdr_filter_desc_text,.wdr_select2_desc_text{color:#a9a9a9;padding-top:5px;font-size:12px}.awdr-accordion-panel{display:none;background-color:#fff;overflow:hidden}.awdr-accordion:after{content:'\02795';font-size:13px;color:#777;float:right;margin-left:5px}.awdr-accordion-active:after{content:"\2796"}.wdr_filter_desc_text{display:block}.wdr_select2_desc_text{display:inline-block;text-transform:capitalize}.awdr-sort-icon{padding-top:12px!important}.dashicons-menu{color:#a9a9a9!important}.dashicons-menu:hover{color:#000!important}.awdr_admin_discount_bar{padding:10px;margin-bottom:10px;border-radius:4px}.wdr_migration_container{margin:10px 0}.wdr_settings .woo_discount_loader{display:none;position:absolute;background-color:rgba(255,255,255,.5);top:0;left:0;width:100%;height:100%;text-align:center}.woo_discount_loader .lds-ripple{display:inline-block;position:relative;top:50%;width:64px;height:64px}.woo_discount_loader .lds-ripple div{position:absolute;border:4px solid #257af0;opacity:1;border-radius:50%;animation:1s cubic-bezier(0,.2,.8,1) infinite lds-ripple}.woo_discount_loader .lds-ripple div:nth-child(2){animation-delay:-.5s}@keyframes lds-ripple{0%{top:28px;left:28px;width:0;height:0;opacity:1}100%{top:-1px;left:-1px;width:58px;height:58px;opacity:0}}.awdr-product-selector span.select2-selection{max-height:100px;overflow:auto}.bulk_discount_max,.bulk_discount_min,.bulk_discount_value,.set_discount_min,.set_discount_value{max-width:106px}.set-for{padding-bottom:32px!important}fieldset{border:1px solid #a9a9a9!important;margin:5px}.awdr-switch-version-button-on-tab{float:right;background:#5bc0de;color:#fff}.awdr_version_text{font-size:12px;display:inline-block;position:relative;top:10px;left:8px;font-weight:400;padding-right:10px}.awdr_rebuild_on_sale_list_notice{color:red;padding:8px 0}.awdr_rebuild_on_sale_rule_page_con.need_attention{display:contents}div.wdr{margin-top:30px;margin-right:20px}.awdr-common-save>button,.awdr-rule-buttons>a{margin-bottom:2px}@media (min-width:320px) and (max-width:480px){.wdr_settings{position:absolute}.wdr-conditions-container,.wdr-rule-filters-and-options-con{display:contents}.wdr-enable-rule{display:inline-grid}.wdr-rule-setting{display:grid;grid-template-columns:unset}.wdr-rule-menu{width:80%}.wdr-rule-options-con{width:83%}#wpfooter{position:fixed}}@media (min-width:481px) and (max-width:767px){.wdr_settings{position:absolute}.wdr-conditions-container,.wdr-rule-filters-and-options-con{display:contents}.wdr-rule-setting{display:grid;grid-template-columns:unset}.wdr-rule-menu{width:80%}.wdr-rule-options-con{width:83%}#wpfooter{position:fixed}}#wdr-search-top{position:relative;margin-left:189px;margin-bottom:-48px}.awdr_rebuild_on_sale_list_con .select2-search{width:120%}.wdr_subtotal_promo_filed_name{color:#000}.awdr-bullet-style{list-style-type:disc}.awdr-bullet-style li a{color:#444}.awdr-bulk-three-column{display:grid!important;grid-template-columns:10% 30% 50%!important;grid-gap:10px;padding:10px}.awdr-count-by-description{background-color:#f5de9c;padding:10px}.wdr_settings_desc_text.text-warning{color:#f0ad4e}.awdr_recipe_main_card:first-child,.awdr_recipe_main_content .button{background-color:#6495ed;color:#fff}.awdr_promotion_message_display_pages .select2-search__field{width:225%!important}.awdr_recipe_container{background-color:#fff;display:flex;padding:0 10px}.awdr_recipe_right{width:80%;float:left;margin:21px}.awdr_recipe_main_card{transition:.3s;width:100%;border-radius:5px;margin-top:20px;margin-bottom:20px;border:1px solid #6495ed}.awdr_recipe_main_card div{padding:2px 16px;border-radius:5px}.card:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,.2)}.awdr_common_border_class{padding:10px;margin:10px;border:1px solid #6495ed;border-radius:5px}.awdr_recipe_main_content .button{border:none;padding:0 32px;text-align:center;text-decoration:none;display:inline-block;cursor:pointer;border-radius:5px;margin-left:10px}.awdr-three-column-document-head{display:grid;grid-template-columns:auto auto auto auto;background-color:#f0f0f1;padding:5px}.awdr-three-column-inner{padding:15px;font-size:large}.awdr-first-column,.awdr-second-column,.awdr-third-column{background-color:#fff;border:3px solid #f0f0f1}.wdr_read_documentation{text-decoration:none}.wdr_read_documentation_con{padding:10px 0}.awdr-header_text_recipe{padding:0 20px;font-weight:700}.awdr-compatible-field{clear:both;padding-top:15px}.wdr-cart-coupon-url{display:inline-grid!important;width:100%}.wdr-cart-coupon-url-lists{margin-top:10px!important}.wdr-cart-coupon-url-all,.wdr-cart-coupon-url-custom,.wdr-cart-coupon-url-one,.wdr-coupon-url-group{margin-left:0}.wdr-coupon-url-group button{height:30px;padding-left:8px;padding-right:8px;border-radius:0 4px 4px 0;background:#f0f0f1;margin-left:-8px;margin-bottom:10px;color:#0a4b78;border:1px dashed #0a4b78}.wdr-coupon-url-group button:hover{background:#f0f0f1;border:1px dashed #0a4b78;cursor:pointer}.wdr-coupon-url-group input,.wdr-coupon-url-group input:focus{border:1px dashed #0a4b78;box-shadow:none}
v2/Assets/Js/admin_script.js CHANGED
@@ -292,10 +292,13 @@ jQuery(document).ready(function ($) {
292
 
293
  /*Remove Section*/
294
  $(document).on('click', '.wdr_discount_remove', function () {
295
- wdr_buildrule.remove_wdr_field_group({
296
- parentsRow: '.wdr-discount-group',
297
- thisObject: this,
298
- });
 
 
 
299
  });
300
 
301
  /*Discounts Tabs navigation*/
@@ -838,6 +841,8 @@ jQuery(document).ready(function ($) {
838
  }
839
  let loader = $('.woo_discount_loader');
840
 
 
 
841
  $.ajax({
842
  data: $(this).serialize(),
843
  type: 'post',
@@ -876,6 +881,17 @@ jQuery(document).ready(function ($) {
876
  notify(message, 'error',alert_counter);
877
  });
878
  }
 
 
 
 
 
 
 
 
 
 
 
879
  }
880
  }
881
  }
@@ -1106,15 +1122,6 @@ jQuery(document).ready(function ($) {
1106
  let free_qty = $(element).find('.bxgx-qty').val();
1107
  let select_type = $(element).find('.buyx_getx_discount_select').val();
1108
  let max_val = $(element).find('.bxgx-value').val();
1109
- if ($(element).find('.awdr-bogo-recurcive').prop("checked") == true) {
1110
- if (min_qty == '') {
1111
- discount_array.push("fails");
1112
- $(element).find('.bxgx-min').css("border", "1px solid red");
1113
- $(element).find('.bxgx-min').focus();
1114
- } else {
1115
- $(element).find('.bxgx-min').css("border", "1px solid #7e8993");
1116
- }
1117
- }
1118
  if (min_qty == '' && max_qty == '') {
1119
  discount_array.push("fails");
1120
  $(element).find('.bxgx-min').css("border", "1px solid red");
@@ -1125,6 +1132,15 @@ jQuery(document).ready(function ($) {
1125
  $(element).find('.bxgx-min').css("border", "1px solid #7e8993");
1126
  $(element).find('.bxgx-max').css("border", "1px solid #7e8993");
1127
  }
 
 
 
 
 
 
 
 
 
1128
  if (free_qty == '') {
1129
  discount_array.push("fails");
1130
  $(element).find('.bxgx-qty').css("border", "1px solid red");
@@ -1177,15 +1193,6 @@ jQuery(document).ready(function ($) {
1177
  $('.select_bxgy_type').css("border", "1px solid #7e8993");
1178
  }
1179
 
1180
- if ($(element).find('.awdr-bogo-recurcive').prop("checked") == true) {
1181
- if (min_qty == '') {
1182
- discount_array.push("fails");
1183
- $(element).find('.bxgy-min').css("border", "1px solid red");
1184
- $(element).find('.bxgy-min').focus();
1185
- } else {
1186
- $(element).find('.bxgy-min').css("border", "1px solid #7e8993");
1187
- }
1188
- }
1189
  if (min_qty == '' && max_qty == '') {
1190
  discount_array.push("fails");
1191
  $(element).find('.bxgy-min').css("border", "1px solid red");
@@ -1196,6 +1203,15 @@ jQuery(document).ready(function ($) {
1196
  $(element).find('.bxgy-min').css("border", "1px solid #7e8993");
1197
  $(element).find('.bxgy-max').css("border", "1px solid #7e8993");
1198
  }
 
 
 
 
 
 
 
 
 
1199
  if (free_qty == '') {
1200
  discount_array.push("fails");
1201
  $(element).find('.bxgy-qty').css("border", "1px solid red");
@@ -1583,7 +1599,7 @@ jQuery(document).ready(function ($) {
1583
  let status_for_product_qty = $(element).find('.wdr-wc-order-status').val();
1584
  let amount_for_product_qty = $(element).find('.float_only_field').val();
1585
  let product_ordered = $(element).find('.specific_product').val();
1586
- if (!product_ordered) {
1587
  condition_array.push("fails");
1588
  $(element).find('.wdr-previous-order-product-selector .select2-selection').css("border", "1px solid red");
1589
  $(element).find('.wdr-previous-order-product-selector .select2-selection').focus();
292
 
293
  /*Remove Section*/
294
  $(document).on('click', '.wdr_discount_remove', function () {
295
+ let rows_count = $(this).closest('.wdr-discount-group').parent().find('.wdr-discount-group').length;
296
+ if (rows_count > 1) {
297
+ wdr_buildrule.remove_wdr_field_group({
298
+ parentsRow: '.wdr-discount-group',
299
+ thisObject: this,
300
+ });
301
+ }
302
  });
303
 
304
  /*Discounts Tabs navigation*/
841
  }
842
  let loader = $('.woo_discount_loader');
843
 
844
+ $("#wdr-save-rule .awdr-validation-attention").css("border", "1px solid #7e8993");
845
+
846
  $.ajax({
847
  data: $(this).serialize(),
848
  type: 'post',
881
  notify(message, 'error',alert_counter);
882
  });
883
  }
884
+
885
+ let name = '', names;
886
+ names = key.split('.');
887
+ names.forEach(function(value, index) {
888
+ if (names.length !== 1) {
889
+ name += (index + 1 !== 1) ? '[' + value + ']' : value;
890
+ } else {
891
+ name += value;
892
+ }
893
+ });
894
+ $('#wdr-save-rule [name="' + name + '"]').css("border", "1px solid red").focus().addClass('awdr-validation-attention');
895
  }
896
  }
897
  }
1122
  let free_qty = $(element).find('.bxgx-qty').val();
1123
  let select_type = $(element).find('.buyx_getx_discount_select').val();
1124
  let max_val = $(element).find('.bxgx-value').val();
 
 
 
 
 
 
 
 
 
1125
  if (min_qty == '' && max_qty == '') {
1126
  discount_array.push("fails");
1127
  $(element).find('.bxgx-min').css("border", "1px solid red");
1132
  $(element).find('.bxgx-min').css("border", "1px solid #7e8993");
1133
  $(element).find('.bxgx-max').css("border", "1px solid #7e8993");
1134
  }
1135
+ if ($(element).find('.awdr-bogo-recurcive').prop("checked") == true) {
1136
+ if (min_qty == '') {
1137
+ discount_array.push("fails");
1138
+ $(element).find('.bxgx-min').css("border", "1px solid red");
1139
+ $(element).find('.bxgx-min').focus();
1140
+ } else {
1141
+ $(element).find('.bxgx-min').css("border", "1px solid #7e8993");
1142
+ }
1143
+ }
1144
  if (free_qty == '') {
1145
  discount_array.push("fails");
1146
  $(element).find('.bxgx-qty').css("border", "1px solid red");
1193
  $('.select_bxgy_type').css("border", "1px solid #7e8993");
1194
  }
1195
 
 
 
 
 
 
 
 
 
 
1196
  if (min_qty == '' && max_qty == '') {
1197
  discount_array.push("fails");
1198
  $(element).find('.bxgy-min').css("border", "1px solid red");
1203
  $(element).find('.bxgy-min').css("border", "1px solid #7e8993");
1204
  $(element).find('.bxgy-max').css("border", "1px solid #7e8993");
1205
  }
1206
+ if ($(element).find('.awdr-bogo-recurcive').prop("checked") == true) {
1207
+ if (min_qty == '') {
1208
+ discount_array.push("fails");
1209
+ $(element).find('.bxgy-min').css("border", "1px solid red");
1210
+ $(element).find('.bxgy-min').focus();
1211
+ } else {
1212
+ $(element).find('.bxgy-min').css("border", "1px solid #7e8993");
1213
+ }
1214
+ }
1215
  if (free_qty == '') {
1216
  discount_array.push("fails");
1217
  $(element).find('.bxgy-qty').css("border", "1px solid red");
1599
  let status_for_product_qty = $(element).find('.wdr-wc-order-status').val();
1600
  let amount_for_product_qty = $(element).find('.float_only_field').val();
1601
  let product_ordered = $(element).find('.specific_product').val();
1602
+ if (product_ordered.length == 0) {
1603
  condition_array.push("fails");
1604
  $(element).find('.wdr-previous-order-product-selector .select2-selection').css("border", "1px solid red");
1605
  $(element).find('.wdr-previous-order-product-selector .select2-selection').focus();
v2/Assets/Js/admin_script.min.js CHANGED
@@ -1 +1 @@
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(e){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":c=wdr_filter_validation(),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()}),window.wdr_filter_validation=function(){let a=[];return $(".wdr-filter-group").each(function(e,b){let d=$(b).find(".wdr-product-filter-type").val(),c=$(b).find(".awdr_validation").val();switch(d){case"all_products":case"product_on_sale":break;case"products":case"product_category":case"product_attributes":case"product_tags":case"product_sku":0==c.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;default:null==c||0==c.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},$("#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")})})
1
+ jQuery(document).ready(function(e){let t={counts:1};function a(t){let a=t.val(),d=t.parents(".wdr-conditions-container").attr("data-index");"greater_than_or_equal"==a||"greater_than"==a?e(".promo_show_hide_"+d).show():e(".promo_show_hide_"+d).hide()}function d(a,d,o=!1){e.ajax({data:{method:"rebuild_onsale_list",action:"wdr_ajax",rules:a,update:o?1:0,awdr_nonce:d.attr("data-awdr_nonce")},type:"post",url:ajaxurl,error:function(e,a){n(wdr_data.localization_data.error,"error",t),d.removeAttr("disabled")},success:function(e){d.html(wdr_data.localization_data.rebuild_on_sale_list_processed_text),d.removeAttr("disabled")}})}function o(t){void 0!==t.required_rebuild&&!0==t.required_rebuild&&(e("#awdr_rebuild_on_sale_list_on_rule_page").html(wdr_data.localization_data.rebuild_on_sale_list_build_text),e(".awdr_rebuild_on_sale_rule_page_con").addClass("need_attention"))}function i(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(a){return{query:a.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 s(e){return 0===e?0:parseInt(e)+1}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=s(t),wdr_buildrule.wdr_clone_field({addFilterType:".wdr-build-filter-type",addFilterMethod:".products",addRemoveIcon:".wdr-icon-remove",ruleAppendTo:".wdr-filter-group-items",newIndex:t}),i(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"),a=e(this).val();switch(wdr_buildrule.remove_wdr_field_group({parentRow:e(this).parent()}),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+a,addRemoveIcon:".wdr-icon-remove",ruleAppendTo:e(this).parents(".wdr-filter-group"),newIndex:t}),a){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>")}i(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=s(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&&a(e(this))}),e(document).on("change",".wdr_quantity_operator",function(){"1"==wdr_data.enable_cart_quantity_promo_text&&a(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 a=e(this).parents(".wdr-conditions-container").attr("data-index");e(".promo_show_hide_"+a).remove()}if("cart_items_quantity"==t){let d=e(this).parents(".wdr-conditions-container").attr("data-index");e(".promo_show_hide_"+d).remove()}}}),e(document).on("change",".wdr-product-condition-type",function(){var t=e(this).parents(".wdr-condition-group").data("index"),a=e(this).val();wdr_buildrule.remove_wdr_field_group({parentRow:e(this).parent()}),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+a,addRemoveIcon:".wdr-icon-remove",ruleAppendTo:e(this).parents(".wdr-conditions-container"),newIndex:t});var d=e(this).parents(".wdr-conditions-container").attr("data-index");"undefined"!=e(".promo_show_hide_"+d)[0]&&e(".promo_show_hide_"+d).remove(),"order_time"==a?e(".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:t}),e(".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:t}),e(".wdr_quantity_operator").trigger("change")),i(e(this).parents(".wdr-conditions-container").find('[data-field="autocomplete"]')),function t(a){a.each(function(t,a){var d=e(a),o=wdr_data.lists[d.data("list")];d.selectWoo({width:"100%",escapeMarkup:function(e){return e},minimumInputLength:1,placeholder:d.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:o}),d.parent().find(".select2-search__field").css("width","100%")})}(e(this).parents(".wdr-conditions-container").find('[data-field="preloaded"]')),function t(a){a.each(function(t,a){var d=e(a),o=wdr_data.lists[d.data("list")];d.selectWoo({width:"100%",escapeMarkup:function(e){return e},placeholder:d.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:o}),d.parent().find(".select2-search__field").css("width","100%")})}(e(this).parents(".wdr-conditions-container").find('[data-field="autoloaded"]')),function t(a){a.each(function(t,a){var d=e(a).data("class");"start_dateonly"==d?e('[data-class="'+d+'"]').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"==d?e('[data-class="'+d+'"]').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"==d?e('[data-class="'+d+'"]').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"==d&&e('[data-class="'+d+'"]').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"),i(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"),a=e(this).data("discount-method"),d=e(this).data("next-starting-value"),o=e("."+t).children().last().attr("data-index");if(o=s(o),wdr_buildrule.wdr_clone_field({addFilterMethod:"."+a,ruleAppendTo:"."+t,addDiscountElement:"enable",newIndex:o}),""!=d&&"undefined"!=d){e("."+t+" "+d+":last-child").find(".awdr_value_selector").val("");let r=e("."+t+" "+d+":nth-last-child(2)").find(".awdr_auto_add_value").val();""==(r=parseInt(r)+1)||isNaN(r)||e("."+t+" "+d+":nth-last-child(1)").find(".awdr_next_value").val(r)}"add_buyx_gety_range"==a?(e(".buyx_gety_individual_range[data-index="+o+"]").find(".awdr-buyx-gety-max").show(),e(".buyx_gety_individual_range[data-index="+o+"]").find(".awdr-bogo-recurcive").prop("checked",!1),e(".wdr-buyx-gety-discount-inner").css("border-bottom","1px solid #ddd")):"add_buyx_getx_range"==a&&(e(".buyx_getx_individual_range[data-index="+o+"]").find(".awdr-buyx-getx-max").show(),e(".buyx_getx_individual_range[data-index="+o+"]").find(".awdr-bogo-recurcive").prop("checked",!1),e(".buyx_getx_individual_range").css("border-bottom","1px solid #ddd")),i(e("."+t+" div:last-child").find('[data-field="autocomplete"]')),i(e("."+t+" div:last-child").find('[data-list="product_category"]'))}),e(document).on("click",".wdr_discount_remove",function(){e(this).closest(".wdr-discount-group").parent().find(".wdr-discount-group").length>1&&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),d(t,e(this),!0)):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),d(null,e(this),!1)}),e(document).on("click","#awdr_do_v1_v2_migration",function(){e(".wdr_migration_process").append(wdr_data.localization_data.processing_migration_text),function a(d){e.ajax({data:{method:"do_v1_v2_migration",action:"wdr_ajax",awdr_nonce:d},type:"post",url:ajaxurl,error:function(e,a){n(wdr_data.localization_data.error,"error",t)},success:function(o){void 0!=o.data.status?("completed"==o.data.status?(n(wdr_data.localization_data.processing_migration_success_message,"success",t),location.reload()):a(d),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,a){n(wdr_data.localization_data.error,"error",t)},success:function(a){"failed"===a?n(wdr_data.localization_data.error,"error",t):!0===a.data&&(e(".wdr_migration_process").append(wdr_data.localization_data.skip_migration_success_message),n(wdr_data.localization_data.skip_migration_success_message,"success",t)),location.reload()}})}),e(".awdr-switch-version-button").on("click",function(t){t.preventDefault();var a=e(this).attr("data-version"),d=e(this).attr("data-page"),o=e(this).attr("data-nonce");e.ajax({url:ajaxurl,type:"POST",data:{action:"awdr_switch_version",version:a,page:d,wdr_nonce:o},success:function(t){!0==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 a=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(){a.show()},complete:function(){a.hide()},error:function(e,a){n(wdr_data.localization_data.error,"error",t)},success:function(e){"failed"===e?n(wdr_data.localization_data.error,"error",t):n(wdr_data.localization_data.duplicate_rule,"success",t),location.reload()}})}),e(document).on("click",".wdr_delete_rule",function(){var a=e(this).closest("tr");if(confirm(wdr_data.localization_data.delete_confirm)){let d=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(){d.show()},complete:function(){d.hide()},error:function(e,a){n(wdr_data.localization_data.error,"error",t)},success:function(e){e?("failed"===e.status?n(wdr_data.localization_data.error,"error",t):(n(wdr_data.localization_data.deleted_rule,"success",t),a.hide(500,function(){a.remove()})),void 0!==e.build_index&&o(e.build_index)):n(wdr_data.localization_data.error,"error",t)}})}}),e(document).on("change",".wdr_manage_status",function(){let a="",d=e(this).closest("tr");a=!0==e(this).prop("checked")?1:0;let i=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:a},type:"post",url:ajaxurl,beforeSend:function(){i.show()},complete:function(){i.hide()},error:function(e,a){n(wdr_data.localization_data.error,"error",t)},success:function(i){i?"failed"===i.status?n(wdr_data.localization_data.error,"error",t):(1==a?(e(d).find(".awdr-enabled-status").show(),n(wdr_data.localization_data.enabled_rule,"success",t)):(e(d).find(".awdr-enabled-status").hide(),n(wdr_data.localization_data.disabled_rule,"success",t)),void 0!==i.build_index&&o(i.build_index)):n(wdr_data.localization_data.error,"error",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,a){var d=e(a),o=wdr_data.lists[d.data("list")];d.selectWoo({width:"100%",escapeMarkup:function(e){return e},minimumInputLength:1,placeholder:d.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:o}),d.parent().find(".select2-search__field").css("width","100%")}),e(".edit-all-loaded-values").each(function(t,a){var d=e(a),o=wdr_data.lists[d.data("list")];d.selectWoo({width:"100%",escapeMarkup:function(e){return e},placeholder:d.data("placeholder"),language:{noResults:function(){return wdr_data.labels.select2_no_results}},data:o}),d.parent().find(".select2-search__field").css("width","100%")}),e("#wdr-save-rule").submit(function(a){a.preventDefault();if(!function t(a){let d=e(".awdr-product-discount-type").val(),o=[],i=[],s=[];switch(d){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":o=wdr_filter_validation(),i=function t(a){let d=[];switch(a){case"wdr_simple_discount":let o=e(".product_discount_value").val();""!=o&&o?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 i=e(".awdr_cart_discount_value").val();""!=i&&i?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(),s=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 r=parseInt(s);""==s||r<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(),s=e(a).find(".bxgx-qty").val(),r=e(a).find(".buyx_getx_discount_select").val(),n=e(a).find(".bxgx-value").val();""==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")),!0==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")),""==s?(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"!=r&&""==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 s=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(),i=e(a).find(".bxgy-max").val(),r=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(),u=e(a).find(".bxgy-val").val();"bxgy_product"==s?0==r.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"==s?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"!=s&&s?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()),""==o&&""==i?(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")),!0==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")),""==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&&""==u?(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:d.push("fails")}return d}(d),s=r();break;case"wdr_free_shipping":s=r()}return -1===o.indexOf("fails")&&-1===i.indexOf("fails")&&-1===s.indexOf("fails")}(e(this)))return!1;let d=e(".woo_discount_loader");e("#wdr-save-rule .awdr-validation-attention").css("border","1px solid #7e8993"),e.ajax({data:e(this).serialize(),type:"post",url:ajaxurl,beforeSend:function(){d.show()},complete:function(){d.hide()},error:function(e,a){n(wdr_data.localization_data.error,"error",t)},success:function(a){var d=a.data;if(a.success)void 0!=d.build_index&&o(d.build_index),d.redirect?(window.location.href=d.redirect,n(wdr_data.localization_data.save_rule,"success",t)):(e(".wdr_desc_text.coupon_error_msg").hide(),e(".coupon_name_msg").css("border",""),n(wdr_data.localization_data.save_rule,"success",t));else if(d.coupon_message)e(".coupon_name_msg").css("border","1px solid #FF0000").focus(),n(wdr_data.localization_data.coupon_exists,"error",t);else for(let[i,s]of Object.entries(d)){d.hasOwnProperty(i)&&s.forEach(function(e){n(e,"error",t)});let r="",l;(l=i.split(".")).forEach(function(e,t){1!==l.length?r+=t+1!==1?"["+e+"]":e:r+=e}),e('#wdr-save-rule [name="'+r+'"]').css("border","1px solid red").focus().addClass("awdr-validation-attention")}}})}),e(document).on("click",".wdr_save_close",function(){e("input[name=wdr_save_close]").val("1"),e(".wdr_save_stay").click()});function r(){let t=[];return e(".wdr-condition-group").each(function(a,d){let o=e(d).find(".wdr-product-condition-type").val();if(void 0!==o)switch(o){case"cart_subtotal":case"cart_items_quantity":case"cart_items_weight":case"cart_line_items_count":""==e(d).find(".float_only_field").val()?(t.push("fails"),e(d).find(".float_only_field").css("border","1px solid red"),e(d).find(".float_only_field").focus()):e(d).find(".float_only_field").css("border","1px solid #7e8993");break;case"cart_coupon":let i=e(d).find(".wdr_copon_type").val(),s=e(d).find(".coupon_name_msg").val(),r=e(d).find("#rm-coupon").val();"custom_coupon"==i?""==s?(t.push("fails"),e(d).find(".coupon_name_msg").css("border","1px solid red"),e(d).find(".coupon_name_msg").focus()):e(d).find(".coupon_name_msg").css("border","1px solid #7e8993"):r?e(d).find(".select2-selection").css("border","1px solid #7e8993"):(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus());break;case"cart_payment_method":0==e(d).find(".select2-hidden-accessible").val().length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993");break;case"cart_item_product_attributes":let n=e(d).find(".awdr-attribute-validation").val(),l=e(d).find(".awdr-num-validation").val();0==n.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),""==l?(t.push("fails"),e(d).find(".awdr-num-validation").css("border","1px solid red"),e(d).find(".awdr-num-validation").focus()):e(d).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_category":let c=e(d).find(".awdr-category-validation").val(),u=e(d).find(".awdr-num-validation").val();0==c.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),""==u?(t.push("fails"),e(d).find(".awdr-num-validation").css("border","1px solid red"),e(d).find(".awdr-num-validation").focus()):e(d).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_combination":let p=e(d).find(".awdr-product-validation").val(),f=e(d).find(".product_from_qty").val(),h=e(d).find(".product_to_qty").val(),w=e(d).find(".combination_operator").val();0==p.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),"in_range"==w?""==f&&""==h?(t.push("fails"),e(d).find(".product_from_qty").css("border","1px solid red"),e(d).find(".product_from_qty").focus(),e(d).find(".product_to_qty").css("border","1px solid red"),e(d).find(".product_to_qty").focus()):(e(d).find(".product_from_qty").css("border","1px solid #7e8993"),e(d).find(".product_to_qty").css("border","1px solid #7e8993")):""==f?(t.push("fails"),e(d).find(".product_from_qty").css("border","1px solid red"),e(d).find(".product_from_qty").focus()):e(d).find(".product_from_qty").css("border","1px solid #7e8993");break;case"cart_item_product_sku":let b=e(d).find(".awdr-sku-validation").val(),m=e(d).find(".awdr-num-validation").val();0==b.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),""==m?(t.push("fails"),e(d).find(".awdr-num-validation").css("border","1px solid red"),e(d).find(".awdr-num-validation").focus()):e(d).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_product_tags":let g=e(d).find(".awdr-tag-validation").val(),v=e(d).find(".awdr-num-validation").val();0==g.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),""==v?(t.push("fails"),e(d).find(".awdr-num-validation").css("border","1px solid red"),e(d).find(".awdr-num-validation").focus()):e(d).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_products":let x=e(d).find(".awdr-product-validation").val(),y=e(d).find(".awdr-num-validation").val();0==x.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),""==y?(t.push("fails"),e(d).find(".awdr-num-validation").css("border","1px solid red"),e(d).find(".awdr-num-validation").focus()):e(d).find(".awdr-num-validation").css("border","1px solid #7e8993");break;case"cart_item_category_combination":let k=e(d).find(".awdr-cat-validation").val(),_=e(d).find(".cat_from_qty").val(),$=e(d).find(".cat_to_qty").val(),z=e(d).find(".cat_combination_operator").val();0==k.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),"in_range"==z?""==_&&""==$?(t.push("fails"),e(d).find(".cat_from_qty").css("border","1px solid red"),e(d).find(".cat_from_qty").focus(),e(d).find(".cat_to_qty").css("border","1px solid red"),e(d).find(".cat_to_qty").focus()):(e(d).find(".cat_from_qty").css("border","1px solid #7e8993"),e(d).find(".cat_to_qty").css("border","1px solid #7e8993")):""==_?(t.push("fails"),e(d).find(".cat_from_qty").css("border","1px solid red"),e(d).find(".cat_from_qty").focus()):e(d).find(".cat_from_qty").css("border","1px solid #7e8993");break;case"order_date":let q=e(d).find(".awdr-from-date").val(),j=e(d).find(".awdr-end-date").val();""==q&&""==j?(t.push("fails"),e(d).find(".awdr-from-date").css("border","1px solid red"),e(d).find(".awdr-from-date").focus(),e(d).find(".awdr-end-date").css("border","1px solid red"),e(d).find(".awdr-end-date").focus()):(e(d).find(".awdr-from-date").css("border","1px solid #7e8993"),e(d).find(".awdr-end-date").css("border","1px solid #7e8993"));break;case"order_date_and_time":let O=e(d).find(".awdr-from-date").val(),I=e(d).find(".awdr-end-date").val();""==O&&""==I?(t.push("fails"),e(d).find(".awdr-from-date").css("border","1px solid red"),e(d).find(".awdr-from-date").focus(),e(d).find(".awdr-end-date").css("border","1px solid red"),e(d).find(".awdr-end-date").focus()):(e(d).find(".awdr-from-date").css("border","1px solid #7e8993"),e(d).find(".awdr-end-date").css("border","1px solid #7e8993"));break;case"order_days":0==e(d).find(".wdr_order_days").val().length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993");break;case"order_time":let C=e(d).find(".wdr-from-time").val(),S=e(d).find(".wdr-to-time").val();""==C&&""==S?(t.push("fails"),e(d).find(".wdr-from-time").css("border","1px solid red"),e(d).find(".wdr-from-time").focus(),e(d).find(".wdr-to-time").css("border","1px solid red"),e(d).find(".wdr-to-time").focus()):(e(d).find(".wdr-from-time").css("border","1px solid #7e8993"),e(d).find(".wdr-to-time").css("border","1px solid #7e8993"));break;case"purchase_last_order":0==e(d).find(".wdr-wc-order-status").val().length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993");break;case"purchase_last_order_amount":let T=e(d).find(".wdr-wc-order-status").val(),D=e(d).find(".float_only_field").val();0==T.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),""==D?(t.push("fails"),e(d).find(".float_only_field").css("border","1px solid red"),e(d).find(".float_only_field").focus()):e(d).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_previous_orders":let A=e(d).find(".wdr-wc-order-status").val(),R=e(d).find(".float_only_field").val();0==A.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),""==R?(t.push("fails"),e(d).find(".float_only_field").css("border","1px solid red"),e(d).find(".float_only_field").focus()):e(d).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_previous_orders_for_specific_product":let M=e(d).find(".wdr-wc-order-status").val(),F=e(d).find(".float_only_field").val();0==e(d).find(".specific_product").val().length?(t.push("fails"),e(d).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid red"),e(d).find(".wdr-previous-order-product-selector .select2-selection").focus()):e(d).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid #7e8993"),0==M.length?(t.push("fails"),e(d).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid red"),e(d).find(".wdr-previous-order-product-status .select2-selection").focus()):e(d).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid #7e8993"),""==F?(t.push("fails"),e(d).find(".float_only_field").css("border","1px solid red"),e(d).find(".float_only_field").focus()):e(d).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_quantities_for_specific_product":let B=e(d).find(".wdr-wc-order-status").val(),L=e(d).find(".float_only_field").val();0==e(d).find(".specific_product").val().length?(t.push("fails"),e(d).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid red"),e(d).find(".wdr-previous-order-product-selector .select2-selection").focus()):e(d).find(".wdr-previous-order-product-selector .select2-selection").css("border","1px solid #7e8993"),0==B.length?(t.push("fails"),e(d).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid red"),e(d).find(".wdr-previous-order-product-status .select2-selection").focus()):e(d).find(".wdr-previous-order-product-status .select2-selection").css("border","1px solid #7e8993"),""==L?(t.push("fails"),e(d).find(".float_only_field").css("border","1px solid red"),e(d).find(".float_only_field").focus()):e(d).find(".float_only_field").css("border","1px solid #7e8993");break;case"purchase_spent":let E=e(d).find(".wdr-wc-order-status").val(),Y=e(d).find(".float_only_field").val();0==E.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),""==Y?(t.push("fails"),e(d).find(".float_only_field").css("border","1px solid red"),e(d).find(".float_only_field").focus()):e(d).find(".float_only_field").css("border","1px solid #7e8993");break;case"shipping_city":case"shipping_zipcode":case"Billing_city":case"user_email":""==e(d).find(".awdr-validation").val()?(t.push("fails"),e(d).find(".awdr-validation").css("border","1px solid red"),e(d).find(".awdr-validation").focus()):e(d).find(".awdr-validation").css("border","1px solid #7e8993");break;case"shipping_country":0==e(d).find(".get_awdr_shipping_country").val().length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993");break;case"shipping_state":let H=e(d).find(".get_awdr_shipping_state").val(),W=e(d).find(".get_awdr_state_based_country").val();0==H.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993"),0==W.length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993");break;case"user_list":0==e(d).find(".wdr_user_list").val().length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993");break;case"user_role":0==e(d).find(".wdr_user_role").val().length?(t.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993")}}),t}function n(t,a="success",d=null){switch(a){case"error":var o="wdr-alert-error";break;case"warning":var o="wdr-alert-warning";break;default:var o="wdr-alert-success"}let i="wdr-notify-msg-"+d.counts,s='<div style="display: none;" class="wdr-alert '+o+'" id="'+i+'">'+t+"</div>";e("#notify-msg-holder").append(s);let r=e("#"+i);var n=d.counts;d.counts=parseInt(n)+parseInt(1),r.fadeIn(500),setTimeout(function(){r.fadeOut(500),r.remove()},5e3)}window.wdr_filter_validation=function t(){let a=[];return e(".wdr-filter-group").each(function(t,d){let o=e(d).find(".wdr-product-filter-type").val(),i=e(d).find(".awdr_validation").val();switch(o){case"all_products":case"product_on_sale":break;case"products":case"product_category":case"product_attributes":case"product_tags":case"product_sku":0==i.length?(a.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993");break;default:null==i||0==i.length?(a.push("fails"),e(d).find(".select2-selection").css("border","1px solid red"),e(d).find(".select2-selection").focus()):e(d).find(".select2-selection").css("border","1px solid #7e8993")}}),a},e("#configuration-form").submit(function(a){a.preventDefault();let d=e(this).serialize(),o=e(".woo_discount_loader");e.ajax({data:d,type:"post",url:ajaxurl,beforeSend:function(){o.show()},complete:function(){o.hide()},error:function(e,a){n(wdr_data.localization_data.error,"error",t)},success:function(a){switch(a.data.save_popup){case"alert_in_popup":"alert_in_popup"==a.data.save_popup&&"passed"==a.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"==a.data.save_popup&&"fails"==a.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"==a.data.save_popup&&"passed"==a.data.security_pass?(n(wdr_data.localization_data.save_settings,"success",t),setTimeout(function(){window.location.replace(wdr_data.admin_url+"&tab=settings")},1e3)):"alert_in_normal"==a.data.save_popup&&"fails"==a.data.security_pass&&(n(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(),n(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(a){a.preventDefault();let d=e(this).serialize(),o=e(".woo_discount_loader");e.ajax({data:d,type:"post",url:ajaxurl,beforeSend:function(){o.show()},complete:function(){o.hide()},error:function(e,a){n(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(a){""!=this.id&&(t.sortOrder[this.id]=a,"customize-bulk-table-title"==this.id?e(".customize_bulk_table_title").val(a):"customize-bulk-table-discount"==this.id?e(".customize_bulk_table_discount").val(a):"customize-bulk-table-range"==this.id&&e(".customize_bulk_table_range").val(a))})}}),e("#wdr-bulk-action-top").submit(function(a){if(a.preventDefault(),!(e('input[name="saved_rules[]"]:checked').length>0))return!1;{let d=e("#bulk-action-selector-top").val(),o;if("enable"==d)o=confirm("Are you sure to enable the selected rules?");else if("disable"==d)o=confirm("Are you sure to disable the selected rules?");else{if("delete"!=d)return!1;o=confirm("Are you sure to delete the selected rules?")}if(!1==o)return!1}let i=e(".woo_discount_loader");e.ajax({data:e(this).serialize(),type:"post",url:ajaxurl,beforeSend:function(){i.show()},complete:function(){i.hide()},error:function(e,a){n(wdr_data.localization_data.error,"error",t)},success:function(e){"disabled"==e.disable?n(wdr_data.localization_data.disabled_rule,"success",t):"enabled"==e.enable?n(wdr_data.localization_data.enabled_rule,"success",t):"deleted"==e.delete?n(wdr_data.localization_data.deleted_rule,"success",t):n(wdr_data.localization_data.error,"error",t),window.location.replace(wdr_data.admin_url)}})}),e("#wdr-search-top").submit(function(t){t.preventDefault();var a=e(this).serializeArray(),d=a[0].value,o=a[1].value;window.location.replace(d+"&name="+o)}),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"),a=e(this).val();"off"==a?(t.val("on"),e(".wdr-rules-selector").prop("checked",!0)):"on"==a&&(t.val("off"),e(".wdr-rules-selector").prop("checked",!1))}),e(document).on("change",".wdr-rules-selector",function(){var t=e(".wdr-rules-select"),a=e(".wdr-ruleboard input:checkbox").length,d=e(".wdr-ruleboard input:checkbox:checked").length;a==d?(t.val("on"),t.prop("checked",!0)):a!=d&&(t.val("off"),t.prop("checked",!1))});var l,c=document.getElementById("ruleHeader");function u(){if(null!=c){var e=c.offsetTop;window.pageYOffset>e?c.classList.add("wdr-sticky"):c.classList.remove("wdr-sticky")}}var p=!1;function f(){e("#sortable").sortable({handle:".awdr-sortable-handle",delay:150,stop:function(t,a){var d=[];e("#sortable>tr").each(function(){d.push(e(this).attr("id"))}),h(d)}})}function h(a){e.ajax({data:{position:a,method:"update_priority_order",action:"wdr_ajax",awdr_nonce:e("input[name=awdr_rule_list_nonce]").val()},type:"post",url:ajaxurl,error:function(e,a){n(wdr_data.localization_data.error,"error",t)},success:function(e){!1===e?n(wdr_data.localization_data.error,"error",t):n(wdr_data.localization_data.save_priority,"success",t)}})}(/(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)))&&(p=!0),e(window).width()>1024?!0==p?f():e("#sortable").sortable({delay:150,stop:function(t,a){var d=[];e("#sortable>tr").each(function(){d.push(e(this).attr("id"))}),h(d)}}):f(),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"),a=e(this).data("removeval"),d=e(this).data("removeopt");e("."+t).hide(),e("."+a).removeAttr("value"),e("."+d).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})});var w=e(".bulk-min").length;if(w>=2){var b=e(".bulk_discount_min").val(),m=e(".bulk_discount_max").val(),g=e(".bulk_discount_value").val();(b||m||g)&&e(".adv-msg-min-qty, .adv-msg-max-qty").show()}var w=e(".set-min").length;if(w>=2){var b=e(".set_discount_min").val(),g=e(".set_discount_value").val();(b||g)&&(e(".adv-msg-min-qty").show(),e(".adv-msg-max-qty").hide())}function v(){e(".wdr-condition-group").each(function(t,a){let d=e(a).find(".wdr-product-condition-type").val();void 0!==d&&"cart_item_product_onsale"===d&&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(){t=e("<input>"),e("body").append(t),t.val(e("#awdr_shortcode_text").text()).select(),document.execCommand("copy"),t.remove();var t,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(),a=e(this).data("keyup");e("."+a).html(t)}),e(".awdr_popup_col_name_text_box").blur(function(){var t=e(this).val(),a=e(this).data("keyup");e("."+a).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(),a=e(this).attr("data-parent"),d=e(this).attr("data-siblings");switch(t){case"flat":e(this).parent("."+a).siblings("."+d).show(),e(this).parent("."+a).siblings("."+d).find(".wdr_desc_text").text(wdr_data.localization_data.buyx_getx_value);break;case"percentage":e(this).parent("."+a).siblings("."+d).show(),e(this).parent("."+a).siblings("."+d).find(".wdr_desc_text").text(wdr_data.localization_data.buyx_getx_percentage);break;default:e(this).parent("."+a).siblings("."+d).hide()}}),e(document).on("change",".awdr-bogo-recurcive",function(){let t=e(this).attr("data-recursive-row"),a=e(this).attr("data-recursive-parent"),d=e(this).attr("data-hide-add-range"),o=e(this).attr("data-bogo-max-range"),i=e(this).attr("data-bogo-min-range"),s=e(this).attr("data-bogo-border"),r=e("."+t).length,n=e(this).attr("data-ranges-row-parent");if(!1==e(this).prop("checked")){e(this).parents("."+n).siblings("."+d).show(),""!=o&&(e(this).parents("."+a).siblings("."+o).show(),e(this).parents("."+a).siblings().find("."+o).show()),e(this).parents("."+a).siblings("."+i).find(".wdr_desc_text").text(wdr_data.localization_data.recursive_min_qty),e("."+s).css("border-bottom","1px solid #ddd");return}r>3&&(confirm(wdr_data.localization_data.recursive_warning)?e(this).parents("."+t).siblings().remove():e(this).prop("checked",!1)),!0==e(this).prop("checked")&&(e(this).parents("."+n).siblings("."+d).hide(),""!=o&&(e(this).parents("."+a).siblings("."+o).hide(),e(this).parents("."+a).siblings().find("."+o).hide()),e(this).parents("."+a).siblings("."+i).find(".wdr_desc_text").text(wdr_data.localization_data.recursive_qty),e("."+s).css("border-bottom","unset"))}),e(document).on("change",".awdr_mode_of_operator",function(){let t=e(this).val();if("wdr_buy_x_get_y_discount"==e(".awdr-product-discount-type").val()){"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(""));return}"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(""))}),e(document).on("change",".awdr-product-discount-type",function(){e(".awdr-example").html("");var t=e(this).data("placement");let a=e(this).val(),d="awdr_doc_";switch(a){case"wdr_simple_discount":e("."+d+a).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("."+d+a).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("."+d+a).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("."+d+a).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("."+d+a).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("."+d+a).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("."+d+a).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: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"),v(),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"),i(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?!0==p?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"),v(),e(".awdr-discount-heading").html(wdr_data.localization_data.two_column_bxgy_discount_heading),i(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"),v(),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"),v(),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"),v(),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"),v(),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(){!0==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");!0==e(this).prop("checked")?e("."+t).show():e("."+t).hide()});var x=document.getElementsByClassName("awdr-accordion");for(l=0;l<x.length;l++)x[l].addEventListener("click",function(t){t.preventDefault(),this.classList.toggle("awdr-accordion-active");var a=this.nextElementSibling;"block"===a.style.display?e(a).slideUp(1e3):e(a).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(),!0==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()),!0==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(){!0==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(){!0==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 a=e(".awdr-used-limit-total").html();t<=parseInt(a)?(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!!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 a=e(this).parents(".wdr-conditions-container").attr("data-index"),d=e(this).parents(".wdr_shipping_state_group"),o=e(this).parent().siblings(".wdr-shipping-state-value"),i=e(".woo_discount_loader"),s=e(this).parent().siblings(".wdr-shipping-state-value").find(".get_awdr_shipping_state").val();var r={action:"wdr_ajax",method:"get_state_details",selected_country:t,selected_state:s,selected_index:a,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(),d.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(a){a.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),n(wdr_data.localization_data.coupon_url_success,"success",t)):n(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,a=e(this).val();""!==a?($group='<span class="wdr-coupon-url-group"><label>',$group+=' <input type="url" value="'+t+"?wdr_coupon="+encodeURIComponent(a)+'"></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,a=e(this).parents(".wdr_cart_coupon_group").find(".wdr-cart-coupon-search select").val(),d=e(this).parents(".wdr_cart_coupon_group").find("select.wdr_copon_type").val();if(0!==a.length){if("at_least_one"===d)$groups="",a.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"===d){var o="";t+="?wdr_coupon=",a.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")})});
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.4
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.7
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.4');
25
  }
26
 
27
  global $awdr_load_version;
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.5
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.9
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.5');
25
  }
26
 
27
  global $awdr_load_version;