Discount Rules for WooCommerce - Version 1.9.9

Version Description

  • 02/06/20 =
  • Improvement - Product addon compatible.
  • Improvement - V2 UI improvements.
  • Improvement - V2 field validations.
  • Improvement - Events: woo_discount_rules_before_apply_cart_discount
  • Improvement - Events: advanced_woo_discount_rules_custom_target_for_simple_product_on_qty_update, advanced_woo_discount_rules_custom_target_for_variable_product_on_qty_update
  • Improvement - Added compatible with WPC Product Timer for WooCommerce - in v2
  • Improvement - Additional shortcode for discount bars - in v2
  • Improvement - Strikeout based on tax settings - in v2
  • Feature - Beta Subtotal promotion message.
  • Fix - Third party coupon doesn't removed in checkout.
  • Fix - Rule doesn't works for few attributes.
  • Fix - Discount bar for BXGY.
  • Fix - Calculating tax for discount fee.
  • Fix - Calculating fee multiple time when calculate total is called multiple times.
Download this release

Release Info

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

Code changes from version 1.9.8 to 1.9.9

Files changed (38) hide show
  1. i18n/languages/woo-discount-rules.pot +528 -395
  2. readme.txt +17 -1
  3. v1/includes/cart-rules.php +3 -0
  4. v2/App/Compatibility/ProductAddOnsByWooCommerce.php +13 -6
  5. v2/App/Conditions/CartSubTotal.php +26 -1
  6. v2/App/Controllers/Admin/Settings.php +3 -0
  7. v2/App/Controllers/Admin/Tabs/Compatible.php +1 -1
  8. v2/App/Controllers/Admin/WDRAjax.php +19 -4
  9. v2/App/Controllers/DiscountCalculator.php +30 -29
  10. v2/App/Controllers/ManageDiscount.php +206 -49
  11. v2/App/Helpers/Filter.php +21 -1
  12. v2/App/Helpers/Helper.php +32 -0
  13. v2/App/Helpers/Input.php +71 -0
  14. v2/App/Helpers/Migration.php +6 -0
  15. v2/App/Helpers/ProOptions.php +1 -1
  16. v2/App/Helpers/Rule.php +95 -21
  17. v2/App/Helpers/Woocommerce.php +29 -2
  18. v2/App/Models/DBTable.php +84 -49
  19. v2/App/Router.php +22 -1
  20. v2/App/Views/Admin/Rules/Conditions/Cart/LineItemCount.php +1 -1
  21. v2/App/Views/Admin/Rules/Conditions/Cart/Subtotal.php +1 -1
  22. v2/App/Views/Admin/Rules/Conditions/Main.php +18 -8
  23. v2/App/Views/Admin/Rules/Discounts/Bulk.php +1 -1
  24. v2/App/Views/Admin/Rules/Discounts/Cart.php +2 -2
  25. v2/App/Views/Admin/Rules/Filters/Main.php +4 -3
  26. v2/App/Views/Admin/Rules/Filters/Products.php +1 -0
  27. v2/App/Views/Admin/Rules/Manage.php +3 -2
  28. v2/App/Views/Admin/Rules/Others/CommonTemplates.php +3 -1
  29. v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php +35 -0
  30. v2/App/Views/Admin/Tabs/DiscountRule.php +65 -1
  31. v2/App/Views/Admin/Tabs/ImportExport.php +7 -1
  32. v2/App/Views/Admin/Tabs/settings.php +15 -0
  33. v2/Assets/Css/admin_style.css +11 -3
  34. v2/Assets/Js/admin_script.js +884 -14
  35. v2/Assets/Js/awdr-dynamic-price.js +1 -1
  36. v2/Assets/Js/rulebuilder.js +11 -2
  37. v2/Assets/Js/site_main.js +16 -7
  38. woo-discount-rules.php +6 -1
i18n/languages/woo-discount-rules.pot CHANGED
@@ -13,88 +13,144 @@ msgstr ""
13
  "X-Generator: Loco https://localise.biz/\n"
14
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;"
15
 
16
- #: common.php:8
17
  msgid "Invalid request"
18
  msgstr ""
19
 
20
- #: common.php:26
 
 
 
 
 
 
 
 
21
  msgid ""
22
- "Please download and install the PRO package with advanced rules for V2 and "
23
- "then switch it. <a href=\"https://docs.flycart.org/en/collections/2195266?"
24
- "utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-"
25
- "click&utm_content=documentation\" target=\"_blank\">Here</a> is a guide for "
26
- "Switching to Advanced V2 Interface"
 
27
  msgstr ""
28
 
29
- #: common.php:46
30
  msgid ""
31
- "Switch to Discount Rules 2.0 with Advanced Rules (you can switch back any "
32
- "time)"
 
 
 
 
 
 
 
 
 
 
 
 
 
33
  msgstr ""
34
 
35
- #: common.php:47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  msgid ""
37
  "Switch to 2.0 <span style='background-color: #FF8C00 ; padding: 3px; border-"
38
  "radius: 4px'>Public beta</span>"
39
  msgstr ""
40
 
41
- #: common.php:50
42
  msgid "Would you like to switch to older Woo Discount Rules?"
43
  msgstr ""
44
 
45
- #: common.php:51
46
  msgid "Click here to Switch back"
47
  msgstr ""
48
 
49
- #: common.php:71
 
 
 
 
50
  msgid "Switch back to Discount Rules 1.x"
51
  msgstr ""
52
 
53
- #: common.php:158
54
  msgid ""
55
  "This plugin can not be activated because it requires minimum PHP version of "
56
  msgstr ""
57
 
58
- #: common.php:161
59
  msgid ""
60
  "Woocommerce must installed and activated in-order to use Advanced woo "
61
  "discount rules!"
62
  msgstr ""
63
 
64
- #: common.php:164
65
  msgid " Advanced woo discount rules requires at least Woocommerce"
66
  msgstr ""
67
 
68
- #: updater.php:68 updater.php:217 v1/helper/purchase.php:62
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  #: v1/helper/purchase.php:66 v1/helper/purchase.php:134
70
  #: v1/helper/purchase.php:137 v1/helper/purchase.php:173
71
  msgid "Please enter a valid license key"
72
  msgstr ""
73
 
74
- #: updater.php:71 v1/helper/purchase.php:182
75
  msgid "License key check : Passed."
76
  msgstr ""
77
 
78
- #: updater.php:73 v1/helper/purchase.php:186 v1/view/settings_general.php:32
79
  msgid "License key seems to be Invalid. Please enter a valid license key"
80
  msgstr ""
81
 
82
- #: updater.php:218 v1/helper/purchase.php:62 v1/helper/purchase.php:66
83
  #: v1/helper/purchase.php:134 v1/helper/purchase.php:137
84
  msgid "our website"
85
  msgstr ""
86
 
87
- #: updater.php:222
88
  #, php-format
89
  msgid "License key for the %s seems invalid. %s, you can get it from %s"
90
  msgstr ""
91
 
92
- #: updater.php:226
93
  #, php-format
94
  msgid "License key for the %s is not entered. %s, you can get it from %s"
95
  msgstr ""
96
 
97
- #: v1/helper/general-helper.php:48 v2/App/Controllers/Admin/Settings.php:293
98
  msgid "Guest"
99
  msgstr ""
100
 
@@ -127,14 +183,14 @@ msgid "Read Docs"
127
  msgstr ""
128
 
129
  #: v1/helper/general-helper.php:1034 v1/view/view-cart-rules.php:697
130
- #: v1/view/view-pricing-rules.php:433 v2/App/Helpers/Woocommerce.php:1448
131
  msgid "Coupon already exists in WooCommerce. Please select another name"
132
  msgstr ""
133
 
134
  #: v1/helper/purchase.php:25 v1/view/includes/cart-menu.php:5
135
  #: v1/view/includes/menu.php:6 v1/view/includes/sub-menu.php:5
136
- #: v2/App/Controllers/Admin/Settings.php:36
137
- #: v2/App/Controllers/Admin/Settings.php:37
138
  msgid "Woo Discount Rules"
139
  msgstr ""
140
 
@@ -193,14 +249,15 @@ msgstr ""
193
 
194
  #: v1/includes/advanced/free_shipping_method.php:68
195
  #: v1/view/documentation.php:63 v1/view/settings_cart_rules.php:126
 
196
  msgid "Free Shipping"
197
  msgstr ""
198
 
199
  #: v1/includes/advanced/free_shipping_method.php:73
200
  #: v1/includes/discount-base.php:1063 v1/view/cart-rules.php:133
201
  #: v1/view/pricing-rules.php:163 v1/view/settings_promotion.php:65
202
- #: v1/view/settings_promotion.php:100 v2/App/Controllers/Admin/Settings.php:403
203
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:75
204
  msgid "Enable"
205
  msgstr ""
206
 
@@ -209,8 +266,8 @@ msgid "Enable this shipping."
209
  msgstr ""
210
 
211
  #: v1/includes/advanced/free_shipping_method.php:80
212
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:102
213
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:247
214
  msgid "Title"
215
  msgstr ""
216
 
@@ -227,7 +284,7 @@ msgid "Failed to save"
227
  msgstr ""
228
 
229
  #: v1/includes/discount-base.php:203 v1/view/cart-rules.php:162
230
- #: v1/view/pricing-rules.php:192 v2/App/Controllers/Admin/Settings.php:402
231
  msgid "Active"
232
  msgstr ""
233
 
@@ -236,8 +293,8 @@ msgstr ""
236
  #: v1/view/settings_cart_rules.php:102 v1/view/settings_price_rules.php:169
237
  #: v1/view/settings_promotion.php:22 v1/view/settings_promotion.php:62
238
  #: v1/view/settings_promotion.php:97 v1/view/settings_promotion.php:132
239
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:187
240
- #: v2/App/Views/Admin/Tabs/settings.php:305
241
  msgid "Disabled"
242
  msgstr ""
243
 
@@ -309,7 +366,7 @@ msgstr ""
309
 
310
  #: v1/includes/discount-base.php:1024 v1/view/view-pricing-rules.php:654
311
  #: v1/view/view-pricing-rules.php:657 v1/view/view-pricing-rules.php:677
312
- #: v2/App/Controllers/Admin/Settings.php:420
313
  msgid "Quantity"
314
  msgstr ""
315
 
@@ -338,7 +395,7 @@ msgid "Adjustment Type"
338
  msgstr ""
339
 
340
  #: v1/includes/discount-base.php:1030 v1/view/view-pricing-rules.php:954
341
- #: v2/App/Controllers/Admin/Settings.php:423
342
  msgid "Discount percentage"
343
  msgstr ""
344
 
@@ -472,7 +529,7 @@ msgstr ""
472
 
473
  #: v1/includes/discount-base.php:1060 v1/view/cart-rules.php:185
474
  #: v1/view/pricing-rules.php:215 v1/view/view-pricing-rules.php:971
475
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:220
476
  msgid "Duplicate"
477
  msgstr ""
478
 
@@ -485,8 +542,8 @@ msgid "Are you sure to remove this ?"
485
  msgstr ""
486
 
487
  #: v1/includes/discount-base.php:1064 v1/view/cart-rules.php:130
488
- #: v1/view/pricing-rules.php:160 v2/App/Controllers/Admin/Settings.php:401
489
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:76
490
  msgid "Disable"
491
  msgstr ""
492
 
@@ -605,10 +662,10 @@ msgid "Shipping zip code"
605
  msgstr ""
606
 
607
  #: v1/includes/discount-base.php:1091 v1/view/view-cart-rules.php:365
608
- #: v1/view/view-pricing-rules.php:536 v2/App/Helpers/ProOptions.php:190
609
- #: v2/App/Helpers/ProOptions.php:198 v2/App/Helpers/ProOptions.php:206
610
- #: v2/App/Helpers/ProOptions.php:214 v2/App/Helpers/ProOptions.php:222
611
- #: v2/App/Helpers/ProOptions.php:230
612
  msgid "Purchase History"
613
  msgstr ""
614
 
@@ -669,13 +726,13 @@ msgstr ""
669
  #: v1/includes/discount-base.php:1103 v1/view/cart-rules.php:114
670
  #: v1/view/cart-rules.php:224 v1/view/pricing-rules.php:144
671
  #: v1/view/pricing-rules.php:254 v1/view/view-cart-rules.php:700
672
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:124
673
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:269
674
  msgid "Action"
675
  msgstr ""
676
 
677
  #: v1/includes/discount-base.php:1104 v1/view/settings.php:33
678
- #: v1/view/settings_taxonomy.php:21 v2/App/Views/Admin/Rules/Manage.php:72
679
  msgid "Save"
680
  msgstr ""
681
 
@@ -699,7 +756,7 @@ msgstr ""
699
  #: v1/includes/discount-base.php:1108 v1/view/settings_price_rules.php:208
700
  #: v1/view/settings_price_rules.php:226 v1/view/settings_price_rules.php:244
701
  #: v1/view/settings_price_rules.php:262
702
- #: v2/App/Views/Admin/Tabs/settings.php:484
703
  msgid "Show"
704
  msgstr ""
705
 
@@ -765,7 +822,7 @@ msgid ""
765
  msgstr ""
766
 
767
  #: v1/includes/discount-base.php:1121 v1/view/view-cart-rules.php:221
768
- #: v2/App/Controllers/Base.php:45
769
  msgid "Products"
770
  msgstr ""
771
 
@@ -937,16 +994,16 @@ msgid ""
937
  "defined in WooCommerce -> Attributes. <a href=\"%s\">Read docs</a>.</span>"
938
  msgstr ""
939
 
940
- #: v1/includes/discount-base.php:1237 v2/App/Controllers/ManageDiscount.php:683
941
  #, php-format
942
  msgid ""
943
  "Sorry, it is not possible to apply coupon <b>\"%s\"</b> as you already have "
944
  "a discount applied in cart."
945
  msgstr ""
946
 
947
- #: v1/includes/discount-base.php:1292 v1/view/includes/menu.php:16
948
- #: v2/App/Controllers/Admin/Settings.php:61
949
- #: v2/App/Controllers/Admin/Tabs/GeneralSettings.php:22
950
  msgid "Settings"
951
  msgstr ""
952
 
@@ -1131,12 +1188,12 @@ msgid "Cart Rules"
1131
  msgstr ""
1132
 
1133
  #: v1/view/cart-rules.php:52 v1/view/pricing-rules.php:84
1134
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:55
1135
  msgid "View Examples"
1136
  msgstr ""
1137
 
1138
  #: v1/view/cart-rules.php:53 v1/view/documentation.php:21
1139
- #: v1/view/pricing-rules.php:85 v2/App/Views/Admin/Tabs/DiscountRule.php:57
1140
  #: v2/App/Views/Admin/Tabs/help.php:12
1141
  msgid "Documentation"
1142
  msgstr ""
@@ -1146,12 +1203,12 @@ msgid "You Reach Max. Rule Limit"
1146
  msgstr ""
1147
 
1148
  #: v1/view/cart-rules.php:68 v1/view/pricing-rules.php:99
1149
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:12
1150
  msgid "Add New Rule"
1151
  msgstr ""
1152
 
1153
  #: v1/view/cart-rules.php:79 v1/view/pricing-rules.php:109
1154
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:74
1155
  msgid "Bulk Actions"
1156
  msgstr ""
1157
 
@@ -1168,7 +1225,7 @@ msgid "Delete rules"
1168
  msgstr ""
1169
 
1170
  #: v1/view/cart-rules.php:84 v1/view/pricing-rules.php:114
1171
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:79
1172
  msgid "Apply"
1173
  msgstr ""
1174
 
@@ -1180,28 +1237,28 @@ msgstr ""
1180
 
1181
  #: v1/view/cart-rules.php:99 v1/view/cart-rules.php:209
1182
  #: v1/view/pricing-rules.php:129 v1/view/pricing-rules.php:239
1183
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:107
1184
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:252
1185
  msgid "Start Date"
1186
  msgstr ""
1187
 
1188
  #: v1/view/cart-rules.php:100 v1/view/cart-rules.php:210
1189
  #: v1/view/pricing-rules.php:130 v1/view/pricing-rules.php:240
1190
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:109
1191
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:254
1192
  msgid "Expired On"
1193
  msgstr ""
1194
 
1195
  #: v1/view/cart-rules.php:101 v1/view/cart-rules.php:211
1196
  #: v1/view/pricing-rules.php:131 v1/view/pricing-rules.php:241
1197
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:122
1198
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:267
1199
  msgid "Status"
1200
  msgstr ""
1201
 
1202
  #: v1/view/cart-rules.php:104 v1/view/cart-rules.php:214
1203
  #: v1/view/pricing-rules.php:134 v1/view/pricing-rules.php:244
1204
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:187
1205
  msgid "Language"
1206
  msgstr ""
1207
 
@@ -1211,13 +1268,13 @@ msgid "Order"
1211
  msgstr ""
1212
 
1213
  #: v1/view/cart-rules.php:181 v1/view/pricing-rules.php:211
1214
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:218
1215
  msgid "Edit"
1216
  msgstr ""
1217
 
1218
  #: v1/view/cart-rules.php:192 v1/view/pricing-rules.php:222
1219
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:77
1220
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:223
1221
  msgid "Delete"
1222
  msgstr ""
1223
 
@@ -1356,9 +1413,9 @@ msgstr ""
1356
 
1357
  #: v1/view/includes/cart-menu.php:13 v1/view/includes/sub-menu.php:13
1358
  #: v1/view/template/discount-table.php:42 v1/view/view-cart-rules.php:756
1359
- #: v1/view/view-pricing-rules.php:708 v2/App/Controllers/Admin/Settings.php:428
1360
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:59
1361
- #: v2/App/Views/Admin/Rules/Manage.php:171
1362
  msgid "Discount"
1363
  msgstr ""
1364
 
@@ -1379,19 +1436,19 @@ msgid ""
1379
  "Discount Rules might get conflict."
1380
  msgstr ""
1381
 
1382
- #: v1/view/includes/menu.php:12
1383
  msgid "Price Discount Rules"
1384
  msgstr ""
1385
 
1386
- #: v1/view/includes/menu.php:14
1387
  msgid "Cart Discount Rules"
1388
  msgstr ""
1389
 
1390
- #: v1/view/includes/menu.php:20
1391
  msgid "Taxonomy Settings"
1392
  msgstr ""
1393
 
1394
- #: v1/view/includes/menu.php:22
1395
  msgid "Read documentation"
1396
  msgstr ""
1397
 
@@ -1540,7 +1597,7 @@ msgstr ""
1540
  #: v2/App/Views/Admin/Tabs/settings.php:158
1541
  #: v2/App/Views/Admin/Tabs/settings.php:253
1542
  #: v2/App/Views/Admin/Tabs/settings.php:270
1543
- #: v2/App/Views/Admin/Tabs/settings.php:332
1544
  msgid "Yes"
1545
  msgstr ""
1546
 
@@ -1554,7 +1611,7 @@ msgstr ""
1554
  #: v2/App/Views/Admin/Tabs/settings.php:161
1555
  #: v2/App/Views/Admin/Tabs/settings.php:257
1556
  #: v2/App/Views/Admin/Tabs/settings.php:276
1557
- #: v2/App/Views/Admin/Tabs/settings.php:337
1558
  msgid "No"
1559
  msgstr ""
1560
 
@@ -1683,7 +1740,7 @@ msgstr ""
1683
  #: v1/view/settings_price_rules.php:137 v1/view/settings_price_rules.php:211
1684
  #: v1/view/settings_price_rules.php:229 v1/view/settings_price_rules.php:247
1685
  #: v1/view/settings_price_rules.php:265
1686
- #: v2/App/Views/Admin/Tabs/settings.php:487
1687
  msgid "Don't Show"
1688
  msgstr ""
1689
 
@@ -1792,19 +1849,19 @@ msgstr ""
1792
  msgid "Display savings text (for price rules)"
1793
  msgstr ""
1794
 
1795
- #: v1/view/settings_promotion.php:25 v2/App/Views/Admin/Tabs/settings.php:306
1796
  msgid "On each line item"
1797
  msgstr ""
1798
 
1799
- #: v1/view/settings_promotion.php:28 v2/App/Views/Admin/Tabs/settings.php:307
1800
  msgid "On after total"
1801
  msgstr ""
1802
 
1803
- #: v1/view/settings_promotion.php:31 v2/App/Views/Admin/Tabs/settings.php:308
1804
  msgid "Both in line item and after total"
1805
  msgstr ""
1806
 
1807
- #: v1/view/settings_promotion.php:39 v2/App/Views/Admin/Tabs/settings.php:315
1808
  msgid "Savings text to show"
1809
  msgstr ""
1810
 
@@ -1818,6 +1875,7 @@ msgstr ""
1818
 
1819
  #: v1/view/settings_promotion.php:73 v1/view/settings_promotion.php:108
1820
  #: v1/view/view-cart-rules.php:730
 
1821
  msgid "Message"
1822
  msgstr ""
1823
 
@@ -1839,19 +1897,19 @@ msgid ""
1839
  "discounts)"
1840
  msgstr ""
1841
 
1842
- #: v1/view/settings_promotion.php:134
1843
  msgid "Shop page"
1844
  msgstr ""
1845
 
1846
- #: v1/view/settings_promotion.php:137
1847
  msgid "Product page"
1848
  msgstr ""
1849
 
1850
- #: v1/view/settings_promotion.php:140
1851
  msgid "Cart page"
1852
  msgstr ""
1853
 
1854
- #: v1/view/settings_promotion.php:143
1855
  msgid "Checkout page"
1856
  msgstr ""
1857
 
@@ -1891,64 +1949,64 @@ msgstr ""
1891
  msgid "Sale!"
1892
  msgstr ""
1893
 
1894
- #: v1/view/template/sidebar.php:7 v2/App/Views/Admin/Tabs/DiscountRule.php:302
1895
  msgid "Looking for more features? Upgrade to PRO"
1896
  msgstr ""
1897
 
1898
- #: v1/view/template/sidebar.php:19 v2/App/Views/Admin/Tabs/DiscountRule.php:307
1899
  msgid "With PRO version, you can create:"
1900
  msgstr ""
1901
 
1902
- #: v1/view/template/sidebar.php:20 v2/App/Views/Admin/Tabs/DiscountRule.php:308
1903
  msgid "- Categories based discounts"
1904
  msgstr ""
1905
 
1906
- #: v1/view/template/sidebar.php:21 v2/App/Views/Admin/Tabs/DiscountRule.php:309
1907
  msgid "- User roles based discounts"
1908
  msgstr ""
1909
 
1910
- #: v1/view/template/sidebar.php:22 v2/App/Views/Admin/Tabs/DiscountRule.php:310
1911
  msgid "- Buy One Get One Free deals"
1912
  msgstr ""
1913
 
1914
- #: v1/view/template/sidebar.php:23 v2/App/Views/Admin/Tabs/DiscountRule.php:311
1915
  msgid "- Buy X Get Y deals"
1916
  msgstr ""
1917
 
1918
- #: v1/view/template/sidebar.php:24
1919
  #, php-format
1920
  msgid "- Buy 2, get 1 at 50% discount"
1921
  msgstr ""
1922
 
1923
- #: v1/view/template/sidebar.php:25 v2/App/Views/Admin/Tabs/DiscountRule.php:312
1924
  msgid "- Buy 3 for $10 (Package / Bundle [Set] Discount)"
1925
  msgstr ""
1926
 
1927
- #: v1/view/template/sidebar.php:26 v2/App/Views/Admin/Tabs/DiscountRule.php:313
1928
  msgid "- Different discounts with one coupon code"
1929
  msgstr ""
1930
 
1931
- #: v1/view/template/sidebar.php:27
1932
  msgid "- Purchase history based discounts"
1933
  msgstr ""
1934
 
1935
- #: v1/view/template/sidebar.php:28
1936
  msgid "- Free product / gift"
1937
  msgstr ""
1938
 
1939
- #: v1/view/template/sidebar.php:29
1940
  msgid "- Discount for variants"
1941
  msgstr ""
1942
 
1943
- #: v1/view/template/sidebar.php:30
1944
  msgid "- Conditional discounts"
1945
  msgstr ""
1946
 
1947
- #: v1/view/template/sidebar.php:31
1948
  msgid "- Fixed cost discounts"
1949
  msgstr ""
1950
 
1951
- #: v1/view/template/sidebar.php:32
1952
  msgid "- Offer fixed price on certain conditions"
1953
  msgstr ""
1954
 
@@ -1965,8 +2023,8 @@ msgid "Edit Cart Rule"
1965
  msgstr ""
1966
 
1967
  #: v1/view/view-cart-rules.php:75 v1/view/view-pricing-rules.php:57
1968
- #: v2/App/Views/Admin/Rules/Manage.php:13
1969
- #: v2/App/Views/Admin/Rules/Manage.php:20
1970
  msgid "This rule is not running currently: "
1971
  msgstr ""
1972
 
@@ -2015,7 +2073,7 @@ msgid "To"
2015
  msgstr ""
2016
 
2017
  #: v1/view/view-cart-rules.php:140 v1/view/view-pricing-rules.php:149
2018
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:122
2019
  #, php-format
2020
  msgid "Current date and time: %s"
2021
  msgstr ""
@@ -2046,6 +2104,7 @@ msgid "Promotion message"
2046
  msgstr ""
2047
 
2048
  #: v1/view/view-cart-rules.php:718
 
2049
  msgid "Subtotal from"
2050
  msgstr ""
2051
 
@@ -2064,6 +2123,7 @@ msgid "Spend {{difference_amount}} more and get 10% discount"
2064
  msgstr ""
2065
 
2066
  #: v1/view/view-cart-rules.php:737
 
2067
  msgid "{{difference_amount}} -> Difference amount to get discount"
2068
  msgstr ""
2069
 
@@ -2304,7 +2364,7 @@ msgstr ""
2304
  msgid "Make sure you have created the coupon already"
2305
  msgstr ""
2306
 
2307
- #: v1/view/view-pricing-rules.php:484 v2/App/Conditions/CartSubTotal.php:14
2308
  msgid "Subtotal"
2309
  msgstr ""
2310
 
@@ -2476,162 +2536,162 @@ msgstr ""
2476
  msgid "Limitation: Strikeout for add-on price and subtotal in product page."
2477
  msgstr ""
2478
 
2479
- #: v2/App/Compatibility/ProductAddOnsByWooCommerce.php:97
2480
- msgid "Add compatible for WooCommerce Product Add Ons"
2481
  msgstr ""
2482
 
2483
  #: v2/App/Compatibility/WholesalePricesByRymeraWebCo.php:51
2484
  msgid "Add compatible for WooCommerce Wholesale Prices"
2485
  msgstr ""
2486
 
2487
- #: v2/App/Conditions/CartLineItemsCount.php:13
2488
  msgid "Line Item Count"
2489
  msgstr ""
2490
 
2491
- #: v2/App/Conditions/CartLineItemsCount.php:14
2492
- #: v2/App/Conditions/CartSubTotal.php:15 v2/App/Helpers/ProOptions.php:78
2493
- #: v2/App/Helpers/ProOptions.php:134 v2/App/Helpers/ProOptions.php:142
2494
- #: v2/App/Helpers/ProOptions.php:150 v2/App/Views/Admin/Tabs/settings.php:241
2495
  msgid "Cart"
2496
  msgstr ""
2497
 
2498
- #: v2/App/Controllers/Admin/Settings.php:159
2499
  msgid ""
2500
  "We found that your were using our old \"Woo discount rules\" plugin, Please "
2501
  "disable it!"
2502
  msgstr ""
2503
 
2504
- #: v2/App/Controllers/Admin/Settings.php:215
2505
  msgid "no results"
2506
  msgstr ""
2507
 
2508
- #: v2/App/Controllers/Admin/Settings.php:216
2509
  msgid "Select Values"
2510
  msgstr ""
2511
 
2512
- #: v2/App/Controllers/Admin/Settings.php:404
2513
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:211
2514
  msgid " - (Running)"
2515
  msgstr ""
2516
 
2517
- #: v2/App/Controllers/Admin/Settings.php:405
2518
  msgid "Oops!! something went wrong!"
2519
  msgstr ""
2520
 
2521
- #: v2/App/Controllers/Admin/Settings.php:406
2522
  msgid "Rule duplicated successfully!"
2523
  msgstr ""
2524
 
2525
- #: v2/App/Controllers/Admin/Settings.php:407
2526
  msgid "Rule deleted successfully!"
2527
  msgstr ""
2528
 
2529
- #: v2/App/Controllers/Admin/Settings.php:408
2530
  msgid "Are you sure want to delete this rule!"
2531
  msgstr ""
2532
 
2533
- #: v2/App/Controllers/Admin/Settings.php:409
2534
  msgid "Rule disabled successfully!"
2535
  msgstr ""
2536
 
2537
- #: v2/App/Controllers/Admin/Settings.php:410
2538
  msgid "Rule enabled successfully!"
2539
  msgstr ""
2540
 
2541
- #: v2/App/Controllers/Admin/Settings.php:411
2542
  msgid "Rule saved successfully!"
2543
  msgstr ""
2544
 
2545
- #: v2/App/Controllers/Admin/Settings.php:412
2546
  msgid "Settings saved successfully!"
2547
  msgstr ""
2548
 
2549
- #: v2/App/Controllers/Admin/Settings.php:413
2550
  msgid "Rule priority changed successfully!"
2551
  msgstr ""
2552
 
2553
- #: v2/App/Controllers/Admin/Settings.php:414
2554
  msgid "Rule priority not changed !"
2555
  msgstr ""
2556
 
2557
- #: v2/App/Controllers/Admin/Settings.php:415
2558
  msgid "No data for this period"
2559
  msgstr ""
2560
 
2561
- #: v2/App/Controllers/Admin/Settings.php:416
2562
  msgid "Oops! Coupon already exists in Woocommerce"
2563
  msgstr ""
2564
 
2565
- #: v2/App/Controllers/Admin/Settings.php:417
2566
  msgid "Copied!"
2567
  msgstr ""
2568
 
2569
- #: v2/App/Controllers/Admin/Settings.php:418
2570
- #: v2/App/Views/Admin/Tabs/settings.php:447
2571
  msgid "Copy ShortCode"
2572
  msgstr ""
2573
 
2574
- #: v2/App/Controllers/Admin/Settings.php:419
2575
  msgid "If you make this recursive other row(s) will be removed!"
2576
  msgstr ""
2577
 
2578
- #: v2/App/Controllers/Admin/Settings.php:421
2579
  msgid "Minimum Quantity"
2580
  msgstr ""
2581
 
2582
- #: v2/App/Controllers/Admin/Settings.php:422
2583
  msgid "Discount value"
2584
  msgstr ""
2585
 
2586
- #: v2/App/Controllers/Admin/Settings.php:424
2587
  msgid "Filter (Buy)"
2588
  msgstr ""
2589
 
2590
- #: v2/App/Controllers/Admin/Settings.php:425
2591
- #: v2/App/Views/Admin/Rules/Manage.php:126
2592
  msgid "Filter"
2593
  msgstr ""
2594
 
2595
- #: v2/App/Controllers/Admin/Settings.php:426
2596
  msgid ""
2597
  "<p>Choose <b>what gets discount</b> (products/categories/attributes/SKU and "
2598
  "so on )</p>\n"
2599
  "<p>Note : You can also exclude products/categories.</p>"
2600
  msgstr ""
2601
 
2602
- #: v2/App/Controllers/Admin/Settings.php:429
2603
  msgid ""
2604
  "<p>Select discount type and its value (percentage/price/fixed price)</p>"
2605
  msgstr ""
2606
 
2607
- #: v2/App/Controllers/Admin/Settings.php:430
2608
  msgid "Rules (optional)"
2609
  msgstr ""
2610
 
2611
- #: v2/App/Controllers/Admin/Settings.php:431
2612
  msgid ""
2613
  "<p>Include additional conditions (if necessary) to apply discount for "
2614
  "product filters.</p>"
2615
  msgstr ""
2616
 
2617
- #: v2/App/Controllers/Admin/Settings.php:432
2618
  msgid ""
2619
  "<p>Choose Buy Products. (products/categories/attributes/tags/sku) Example : "
2620
  "For Buy X get Y scenarios, choose X here.</p>"
2621
  msgstr ""
2622
 
2623
- #: v2/App/Controllers/Admin/Settings.php:433
2624
  msgid ""
2625
  "<p>Choose on which products the discount should be applied (This can be "
2626
  "products/categories/SKU)</p>"
2627
  msgstr ""
2628
 
2629
- #: v2/App/Controllers/Admin/Settings.php:434
2630
- #: v2/App/Controllers/Admin/Settings.php:436
2631
  msgid "Get Discount"
2632
  msgstr ""
2633
 
2634
- #: v2/App/Controllers/Admin/Settings.php:435
2635
  msgid ""
2636
  "<p>Enter the min/max ranges and choose free item quantity.</p><p>Note : "
2637
  "Enable recursive checkbox if the discounts should be applied in sequential "
@@ -2639,7 +2699,7 @@ msgid ""
2639
  "p>"
2640
  msgstr ""
2641
 
2642
- #: v2/App/Controllers/Admin/Settings.php:437
2643
  msgid ""
2644
  "<p>Choose the adjustment type to which the discount should be applied. You "
2645
  "can choose from products/categories/all products.</p><p>Note : Enable "
@@ -2647,7 +2707,7 @@ msgid ""
2647
  "</p>"
2648
  msgstr ""
2649
 
2650
- #: v2/App/Controllers/Admin/Settings.php:438
2651
  msgid ""
2652
  "<p>Choose the adjustment type to which the discount should be applied. You "
2653
  "can choose from products/categories/all products.</p><p>Note : Enable "
@@ -2658,45 +2718,45 @@ msgid ""
2658
  "td><td>5</td><td>2</td></tr></tbody></table>"
2659
  msgstr ""
2660
 
2661
- #: v2/App/Controllers/Admin/Settings.php:439
2662
- #: v2/App/Controllers/Admin/Settings.php:440
2663
  msgid "<p>Include additional conditions (if necessary)</p>"
2664
  msgstr ""
2665
 
2666
- #: v2/App/Controllers/Admin/Settings.php:441
2667
  msgid "<p>Processing migration, please wait...</p>"
2668
  msgstr ""
2669
 
2670
- #: v2/App/Controllers/Admin/Settings.php:442
2671
  msgid "<p>Migration completed.</p>"
2672
  msgstr ""
2673
 
2674
- #: v2/App/Controllers/Admin/Settings.php:443
2675
  msgid "<p>Migration skipped.</p>"
2676
  msgstr ""
2677
 
2678
- #: v2/App/Controllers/Admin/Settings.php:444
2679
  msgid "<p>Skipping migration, please wait...</p>"
2680
  msgstr ""
2681
 
2682
- #: v2/App/Controllers/Admin/Settings.php:445
2683
  msgid ""
2684
  "<span><b>Example:</b> Product A - Small and Product A - Medium will be "
2685
  "counted as 2 quantity</span>"
2686
  msgstr ""
2687
 
2688
- #: v2/App/Controllers/Admin/Settings.php:446
2689
  msgid "<span>Discount applies to all eligible products in the store</span>"
2690
  msgstr ""
2691
 
2692
- #: v2/App/Controllers/Admin/Settings.php:447
2693
  msgid ""
2694
  "<span>Choose products that get the discount using \"In List\". If you want "
2695
  "to exclude a few products, choose \"Not In List\" and select the products "
2696
  "you wanted to exclude from discount. (You can add multiple filters)</span>"
2697
  msgstr ""
2698
 
2699
- #: v2/App/Controllers/Admin/Settings.php:448
2700
  msgid ""
2701
  "<span>Choose categories that get the discount using \"In List\". If you want "
2702
  "to exclude a few categories, choose \"Not In List\" and select the "
@@ -2704,7 +2764,7 @@ msgid ""
2704
  "filters of same type)</span>"
2705
  msgstr ""
2706
 
2707
- #: v2/App/Controllers/Admin/Settings.php:449
2708
  msgid ""
2709
  "<span> Choose attributes that get the discount using \"In List\". If you "
2710
  "want to exclude a few attributes, choose \"Not In List\" and select the "
@@ -2712,57 +2772,57 @@ msgid ""
2712
  "filters of same type)</span>"
2713
  msgstr ""
2714
 
2715
- #: v2/App/Controllers/Admin/Settings.php:450
2716
  msgid ""
2717
  "<span>Choose tags that get the discount using \"In List\". If you want to "
2718
  "exclude a few tags, choose \"Not In List\" and select the tags you wanted to "
2719
  "exclude from discount. (You can add multiple filters of same type)</span>"
2720
  msgstr ""
2721
 
2722
- #: v2/App/Controllers/Admin/Settings.php:451
2723
  msgid ""
2724
  "<span>Choose SKUs that get the discount using \"In List\". If you want to "
2725
  "exclude a few SKUs, choose \"Not In List\" and select the SKUs you wanted to "
2726
  "exclude from discount. (You can add multiple filters of same type)</span>"
2727
  msgstr ""
2728
 
2729
- #: v2/App/Controllers/Admin/Settings.php:452
2730
  msgid ""
2731
  "<span>Choose whether you want to include (or exclude) products on sale "
2732
  "(those having a sale price) for the discount </span>"
2733
  msgstr ""
2734
 
2735
- #: v2/App/Controllers/Admin/Settings.php:453
2736
  msgid "<span>Discount applies to custom taxonomy</span>"
2737
  msgstr ""
2738
 
2739
- #: v2/App/Controllers/Admin/Settings.php:454
2740
  msgid "Processing please wait.."
2741
  msgstr ""
2742
 
2743
- #: v2/App/Controllers/Admin/Settings.php:455
2744
  msgid "Rebuild index processed"
2745
  msgstr ""
2746
 
2747
- #: v2/App/Controllers/Admin/Settings.php:456
2748
  msgid "Please select the rules to build index"
2749
  msgstr ""
2750
 
2751
- #: v2/App/Controllers/Admin/Tabs/Compatible.php:20
2752
  msgid "Compatibility"
2753
  msgstr ""
2754
 
2755
- #: v2/App/Controllers/Admin/Tabs/DiscountRules.php:21
2756
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:10
2757
  msgid "Discount Rules"
2758
  msgstr ""
2759
 
2760
- #: v2/App/Controllers/Admin/Tabs/Help.php:15
2761
  msgid "Read Documentation"
2762
  msgstr ""
2763
 
2764
- #: v2/App/Controllers/Admin/Tabs/ImportExport.php:16
2765
- #: v2/App/Views/Admin/Tabs/ImportExport.php:53
2766
  msgid "Export"
2767
  msgstr ""
2768
 
@@ -2783,371 +2843,372 @@ msgstr ""
2783
  msgid "Rule amount data with cart discounts"
2784
  msgstr ""
2785
 
2786
- #: v2/App/Controllers/Admin/Tabs/Statistics.php:22
2787
  msgid "Reports"
2788
  msgstr ""
2789
 
2790
- #: v2/App/Controllers/Admin/Tabs/Statistics.php:27
2791
  msgid "Rule amount"
2792
  msgstr ""
2793
 
2794
- #: v2/App/Controllers/Admin/Tabs/Statistics.php:28
2795
- #: v2/App/Controllers/Admin/Tabs/Statistics.php:33
2796
  msgid "Rule"
2797
  msgstr ""
2798
 
2799
- #: v2/App/Controllers/Admin/Tabs/Statistics.php:32
2800
  msgid "Rule amount with cart discount"
2801
  msgstr ""
2802
 
2803
- #: v2/App/Controllers/Base.php:40
2804
  msgid "All Products"
2805
  msgstr ""
2806
 
2807
- #: v2/App/Controllers/Base.php:41 v2/App/Controllers/Base.php:46
2808
- #: v2/App/Helpers/ProOptions.php:32 v2/App/Helpers/ProOptions.php:38
2809
- #: v2/App/Helpers/ProOptions.php:44 v2/App/Helpers/ProOptions.php:50
2810
- #: v2/App/Helpers/ProOptions.php:56 v2/App/Views/Admin/Tabs/settings.php:99
2811
  msgid "Product"
2812
  msgstr ""
2813
 
2814
- #: v2/App/Controllers/Base.php:188
2815
  msgid "Product Adjustment"
2816
  msgstr ""
2817
 
2818
- #: v2/App/Controllers/Base.php:189 v2/App/Controllers/Base.php:195
2819
- #: v2/App/Helpers/ProOptions.php:330
2820
  msgid "Simple Discount"
2821
  msgstr ""
2822
 
2823
- #: v2/App/Controllers/Base.php:194
2824
  msgid "Cart Adjustment"
2825
  msgstr ""
2826
 
2827
- #: v2/App/Controllers/Base.php:200 v2/App/Controllers/Base.php:201
2828
- #: v2/App/Helpers/ProOptions.php:336
 
2829
  msgid "Bulk Discount"
2830
  msgstr ""
2831
 
2832
- #: v2/App/Controllers/ManageDiscount.php:533
2833
  msgid "cart discount"
2834
  msgstr ""
2835
 
2836
- #: v2/App/Controllers/ManageDiscount.php:705
2837
  msgid "Coupon code applied successfully."
2838
  msgstr ""
2839
 
2840
- #: v2/App/Controllers/ShortCodeManager.php:675
2841
  msgid "No Banner Content"
2842
  msgstr ""
2843
 
2844
- #: v2/App/Helpers/Migration.php:131
2845
  #, php-format
2846
  msgid "%s Completed. Please wait.."
2847
  msgstr ""
2848
 
2849
- #: v2/App/Helpers/ProOptions.php:31 v2/App/Helpers/ProOptions.php:93
2850
  msgid "Category - PRO -"
2851
  msgstr ""
2852
 
2853
- #: v2/App/Helpers/ProOptions.php:37 v2/App/Helpers/ProOptions.php:85
2854
  msgid "Attributes - PRO -"
2855
  msgstr ""
2856
 
2857
- #: v2/App/Helpers/ProOptions.php:43 v2/App/Helpers/ProOptions.php:125
2858
  msgid "Tags - PRO -"
2859
  msgstr ""
2860
 
2861
- #: v2/App/Helpers/ProOptions.php:49
2862
  msgid "SKUs - PRO -"
2863
  msgstr ""
2864
 
2865
- #: v2/App/Helpers/ProOptions.php:55
2866
  msgid "On sale products - PRO -"
2867
  msgstr ""
2868
 
2869
- #: v2/App/Helpers/ProOptions.php:77
2870
  msgid "Coupons - PRO -"
2871
  msgstr ""
2872
 
2873
- #: v2/App/Helpers/ProOptions.php:86 v2/App/Helpers/ProOptions.php:94
2874
- #: v2/App/Helpers/ProOptions.php:102 v2/App/Helpers/ProOptions.php:110
2875
- #: v2/App/Helpers/ProOptions.php:118 v2/App/Helpers/ProOptions.php:126
2876
  msgid "Cart Items"
2877
  msgstr ""
2878
 
2879
- #: v2/App/Helpers/ProOptions.php:101
2880
  msgid "Product combination - PRO -"
2881
  msgstr ""
2882
 
2883
- #: v2/App/Helpers/ProOptions.php:109
2884
  msgid "Products - PRO -"
2885
  msgstr ""
2886
 
2887
- #: v2/App/Helpers/ProOptions.php:117
2888
  msgid "SKU - PRO -"
2889
  msgstr ""
2890
 
2891
- #: v2/App/Helpers/ProOptions.php:133
2892
  msgid "Cart items quantity - PRO -"
2893
  msgstr ""
2894
 
2895
- #: v2/App/Helpers/ProOptions.php:141
2896
  msgid "Total weight - PRO -"
2897
  msgstr ""
2898
 
2899
- #: v2/App/Helpers/ProOptions.php:149
2900
  msgid "Payment Method - PRO -"
2901
  msgstr ""
2902
 
2903
- #: v2/App/Helpers/ProOptions.php:157
2904
  msgid "Date - PRO -"
2905
  msgstr ""
2906
 
2907
- #: v2/App/Helpers/ProOptions.php:158 v2/App/Helpers/ProOptions.php:166
2908
- #: v2/App/Helpers/ProOptions.php:174 v2/App/Helpers/ProOptions.php:182
2909
  msgid "Date & Time"
2910
  msgstr ""
2911
 
2912
- #: v2/App/Helpers/ProOptions.php:165
2913
  msgid "Date and Time - PRO -"
2914
  msgstr ""
2915
 
2916
- #: v2/App/Helpers/ProOptions.php:173
2917
  msgid "Days - PRO -"
2918
  msgstr ""
2919
 
2920
- #: v2/App/Helpers/ProOptions.php:181
2921
  msgid "Time - PRO -"
2922
  msgstr ""
2923
 
2924
- #: v2/App/Helpers/ProOptions.php:189
2925
  msgid "First order - PRO -"
2926
  msgstr ""
2927
 
2928
- #: v2/App/Helpers/ProOptions.php:197
2929
  msgid "Last order - PRO -"
2930
  msgstr ""
2931
 
2932
- #: v2/App/Helpers/ProOptions.php:205
2933
  msgid "Last order amount - PRO -"
2934
  msgstr ""
2935
 
2936
- #: v2/App/Helpers/ProOptions.php:213
2937
  msgid "Number of orders made - PRO -"
2938
  msgstr ""
2939
 
2940
- #: v2/App/Helpers/ProOptions.php:221
2941
  msgid "Number of orders made with following products - PRO -"
2942
  msgstr ""
2943
 
2944
- #: v2/App/Helpers/ProOptions.php:229
2945
  msgid "Spent - PRO -"
2946
  msgstr ""
2947
 
2948
- #: v2/App/Helpers/ProOptions.php:237
2949
  msgid "City - PRO -"
2950
  msgstr ""
2951
 
2952
- #: v2/App/Helpers/ProOptions.php:238 v2/App/Helpers/ProOptions.php:246
2953
- #: v2/App/Helpers/ProOptions.php:254 v2/App/Helpers/ProOptions.php:262
2954
  msgid "Shipping"
2955
  msgstr ""
2956
 
2957
- #: v2/App/Helpers/ProOptions.php:245
2958
  msgid "Country - PRO -"
2959
  msgstr ""
2960
 
2961
- #: v2/App/Helpers/ProOptions.php:253
2962
  msgid "State - PRO -"
2963
  msgstr ""
2964
 
2965
- #: v2/App/Helpers/ProOptions.php:261
2966
  msgid "Zipcode - PRO -"
2967
  msgstr ""
2968
 
2969
- #: v2/App/Helpers/ProOptions.php:269
2970
  msgid "Email - PRO -"
2971
  msgstr ""
2972
 
2973
- #: v2/App/Helpers/ProOptions.php:270 v2/App/Helpers/ProOptions.php:278
2974
- #: v2/App/Helpers/ProOptions.php:286 v2/App/Helpers/ProOptions.php:294
2975
  msgid "Customer"
2976
  msgstr ""
2977
 
2978
- #: v2/App/Helpers/ProOptions.php:277
2979
  msgid "User - PRO -"
2980
  msgstr ""
2981
 
2982
- #: v2/App/Helpers/ProOptions.php:285
2983
  msgid "Is logged in - PRO -"
2984
  msgstr ""
2985
 
2986
- #: v2/App/Helpers/ProOptions.php:293
2987
  msgid "User role - PRO -"
2988
  msgstr ""
2989
 
2990
- #: v2/App/Helpers/ProOptions.php:315
2991
  msgid "Buy X get X - PRO -"
2992
  msgstr ""
2993
 
2994
- #: v2/App/Helpers/ProOptions.php:316 v2/App/Helpers/ProOptions.php:323
2995
  msgid "Bogo Discount"
2996
  msgstr ""
2997
 
2998
- #: v2/App/Helpers/ProOptions.php:322
2999
  msgid "Buy X get Y - PRO -"
3000
  msgstr ""
3001
 
3002
- #: v2/App/Helpers/ProOptions.php:329
3003
  msgid "Free Shipping - PRO -"
3004
  msgstr ""
3005
 
3006
- #: v2/App/Helpers/ProOptions.php:335
3007
  msgid "Set Discount - PRO -"
3008
  msgstr ""
3009
 
3010
- #: v2/App/Helpers/Rule.php:1072 v2/App/Helpers/Rule.php:1083
3011
  msgid "discount"
3012
  msgstr ""
3013
 
3014
- #: v2/App/Helpers/Rule.php:1136 v2/App/Helpers/Rule.php:1213
3015
  msgid "Untitled Rule"
3016
  msgstr ""
3017
 
3018
- #: v2/App/Helpers/Woocommerce.php:878
3019
  msgid "Sunday"
3020
  msgstr ""
3021
 
3022
- #: v2/App/Helpers/Woocommerce.php:879
3023
  msgid "Monday"
3024
  msgstr ""
3025
 
3026
- #: v2/App/Helpers/Woocommerce.php:880
3027
  msgid "Tuesday"
3028
  msgstr ""
3029
 
3030
- #: v2/App/Helpers/Woocommerce.php:881
3031
  msgid "Wednesday"
3032
  msgstr ""
3033
 
3034
- #: v2/App/Helpers/Woocommerce.php:882
3035
  msgid "Thursday"
3036
  msgstr ""
3037
 
3038
- #: v2/App/Helpers/Woocommerce.php:883
3039
  msgid "Friday"
3040
  msgstr ""
3041
 
3042
- #: v2/App/Helpers/Woocommerce.php:884
3043
  msgid "Saturday"
3044
  msgstr ""
3045
 
3046
- #: v2/App/Helpers/Woocommerce.php:895
3047
  msgid ""
3048
  "Woocommerce before main content(Archive / Shop / Cat Pages / single product)"
3049
  msgstr ""
3050
 
3051
- #: v2/App/Helpers/Woocommerce.php:896
3052
  msgid "Woocommerce archive description(Archive / Shop / Cat Pages)"
3053
  msgstr ""
3054
 
3055
- #: v2/App/Helpers/Woocommerce.php:897
3056
  msgid "Woocommerce before shop loop(Archive / Shop / Cat Pages)"
3057
  msgstr ""
3058
 
3059
- #: v2/App/Helpers/Woocommerce.php:898
3060
  msgid "Woocommerce after shop loop(Archive / Shop / Cat Pages)"
3061
  msgstr ""
3062
 
3063
- #: v2/App/Helpers/Woocommerce.php:899
3064
  msgid ""
3065
  "Woocommerce after main content(Archive / Shop / Cat Pages / single product)"
3066
  msgstr ""
3067
 
3068
- #: v2/App/Helpers/Woocommerce.php:900 v2/App/Views/Admin/Tabs/settings.php:179
3069
  #: v2/App/Views/Admin/Tabs/settings.php:197
3070
  msgid "Woocommerce before single product"
3071
  msgstr ""
3072
 
3073
- #: v2/App/Helpers/Woocommerce.php:901 v2/App/Views/Admin/Tabs/settings.php:181
3074
  #: v2/App/Views/Admin/Tabs/settings.php:199
3075
  msgid "Woocommerce before single product summary"
3076
  msgstr ""
3077
 
3078
- #: v2/App/Helpers/Woocommerce.php:902 v2/App/Views/Admin/Tabs/settings.php:180
3079
  #: v2/App/Views/Admin/Tabs/settings.php:198
3080
  msgid "Woocommerce after single product summary"
3081
  msgstr ""
3082
 
3083
- #: v2/App/Helpers/Woocommerce.php:903 v2/App/Views/Admin/Tabs/settings.php:178
3084
  #: v2/App/Views/Admin/Tabs/settings.php:196
3085
  msgid "Woocommerce after single product"
3086
  msgstr ""
3087
 
3088
- #: v2/App/Helpers/Woocommerce.php:904
3089
  msgid "Woocommerce before cart"
3090
  msgstr ""
3091
 
3092
- #: v2/App/Helpers/Woocommerce.php:905
3093
  msgid "Woocommerce before cart table"
3094
  msgstr ""
3095
 
3096
- #: v2/App/Helpers/Woocommerce.php:906
3097
  msgid "Woocommerce before cart contents"
3098
  msgstr ""
3099
 
3100
- #: v2/App/Helpers/Woocommerce.php:907
3101
  msgid "Woocommerce cart contents"
3102
  msgstr ""
3103
 
3104
- #: v2/App/Helpers/Woocommerce.php:908
3105
  msgid "Woocommerce after cart contents"
3106
  msgstr ""
3107
 
3108
- #: v2/App/Helpers/Woocommerce.php:909
3109
  msgid "Woocommerce after cart table"
3110
  msgstr ""
3111
 
3112
- #: v2/App/Helpers/Woocommerce.php:910
3113
  msgid "Woocommerce after cart"
3114
  msgstr ""
3115
 
3116
- #: v2/App/Helpers/Woocommerce.php:911
3117
  msgid "Woocommerce before checkout form"
3118
  msgstr ""
3119
 
3120
- #: v2/App/Helpers/Woocommerce.php:913
3121
  msgid "Woocommerce before checkout billing form"
3122
  msgstr ""
3123
 
3124
- #: v2/App/Helpers/Woocommerce.php:914
3125
  msgid "Woocommerce after checkout billing form"
3126
  msgstr ""
3127
 
3128
- #: v2/App/Helpers/Woocommerce.php:915
3129
  msgid "Woocommerce before checkout shipping form"
3130
  msgstr ""
3131
 
3132
- #: v2/App/Helpers/Woocommerce.php:916
3133
  msgid "Woocommerce after checkout shipping form"
3134
  msgstr ""
3135
 
3136
- #: v2/App/Helpers/Woocommerce.php:917
3137
  msgid "Woocommerce before order notes"
3138
  msgstr ""
3139
 
3140
- #: v2/App/Helpers/Woocommerce.php:918
3141
  msgid "Woocommerce after order notes"
3142
  msgstr ""
3143
 
3144
- #: v2/App/Views/Admin/Menu.php:21
3145
  msgid ""
3146
  "<span style='color: #FF8C00 ; padding: 3px; border-radius: 4px'> (public "
3147
  "beta) </span>"
3148
  msgstr ""
3149
 
3150
- #: v2/App/Views/Admin/Menu.php:31
3151
  msgid "Rebuild index"
3152
  msgstr ""
3153
 
@@ -3202,6 +3263,7 @@ msgid "Subtotal should be"
3202
  msgstr ""
3203
 
3204
  #: v2/App/Views/Admin/Rules/Conditions/Cart/Subtotal.php:23
 
3205
  msgid "0.00"
3206
  msgstr ""
3207
 
@@ -3228,58 +3290,58 @@ msgid "Conditions Relationship "
3228
  msgstr ""
3229
 
3230
  #: v2/App/Views/Admin/Rules/Conditions/Main.php:23
3231
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:99
3232
  msgid "Match All"
3233
  msgstr ""
3234
 
3235
  #: v2/App/Views/Admin/Rules/Conditions/Main.php:25
3236
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:101
3237
  msgid "Many Any"
3238
  msgstr ""
3239
 
3240
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:71
3241
  #: v2/App/Views/Admin/Rules/Others/CommonTemplates.php:87
3242
  msgid "Condition Type"
3243
  msgstr ""
3244
 
3245
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:89
3246
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:109
3247
  msgid "Add condition"
3248
  msgstr ""
3249
 
3250
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:97
3251
  msgid "Conditions Relationship"
3252
  msgstr ""
3253
 
3254
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:119
3255
  msgid "Rule Limits"
3256
  msgstr ""
3257
 
3258
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:132
3259
  msgid "Unlimited"
3260
  msgstr ""
3261
 
3262
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:139
3263
  msgid "Maximum usage limit"
3264
  msgstr ""
3265
 
3266
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:147
3267
  msgid "Rule Vaild From"
3268
  msgstr ""
3269
 
3270
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:152
3271
  msgid "Vaild from"
3272
  msgstr ""
3273
 
3274
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:159
3275
  msgid "Rule Valid To"
3276
  msgstr ""
3277
 
3278
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:163
3279
  msgid "Vaild to"
3280
  msgstr ""
3281
 
3282
- #: v2/App/Views/Admin/Rules/Conditions/Main.php:174
3283
  msgid "Select values"
3284
  msgstr ""
3285
 
@@ -3300,7 +3362,7 @@ msgid "Preview"
3300
  msgstr ""
3301
 
3302
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:22
3303
- #: v2/App/Views/Admin/Tabs/settings.php:468
3304
  msgid "Note:"
3305
  msgstr ""
3306
 
@@ -3320,9 +3382,9 @@ msgstr ""
3320
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:71
3321
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:92
3322
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:126
3323
- #: v2/App/Views/Admin/Tabs/settings.php:364
3324
- #: v2/App/Views/Admin/Tabs/settings.php:373
3325
- #: v2/App/Views/Admin/Tabs/settings.php:436
3326
  msgid ""
3327
  "Unlock this feature by <a href='https://www.flycart.org/products/wordpress/"
3328
  "woocommerce-discount-rules' target='_blank'>Upgrading to Pro</a>"
@@ -3418,11 +3480,13 @@ msgstr ""
3418
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:53
3419
  #: v2/App/Views/Admin/Rules/Discounts/Cart.php:24
3420
  #: v2/App/Views/Admin/Rules/Discounts/simple.php:23
 
 
3421
  msgid "Discount Type"
3422
  msgstr ""
3423
 
3424
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:65
3425
- #: v2/App/Views/Admin/Tabs/settings.php:534
3426
  msgid "Discount Value"
3427
  msgstr ""
3428
 
@@ -3493,18 +3557,18 @@ msgstr ""
3493
  msgid "Not In List"
3494
  msgstr ""
3495
 
3496
- #: v2/App/Views/Admin/Rules/Filters/Main.php:81
3497
  msgid "Select "
3498
  msgstr ""
3499
 
3500
- #: v2/App/Views/Admin/Rules/Filters/Main.php:97
3501
  msgid ""
3502
  "Choose products that get the discount using \"In List\". If you want to "
3503
  "exclude a few products, choose \"Not In List\" and select the products you "
3504
  "wanted to exclude from discount. (You can add multiple filters)"
3505
  msgstr ""
3506
 
3507
- #: v2/App/Views/Admin/Rules/Filters/Main.php:100
3508
  msgid ""
3509
  "Choose categories that get the discount using \"In List\". If you want to "
3510
  "exclude a few categories, choose \"Not In List\" and select the categories "
@@ -3512,7 +3576,7 @@ msgid ""
3512
  "type)"
3513
  msgstr ""
3514
 
3515
- #: v2/App/Views/Admin/Rules/Filters/Main.php:103
3516
  msgid ""
3517
  "Choose attributes that get the discount using \"In List\". If you want to "
3518
  "exclude a few attributes, choose \"Not In List\" and select the attributes "
@@ -3520,111 +3584,137 @@ msgid ""
3520
  "type)"
3521
  msgstr ""
3522
 
3523
- #: v2/App/Views/Admin/Rules/Filters/Main.php:106
3524
  msgid ""
3525
  "Choose tags that get the discount using \"In List\". If you want to exclude "
3526
  "a few tags, choose \"Not In List\" and select the tags you wanted to exclude "
3527
  "from discount. (You can add multiple filters of same type)"
3528
  msgstr ""
3529
 
3530
- #: v2/App/Views/Admin/Rules/Filters/Main.php:109
3531
  msgid ""
3532
  "Choose SKUs that get the discount using \"In List\". If you want to exclude "
3533
  "a few SKUs, choose \"Not In List\" and select the SKUs you wanted to exclude "
3534
  "from discount. (You can add multiple filters of same type)"
3535
  msgstr ""
3536
 
3537
- #: v2/App/Views/Admin/Rules/Filters/Main.php:112
3538
  msgid ""
3539
  "Choose whether you want to include (or exclude) products on sale (those "
3540
  "having a sale price) for the discount "
3541
  msgstr ""
3542
 
3543
- #: v2/App/Views/Admin/Rules/Filters/Main.php:115
3544
- #: v2/App/Views/Admin/Rules/Filters/Main.php:161
3545
  msgid "Discount applies to all eligible products in the store"
3546
  msgstr ""
3547
 
3548
- #: v2/App/Views/Admin/Rules/Filters/Main.php:119
3549
  msgid "Discount applies to custom taxonomy"
3550
  msgstr ""
3551
 
3552
- #: v2/App/Views/Admin/Rules/Filters/Main.php:172
3553
  msgid "Add filter"
3554
  msgstr ""
3555
 
3556
- #: v2/App/Views/Admin/Rules/Filters/Products.php:17
3557
  msgid "Select Products"
3558
  msgstr ""
3559
 
3560
- #: v2/App/Views/Admin/Rules/Manage.php:13
3561
  msgid " Start date and time is set in the future date"
3562
  msgstr ""
3563
 
3564
- #: v2/App/Views/Admin/Rules/Manage.php:20
3565
  msgid " Validity expired"
3566
  msgstr ""
3567
 
3568
- #: v2/App/Views/Admin/Rules/Manage.php:49
3569
  msgid "Enable?"
3570
  msgstr ""
3571
 
3572
- #: v2/App/Views/Admin/Rules/Manage.php:58
3573
  msgid "Apply this rule if matched and ignore all other rules"
3574
  msgstr ""
3575
 
3576
- #: v2/App/Views/Admin/Rules/Manage.php:67
3577
  msgid "#Rule ID: "
3578
  msgstr ""
3579
 
3580
- #: v2/App/Views/Admin/Rules/Manage.php:74
3581
  msgid "Save & Close"
3582
  msgstr ""
3583
 
3584
- #: v2/App/Views/Admin/Rules/Manage.php:77
3585
  msgid "Cancel"
3586
  msgstr ""
3587
 
3588
- #: v2/App/Views/Admin/Rules/Manage.php:89
3589
  msgid "Select Discount Type"
3590
  msgstr ""
3591
 
3592
- #: v2/App/Views/Admin/Rules/Manage.php:128
3593
  msgid ""
3594
  "Choose which <b>gets</b> discount (products/categories/attributes/SKU and so "
3595
  "on )"
3596
  msgstr ""
3597
 
3598
- #: v2/App/Views/Admin/Rules/Manage.php:129
3599
  msgid "Note : You can also exclude products/categories."
3600
  msgstr ""
3601
 
3602
- #: v2/App/Views/Admin/Rules/Manage.php:173
3603
  msgid "Select discount type and its value (percentage/price/fixed price)"
3604
  msgstr ""
3605
 
3606
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3607
  msgid "Migrate rules from v1"
3608
  msgstr ""
3609
 
3610
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:22
3611
  msgid "Migration"
3612
  msgstr ""
3613
 
3614
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:26
3615
- #: v2/App/Views/Admin/welcome-text.php:6
3616
  msgid "Migrate rules from v1 to v2"
3617
  msgstr ""
3618
 
3619
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:30
3620
  msgid "Available price rules"
3621
  msgstr ""
3622
 
3623
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:33
3624
  msgid "Available cart rules"
3625
  msgstr ""
3626
 
3627
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:36
3628
  msgid ""
3629
  "Once migration is completed, please open the rules and check their "
3630
  "configuration once again to make sure it meets your discount scenario. If "
@@ -3633,70 +3723,100 @@ msgid ""
3633
  "\">https://www.flycart.org/support</a>"
3634
  msgstr ""
3635
 
3636
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:41
3637
- #: v2/App/Views/Admin/welcome-text.php:11
3638
  msgid "Migrate"
3639
  msgstr ""
3640
 
3641
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:42
3642
- #: v2/App/Views/Admin/welcome-text.php:12
3643
  msgid "Skip"
3644
  msgstr ""
3645
 
3646
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:66
3647
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:72
3648
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:82
3649
  msgid "Search Rules"
3650
  msgstr ""
3651
 
3652
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:86
3653
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:288
3654
  msgid "item"
3655
  msgstr ""
3656
 
3657
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:86
3658
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:288
3659
  msgid "items"
3660
  msgstr ""
3661
 
3662
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:114
3663
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:259
3664
  msgid "Language(s)"
3665
  msgstr ""
3666
 
3667
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:146
3668
  msgid "Exclusive"
3669
  msgstr ""
3670
 
3671
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:187
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3672
  msgid "Enabled"
3673
  msgstr ""
3674
 
3675
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:196
3676
  msgid " - ( Will run in future)"
3677
  msgstr ""
3678
 
3679
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:199
3680
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:207
3681
  msgid "Your server current date and time:"
3682
  msgstr ""
3683
 
3684
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:204
3685
  msgid " - ( Not running - validity expired)"
3686
  msgstr ""
3687
 
3688
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:234
3689
  msgid "No rules found."
3690
  msgstr ""
3691
 
3692
- #: v2/App/Views/Admin/Tabs/DiscountRule.php:314
3693
  msgid "Go PRO"
3694
  msgstr ""
3695
 
3696
- #: v2/App/Views/Admin/Tabs/ImportExport.php:12
3697
  msgid "Export tool"
3698
  msgstr ""
3699
 
 
 
 
 
 
3700
  #: v2/App/Views/Admin/Tabs/Statistics.php:39
3701
  msgid "This Week"
3702
  msgstr ""
@@ -3827,7 +3947,7 @@ msgid "Show discount table on product page"
3827
  msgstr ""
3828
 
3829
  #: v2/App/Views/Admin/Tabs/settings.php:162
3830
- #: v2/App/Views/Admin/Tabs/settings.php:464
3831
  msgid "Customize Discount Table"
3832
  msgstr ""
3833
 
@@ -3917,209 +4037,222 @@ msgid "Discount label for combined discounts"
3917
  msgstr ""
3918
 
3919
  #: v2/App/Views/Admin/Tabs/settings.php:300
3920
- msgid "Display you saved text"
3921
  msgstr ""
3922
 
3923
  #: v2/App/Views/Admin/Tabs/settings.php:301
3924
- msgid "Display you saved text when rule applied"
 
 
 
 
 
 
 
 
 
3925
  msgstr ""
3926
 
3927
  #: v2/App/Views/Admin/Tabs/settings.php:316
 
 
 
 
3928
  msgid "You save text to show when rule applied"
3929
  msgstr ""
3930
 
3931
- #: v2/App/Views/Admin/Tabs/settings.php:325
3932
  msgid "Show a discount applied message on cart?"
3933
  msgstr ""
3934
 
3935
- #: v2/App/Views/Admin/Tabs/settings.php:326
3936
  msgid "Show message in cart page on rule applied"
3937
  msgstr ""
3938
 
3939
- #: v2/App/Views/Admin/Tabs/settings.php:342
3940
  msgid "Applied rule message text on cart"
3941
  msgstr ""
3942
 
3943
- #: v2/App/Views/Admin/Tabs/settings.php:343
3944
  msgid "Text to show when rule applied"
3945
  msgstr ""
3946
 
3947
- #: v2/App/Views/Admin/Tabs/settings.php:353
3948
  msgid "Banner"
3949
  msgstr ""
3950
 
3951
- #: v2/App/Views/Admin/Tabs/settings.php:360
3952
  msgid "Banner Content"
3953
  msgstr ""
3954
 
3955
- #: v2/App/Views/Admin/Tabs/settings.php:361
3956
  msgid ""
3957
  "A static banner you that you want to display in your storefront. <br><br> "
3958
  "<b>NOTE:</b> It is a static banner. You can use any content or html here."
3959
  msgstr ""
3960
 
3961
- #: v2/App/Views/Admin/Tabs/settings.php:370
3962
  msgid "Banner Content display position"
3963
  msgstr ""
3964
 
3965
- #: v2/App/Views/Admin/Tabs/settings.php:371
3966
  msgid "Choose a display position for the banner in your storefront"
3967
  msgstr ""
3968
 
3969
- #: v2/App/Views/Admin/Tabs/settings.php:382
3970
  msgid "On-Sale page"
3971
  msgstr ""
3972
 
3973
- #: v2/App/Views/Admin/Tabs/settings.php:388
3974
  msgid "Select rules for the On Sale Page"
3975
  msgstr ""
3976
 
3977
- #: v2/App/Views/Admin/Tabs/settings.php:401
3978
  msgid "Type the name of the rule to select it"
3979
  msgstr ""
3980
 
3981
- #: v2/App/Views/Admin/Tabs/settings.php:409
3982
  msgid "All active rules"
3983
  msgstr ""
3984
 
3985
- #: v2/App/Views/Admin/Tabs/settings.php:434
3986
  msgid "Save and Build Index"
3987
  msgstr ""
3988
 
3989
- #: v2/App/Views/Admin/Tabs/settings.php:444
3990
  msgid ""
3991
  "ShortCode to load all products which has discount through Woo Discount Rules"
3992
  msgstr ""
3993
 
3994
- #: v2/App/Views/Admin/Tabs/settings.php:467
3995
  msgid "Settings Saved"
3996
  msgstr ""
3997
 
3998
- #: v2/App/Views/Admin/Tabs/settings.php:468
3999
  msgid " This table contains sample content for design purpose."
4000
  msgstr ""
4001
 
4002
- #: v2/App/Views/Admin/Tabs/settings.php:478
4003
  msgid "Table Header"
4004
  msgstr ""
4005
 
4006
- #: v2/App/Views/Admin/Tabs/settings.php:479
4007
  msgid "Show/Hide table header column names"
4008
  msgstr ""
4009
 
4010
- #: v2/App/Views/Admin/Tabs/settings.php:492
4011
  msgid "Title column Name on table"
4012
  msgstr ""
4013
 
4014
- #: v2/App/Views/Admin/Tabs/settings.php:493
4015
  msgid "Give name for rule title column"
4016
  msgstr ""
4017
 
4018
- #: v2/App/Views/Admin/Tabs/settings.php:504
4019
  msgid "Discount column Name on table"
4020
  msgstr ""
4021
 
4022
- #: v2/App/Views/Admin/Tabs/settings.php:505
4023
  msgid "Give name for discount column"
4024
  msgstr ""
4025
 
4026
- #: v2/App/Views/Admin/Tabs/settings.php:516
4027
  msgid "Range column Name on table"
4028
  msgstr ""
4029
 
4030
- #: v2/App/Views/Admin/Tabs/settings.php:517
4031
  msgid "Give name for range column"
4032
  msgstr ""
4033
 
4034
- #: v2/App/Views/Admin/Tabs/settings.php:528
4035
  msgid "Discount column value on table"
4036
  msgstr ""
4037
 
4038
- #: v2/App/Views/Admin/Tabs/settings.php:529
4039
  msgid "Show Discount value/price in table"
4040
  msgstr ""
4041
 
4042
- #: v2/App/Views/Admin/Tabs/settings.php:537
4043
  msgid "Discounted Price"
4044
  msgstr ""
4045
 
4046
- #: v2/App/Views/Admin/Tabs/settings.php:612
4047
- #: v2/App/Views/Admin/Tabs/settings.php:635
4048
  msgid "Bulk Rule"
4049
  msgstr ""
4050
 
4051
- #: v2/App/Views/Admin/Tabs/settings.php:620
4052
- #: v2/App/Views/Admin/Tabs/settings.php:666
4053
- #: v2/App/Views/Admin/Tabs/settings.php:733
4054
- #: v2/App/Views/Templates/discount_table.php:111
4055
  msgid " flat"
4056
  msgstr ""
4057
 
4058
- #: v2/App/Views/Admin/Tabs/settings.php:626
4059
  msgid "1 - 5"
4060
  msgstr ""
4061
 
4062
- #: v2/App/Views/Admin/Tabs/settings.php:649
4063
  msgid "11 - 15"
4064
  msgstr ""
4065
 
4066
- #: v2/App/Views/Admin/Tabs/settings.php:658
4067
  msgid "Bulk Flat discount"
4068
  msgstr ""
4069
 
4070
- #: v2/App/Views/Admin/Tabs/settings.php:672
4071
  msgid "50 - 60"
4072
  msgstr ""
4073
 
4074
- #: v2/App/Views/Admin/Tabs/settings.php:681
4075
  msgid "Bulk percentage discount"
4076
  msgstr ""
4077
 
4078
- #: v2/App/Views/Admin/Tabs/settings.php:694
4079
  msgid "70 - 80"
4080
  msgstr ""
4081
 
4082
- #: v2/App/Views/Admin/Tabs/settings.php:703
4083
  #, php-format
4084
  msgid "Bulk % discount"
4085
  msgstr ""
4086
 
4087
- #: v2/App/Views/Admin/Tabs/settings.php:716
4088
  msgid "450 - 500"
4089
  msgstr ""
4090
 
4091
- #: v2/App/Views/Admin/Tabs/settings.php:725
4092
  msgid "Bulk flat"
4093
  msgstr ""
4094
 
4095
- #: v2/App/Views/Admin/Tabs/settings.php:739
4096
  msgid "600 - 700"
4097
  msgstr ""
4098
 
4099
- #: v2/App/Views/Admin/Tabs/settings.php:748
4100
  msgid "set percentage discount"
4101
  msgstr ""
4102
 
4103
- #: v2/App/Views/Admin/Tabs/settings.php:761
4104
  msgid "5"
4105
  msgstr ""
4106
 
4107
- #: v2/App/Views/Admin/Tabs/settings.php:770
4108
  msgid "Fixed discount for set"
4109
  msgstr ""
4110
 
4111
- #: v2/App/Views/Admin/Tabs/settings.php:783
4112
  msgid "10"
4113
  msgstr ""
4114
 
4115
- #: v2/App/Views/Admin/Tabs/settings.php:792
4116
  msgid "set flat discount"
4117
  msgstr ""
4118
 
4119
- #: v2/App/Views/Admin/Tabs/settings.php:805
4120
  msgid "15"
4121
  msgstr ""
4122
 
4123
- #: v2/App/Views/Templates/discount_table.php:106
4124
  msgid " (in cart)"
4125
- msgstr ""
13
  "X-Generator: Loco https://localise.biz/\n"
14
  "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;"
15
 
16
+ #: common.php:12
17
  msgid "Invalid request"
18
  msgstr ""
19
 
20
+ #: common.php:17
21
+ msgid "Discount Rules 2.0 requires minimum PHP version of "
22
+ msgstr ""
23
+
24
+ #: common.php:21
25
+ msgid "Discount Rules 2.0 requires at least Woocommerce"
26
+ msgstr ""
27
+
28
+ #: common.php:48
29
  msgid ""
30
+ "<p>Since 2.0, you need BOTH Core and Pro (2.0) packages installed and "
31
+ "activated.</p>"
32
+ msgstr ""
33
+
34
+ #: common.php:49
35
+ msgid "<p><b>Why we made this change?</b></p>"
36
  msgstr ""
37
 
38
+ #: common.php:50
39
  msgid ""
40
+ "<p>This arrangement is to avoid the confusion in the installation and "
41
+ "upgrade process. Many users first install the core free version. Then "
42
+ "purchase the PRO version and try to install it over the free version. Since "
43
+ "both free and pro packages have same names, wordpress asks them to uninstall "
44
+ "free and then install pro. As you can see, this is quite confusing for the "
45
+ "end users.</p>"
46
+ msgstr ""
47
+
48
+ #: common.php:51
49
+ msgid ""
50
+ "<p>As a result, starting from 2.0, we now have two packs: 1. Core 2. PRO.</p>"
51
+ msgstr ""
52
+
53
+ #: common.php:52
54
+ msgid "Download and Install"
55
  msgstr ""
56
 
57
+ #: common.php:55
58
+ msgid ""
59
+ "Since 2.0, you need BOTH Core and Pro (2.0) packages installed and "
60
+ "activated. Please download the Pro 2.0 pack from My Downloads page in our "
61
+ "site, install and activate it. <a href=\"https://docs.flycart.org/en/"
62
+ "articles/4006520-switching-to-2-0-from-v1-x-versions?utm_source=woo-discount-"
63
+ "rules-v2&utm_campaign=doc&utm_medium=text-click&utm_content=switch_to_v2\" "
64
+ "target=\"_blank\">Here is a guide and video tutorial</a>"
65
+ msgstr ""
66
+
67
+ #: common.php:77
68
+ msgid ""
69
+ "Switch to Discount Rules 2.0 which comes with a better UI and advanced "
70
+ "rules. (You can switch back any time. Your settings and rules in V1 are "
71
+ "kept as is)"
72
+ msgstr ""
73
+
74
+ #: common.php:78
75
  msgid ""
76
  "Switch to 2.0 <span style='background-color: #FF8C00 ; padding: 3px; border-"
77
  "radius: 4px'>Public beta</span>"
78
  msgstr ""
79
 
80
+ #: common.php:81
81
  msgid "Would you like to switch to older Woo Discount Rules?"
82
  msgstr ""
83
 
84
+ #: common.php:82
85
  msgid "Click here to Switch back"
86
  msgstr ""
87
 
88
+ #: common.php:92
89
+ msgid "Install 2.0 Pro package"
90
+ msgstr ""
91
+
92
+ #: common.php:114
93
  msgid "Switch back to Discount Rules 1.x"
94
  msgstr ""
95
 
96
+ #: common.php:201
97
  msgid ""
98
  "This plugin can not be activated because it requires minimum PHP version of "
99
  msgstr ""
100
 
101
+ #: common.php:204
102
  msgid ""
103
  "Woocommerce must installed and activated in-order to use Advanced woo "
104
  "discount rules!"
105
  msgstr ""
106
 
107
+ #: common.php:207
108
  msgid " Advanced woo discount rules requires at least Woocommerce"
109
  msgstr ""
110
 
111
+ #: updater.php:52
112
+ msgid ""
113
+ "Please download the Pro 2.0 pack from My Downloads page in our site, install "
114
+ "and activate it. <a href=\"https://docs.flycart.org/en/collections/2195266?"
115
+ "utm_source=woo-discount-rules-v2&utm_campaign=doc&utm_medium=text-"
116
+ "click&utm_content=documentation\" target=\"_blank\">Here is a guide and "
117
+ "video tutorial</a>"
118
+ msgstr ""
119
+
120
+ #: updater.php:55
121
+ msgid "Redirecting to v2 please wait.."
122
+ msgstr ""
123
+
124
+ #: updater.php:142 updater.php:307 v1/helper/purchase.php:62
125
  #: v1/helper/purchase.php:66 v1/helper/purchase.php:134
126
  #: v1/helper/purchase.php:137 v1/helper/purchase.php:173
127
  msgid "Please enter a valid license key"
128
  msgstr ""
129
 
130
+ #: updater.php:145 v1/helper/purchase.php:182
131
  msgid "License key check : Passed."
132
  msgstr ""
133
 
134
+ #: updater.php:147 v1/helper/purchase.php:186 v1/view/settings_general.php:32
135
  msgid "License key seems to be Invalid. Please enter a valid license key"
136
  msgstr ""
137
 
138
+ #: updater.php:308 v1/helper/purchase.php:62 v1/helper/purchase.php:66
139
  #: v1/helper/purchase.php:134 v1/helper/purchase.php:137
140
  msgid "our website"
141
  msgstr ""
142
 
143
+ #: updater.php:312
144
  #, php-format
145
  msgid "License key for the %s seems invalid. %s, you can get it from %s"
146
  msgstr ""
147
 
148
+ #: updater.php:316
149
  #, php-format
150
  msgid "License key for the %s is not entered. %s, you can get it from %s"
151
  msgstr ""
152
 
153
+ #: v1/helper/general-helper.php:48 v2/App/Controllers/Admin/Settings.php:298
154
  msgid "Guest"
155
  msgstr ""
156
 
183
  msgstr ""
184
 
185
  #: v1/helper/general-helper.php:1034 v1/view/view-cart-rules.php:697
186
+ #: v1/view/view-pricing-rules.php:433 v2/App/Helpers/Woocommerce.php:1477
187
  msgid "Coupon already exists in WooCommerce. Please select another name"
188
  msgstr ""
189
 
190
  #: v1/helper/purchase.php:25 v1/view/includes/cart-menu.php:5
191
  #: v1/view/includes/menu.php:6 v1/view/includes/sub-menu.php:5
192
+ #: v2/App/Controllers/Admin/Settings.php:39
193
+ #: v2/App/Controllers/Admin/Settings.php:40
194
  msgid "Woo Discount Rules"
195
  msgstr ""
196
 
249
 
250
  #: v1/includes/advanced/free_shipping_method.php:68
251
  #: v1/view/documentation.php:63 v1/view/settings_cart_rules.php:126
252
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:195
253
  msgid "Free Shipping"
254
  msgstr ""
255
 
256
  #: v1/includes/advanced/free_shipping_method.php:73
257
  #: v1/includes/discount-base.php:1063 v1/view/cart-rules.php:133
258
  #: v1/view/pricing-rules.php:163 v1/view/settings_promotion.php:65
259
+ #: v1/view/settings_promotion.php:100 v2/App/Controllers/Admin/Settings.php:408
260
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:76
261
  msgid "Enable"
262
  msgstr ""
263
 
266
  msgstr ""
267
 
268
  #: v1/includes/advanced/free_shipping_method.php:80
269
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:103
270
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:310
271
  msgid "Title"
272
  msgstr ""
273
 
284
  msgstr ""
285
 
286
  #: v1/includes/discount-base.php:203 v1/view/cart-rules.php:162
287
+ #: v1/view/pricing-rules.php:192 v2/App/Controllers/Admin/Settings.php:407
288
  msgid "Active"
289
  msgstr ""
290
 
293
  #: v1/view/settings_cart_rules.php:102 v1/view/settings_price_rules.php:169
294
  #: v1/view/settings_promotion.php:22 v1/view/settings_promotion.php:62
295
  #: v1/view/settings_promotion.php:97 v1/view/settings_promotion.php:132
296
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:250
297
+ #: v2/App/Views/Admin/Tabs/settings.php:320
298
  msgid "Disabled"
299
  msgstr ""
300
 
366
 
367
  #: v1/includes/discount-base.php:1024 v1/view/view-pricing-rules.php:654
368
  #: v1/view/view-pricing-rules.php:657 v1/view/view-pricing-rules.php:677
369
+ #: v2/App/Controllers/Admin/Settings.php:425
370
  msgid "Quantity"
371
  msgstr ""
372
 
395
  msgstr ""
396
 
397
  #: v1/includes/discount-base.php:1030 v1/view/view-pricing-rules.php:954
398
+ #: v2/App/Controllers/Admin/Settings.php:428
399
  msgid "Discount percentage"
400
  msgstr ""
401
 
529
 
530
  #: v1/includes/discount-base.php:1060 v1/view/cart-rules.php:185
531
  #: v1/view/pricing-rules.php:215 v1/view/view-pricing-rules.php:971
532
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:283
533
  msgid "Duplicate"
534
  msgstr ""
535
 
542
  msgstr ""
543
 
544
  #: v1/includes/discount-base.php:1064 v1/view/cart-rules.php:130
545
+ #: v1/view/pricing-rules.php:160 v2/App/Controllers/Admin/Settings.php:406
546
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:77
547
  msgid "Disable"
548
  msgstr ""
549
 
662
  msgstr ""
663
 
664
  #: v1/includes/discount-base.php:1091 v1/view/view-cart-rules.php:365
665
+ #: v1/view/view-pricing-rules.php:536 v2/App/Helpers/ProOptions.php:192
666
+ #: v2/App/Helpers/ProOptions.php:200 v2/App/Helpers/ProOptions.php:208
667
+ #: v2/App/Helpers/ProOptions.php:216 v2/App/Helpers/ProOptions.php:224
668
+ #: v2/App/Helpers/ProOptions.php:232
669
  msgid "Purchase History"
670
  msgstr ""
671
 
726
  #: v1/includes/discount-base.php:1103 v1/view/cart-rules.php:114
727
  #: v1/view/cart-rules.php:224 v1/view/pricing-rules.php:144
728
  #: v1/view/pricing-rules.php:254 v1/view/view-cart-rules.php:700
729
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:127
730
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:334
731
  msgid "Action"
732
  msgstr ""
733
 
734
  #: v1/includes/discount-base.php:1104 v1/view/settings.php:33
735
+ #: v1/view/settings_taxonomy.php:21 v2/App/Views/Admin/Rules/Manage.php:75
736
  msgid "Save"
737
  msgstr ""
738
 
756
  #: v1/includes/discount-base.php:1108 v1/view/settings_price_rules.php:208
757
  #: v1/view/settings_price_rules.php:226 v1/view/settings_price_rules.php:244
758
  #: v1/view/settings_price_rules.php:262
759
+ #: v2/App/Views/Admin/Tabs/settings.php:499
760
  msgid "Show"
761
  msgstr ""
762
 
822
  msgstr ""
823
 
824
  #: v1/includes/discount-base.php:1121 v1/view/view-cart-rules.php:221
825
+ #: v2/App/Controllers/Base.php:47
826
  msgid "Products"
827
  msgstr ""
828
 
994
  "defined in WooCommerce -> Attributes. <a href=\"%s\">Read docs</a>.</span>"
995
  msgstr ""
996
 
997
+ #: v1/includes/discount-base.php:1237 v2/App/Controllers/ManageDiscount.php:767
998
  #, php-format
999
  msgid ""
1000
  "Sorry, it is not possible to apply coupon <b>\"%s\"</b> as you already have "
1001
  "a discount applied in cart."
1002
  msgstr ""
1003
 
1004
+ #: v1/includes/discount-base.php:1292 v1/view/includes/menu.php:18
1005
+ #: v2/App/Controllers/Admin/Settings.php:64
1006
+ #: v2/App/Controllers/Admin/Tabs/GeneralSettings.php:23
1007
  msgid "Settings"
1008
  msgstr ""
1009
 
1188
  msgstr ""
1189
 
1190
  #: v1/view/cart-rules.php:52 v1/view/pricing-rules.php:84
1191
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:56
1192
  msgid "View Examples"
1193
  msgstr ""
1194
 
1195
  #: v1/view/cart-rules.php:53 v1/view/documentation.php:21
1196
+ #: v1/view/pricing-rules.php:85 v2/App/Views/Admin/Tabs/DiscountRule.php:58
1197
  #: v2/App/Views/Admin/Tabs/help.php:12
1198
  msgid "Documentation"
1199
  msgstr ""
1203
  msgstr ""
1204
 
1205
  #: v1/view/cart-rules.php:68 v1/view/pricing-rules.php:99
1206
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:13
1207
  msgid "Add New Rule"
1208
  msgstr ""
1209
 
1210
  #: v1/view/cart-rules.php:79 v1/view/pricing-rules.php:109
1211
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:75
1212
  msgid "Bulk Actions"
1213
  msgstr ""
1214
 
1225
  msgstr ""
1226
 
1227
  #: v1/view/cart-rules.php:84 v1/view/pricing-rules.php:114
1228
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:80
1229
  msgid "Apply"
1230
  msgstr ""
1231
 
1237
 
1238
  #: v1/view/cart-rules.php:99 v1/view/cart-rules.php:209
1239
  #: v1/view/pricing-rules.php:129 v1/view/pricing-rules.php:239
1240
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:110
1241
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:317
1242
  msgid "Start Date"
1243
  msgstr ""
1244
 
1245
  #: v1/view/cart-rules.php:100 v1/view/cart-rules.php:210
1246
  #: v1/view/pricing-rules.php:130 v1/view/pricing-rules.php:240
1247
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:112
1248
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:319
1249
  msgid "Expired On"
1250
  msgstr ""
1251
 
1252
  #: v1/view/cart-rules.php:101 v1/view/cart-rules.php:211
1253
  #: v1/view/pricing-rules.php:131 v1/view/pricing-rules.php:241
1254
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:125
1255
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:332
1256
  msgid "Status"
1257
  msgstr ""
1258
 
1259
  #: v1/view/cart-rules.php:104 v1/view/cart-rules.php:214
1260
  #: v1/view/pricing-rules.php:134 v1/view/pricing-rules.php:244
1261
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:197
1262
  msgid "Language"
1263
  msgstr ""
1264
 
1268
  msgstr ""
1269
 
1270
  #: v1/view/cart-rules.php:181 v1/view/pricing-rules.php:211
1271
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:281
1272
  msgid "Edit"
1273
  msgstr ""
1274
 
1275
  #: v1/view/cart-rules.php:192 v1/view/pricing-rules.php:222
1276
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:78
1277
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:286
1278
  msgid "Delete"
1279
  msgstr ""
1280
 
1413
 
1414
  #: v1/view/includes/cart-menu.php:13 v1/view/includes/sub-menu.php:13
1415
  #: v1/view/template/discount-table.php:42 v1/view/view-cart-rules.php:756
1416
+ #: v1/view/view-pricing-rules.php:708 v2/App/Controllers/Admin/Settings.php:433
1417
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:59
1418
+ #: v2/App/Views/Admin/Rules/Manage.php:174
1419
  msgid "Discount"
1420
  msgstr ""
1421
 
1436
  "Discount Rules might get conflict."
1437
  msgstr ""
1438
 
1439
+ #: v1/view/includes/menu.php:14
1440
  msgid "Price Discount Rules"
1441
  msgstr ""
1442
 
1443
+ #: v1/view/includes/menu.php:16
1444
  msgid "Cart Discount Rules"
1445
  msgstr ""
1446
 
1447
+ #: v1/view/includes/menu.php:22
1448
  msgid "Taxonomy Settings"
1449
  msgstr ""
1450
 
1451
+ #: v1/view/includes/menu.php:24
1452
  msgid "Read documentation"
1453
  msgstr ""
1454
 
1597
  #: v2/App/Views/Admin/Tabs/settings.php:158
1598
  #: v2/App/Views/Admin/Tabs/settings.php:253
1599
  #: v2/App/Views/Admin/Tabs/settings.php:270
1600
+ #: v2/App/Views/Admin/Tabs/settings.php:347
1601
  msgid "Yes"
1602
  msgstr ""
1603
 
1611
  #: v2/App/Views/Admin/Tabs/settings.php:161
1612
  #: v2/App/Views/Admin/Tabs/settings.php:257
1613
  #: v2/App/Views/Admin/Tabs/settings.php:276
1614
+ #: v2/App/Views/Admin/Tabs/settings.php:352
1615
  msgid "No"
1616
  msgstr ""
1617
 
1740
  #: v1/view/settings_price_rules.php:137 v1/view/settings_price_rules.php:211
1741
  #: v1/view/settings_price_rules.php:229 v1/view/settings_price_rules.php:247
1742
  #: v1/view/settings_price_rules.php:265
1743
+ #: v2/App/Views/Admin/Tabs/settings.php:502
1744
  msgid "Don't Show"
1745
  msgstr ""
1746
 
1849
  msgid "Display savings text (for price rules)"
1850
  msgstr ""
1851
 
1852
+ #: v1/view/settings_promotion.php:25 v2/App/Views/Admin/Tabs/settings.php:321
1853
  msgid "On each line item"
1854
  msgstr ""
1855
 
1856
+ #: v1/view/settings_promotion.php:28 v2/App/Views/Admin/Tabs/settings.php:322
1857
  msgid "On after total"
1858
  msgstr ""
1859
 
1860
+ #: v1/view/settings_promotion.php:31 v2/App/Views/Admin/Tabs/settings.php:323
1861
  msgid "Both in line item and after total"
1862
  msgstr ""
1863
 
1864
+ #: v1/view/settings_promotion.php:39 v2/App/Views/Admin/Tabs/settings.php:330
1865
  msgid "Savings text to show"
1866
  msgstr ""
1867
 
1875
 
1876
  #: v1/view/settings_promotion.php:73 v1/view/settings_promotion.php:108
1877
  #: v1/view/view-cart-rules.php:730
1878
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:25
1879
  msgid "Message"
1880
  msgstr ""
1881
 
1897
  "discounts)"
1898
  msgstr ""
1899
 
1900
+ #: v1/view/settings_promotion.php:134 v2/App/Views/Admin/Tabs/settings.php:306
1901
  msgid "Shop page"
1902
  msgstr ""
1903
 
1904
+ #: v1/view/settings_promotion.php:137 v2/App/Views/Admin/Tabs/settings.php:307
1905
  msgid "Product page"
1906
  msgstr ""
1907
 
1908
+ #: v1/view/settings_promotion.php:140 v2/App/Views/Admin/Tabs/settings.php:308
1909
  msgid "Cart page"
1910
  msgstr ""
1911
 
1912
+ #: v1/view/settings_promotion.php:143 v2/App/Views/Admin/Tabs/settings.php:309
1913
  msgid "Checkout page"
1914
  msgstr ""
1915
 
1949
  msgid "Sale!"
1950
  msgstr ""
1951
 
1952
+ #: v1/view/template/sidebar.php:7 v2/App/Views/Admin/Tabs/DiscountRule.php:367
1953
  msgid "Looking for more features? Upgrade to PRO"
1954
  msgstr ""
1955
 
1956
+ #: v1/view/template/sidebar.php:19 v2/App/Views/Admin/Tabs/DiscountRule.php:372
1957
  msgid "With PRO version, you can create:"
1958
  msgstr ""
1959
 
1960
+ #: v1/view/template/sidebar.php:20 v2/App/Views/Admin/Tabs/DiscountRule.php:373
1961
  msgid "- Categories based discounts"
1962
  msgstr ""
1963
 
1964
+ #: v1/view/template/sidebar.php:21 v2/App/Views/Admin/Tabs/DiscountRule.php:374
1965
  msgid "- User roles based discounts"
1966
  msgstr ""
1967
 
1968
+ #: v1/view/template/sidebar.php:22 v2/App/Views/Admin/Tabs/DiscountRule.php:375
1969
  msgid "- Buy One Get One Free deals"
1970
  msgstr ""
1971
 
1972
+ #: v1/view/template/sidebar.php:23 v2/App/Views/Admin/Tabs/DiscountRule.php:376
1973
  msgid "- Buy X Get Y deals"
1974
  msgstr ""
1975
 
1976
+ #: v1/view/template/sidebar.php:24 v2/App/Views/Admin/Tabs/DiscountRule.php:377
1977
  #, php-format
1978
  msgid "- Buy 2, get 1 at 50% discount"
1979
  msgstr ""
1980
 
1981
+ #: v1/view/template/sidebar.php:25 v2/App/Views/Admin/Tabs/DiscountRule.php:378
1982
  msgid "- Buy 3 for $10 (Package / Bundle [Set] Discount)"
1983
  msgstr ""
1984
 
1985
+ #: v1/view/template/sidebar.php:26 v2/App/Views/Admin/Tabs/DiscountRule.php:379
1986
  msgid "- Different discounts with one coupon code"
1987
  msgstr ""
1988
 
1989
+ #: v1/view/template/sidebar.php:27 v2/App/Views/Admin/Tabs/DiscountRule.php:380
1990
  msgid "- Purchase history based discounts"
1991
  msgstr ""
1992
 
1993
+ #: v1/view/template/sidebar.php:28 v2/App/Views/Admin/Tabs/DiscountRule.php:381
1994
  msgid "- Free product / gift"
1995
  msgstr ""
1996
 
1997
+ #: v1/view/template/sidebar.php:29 v2/App/Views/Admin/Tabs/DiscountRule.php:382
1998
  msgid "- Discount for variants"
1999
  msgstr ""
2000
 
2001
+ #: v1/view/template/sidebar.php:30 v2/App/Views/Admin/Tabs/DiscountRule.php:383
2002
  msgid "- Conditional discounts"
2003
  msgstr ""
2004
 
2005
+ #: v1/view/template/sidebar.php:31 v2/App/Views/Admin/Tabs/DiscountRule.php:384
2006
  msgid "- Fixed cost discounts"
2007
  msgstr ""
2008
 
2009
+ #: v1/view/template/sidebar.php:32 v2/App/Views/Admin/Tabs/DiscountRule.php:385
2010
  msgid "- Offer fixed price on certain conditions"
2011
  msgstr ""
2012
 
2023
  msgstr ""
2024
 
2025
  #: v1/view/view-cart-rules.php:75 v1/view/view-pricing-rules.php:57
2026
+ #: v2/App/Views/Admin/Rules/Manage.php:16
2027
+ #: v2/App/Views/Admin/Rules/Manage.php:23
2028
  msgid "This rule is not running currently: "
2029
  msgstr ""
2030
 
2073
  msgstr ""
2074
 
2075
  #: v1/view/view-cart-rules.php:140 v1/view/view-pricing-rules.php:149
2076
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:132
2077
  #, php-format
2078
  msgid "Current date and time: %s"
2079
  msgstr ""
2104
  msgstr ""
2105
 
2106
  #: v1/view/view-cart-rules.php:718
2107
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:15
2108
  msgid "Subtotal from"
2109
  msgstr ""
2110
 
2123
  msgstr ""
2124
 
2125
  #: v1/view/view-cart-rules.php:737
2126
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:30
2127
  msgid "{{difference_amount}} -> Difference amount to get discount"
2128
  msgstr ""
2129
 
2364
  msgid "Make sure you have created the coupon already"
2365
  msgstr ""
2366
 
2367
+ #: v1/view/view-pricing-rules.php:484 v2/App/Conditions/CartSubTotal.php:17
2368
  msgid "Subtotal"
2369
  msgstr ""
2370
 
2536
  msgid "Limitation: Strikeout for add-on price and subtotal in product page."
2537
  msgstr ""
2538
 
2539
+ #: v2/App/Compatibility/ProductAddOnsByWooCommerce.php:104
2540
+ msgid "Show discount price in product pages for WooCommerce Product Add Ons."
2541
  msgstr ""
2542
 
2543
  #: v2/App/Compatibility/WholesalePricesByRymeraWebCo.php:51
2544
  msgid "Add compatible for WooCommerce Wholesale Prices"
2545
  msgstr ""
2546
 
2547
+ #: v2/App/Conditions/CartLineItemsCount.php:15
2548
  msgid "Line Item Count"
2549
  msgstr ""
2550
 
2551
+ #: v2/App/Conditions/CartLineItemsCount.php:16
2552
+ #: v2/App/Conditions/CartSubTotal.php:18 v2/App/Helpers/ProOptions.php:80
2553
+ #: v2/App/Helpers/ProOptions.php:136 v2/App/Helpers/ProOptions.php:144
2554
+ #: v2/App/Helpers/ProOptions.php:152 v2/App/Views/Admin/Tabs/settings.php:241
2555
  msgid "Cart"
2556
  msgstr ""
2557
 
2558
+ #: v2/App/Controllers/Admin/Settings.php:162
2559
  msgid ""
2560
  "We found that your were using our old \"Woo discount rules\" plugin, Please "
2561
  "disable it!"
2562
  msgstr ""
2563
 
2564
+ #: v2/App/Controllers/Admin/Settings.php:219
2565
  msgid "no results"
2566
  msgstr ""
2567
 
2568
+ #: v2/App/Controllers/Admin/Settings.php:220
2569
  msgid "Select Values"
2570
  msgstr ""
2571
 
2572
+ #: v2/App/Controllers/Admin/Settings.php:409
2573
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:274
2574
  msgid " - (Running)"
2575
  msgstr ""
2576
 
2577
+ #: v2/App/Controllers/Admin/Settings.php:410
2578
  msgid "Oops!! something went wrong!"
2579
  msgstr ""
2580
 
2581
+ #: v2/App/Controllers/Admin/Settings.php:411
2582
  msgid "Rule duplicated successfully!"
2583
  msgstr ""
2584
 
2585
+ #: v2/App/Controllers/Admin/Settings.php:412
2586
  msgid "Rule deleted successfully!"
2587
  msgstr ""
2588
 
2589
+ #: v2/App/Controllers/Admin/Settings.php:413
2590
  msgid "Are you sure want to delete this rule!"
2591
  msgstr ""
2592
 
2593
+ #: v2/App/Controllers/Admin/Settings.php:414
2594
  msgid "Rule disabled successfully!"
2595
  msgstr ""
2596
 
2597
+ #: v2/App/Controllers/Admin/Settings.php:415
2598
  msgid "Rule enabled successfully!"
2599
  msgstr ""
2600
 
2601
+ #: v2/App/Controllers/Admin/Settings.php:416
2602
  msgid "Rule saved successfully!"
2603
  msgstr ""
2604
 
2605
+ #: v2/App/Controllers/Admin/Settings.php:417
2606
  msgid "Settings saved successfully!"
2607
  msgstr ""
2608
 
2609
+ #: v2/App/Controllers/Admin/Settings.php:418
2610
  msgid "Rule priority changed successfully!"
2611
  msgstr ""
2612
 
2613
+ #: v2/App/Controllers/Admin/Settings.php:419
2614
  msgid "Rule priority not changed !"
2615
  msgstr ""
2616
 
2617
+ #: v2/App/Controllers/Admin/Settings.php:420
2618
  msgid "No data for this period"
2619
  msgstr ""
2620
 
2621
+ #: v2/App/Controllers/Admin/Settings.php:421
2622
  msgid "Oops! Coupon already exists in Woocommerce"
2623
  msgstr ""
2624
 
2625
+ #: v2/App/Controllers/Admin/Settings.php:422
2626
  msgid "Copied!"
2627
  msgstr ""
2628
 
2629
+ #: v2/App/Controllers/Admin/Settings.php:423
2630
+ #: v2/App/Views/Admin/Tabs/settings.php:462
2631
  msgid "Copy ShortCode"
2632
  msgstr ""
2633
 
2634
+ #: v2/App/Controllers/Admin/Settings.php:424
2635
  msgid "If you make this recursive other row(s) will be removed!"
2636
  msgstr ""
2637
 
2638
+ #: v2/App/Controllers/Admin/Settings.php:426
2639
  msgid "Minimum Quantity"
2640
  msgstr ""
2641
 
2642
+ #: v2/App/Controllers/Admin/Settings.php:427
2643
  msgid "Discount value"
2644
  msgstr ""
2645
 
2646
+ #: v2/App/Controllers/Admin/Settings.php:429
2647
  msgid "Filter (Buy)"
2648
  msgstr ""
2649
 
2650
+ #: v2/App/Controllers/Admin/Settings.php:430
2651
+ #: v2/App/Views/Admin/Rules/Manage.php:129
2652
  msgid "Filter"
2653
  msgstr ""
2654
 
2655
+ #: v2/App/Controllers/Admin/Settings.php:431
2656
  msgid ""
2657
  "<p>Choose <b>what gets discount</b> (products/categories/attributes/SKU and "
2658
  "so on )</p>\n"
2659
  "<p>Note : You can also exclude products/categories.</p>"
2660
  msgstr ""
2661
 
2662
+ #: v2/App/Controllers/Admin/Settings.php:434
2663
  msgid ""
2664
  "<p>Select discount type and its value (percentage/price/fixed price)</p>"
2665
  msgstr ""
2666
 
2667
+ #: v2/App/Controllers/Admin/Settings.php:435
2668
  msgid "Rules (optional)"
2669
  msgstr ""
2670
 
2671
+ #: v2/App/Controllers/Admin/Settings.php:436
2672
  msgid ""
2673
  "<p>Include additional conditions (if necessary) to apply discount for "
2674
  "product filters.</p>"
2675
  msgstr ""
2676
 
2677
+ #: v2/App/Controllers/Admin/Settings.php:437
2678
  msgid ""
2679
  "<p>Choose Buy Products. (products/categories/attributes/tags/sku) Example : "
2680
  "For Buy X get Y scenarios, choose X here.</p>"
2681
  msgstr ""
2682
 
2683
+ #: v2/App/Controllers/Admin/Settings.php:438
2684
  msgid ""
2685
  "<p>Choose on which products the discount should be applied (This can be "
2686
  "products/categories/SKU)</p>"
2687
  msgstr ""
2688
 
2689
+ #: v2/App/Controllers/Admin/Settings.php:439
2690
+ #: v2/App/Controllers/Admin/Settings.php:441
2691
  msgid "Get Discount"
2692
  msgstr ""
2693
 
2694
+ #: v2/App/Controllers/Admin/Settings.php:440
2695
  msgid ""
2696
  "<p>Enter the min/max ranges and choose free item quantity.</p><p>Note : "
2697
  "Enable recursive checkbox if the discounts should be applied in sequential "
2699
  "p>"
2700
  msgstr ""
2701
 
2702
+ #: v2/App/Controllers/Admin/Settings.php:442
2703
  msgid ""
2704
  "<p>Choose the adjustment type to which the discount should be applied. You "
2705
  "can choose from products/categories/all products.</p><p>Note : Enable "
2707
  "</p>"
2708
  msgstr ""
2709
 
2710
+ #: v2/App/Controllers/Admin/Settings.php:443
2711
  msgid ""
2712
  "<p>Choose the adjustment type to which the discount should be applied. You "
2713
  "can choose from products/categories/all products.</p><p>Note : Enable "
2718
  "td><td>5</td><td>2</td></tr></tbody></table>"
2719
  msgstr ""
2720
 
2721
+ #: v2/App/Controllers/Admin/Settings.php:444
2722
+ #: v2/App/Controllers/Admin/Settings.php:445
2723
  msgid "<p>Include additional conditions (if necessary)</p>"
2724
  msgstr ""
2725
 
2726
+ #: v2/App/Controllers/Admin/Settings.php:446
2727
  msgid "<p>Processing migration, please wait...</p>"
2728
  msgstr ""
2729
 
2730
+ #: v2/App/Controllers/Admin/Settings.php:447
2731
  msgid "<p>Migration completed.</p>"
2732
  msgstr ""
2733
 
2734
+ #: v2/App/Controllers/Admin/Settings.php:448
2735
  msgid "<p>Migration skipped.</p>"
2736
  msgstr ""
2737
 
2738
+ #: v2/App/Controllers/Admin/Settings.php:449
2739
  msgid "<p>Skipping migration, please wait...</p>"
2740
  msgstr ""
2741
 
2742
+ #: v2/App/Controllers/Admin/Settings.php:450
2743
  msgid ""
2744
  "<span><b>Example:</b> Product A - Small and Product A - Medium will be "
2745
  "counted as 2 quantity</span>"
2746
  msgstr ""
2747
 
2748
+ #: v2/App/Controllers/Admin/Settings.php:451
2749
  msgid "<span>Discount applies to all eligible products in the store</span>"
2750
  msgstr ""
2751
 
2752
+ #: v2/App/Controllers/Admin/Settings.php:452
2753
  msgid ""
2754
  "<span>Choose products that get the discount using \"In List\". If you want "
2755
  "to exclude a few products, choose \"Not In List\" and select the products "
2756
  "you wanted to exclude from discount. (You can add multiple filters)</span>"
2757
  msgstr ""
2758
 
2759
+ #: v2/App/Controllers/Admin/Settings.php:453
2760
  msgid ""
2761
  "<span>Choose categories that get the discount using \"In List\". If you want "
2762
  "to exclude a few categories, choose \"Not In List\" and select the "
2764
  "filters of same type)</span>"
2765
  msgstr ""
2766
 
2767
+ #: v2/App/Controllers/Admin/Settings.php:454
2768
  msgid ""
2769
  "<span> Choose attributes that get the discount using \"In List\". If you "
2770
  "want to exclude a few attributes, choose \"Not In List\" and select the "
2772
  "filters of same type)</span>"
2773
  msgstr ""
2774
 
2775
+ #: v2/App/Controllers/Admin/Settings.php:455
2776
  msgid ""
2777
  "<span>Choose tags that get the discount using \"In List\". If you want to "
2778
  "exclude a few tags, choose \"Not In List\" and select the tags you wanted to "
2779
  "exclude from discount. (You can add multiple filters of same type)</span>"
2780
  msgstr ""
2781
 
2782
+ #: v2/App/Controllers/Admin/Settings.php:456
2783
  msgid ""
2784
  "<span>Choose SKUs that get the discount using \"In List\". If you want to "
2785
  "exclude a few SKUs, choose \"Not In List\" and select the SKUs you wanted to "
2786
  "exclude from discount. (You can add multiple filters of same type)</span>"
2787
  msgstr ""
2788
 
2789
+ #: v2/App/Controllers/Admin/Settings.php:457
2790
  msgid ""
2791
  "<span>Choose whether you want to include (or exclude) products on sale "
2792
  "(those having a sale price) for the discount </span>"
2793
  msgstr ""
2794
 
2795
+ #: v2/App/Controllers/Admin/Settings.php:458
2796
  msgid "<span>Discount applies to custom taxonomy</span>"
2797
  msgstr ""
2798
 
2799
+ #: v2/App/Controllers/Admin/Settings.php:459
2800
  msgid "Processing please wait.."
2801
  msgstr ""
2802
 
2803
+ #: v2/App/Controllers/Admin/Settings.php:460
2804
  msgid "Rebuild index processed"
2805
  msgstr ""
2806
 
2807
+ #: v2/App/Controllers/Admin/Settings.php:461
2808
  msgid "Please select the rules to build index"
2809
  msgstr ""
2810
 
2811
+ #: v2/App/Controllers/Admin/Tabs/Compatible.php:21
2812
  msgid "Compatibility"
2813
  msgstr ""
2814
 
2815
+ #: v2/App/Controllers/Admin/Tabs/DiscountRules.php:22
2816
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:11
2817
  msgid "Discount Rules"
2818
  msgstr ""
2819
 
2820
+ #: v2/App/Controllers/Admin/Tabs/Help.php:17
2821
  msgid "Read Documentation"
2822
  msgstr ""
2823
 
2824
+ #: v2/App/Controllers/Admin/Tabs/ImportExport.php:19
2825
+ #: v2/App/Views/Admin/Tabs/ImportExport.php:60
2826
  msgid "Export"
2827
  msgstr ""
2828
 
2843
  msgid "Rule amount data with cart discounts"
2844
  msgstr ""
2845
 
2846
+ #: v2/App/Controllers/Admin/Tabs/Statistics.php:23
2847
  msgid "Reports"
2848
  msgstr ""
2849
 
2850
+ #: v2/App/Controllers/Admin/Tabs/Statistics.php:28
2851
  msgid "Rule amount"
2852
  msgstr ""
2853
 
2854
+ #: v2/App/Controllers/Admin/Tabs/Statistics.php:29
2855
+ #: v2/App/Controllers/Admin/Tabs/Statistics.php:34
2856
  msgid "Rule"
2857
  msgstr ""
2858
 
2859
+ #: v2/App/Controllers/Admin/Tabs/Statistics.php:33
2860
  msgid "Rule amount with cart discount"
2861
  msgstr ""
2862
 
2863
+ #: v2/App/Controllers/Base.php:42
2864
  msgid "All Products"
2865
  msgstr ""
2866
 
2867
+ #: v2/App/Controllers/Base.php:43 v2/App/Controllers/Base.php:48
2868
+ #: v2/App/Helpers/ProOptions.php:34 v2/App/Helpers/ProOptions.php:40
2869
+ #: v2/App/Helpers/ProOptions.php:46 v2/App/Helpers/ProOptions.php:52
2870
+ #: v2/App/Helpers/ProOptions.php:58 v2/App/Views/Admin/Tabs/settings.php:99
2871
  msgid "Product"
2872
  msgstr ""
2873
 
2874
+ #: v2/App/Controllers/Base.php:190 v2/App/Views/Admin/Tabs/DiscountRule.php:189
2875
  msgid "Product Adjustment"
2876
  msgstr ""
2877
 
2878
+ #: v2/App/Controllers/Base.php:191 v2/App/Controllers/Base.php:197
2879
+ #: v2/App/Helpers/ProOptions.php:332
2880
  msgid "Simple Discount"
2881
  msgstr ""
2882
 
2883
+ #: v2/App/Controllers/Base.php:196 v2/App/Views/Admin/Tabs/DiscountRule.php:192
2884
  msgid "Cart Adjustment"
2885
  msgstr ""
2886
 
2887
+ #: v2/App/Controllers/Base.php:202 v2/App/Controllers/Base.php:203
2888
+ #: v2/App/Helpers/ProOptions.php:338
2889
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:198
2890
  msgid "Bulk Discount"
2891
  msgstr ""
2892
 
2893
+ #: v2/App/Controllers/ManageDiscount.php:584
2894
  msgid "cart discount"
2895
  msgstr ""
2896
 
2897
+ #: v2/App/Controllers/ManageDiscount.php:781
2898
  msgid "Coupon code applied successfully."
2899
  msgstr ""
2900
 
2901
+ #: v2/App/Controllers/ShortCodeManager.php:677
2902
  msgid "No Banner Content"
2903
  msgstr ""
2904
 
2905
+ #: v2/App/Helpers/Migration.php:133
2906
  #, php-format
2907
  msgid "%s Completed. Please wait.."
2908
  msgstr ""
2909
 
2910
+ #: v2/App/Helpers/ProOptions.php:33 v2/App/Helpers/ProOptions.php:95
2911
  msgid "Category - PRO -"
2912
  msgstr ""
2913
 
2914
+ #: v2/App/Helpers/ProOptions.php:39 v2/App/Helpers/ProOptions.php:87
2915
  msgid "Attributes - PRO -"
2916
  msgstr ""
2917
 
2918
+ #: v2/App/Helpers/ProOptions.php:45 v2/App/Helpers/ProOptions.php:127
2919
  msgid "Tags - PRO -"
2920
  msgstr ""
2921
 
2922
+ #: v2/App/Helpers/ProOptions.php:51
2923
  msgid "SKUs - PRO -"
2924
  msgstr ""
2925
 
2926
+ #: v2/App/Helpers/ProOptions.php:57
2927
  msgid "On sale products - PRO -"
2928
  msgstr ""
2929
 
2930
+ #: v2/App/Helpers/ProOptions.php:79
2931
  msgid "Coupons - PRO -"
2932
  msgstr ""
2933
 
2934
+ #: v2/App/Helpers/ProOptions.php:88 v2/App/Helpers/ProOptions.php:96
2935
+ #: v2/App/Helpers/ProOptions.php:104 v2/App/Helpers/ProOptions.php:112
2936
+ #: v2/App/Helpers/ProOptions.php:120 v2/App/Helpers/ProOptions.php:128
2937
  msgid "Cart Items"
2938
  msgstr ""
2939
 
2940
+ #: v2/App/Helpers/ProOptions.php:103
2941
  msgid "Product combination - PRO -"
2942
  msgstr ""
2943
 
2944
+ #: v2/App/Helpers/ProOptions.php:111
2945
  msgid "Products - PRO -"
2946
  msgstr ""
2947
 
2948
+ #: v2/App/Helpers/ProOptions.php:119
2949
  msgid "SKU - PRO -"
2950
  msgstr ""
2951
 
2952
+ #: v2/App/Helpers/ProOptions.php:135
2953
  msgid "Cart items quantity - PRO -"
2954
  msgstr ""
2955
 
2956
+ #: v2/App/Helpers/ProOptions.php:143
2957
  msgid "Total weight - PRO -"
2958
  msgstr ""
2959
 
2960
+ #: v2/App/Helpers/ProOptions.php:151
2961
  msgid "Payment Method - PRO -"
2962
  msgstr ""
2963
 
2964
+ #: v2/App/Helpers/ProOptions.php:159
2965
  msgid "Date - PRO -"
2966
  msgstr ""
2967
 
2968
+ #: v2/App/Helpers/ProOptions.php:160 v2/App/Helpers/ProOptions.php:168
2969
+ #: v2/App/Helpers/ProOptions.php:176 v2/App/Helpers/ProOptions.php:184
2970
  msgid "Date & Time"
2971
  msgstr ""
2972
 
2973
+ #: v2/App/Helpers/ProOptions.php:167
2974
  msgid "Date and Time - PRO -"
2975
  msgstr ""
2976
 
2977
+ #: v2/App/Helpers/ProOptions.php:175
2978
  msgid "Days - PRO -"
2979
  msgstr ""
2980
 
2981
+ #: v2/App/Helpers/ProOptions.php:183
2982
  msgid "Time - PRO -"
2983
  msgstr ""
2984
 
2985
+ #: v2/App/Helpers/ProOptions.php:191
2986
  msgid "First order - PRO -"
2987
  msgstr ""
2988
 
2989
+ #: v2/App/Helpers/ProOptions.php:199
2990
  msgid "Last order - PRO -"
2991
  msgstr ""
2992
 
2993
+ #: v2/App/Helpers/ProOptions.php:207
2994
  msgid "Last order amount - PRO -"
2995
  msgstr ""
2996
 
2997
+ #: v2/App/Helpers/ProOptions.php:215
2998
  msgid "Number of orders made - PRO -"
2999
  msgstr ""
3000
 
3001
+ #: v2/App/Helpers/ProOptions.php:223
3002
  msgid "Number of orders made with following products - PRO -"
3003
  msgstr ""
3004
 
3005
+ #: v2/App/Helpers/ProOptions.php:231
3006
  msgid "Spent - PRO -"
3007
  msgstr ""
3008
 
3009
+ #: v2/App/Helpers/ProOptions.php:239
3010
  msgid "City - PRO -"
3011
  msgstr ""
3012
 
3013
+ #: v2/App/Helpers/ProOptions.php:240 v2/App/Helpers/ProOptions.php:248
3014
+ #: v2/App/Helpers/ProOptions.php:256 v2/App/Helpers/ProOptions.php:264
3015
  msgid "Shipping"
3016
  msgstr ""
3017
 
3018
+ #: v2/App/Helpers/ProOptions.php:247
3019
  msgid "Country - PRO -"
3020
  msgstr ""
3021
 
3022
+ #: v2/App/Helpers/ProOptions.php:255
3023
  msgid "State - PRO -"
3024
  msgstr ""
3025
 
3026
+ #: v2/App/Helpers/ProOptions.php:263
3027
  msgid "Zipcode - PRO -"
3028
  msgstr ""
3029
 
3030
+ #: v2/App/Helpers/ProOptions.php:271
3031
  msgid "Email - PRO -"
3032
  msgstr ""
3033
 
3034
+ #: v2/App/Helpers/ProOptions.php:272 v2/App/Helpers/ProOptions.php:280
3035
+ #: v2/App/Helpers/ProOptions.php:288 v2/App/Helpers/ProOptions.php:296
3036
  msgid "Customer"
3037
  msgstr ""
3038
 
3039
+ #: v2/App/Helpers/ProOptions.php:279
3040
  msgid "User - PRO -"
3041
  msgstr ""
3042
 
3043
+ #: v2/App/Helpers/ProOptions.php:287
3044
  msgid "Is logged in - PRO -"
3045
  msgstr ""
3046
 
3047
+ #: v2/App/Helpers/ProOptions.php:295
3048
  msgid "User role - PRO -"
3049
  msgstr ""
3050
 
3051
+ #: v2/App/Helpers/ProOptions.php:317
3052
  msgid "Buy X get X - PRO -"
3053
  msgstr ""
3054
 
3055
+ #: v2/App/Helpers/ProOptions.php:318 v2/App/Helpers/ProOptions.php:325
3056
  msgid "Bogo Discount"
3057
  msgstr ""
3058
 
3059
+ #: v2/App/Helpers/ProOptions.php:324
3060
  msgid "Buy X get Y - PRO -"
3061
  msgstr ""
3062
 
3063
+ #: v2/App/Helpers/ProOptions.php:331
3064
  msgid "Free Shipping - PRO -"
3065
  msgstr ""
3066
 
3067
+ #: v2/App/Helpers/ProOptions.php:337
3068
  msgid "Set Discount - PRO -"
3069
  msgstr ""
3070
 
3071
+ #: v2/App/Helpers/Rule.php:1129 v2/App/Helpers/Rule.php:1140
3072
  msgid "discount"
3073
  msgstr ""
3074
 
3075
+ #: v2/App/Helpers/Rule.php:1200 v2/App/Helpers/Rule.php:1278
3076
  msgid "Untitled Rule"
3077
  msgstr ""
3078
 
3079
+ #: v2/App/Helpers/Woocommerce.php:907
3080
  msgid "Sunday"
3081
  msgstr ""
3082
 
3083
+ #: v2/App/Helpers/Woocommerce.php:908
3084
  msgid "Monday"
3085
  msgstr ""
3086
 
3087
+ #: v2/App/Helpers/Woocommerce.php:909
3088
  msgid "Tuesday"
3089
  msgstr ""
3090
 
3091
+ #: v2/App/Helpers/Woocommerce.php:910
3092
  msgid "Wednesday"
3093
  msgstr ""
3094
 
3095
+ #: v2/App/Helpers/Woocommerce.php:911
3096
  msgid "Thursday"
3097
  msgstr ""
3098
 
3099
+ #: v2/App/Helpers/Woocommerce.php:912
3100
  msgid "Friday"
3101
  msgstr ""
3102
 
3103
+ #: v2/App/Helpers/Woocommerce.php:913
3104
  msgid "Saturday"
3105
  msgstr ""
3106
 
3107
+ #: v2/App/Helpers/Woocommerce.php:924
3108
  msgid ""
3109
  "Woocommerce before main content(Archive / Shop / Cat Pages / single product)"
3110
  msgstr ""
3111
 
3112
+ #: v2/App/Helpers/Woocommerce.php:925
3113
  msgid "Woocommerce archive description(Archive / Shop / Cat Pages)"
3114
  msgstr ""
3115
 
3116
+ #: v2/App/Helpers/Woocommerce.php:926
3117
  msgid "Woocommerce before shop loop(Archive / Shop / Cat Pages)"
3118
  msgstr ""
3119
 
3120
+ #: v2/App/Helpers/Woocommerce.php:927
3121
  msgid "Woocommerce after shop loop(Archive / Shop / Cat Pages)"
3122
  msgstr ""
3123
 
3124
+ #: v2/App/Helpers/Woocommerce.php:928
3125
  msgid ""
3126
  "Woocommerce after main content(Archive / Shop / Cat Pages / single product)"
3127
  msgstr ""
3128
 
3129
+ #: v2/App/Helpers/Woocommerce.php:929 v2/App/Views/Admin/Tabs/settings.php:179
3130
  #: v2/App/Views/Admin/Tabs/settings.php:197
3131
  msgid "Woocommerce before single product"
3132
  msgstr ""
3133
 
3134
+ #: v2/App/Helpers/Woocommerce.php:930 v2/App/Views/Admin/Tabs/settings.php:181
3135
  #: v2/App/Views/Admin/Tabs/settings.php:199
3136
  msgid "Woocommerce before single product summary"
3137
  msgstr ""
3138
 
3139
+ #: v2/App/Helpers/Woocommerce.php:931 v2/App/Views/Admin/Tabs/settings.php:180
3140
  #: v2/App/Views/Admin/Tabs/settings.php:198
3141
  msgid "Woocommerce after single product summary"
3142
  msgstr ""
3143
 
3144
+ #: v2/App/Helpers/Woocommerce.php:932 v2/App/Views/Admin/Tabs/settings.php:178
3145
  #: v2/App/Views/Admin/Tabs/settings.php:196
3146
  msgid "Woocommerce after single product"
3147
  msgstr ""
3148
 
3149
+ #: v2/App/Helpers/Woocommerce.php:933
3150
  msgid "Woocommerce before cart"
3151
  msgstr ""
3152
 
3153
+ #: v2/App/Helpers/Woocommerce.php:934
3154
  msgid "Woocommerce before cart table"
3155
  msgstr ""
3156
 
3157
+ #: v2/App/Helpers/Woocommerce.php:935
3158
  msgid "Woocommerce before cart contents"
3159
  msgstr ""
3160
 
3161
+ #: v2/App/Helpers/Woocommerce.php:936
3162
  msgid "Woocommerce cart contents"
3163
  msgstr ""
3164
 
3165
+ #: v2/App/Helpers/Woocommerce.php:937
3166
  msgid "Woocommerce after cart contents"
3167
  msgstr ""
3168
 
3169
+ #: v2/App/Helpers/Woocommerce.php:938
3170
  msgid "Woocommerce after cart table"
3171
  msgstr ""
3172
 
3173
+ #: v2/App/Helpers/Woocommerce.php:939
3174
  msgid "Woocommerce after cart"
3175
  msgstr ""
3176
 
3177
+ #: v2/App/Helpers/Woocommerce.php:940
3178
  msgid "Woocommerce before checkout form"
3179
  msgstr ""
3180
 
3181
+ #: v2/App/Helpers/Woocommerce.php:942
3182
  msgid "Woocommerce before checkout billing form"
3183
  msgstr ""
3184
 
3185
+ #: v2/App/Helpers/Woocommerce.php:943
3186
  msgid "Woocommerce after checkout billing form"
3187
  msgstr ""
3188
 
3189
+ #: v2/App/Helpers/Woocommerce.php:944
3190
  msgid "Woocommerce before checkout shipping form"
3191
  msgstr ""
3192
 
3193
+ #: v2/App/Helpers/Woocommerce.php:945
3194
  msgid "Woocommerce after checkout shipping form"
3195
  msgstr ""
3196
 
3197
+ #: v2/App/Helpers/Woocommerce.php:946
3198
  msgid "Woocommerce before order notes"
3199
  msgstr ""
3200
 
3201
+ #: v2/App/Helpers/Woocommerce.php:947
3202
  msgid "Woocommerce after order notes"
3203
  msgstr ""
3204
 
3205
+ #: v2/App/Views/Admin/Menu.php:24
3206
  msgid ""
3207
  "<span style='color: #FF8C00 ; padding: 3px; border-radius: 4px'> (public "
3208
  "beta) </span>"
3209
  msgstr ""
3210
 
3211
+ #: v2/App/Views/Admin/Menu.php:34
3212
  msgid "Rebuild index"
3213
  msgstr ""
3214
 
3263
  msgstr ""
3264
 
3265
  #: v2/App/Views/Admin/Rules/Conditions/Cart/Subtotal.php:23
3266
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:19
3267
  msgid "0.00"
3268
  msgstr ""
3269
 
3290
  msgstr ""
3291
 
3292
  #: v2/App/Views/Admin/Rules/Conditions/Main.php:23
3293
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:110
3294
  msgid "Match All"
3295
  msgstr ""
3296
 
3297
  #: v2/App/Views/Admin/Rules/Conditions/Main.php:25
3298
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:112
3299
  msgid "Many Any"
3300
  msgstr ""
3301
 
3302
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:72
3303
  #: v2/App/Views/Admin/Rules/Others/CommonTemplates.php:87
3304
  msgid "Condition Type"
3305
  msgstr ""
3306
 
3307
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:100
3308
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:120
3309
  msgid "Add condition"
3310
  msgstr ""
3311
 
3312
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:108
3313
  msgid "Conditions Relationship"
3314
  msgstr ""
3315
 
3316
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:130
3317
  msgid "Rule Limits"
3318
  msgstr ""
3319
 
3320
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:142
3321
  msgid "Unlimited"
3322
  msgstr ""
3323
 
3324
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:149
3325
  msgid "Maximum usage limit"
3326
  msgstr ""
3327
 
3328
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:157
3329
  msgid "Rule Vaild From"
3330
  msgstr ""
3331
 
3332
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:162
3333
  msgid "Vaild from"
3334
  msgstr ""
3335
 
3336
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:169
3337
  msgid "Rule Valid To"
3338
  msgstr ""
3339
 
3340
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:173
3341
  msgid "Vaild to"
3342
  msgstr ""
3343
 
3344
+ #: v2/App/Views/Admin/Rules/Conditions/Main.php:184
3345
  msgid "Select values"
3346
  msgstr ""
3347
 
3362
  msgstr ""
3363
 
3364
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:22
3365
+ #: v2/App/Views/Admin/Tabs/settings.php:483
3366
  msgid "Note:"
3367
  msgstr ""
3368
 
3382
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:71
3383
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:92
3384
  #: v2/App/Views/Admin/Rules/DiscountBatch/Main.php:126
3385
+ #: v2/App/Views/Admin/Tabs/settings.php:379
3386
+ #: v2/App/Views/Admin/Tabs/settings.php:388
3387
+ #: v2/App/Views/Admin/Tabs/settings.php:451
3388
  msgid ""
3389
  "Unlock this feature by <a href='https://www.flycart.org/products/wordpress/"
3390
  "woocommerce-discount-rules' target='_blank'>Upgrading to Pro</a>"
3480
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:53
3481
  #: v2/App/Views/Admin/Rules/Discounts/Cart.php:24
3482
  #: v2/App/Views/Admin/Rules/Discounts/simple.php:23
3483
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:108
3484
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:315
3485
  msgid "Discount Type"
3486
  msgstr ""
3487
 
3488
  #: v2/App/Views/Admin/Rules/Discounts/Bulk.php:65
3489
+ #: v2/App/Views/Admin/Tabs/settings.php:549
3490
  msgid "Discount Value"
3491
  msgstr ""
3492
 
3557
  msgid "Not In List"
3558
  msgstr ""
3559
 
3560
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:82
3561
  msgid "Select "
3562
  msgstr ""
3563
 
3564
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:98
3565
  msgid ""
3566
  "Choose products that get the discount using \"In List\". If you want to "
3567
  "exclude a few products, choose \"Not In List\" and select the products you "
3568
  "wanted to exclude from discount. (You can add multiple filters)"
3569
  msgstr ""
3570
 
3571
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:101
3572
  msgid ""
3573
  "Choose categories that get the discount using \"In List\". If you want to "
3574
  "exclude a few categories, choose \"Not In List\" and select the categories "
3576
  "type)"
3577
  msgstr ""
3578
 
3579
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:104
3580
  msgid ""
3581
  "Choose attributes that get the discount using \"In List\". If you want to "
3582
  "exclude a few attributes, choose \"Not In List\" and select the attributes "
3584
  "type)"
3585
  msgstr ""
3586
 
3587
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:107
3588
  msgid ""
3589
  "Choose tags that get the discount using \"In List\". If you want to exclude "
3590
  "a few tags, choose \"Not In List\" and select the tags you wanted to exclude "
3591
  "from discount. (You can add multiple filters of same type)"
3592
  msgstr ""
3593
 
3594
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:110
3595
  msgid ""
3596
  "Choose SKUs that get the discount using \"In List\". If you want to exclude "
3597
  "a few SKUs, choose \"Not In List\" and select the SKUs you wanted to exclude "
3598
  "from discount. (You can add multiple filters of same type)"
3599
  msgstr ""
3600
 
3601
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:113
3602
  msgid ""
3603
  "Choose whether you want to include (or exclude) products on sale (those "
3604
  "having a sale price) for the discount "
3605
  msgstr ""
3606
 
3607
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:116
3608
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:162
3609
  msgid "Discount applies to all eligible products in the store"
3610
  msgstr ""
3611
 
3612
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:120
3613
  msgid "Discount applies to custom taxonomy"
3614
  msgstr ""
3615
 
3616
+ #: v2/App/Views/Admin/Rules/Filters/Main.php:173
3617
  msgid "Add filter"
3618
  msgstr ""
3619
 
3620
+ #: v2/App/Views/Admin/Rules/Filters/Products.php:18
3621
  msgid "Select Products"
3622
  msgstr ""
3623
 
3624
+ #: v2/App/Views/Admin/Rules/Manage.php:16
3625
  msgid " Start date and time is set in the future date"
3626
  msgstr ""
3627
 
3628
+ #: v2/App/Views/Admin/Rules/Manage.php:23
3629
  msgid " Validity expired"
3630
  msgstr ""
3631
 
3632
+ #: v2/App/Views/Admin/Rules/Manage.php:52
3633
  msgid "Enable?"
3634
  msgstr ""
3635
 
3636
+ #: v2/App/Views/Admin/Rules/Manage.php:61
3637
  msgid "Apply this rule if matched and ignore all other rules"
3638
  msgstr ""
3639
 
3640
+ #: v2/App/Views/Admin/Rules/Manage.php:70
3641
  msgid "#Rule ID: "
3642
  msgstr ""
3643
 
3644
+ #: v2/App/Views/Admin/Rules/Manage.php:77
3645
  msgid "Save & Close"
3646
  msgstr ""
3647
 
3648
+ #: v2/App/Views/Admin/Rules/Manage.php:80
3649
  msgid "Cancel"
3650
  msgstr ""
3651
 
3652
+ #: v2/App/Views/Admin/Rules/Manage.php:92
3653
  msgid "Select Discount Type"
3654
  msgstr ""
3655
 
3656
+ #: v2/App/Views/Admin/Rules/Manage.php:131
3657
  msgid ""
3658
  "Choose which <b>gets</b> discount (products/categories/attributes/SKU and so "
3659
  "on )"
3660
  msgstr ""
3661
 
3662
+ #: v2/App/Views/Admin/Rules/Manage.php:132
3663
  msgid "Note : You can also exclude products/categories."
3664
  msgstr ""
3665
 
3666
+ #: v2/App/Views/Admin/Rules/Manage.php:176
3667
  msgid "Select discount type and its value (percentage/price/fixed price)"
3668
  msgstr ""
3669
 
3670
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:13
3671
+ msgid "Promotion Message"
3672
+ msgstr ""
3673
+
3674
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:21
3675
+ msgid "Set a threshold from which you want to start showing promotion message"
3676
+ msgstr ""
3677
+
3678
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:22
3679
+ #, php-format
3680
+ msgid ""
3681
+ "<b>Example:</b> Let's say you offer a 10% discount for 1000 and above. you "
3682
+ "may want to set 900 here. So that the customer can see the promo text when "
3683
+ "his cart subtotal reaches 900"
3684
+ msgstr ""
3685
+
3686
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:29
3687
+ #, php-format
3688
+ msgid "Spent {{difference_amount}} more and get 10% discount"
3689
+ msgstr ""
3690
+
3691
+ #: v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php:31
3692
+ #, php-format
3693
+ msgid "<b>Eg:</b> Spent {{difference_amount}} more and get 10% discount"
3694
+ msgstr ""
3695
+
3696
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:16
3697
  msgid "Migrate rules from v1"
3698
  msgstr ""
3699
 
3700
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:23
3701
  msgid "Migration"
3702
  msgstr ""
3703
 
3704
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:27
3705
+ #: v2/App/Views/Admin/welcome-text.php:9
3706
  msgid "Migrate rules from v1 to v2"
3707
  msgstr ""
3708
 
3709
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:31
3710
  msgid "Available price rules"
3711
  msgstr ""
3712
 
3713
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:34
3714
  msgid "Available cart rules"
3715
  msgstr ""
3716
 
3717
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:37
3718
  msgid ""
3719
  "Once migration is completed, please open the rules and check their "
3720
  "configuration once again to make sure it meets your discount scenario. If "
3723
  "\">https://www.flycart.org/support</a>"
3724
  msgstr ""
3725
 
3726
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:42
3727
+ #: v2/App/Views/Admin/welcome-text.php:14
3728
  msgid "Migrate"
3729
  msgstr ""
3730
 
3731
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:43
3732
+ #: v2/App/Views/Admin/welcome-text.php:15
3733
  msgid "Skip"
3734
  msgstr ""
3735
 
3736
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:67
3737
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:73
3738
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:83
3739
  msgid "Search Rules"
3740
  msgstr ""
3741
 
3742
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:87
3743
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:353
3744
  msgid "item"
3745
  msgstr ""
3746
 
3747
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:87
3748
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:353
3749
  msgid "items"
3750
  msgstr ""
3751
 
3752
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:117
3753
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:324
3754
  msgid "Language(s)"
3755
  msgstr ""
3756
 
3757
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:149
3758
  msgid "Exclusive"
3759
  msgstr ""
3760
 
3761
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:178
3762
+ msgid "Created by: "
3763
+ msgstr ""
3764
+
3765
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:178
3766
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:180
3767
+ msgid " On: "
3768
+ msgstr ""
3769
+
3770
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:180
3771
+ msgid "Modified by: "
3772
+ msgstr ""
3773
+
3774
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:201
3775
+ msgid "Set Discount"
3776
+ msgstr ""
3777
+
3778
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:204
3779
+ msgid "Buy X get X"
3780
+ msgstr ""
3781
+
3782
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:207
3783
+ msgid "Buy X get Y"
3784
+ msgstr ""
3785
+
3786
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:250
3787
  msgid "Enabled"
3788
  msgstr ""
3789
 
3790
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:259
3791
  msgid " - ( Will run in future)"
3792
  msgstr ""
3793
 
3794
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:262
3795
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:270
3796
  msgid "Your server current date and time:"
3797
  msgstr ""
3798
 
3799
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:267
3800
  msgid " - ( Not running - validity expired)"
3801
  msgstr ""
3802
 
3803
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:297
3804
  msgid "No rules found."
3805
  msgstr ""
3806
 
3807
+ #: v2/App/Views/Admin/Tabs/DiscountRule.php:386
3808
  msgid "Go PRO"
3809
  msgstr ""
3810
 
3811
+ #: v2/App/Views/Admin/Tabs/ImportExport.php:13
3812
  msgid "Export tool"
3813
  msgstr ""
3814
 
3815
+ #: v2/App/Views/Admin/Tabs/ImportExport.php:35
3816
+ #: v2/App/Views/Admin/Tabs/ImportExport.php:53
3817
+ msgid "Oops!. Download failed!!"
3818
+ msgstr ""
3819
+
3820
  #: v2/App/Views/Admin/Tabs/Statistics.php:39
3821
  msgid "This Week"
3822
  msgstr ""
3947
  msgstr ""
3948
 
3949
  #: v2/App/Views/Admin/Tabs/settings.php:162
3950
+ #: v2/App/Views/Admin/Tabs/settings.php:479
3951
  msgid "Customize Discount Table"
3952
  msgstr ""
3953
 
4037
  msgstr ""
4038
 
4039
  #: v2/App/Views/Admin/Tabs/settings.php:300
4040
+ msgid "Subtotal based promo text"
4041
  msgstr ""
4042
 
4043
  #: v2/App/Views/Admin/Tabs/settings.php:301
4044
+ msgid ""
4045
+ "Subtotal based promo text (available only for subtotal based discounts) "
4046
+ msgstr ""
4047
+
4048
+ #: v2/App/Views/Admin/Tabs/settings.php:305
4049
+ msgid "Select the page to display promotion message"
4050
+ msgstr ""
4051
+
4052
+ #: v2/App/Views/Admin/Tabs/settings.php:315
4053
+ msgid "Display you saved text"
4054
  msgstr ""
4055
 
4056
  #: v2/App/Views/Admin/Tabs/settings.php:316
4057
+ msgid "Display you saved text when rule applied"
4058
+ msgstr ""
4059
+
4060
+ #: v2/App/Views/Admin/Tabs/settings.php:331
4061
  msgid "You save text to show when rule applied"
4062
  msgstr ""
4063
 
4064
+ #: v2/App/Views/Admin/Tabs/settings.php:340
4065
  msgid "Show a discount applied message on cart?"
4066
  msgstr ""
4067
 
4068
+ #: v2/App/Views/Admin/Tabs/settings.php:341
4069
  msgid "Show message in cart page on rule applied"
4070
  msgstr ""
4071
 
4072
+ #: v2/App/Views/Admin/Tabs/settings.php:357
4073
  msgid "Applied rule message text on cart"
4074
  msgstr ""
4075
 
4076
+ #: v2/App/Views/Admin/Tabs/settings.php:358
4077
  msgid "Text to show when rule applied"
4078
  msgstr ""
4079
 
4080
+ #: v2/App/Views/Admin/Tabs/settings.php:368
4081
  msgid "Banner"
4082
  msgstr ""
4083
 
4084
+ #: v2/App/Views/Admin/Tabs/settings.php:375
4085
  msgid "Banner Content"
4086
  msgstr ""
4087
 
4088
+ #: v2/App/Views/Admin/Tabs/settings.php:376
4089
  msgid ""
4090
  "A static banner you that you want to display in your storefront. <br><br> "
4091
  "<b>NOTE:</b> It is a static banner. You can use any content or html here."
4092
  msgstr ""
4093
 
4094
+ #: v2/App/Views/Admin/Tabs/settings.php:385
4095
  msgid "Banner Content display position"
4096
  msgstr ""
4097
 
4098
+ #: v2/App/Views/Admin/Tabs/settings.php:386
4099
  msgid "Choose a display position for the banner in your storefront"
4100
  msgstr ""
4101
 
4102
+ #: v2/App/Views/Admin/Tabs/settings.php:397
4103
  msgid "On-Sale page"
4104
  msgstr ""
4105
 
4106
+ #: v2/App/Views/Admin/Tabs/settings.php:403
4107
  msgid "Select rules for the On Sale Page"
4108
  msgstr ""
4109
 
4110
+ #: v2/App/Views/Admin/Tabs/settings.php:416
4111
  msgid "Type the name of the rule to select it"
4112
  msgstr ""
4113
 
4114
+ #: v2/App/Views/Admin/Tabs/settings.php:424
4115
  msgid "All active rules"
4116
  msgstr ""
4117
 
4118
+ #: v2/App/Views/Admin/Tabs/settings.php:449
4119
  msgid "Save and Build Index"
4120
  msgstr ""
4121
 
4122
+ #: v2/App/Views/Admin/Tabs/settings.php:459
4123
  msgid ""
4124
  "ShortCode to load all products which has discount through Woo Discount Rules"
4125
  msgstr ""
4126
 
4127
+ #: v2/App/Views/Admin/Tabs/settings.php:482
4128
  msgid "Settings Saved"
4129
  msgstr ""
4130
 
4131
+ #: v2/App/Views/Admin/Tabs/settings.php:483
4132
  msgid " This table contains sample content for design purpose."
4133
  msgstr ""
4134
 
4135
+ #: v2/App/Views/Admin/Tabs/settings.php:493
4136
  msgid "Table Header"
4137
  msgstr ""
4138
 
4139
+ #: v2/App/Views/Admin/Tabs/settings.php:494
4140
  msgid "Show/Hide table header column names"
4141
  msgstr ""
4142
 
4143
+ #: v2/App/Views/Admin/Tabs/settings.php:507
4144
  msgid "Title column Name on table"
4145
  msgstr ""
4146
 
4147
+ #: v2/App/Views/Admin/Tabs/settings.php:508
4148
  msgid "Give name for rule title column"
4149
  msgstr ""
4150
 
4151
+ #: v2/App/Views/Admin/Tabs/settings.php:519
4152
  msgid "Discount column Name on table"
4153
  msgstr ""
4154
 
4155
+ #: v2/App/Views/Admin/Tabs/settings.php:520
4156
  msgid "Give name for discount column"
4157
  msgstr ""
4158
 
4159
+ #: v2/App/Views/Admin/Tabs/settings.php:531
4160
  msgid "Range column Name on table"
4161
  msgstr ""
4162
 
4163
+ #: v2/App/Views/Admin/Tabs/settings.php:532
4164
  msgid "Give name for range column"
4165
  msgstr ""
4166
 
4167
+ #: v2/App/Views/Admin/Tabs/settings.php:543
4168
  msgid "Discount column value on table"
4169
  msgstr ""
4170
 
4171
+ #: v2/App/Views/Admin/Tabs/settings.php:544
4172
  msgid "Show Discount value/price in table"
4173
  msgstr ""
4174
 
4175
+ #: v2/App/Views/Admin/Tabs/settings.php:552
4176
  msgid "Discounted Price"
4177
  msgstr ""
4178
 
4179
+ #: v2/App/Views/Admin/Tabs/settings.php:627
4180
+ #: v2/App/Views/Admin/Tabs/settings.php:650
4181
  msgid "Bulk Rule"
4182
  msgstr ""
4183
 
4184
+ #: v2/App/Views/Admin/Tabs/settings.php:635
4185
+ #: v2/App/Views/Admin/Tabs/settings.php:681
4186
+ #: v2/App/Views/Admin/Tabs/settings.php:748
4187
+ #: v2/App/Views/Templates/discount_table.php:113
4188
  msgid " flat"
4189
  msgstr ""
4190
 
4191
+ #: v2/App/Views/Admin/Tabs/settings.php:641
4192
  msgid "1 - 5"
4193
  msgstr ""
4194
 
4195
+ #: v2/App/Views/Admin/Tabs/settings.php:664
4196
  msgid "11 - 15"
4197
  msgstr ""
4198
 
4199
+ #: v2/App/Views/Admin/Tabs/settings.php:673
4200
  msgid "Bulk Flat discount"
4201
  msgstr ""
4202
 
4203
+ #: v2/App/Views/Admin/Tabs/settings.php:687
4204
  msgid "50 - 60"
4205
  msgstr ""
4206
 
4207
+ #: v2/App/Views/Admin/Tabs/settings.php:696
4208
  msgid "Bulk percentage discount"
4209
  msgstr ""
4210
 
4211
+ #: v2/App/Views/Admin/Tabs/settings.php:709
4212
  msgid "70 - 80"
4213
  msgstr ""
4214
 
4215
+ #: v2/App/Views/Admin/Tabs/settings.php:718
4216
  #, php-format
4217
  msgid "Bulk % discount"
4218
  msgstr ""
4219
 
4220
+ #: v2/App/Views/Admin/Tabs/settings.php:731
4221
  msgid "450 - 500"
4222
  msgstr ""
4223
 
4224
+ #: v2/App/Views/Admin/Tabs/settings.php:740
4225
  msgid "Bulk flat"
4226
  msgstr ""
4227
 
4228
+ #: v2/App/Views/Admin/Tabs/settings.php:754
4229
  msgid "600 - 700"
4230
  msgstr ""
4231
 
4232
+ #: v2/App/Views/Admin/Tabs/settings.php:763
4233
  msgid "set percentage discount"
4234
  msgstr ""
4235
 
4236
+ #: v2/App/Views/Admin/Tabs/settings.php:776
4237
  msgid "5"
4238
  msgstr ""
4239
 
4240
+ #: v2/App/Views/Admin/Tabs/settings.php:785
4241
  msgid "Fixed discount for set"
4242
  msgstr ""
4243
 
4244
+ #: v2/App/Views/Admin/Tabs/settings.php:798
4245
  msgid "10"
4246
  msgstr ""
4247
 
4248
+ #: v2/App/Views/Admin/Tabs/settings.php:807
4249
  msgid "set flat discount"
4250
  msgstr ""
4251
 
4252
+ #: v2/App/Views/Admin/Tabs/settings.php:820
4253
  msgid "15"
4254
  msgstr ""
4255
 
4256
+ #: v2/App/Views/Templates/discount_table.php:108
4257
  msgid " (in cart)"
4258
+ msgstr ""
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: 5.4
7
- Stable tag: 1.9.8
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -336,6 +336,22 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
336
 
337
  == Changelog ==
338
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
339
  = 1.9.8 - 13/05/20 =
340
  * Feature - Included v2 beta with new UI
341
  * Fix - PHP warning fix
4
  Tags: woocommerce, coupons, discounts, dynamic pricing, Buy One Get One Free, pricing deals, bulk discount, discount
5
  Requires at least: 4.4.1
6
  Tested up to: 5.4
7
+ Stable tag: 1.9.9
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
336
 
337
  == Changelog ==
338
 
339
+ = 1.9.9 - 02/06/20 =
340
+ * Improvement - Product addon compatible.
341
+ * Improvement - V2 UI improvements.
342
+ * Improvement - V2 field validations.
343
+ * Improvement - Events: woo_discount_rules_before_apply_cart_discount
344
+ * Improvement - Events: advanced_woo_discount_rules_custom_target_for_simple_product_on_qty_update, advanced_woo_discount_rules_custom_target_for_variable_product_on_qty_update
345
+ * Improvement - Added compatible with WPC Product Timer for WooCommerce - in v2
346
+ * Improvement - Additional shortcode for discount bars - in v2
347
+ * Improvement - Strikeout based on tax settings - in v2
348
+ * Feature - Beta Subtotal promotion message.
349
+ * Fix - Third party coupon doesn't removed in checkout.
350
+ * Fix - Rule doesn't works for few attributes.
351
+ * Fix - Discount bar for BXGY.
352
+ * Fix - Calculating tax for discount fee.
353
+ * Fix - Calculating fee multiple time when calculate total is called multiple times.
354
+
355
  = 1.9.8 - 13/05/20 =
356
  * Feature - Included v2 beta with new UI
357
  * Fix - PHP warning fix
v1/includes/cart-rules.php CHANGED
@@ -813,6 +813,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
813
  // Processing the Totals.
814
  foreach ($this->rule_sets as $index => $rule) {
815
  if ($rule['enabled'] == true) {
 
816
  $discounts['name'][$index] = $rule['name'];
817
  $discounts['type'][$index] = $rule['discount_type'];
818
  //we will have to re-calculate the sub-total if it has category selected
@@ -857,6 +858,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
857
  // Processing the Totals.
858
  foreach ($this->rule_sets as $index => $rule) {
859
  if ($rule['enabled'] == true) {
 
860
  $discounts['name'][$index] = $rule['name'];
861
  $discounts['type'][$index] = $rule['discount_type'];
862
  //we will have to re-calculate the sub-total if it has category selected
@@ -898,6 +900,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
898
  // Processing the Totals.
899
  foreach ($this->rule_sets as $index => $rule) {
900
  if ($rule['enabled'] == true) {
 
901
  //we will have to re-calculate the sub-total if it has category selected
902
  $this->has_category_in_rule = $this->is_category_specific($rule);
903
  $this->has_product_specific_rule = $this->is_product_specific($rule);
813
  // Processing the Totals.
814
  foreach ($this->rule_sets as $index => $rule) {
815
  if ($rule['enabled'] == true) {
816
+ do_action('woo_discount_rules_before_apply_cart_discount', $rule, $cart_setup);
817
  $discounts['name'][$index] = $rule['name'];
818
  $discounts['type'][$index] = $rule['discount_type'];
819
  //we will have to re-calculate the sub-total if it has category selected
858
  // Processing the Totals.
859
  foreach ($this->rule_sets as $index => $rule) {
860
  if ($rule['enabled'] == true) {
861
+ do_action('woo_discount_rules_before_apply_cart_discount', $rule, $cart_setup);
862
  $discounts['name'][$index] = $rule['name'];
863
  $discounts['type'][$index] = $rule['discount_type'];
864
  //we will have to re-calculate the sub-total if it has category selected
900
  // Processing the Totals.
901
  foreach ($this->rule_sets as $index => $rule) {
902
  if ($rule['enabled'] == true) {
903
+ do_action('woo_discount_rules_before_apply_cart_discount', $rule, $cart_setup);
904
  //we will have to re-calculate the sub-total if it has category selected
905
  $this->has_category_in_rule = $this->is_category_specific($rule);
906
  $this->has_product_specific_rule = $this->is_product_specific($rule);
v2/App/Compatibility/ProductAddOnsByWooCommerce.php CHANGED
@@ -14,11 +14,16 @@ class ProductAddOnsByWooCommerce extends Base
14
  public function run(){
15
  $value = $this->config->getConfigData($this->key, 0);
16
  if($value){
17
- add_action( 'wp_head', function () { ?>
 
 
 
 
 
18
  <script type="application/javascript">
19
  (function ($) {
20
  $(document).ready(function ($) {
21
- var currency_string = '$';
22
  var $form = jQuery('form.cart').first();
23
  /**
24
  * Strikeout for option title
@@ -44,9 +49,11 @@ class ProductAddOnsByWooCommerce extends Base
44
  if(response.success == true){
45
  var price_html = ''
46
  if(response.data !== undefined){
47
- price_html += '<del>'+response.data.initial_price_html+'</del>';
48
- price_html += ' <ins>'+response.data.discounted_price_html+'</ins>';
49
- target.html(price_html);
 
 
50
  }
51
  }
52
  target.attr('data-lock', false);
@@ -94,7 +101,7 @@ class ProductAddOnsByWooCommerce extends Base
94
  <div class="awdr-compatible-field">
95
  <label>
96
  <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
97
- <?php esc_html_e('Add compatible for WooCommerce Product Add Ons', WDR_TEXT_DOMAIN); ?>
98
  </label>
99
  </div>
100
  <?php
14
  public function run(){
15
  $value = $this->config->getConfigData($this->key, 0);
16
  if($value){
17
+ add_action( 'wp_head', function () {
18
+ $currency_code = '$';
19
+ if(function_exists('get_woocommerce_currency_symbol')){
20
+ $currency_code = html_entity_decode(get_woocommerce_currency_symbol());
21
+ }
22
+ ?>
23
  <script type="application/javascript">
24
  (function ($) {
25
  $(document).ready(function ($) {
26
+ var currency_string = '<?php echo $currency_code; ?>';
27
  var $form = jQuery('form.cart').first();
28
  /**
29
  * Strikeout for option title
49
  if(response.success == true){
50
  var price_html = ''
51
  if(response.data !== undefined){
52
+ if(response.data.initial_price_html !== undefined && response.data.discounted_price_html !== undefined){
53
+ price_html += '<del>'+response.data.initial_price_html+'</del>';
54
+ price_html += ' <ins>'+response.data.discounted_price_html+'</ins>';
55
+ target.html(price_html);
56
+ }
57
  }
58
  }
59
  target.attr('data-lock', false);
101
  <div class="awdr-compatible-field">
102
  <label>
103
  <input type="checkbox" name="wdrc[<?php echo $this->key; ?>]" id="<?php echo $this->key; ?>" value="1" <?php if ($value == 1) { ?> checked <?php } ?>>
104
+ <?php esc_html_e('Show discount price in product pages for WooCommerce Product Add Ons.', WDR_TEXT_DOMAIN); ?>
105
  </label>
106
  </div>
107
  <?php
v2/App/Conditions/CartSubTotal.php CHANGED
@@ -3,6 +3,7 @@
3
  namespace Wdr\App\Conditions;
4
 
5
  use Wdr\App\Controllers\DiscountCalculator;
 
6
  use Wdr\App\Helpers\Woocommerce;
7
 
8
  if (!defined('ABSPATH')) exit;
@@ -45,9 +46,33 @@ class CartSubTotal extends Base
45
  if (isset($options->operator) && $options->value) {
46
  $operator = sanitize_text_field($options->operator);
47
  $value = sanitize_key($options->value);
48
- return $this->doComparisionOperation($operator, $cart_sub_total, $value);
 
 
 
 
49
  }
50
 
51
  return false;
52
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  }
3
  namespace Wdr\App\Conditions;
4
 
5
  use Wdr\App\Controllers\DiscountCalculator;
6
+ use Wdr\App\Helpers\Helper;
7
  use Wdr\App\Helpers\Woocommerce;
8
 
9
  if (!defined('ABSPATH')) exit;
46
  if (isset($options->operator) && $options->value) {
47
  $operator = sanitize_text_field($options->operator);
48
  $value = sanitize_key($options->value);
49
+ $status = $this->doComparisionOperation($operator, $cart_sub_total, $value);
50
+ if(!$status){
51
+ $this->processPromotion($operator, $options, $cart_sub_total, $value);
52
+ }
53
+ return $status;
54
  }
55
 
56
  return false;
57
  }
58
+
59
+ /**
60
+ * Process promotion
61
+ */
62
+ function processPromotion($operator, $options, $cart_sub_total, $min_value)
63
+ {
64
+ if(in_array($operator, array('greater_than', 'greater_than_or_equal'))){
65
+ if(!empty($options->subtotal_promotion_from) && !empty($options->subtotal_promotion_message)){
66
+ if($options->subtotal_promotion_from <= $cart_sub_total){
67
+ $difference_amount = $min_value - $cart_sub_total;
68
+ if($difference_amount > 0){
69
+ $message = __($options->subtotal_promotion_message, WDR_TEXT_DOMAIN);
70
+ $difference_amount = Woocommerce::formatPrice($difference_amount);
71
+ $message = str_replace('{{difference_amount}}', $difference_amount, $message);
72
+ Helper::setPromotionMessage($message, $this->rule->rule->id);
73
+ }
74
+ }
75
+ }
76
+ }
77
+ }
78
  }
v2/App/Controllers/Admin/Settings.php CHANGED
@@ -13,6 +13,7 @@ use Wdr\App\Controllers\OnSaleShortCode;
13
  use Wdr\App\Helpers\Language;
14
  use Wdr\App\Helpers\Migration;
15
  use Wdr\App\Helpers\SurveyForm;
 
16
 
17
  if (!defined('ABSPATH')) exit;
18
 
@@ -212,6 +213,7 @@ class Settings extends Base
212
  'banner_position' => $this->getBannerPosition(),
213
  );
214
  $localization_data = $this->getLocalizationData();
 
215
  $wdr_data = array(
216
  'labels' => array(
217
  'select2_no_results' => __('no results', WDR_TEXT_DOMAIN),
@@ -220,6 +222,7 @@ class Settings extends Base
220
  'lists' => $preloaded_lists,
221
  'admin_url' => admin_url('admin.php?page=woo_discount_rules'),
222
  'localization_data' => $localization_data,
 
223
  'rule_id' => $this->input->get('task', 'create'),
224
  );
225
  wp_localize_script(WDR_SLUG . '-admin', 'wdr_data', $wdr_data);
13
  use Wdr\App\Helpers\Language;
14
  use Wdr\App\Helpers\Migration;
15
  use Wdr\App\Helpers\SurveyForm;
16
+ use Wdr\App\Controllers\Configuration;
17
 
18
  if (!defined('ABSPATH')) exit;
19
 
213
  'banner_position' => $this->getBannerPosition(),
214
  );
215
  $localization_data = $this->getLocalizationData();
216
+ $conig = new Configuration();
217
  $wdr_data = array(
218
  'labels' => array(
219
  'select2_no_results' => __('no results', WDR_TEXT_DOMAIN),
222
  'lists' => $preloaded_lists,
223
  'admin_url' => admin_url('admin.php?page=woo_discount_rules'),
224
  'localization_data' => $localization_data,
225
+ 'enable_subtotal_promo_text' => $conig->getConfig('show_promo_text', ''),
226
  'rule_id' => $this->input->get('task', 'create'),
227
  );
228
  wp_localize_script(WDR_SLUG . '-admin', 'wdr_data', $wdr_data);
v2/App/Controllers/Admin/Tabs/Compatible.php CHANGED
@@ -69,7 +69,7 @@ class Compatible extends Base
69
  * Get config data
70
  * */
71
  public function getConfigData($key, $default = ''){
72
- $options = $this->getConfig();
73
  if(isset($options[$key])){
74
  return $options[$key];
75
  }
69
  * Get config data
70
  * */
71
  public function getConfigData($key, $default = ''){
72
+ $options = $this->getConfig(1);
73
  if(isset($options[$key])){
74
  return $options[$key];
75
  }
v2/App/Controllers/Admin/WDRAjax.php CHANGED
@@ -76,7 +76,7 @@ class WDRAjax extends Base
76
  $product = Woocommerce::getProduct($product_id);
77
  $price = Woocommerce::getProductPrice($product);
78
  $custom_price = $this->input->post('custom_price', '');
79
- $result = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $price, $product, $quantity, $custom_price, 'all');
80
  if(!empty($result)){
81
  $result = Helper::formatAllPrices($result);
82
  }
@@ -113,10 +113,18 @@ class WDRAjax extends Base
113
  }
114
  $query = $this->input->post('query', '');
115
  $terms = get_terms(array('taxonomy' => $taxonomy, 'name__like' => $query, 'hide_empty' => false, 'number' => $this->search_result_limit));
 
116
  return array_map(function ($term) {
 
 
 
 
 
 
 
117
  return array(
118
  'id' => (string)$term->term_id,
119
- 'text' => $term->name,
120
  );
121
  }, $terms);
122
  }
@@ -144,7 +152,6 @@ class WDRAjax extends Base
144
  */
145
  public function wdr_ajax_product_taxonomies()
146
  {
147
-
148
  $query = $this->input->post('query', '');
149
  $taxonomy_name = $this->input->post('taxonomy', '');
150
  $terms = get_terms(array('taxonomy' => $taxonomy_name,
@@ -152,10 +159,18 @@ class WDRAjax extends Base
152
  'hide_empty' => false,
153
  'number' => $this->search_result_limit,
154
  ));
 
155
  return array_map(function ($term) {
 
 
 
 
 
 
 
156
  return array(
157
  'id' => (string)$term->term_id,
158
- 'text' => $term->name,
159
  );
160
  }, $terms);
161
  }
76
  $product = Woocommerce::getProduct($product_id);
77
  $price = Woocommerce::getProductPrice($product);
78
  $custom_price = $this->input->post('custom_price', '');
79
+ $result = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', $price, $product, $quantity, $custom_price, 'all', true);
80
  if(!empty($result)){
81
  $result = Helper::formatAllPrices($result);
82
  }
113
  }
114
  $query = $this->input->post('query', '');
115
  $terms = get_terms(array('taxonomy' => $taxonomy, 'name__like' => $query, 'hide_empty' => false, 'number' => $this->search_result_limit));
116
+
117
  return array_map(function ($term) {
118
+ $parant_name = '';
119
+ if(!empty($term->parent)){
120
+ if (function_exists('get_the_category_by_ID')) {
121
+ $parant_names = get_the_category_by_ID((int)$term->parent);
122
+ $parant_name = $parant_names . ' -> ';
123
+ }
124
+ }
125
  return array(
126
  'id' => (string)$term->term_id,
127
+ 'text' => $parant_name.$term->name,
128
  );
129
  }, $terms);
130
  }
152
  */
153
  public function wdr_ajax_product_taxonomies()
154
  {
 
155
  $query = $this->input->post('query', '');
156
  $taxonomy_name = $this->input->post('taxonomy', '');
157
  $terms = get_terms(array('taxonomy' => $taxonomy_name,
159
  'hide_empty' => false,
160
  'number' => $this->search_result_limit,
161
  ));
162
+
163
  return array_map(function ($term) {
164
+ $parant_name = '';
165
+ if(!empty($term->parent)){
166
+ if (function_exists('get_the_category_by_ID')) {
167
+ $parant_names = get_the_category_by_ID((int)$term->parent);
168
+ $parant_name = $parant_names . ' -> ';
169
+ }
170
+ }
171
  return array(
172
  'id' => (string)$term->term_id,
173
+ 'text' => $parant_name.$term->name,
174
  );
175
  }, $terms);
176
  }
v2/App/Controllers/DiscountCalculator.php CHANGED
@@ -238,7 +238,7 @@ class DiscountCalculator extends Base
238
  }
239
  }
240
  }
241
- if($discount_type == 'wdr_free_shipping' || $discount_type == 'wdr_buy_x_get_x_discount' || $discount_type == 'wdr_buy_x_get_y_discount'){
242
  $discount_method = "free_shipping";
243
  $badge_bg_color = $rule->getAdvancedDiscountMessage('badge_color_picker', '#ffffff');
244
  $badge_text_color = $rule->getAdvancedDiscountMessage('badge_text_color_picker', '#000000');
@@ -325,12 +325,12 @@ class DiscountCalculator extends Base
325
  //if (!empty($discount_text) && !empty($discounted_price_text)) {
326
  $dont_allow_duplicate = true;
327
  if ($discount_method == "bulk_discount") {
328
- $searchForReplace = array('{{title}}');//, '{{min_quantity}}', '{{max_quantity}}', '{{discount}}', '{{discounted_price}}'
329
- $string_to_replace = array($discounted_title_text); //, $min, $max, $discount_text, $discounted_price_text
330
  $html_content = str_replace($searchForReplace, $string_to_replace, $html_content);
331
  } elseif ($discount_method == "set_discount") {
332
- $searchForReplace = array('{{title}}'); //, '{{min_quantity}}', '{{discount}}', '{{discounted_price}}'
333
- $string_to_replace = array($discounted_title_text);//, $min, $discount_text, $discounted_price_text
334
  $html_content = str_replace($searchForReplace, $string_to_replace, $html_content);
335
  $searchForRemove = array('/{{max_quantity}}/');
336
  $replacements = array('');
@@ -343,8 +343,8 @@ class DiscountCalculator extends Base
343
  $replacements = array('', '');
344
  $html_content = preg_replace($searchForRemove, $replacements, $html_content);
345
  }else {
346
- $searchForReplace = array('{{title}}');//, '{{discount}}', '{{discounted_price}}'
347
- $string_to_replace = array($discounted_title_text);//, $discount_text, $discounted_price_text
348
  $html_content = str_replace($searchForReplace, $string_to_replace, $html_content);
349
  $searchForRemove = array('/{{min_quantity}}/', '/{{max_quantity}}/');
350
  $replacements = array('', '');
@@ -380,7 +380,7 @@ class DiscountCalculator extends Base
380
  * @param $cart_item
381
  * @return array|bool
382
  */
383
- function mayApplyPriceDiscount($product, $quantity, $custom_price = 0, $ajax_price = false, $cart_item = array(), $is_cart=true)
384
  {
385
  if (!empty(self::$rules) && !empty($product)) {
386
  $calculate_discount_from = self::$config->getConfig('calculate_discount_from', 'sale_price');
@@ -394,12 +394,13 @@ class DiscountCalculator extends Base
394
  $product_price = $custom_price;
395
  }
396
 
397
- $original_product_price = $product_price;
398
- $product_price = apply_filters('advanced_woo_discount_rules_product_price_on_before_calculate_discount', $product_price, $product, $quantity, $cart_item);
399
 
400
  $exclusive_rules = $discounts = $exclude_products = array();
401
  $cart = self::$woocommerce_helper->getCart();
402
  $product_id = self::$woocommerce_helper->getProductId($product);
 
403
  $language_helper_object = self::$language_helper;
404
  $apply_rule_to = self::$config->getConfig('apply_product_discount_to', 'biggest_discount');
405
  $price_display_condition = self::$config->getConfig('show_strikeout_when', 'show_when_matched');
@@ -407,10 +408,8 @@ class DiscountCalculator extends Base
407
  $price_as_cart_discount = array();
408
  foreach (self::$rules as $rule) {
409
  $discount_type = $rule->getRuleDiscountType();
410
- if ($ajax_price) {
411
- if (!$rule->isEnabled()) {
412
- continue;
413
- }
414
  }
415
  $chosen_languages = $rule->getLanguages();
416
  if (!empty($chosen_languages)) {
@@ -434,7 +433,7 @@ class DiscountCalculator extends Base
434
  }
435
  }
436
  $rule::$set_discounts = $rule::$simple_discounts = $rule::$bulk_discounts = array();
437
- if ($discounted_price = $rule->calculateDiscount($product_price, $quantity, $product, $ajax_price, $cart_item, $price_display_condition, $is_cart)) {
438
  $cart_discounted_price = 0;
439
  $discount_label = '';
440
  if(!is_array($discounted_price)){
@@ -538,9 +537,9 @@ class DiscountCalculator extends Base
538
  self::$total_discounts['ajax_product'][$rule_id]['bulk_discount'] = isset($bulk_discounts[$product_id]) ? $bulk_discounts[$product_id] : 0;
539
  self::$total_discounts['ajax_product'][$rule_id]['simple_discount'] = isset($simple_discounts[$product_id]) ? $simple_discounts[$product_id] : 0;
540
  }else{
541
- self::$total_discounts[$product_id][$rule_id]['set_discount'] = isset($set_discounts[$product_id]) ? $set_discounts[$product_id] : 0;
542
- self::$total_discounts[$product_id][$rule_id]['bulk_discount'] = isset($bulk_discounts[$product_id]) ? $bulk_discounts[$product_id] : 0;
543
- self::$total_discounts[$product_id][$rule_id]['simple_discount'] = isset($simple_discounts[$product_id]) ? $simple_discounts[$product_id] : 0;
544
  }
545
  }
546
  } else {
@@ -554,10 +553,10 @@ class DiscountCalculator extends Base
554
  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);
555
  $ajax_discounts[] = $discounted_price;
556
  }else{
557
- if(!isset(self::$total_discounts[$product_id][$rule_id])){
558
- self::$total_discounts[$product_id][$rule_id] = array();
559
  }
560
- self::$total_discounts[$product_id][$rule_id] = apply_filters('advanced_woo_discount_rules_calculated_discounts_of_each_rule', self::$total_discounts[$product_id][$rule_id], $product_id, $rule_id, $filter_passed, $cart_item, $is_cart);
561
  if ($rule->isExclusive()) {
562
  array_push($exclusive_rules, $rule_id);
563
  }
@@ -590,8 +589,8 @@ class DiscountCalculator extends Base
590
  $valid_discounts = array();
591
  if (isset($rules) && !empty($rules) && !empty($discounts)) {
592
  foreach ($rules as $rule_id) {
593
- if(isset(self::$total_discounts[$product_id]) && isset(self::$total_discounts[$product_id][$rule_id])){
594
- $valid_discounts[$product_id][$rule_id] = self::$total_discounts[$product_id][$rule_id];
595
  }
596
  if(!empty($price_as_cart_discount) && isset($price_as_cart_discount[$rule_id])){
597
  if(isset(self::$price_discount_apply_as_cart_discount[$rule_id])){
@@ -610,8 +609,8 @@ class DiscountCalculator extends Base
610
  }
611
  }
612
  if(!empty($valid_discounts)){
613
- unset(self::$total_discounts[$product_id]);
614
- self::$total_discounts[$product_id] = $valid_discounts[$product_id];
615
  }
616
  $discounted_price = $product_price - $discount_price;
617
  if ($discounted_price < 0 ) {
@@ -727,11 +726,12 @@ class DiscountCalculator extends Base
727
  }
728
  //$rule_id = $rule->getId();
729
  $discount_type = $rule->getRuleDiscountType();
730
- $cart_items = self::$woocommerce_helper->getCart();
731
  $rule_id = $rule->rule->id;
732
  if ($discount_type == "wdr_free_shipping") {
733
- foreach ($cart_items as $cart_item){
734
- //if ($rule->isFilterPassed($cart_item['data'])) {
 
 
735
  if ($rule->hasConditions()) {
736
  if (!$rule->isCartConditionsPassed($cart_items)) {
737
  continue;
@@ -739,7 +739,8 @@ class DiscountCalculator extends Base
739
  }
740
  self::$applied_rules[$rule_id] = self::$rules[$rule_id];
741
  return array('free_shipping'=>1);
742
- //}
 
743
  }
744
  }
745
  }
238
  }
239
  }
240
  }
241
+ if($discount_type == 'wdr_free_shipping' || $discount_type == 'wdr_buy_x_get_x_discount'){
242
  $discount_method = "free_shipping";
243
  $badge_bg_color = $rule->getAdvancedDiscountMessage('badge_color_picker', '#ffffff');
244
  $badge_text_color = $rule->getAdvancedDiscountMessage('badge_text_color_picker', '#000000');
325
  //if (!empty($discount_text) && !empty($discounted_price_text)) {
326
  $dont_allow_duplicate = true;
327
  if ($discount_method == "bulk_discount") {
328
+ $searchForReplace = array('{{title}}', '{{min_quantity}}', '{{max_quantity}}', '{{discount}}', '{{discounted_price}}');//, '{{min_quantity}}', '{{max_quantity}}', '{{discount}}', '{{discounted_price}}'
329
+ $string_to_replace = array($discounted_title_text, $min, $max, $discount_text, $discounted_price_text); //, $min, $max, $discount_text, $discounted_price_text
330
  $html_content = str_replace($searchForReplace, $string_to_replace, $html_content);
331
  } elseif ($discount_method == "set_discount") {
332
+ $searchForReplace = array('{{title}}', '{{min_quantity}}', '{{discount}}', '{{discounted_price}}'); //, '{{min_quantity}}', '{{discount}}', '{{discounted_price}}'
333
+ $string_to_replace = array($discounted_title_text, $min, $discount_text, $discounted_price_text);//, $min, $discount_text, $discounted_price_text
334
  $html_content = str_replace($searchForReplace, $string_to_replace, $html_content);
335
  $searchForRemove = array('/{{max_quantity}}/');
336
  $replacements = array('');
343
  $replacements = array('', '');
344
  $html_content = preg_replace($searchForRemove, $replacements, $html_content);
345
  }else {
346
+ $searchForReplace = array('{{title}}', '{{discount}}', '{{discounted_price}}');//, '{{discount}}', '{{discounted_price}}'
347
+ $string_to_replace = array($discounted_title_text, $discount_text, $discounted_price_text);//, $discount_text, $discounted_price_text
348
  $html_content = str_replace($searchForReplace, $string_to_replace, $html_content);
349
  $searchForRemove = array('/{{min_quantity}}/', '/{{max_quantity}}/');
350
  $replacements = array('', '');
380
  * @param $cart_item
381
  * @return array|bool
382
  */
383
+ function mayApplyPriceDiscount($product, $quantity, $custom_price = 0, $ajax_price = false, $cart_item = array(), $is_cart=true, $manual_request = false)
384
  {
385
  if (!empty(self::$rules) && !empty($product)) {
386
  $calculate_discount_from = self::$config->getConfig('calculate_discount_from', 'sale_price');
394
  $product_price = $custom_price;
395
  }
396
 
397
+ $original_product_price = apply_filters('advanced_woo_discount_rules_product_original_price_on_before_calculate_discount', $product_price, $product, $quantity, $cart_item, $calculate_discount_from);
398
+ $product_price = apply_filters('advanced_woo_discount_rules_product_price_on_before_calculate_discount', $product_price, $product, $quantity, $cart_item, $calculate_discount_from);
399
 
400
  $exclusive_rules = $discounts = $exclude_products = array();
401
  $cart = self::$woocommerce_helper->getCart();
402
  $product_id = self::$woocommerce_helper->getProductId($product);
403
+ $matched_item_key = (isset($cart_item['key']))? $cart_item['key']: $product_id;
404
  $language_helper_object = self::$language_helper;
405
  $apply_rule_to = self::$config->getConfig('apply_product_discount_to', 'biggest_discount');
406
  $price_display_condition = self::$config->getConfig('show_strikeout_when', 'show_when_matched');
408
  $price_as_cart_discount = array();
409
  foreach (self::$rules as $rule) {
410
  $discount_type = $rule->getRuleDiscountType();
411
+ if (!$rule->isEnabled()) {
412
+ continue;
 
 
413
  }
414
  $chosen_languages = $rule->getLanguages();
415
  if (!empty($chosen_languages)) {
433
  }
434
  }
435
  $rule::$set_discounts = $rule::$simple_discounts = $rule::$bulk_discounts = array();
436
+ if ($discounted_price = $rule->calculateDiscount($product_price, $quantity, $product, $ajax_price, $cart_item, $price_display_condition, $is_cart, $manual_request)) {
437
  $cart_discounted_price = 0;
438
  $discount_label = '';
439
  if(!is_array($discounted_price)){
537
  self::$total_discounts['ajax_product'][$rule_id]['bulk_discount'] = isset($bulk_discounts[$product_id]) ? $bulk_discounts[$product_id] : 0;
538
  self::$total_discounts['ajax_product'][$rule_id]['simple_discount'] = isset($simple_discounts[$product_id]) ? $simple_discounts[$product_id] : 0;
539
  }else{
540
+ self::$total_discounts[$matched_item_key][$rule_id]['set_discount'] = isset($set_discounts[$product_id]) ? $set_discounts[$product_id] : 0;
541
+ self::$total_discounts[$matched_item_key][$rule_id]['bulk_discount'] = isset($bulk_discounts[$product_id]) ? $bulk_discounts[$product_id] : 0;
542
+ self::$total_discounts[$matched_item_key][$rule_id]['simple_discount'] = isset($simple_discounts[$product_id]) ? $simple_discounts[$product_id] : 0;
543
  }
544
  }
545
  } else {
553
  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);
554
  $ajax_discounts[] = $discounted_price;
555
  }else{
556
+ if(!isset(self::$total_discounts[$matched_item_key][$rule_id])){
557
+ self::$total_discounts[$matched_item_key][$rule_id] = array();
558
  }
559
+ 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);
560
  if ($rule->isExclusive()) {
561
  array_push($exclusive_rules, $rule_id);
562
  }
589
  $valid_discounts = array();
590
  if (isset($rules) && !empty($rules) && !empty($discounts)) {
591
  foreach ($rules as $rule_id) {
592
+ if(isset(self::$total_discounts[$matched_item_key]) && isset(self::$total_discounts[$matched_item_key][$rule_id])){
593
+ $valid_discounts[$matched_item_key][$rule_id] = self::$total_discounts[$matched_item_key][$rule_id];
594
  }
595
  if(!empty($price_as_cart_discount) && isset($price_as_cart_discount[$rule_id])){
596
  if(isset(self::$price_discount_apply_as_cart_discount[$rule_id])){
609
  }
610
  }
611
  if(!empty($valid_discounts)){
612
+ unset(self::$total_discounts[$matched_item_key]);
613
+ self::$total_discounts[$matched_item_key] = $valid_discounts[$matched_item_key];
614
  }
615
  $discounted_price = $product_price - $discount_price;
616
  if ($discounted_price < 0 ) {
726
  }
727
  //$rule_id = $rule->getId();
728
  $discount_type = $rule->getRuleDiscountType();
 
729
  $rule_id = $rule->rule->id;
730
  if ($discount_type == "wdr_free_shipping") {
731
+ $cart_items = self::$woocommerce_helper->getCart();
732
+ if(!empty($cart_items)){
733
+ foreach ($cart_items as $cart_item){
734
+ //if ($rule->isFilterPassed($cart_item['data'])) {
735
  if ($rule->hasConditions()) {
736
  if (!$rule->isCartConditionsPassed($cart_items)) {
737
  continue;
739
  }
740
  self::$applied_rules[$rule_id] = self::$rules[$rule_id];
741
  return array('free_shipping'=>1);
742
+ //}
743
+ }
744
  }
745
  }
746
  }
v2/App/Controllers/ManageDiscount.php CHANGED
@@ -49,6 +49,8 @@ class ManageDiscount extends Base
49
  $awdr_front_end_script = array(
50
  'ajaxurl' => admin_url('admin-ajax.php'),
51
  'enable_update_price_with_qty' => $ajax_update_price,
 
 
52
  'js_init_trigger' => apply_filters('advanced_woo_discount_rules_update_discount_price_init_trigger', ""),
53
  );
54
  wp_enqueue_script('awdr-dynamic-price', WDR_PLUGIN_URL . 'Assets/Js/awdr-dynamic-price.js', array('jquery'));
@@ -63,6 +65,7 @@ class ManageDiscount extends Base
63
  */
64
  function isProductInSale($on_sale, $product)
65
  {
 
66
  //Need to check if conditions also passed
67
  $show_on_sale_badge = self::$config->getConfig('show_on_sale_badge', 'disabled');
68
  if ($show_on_sale_badge == 'when_condition_matches') {
@@ -80,7 +83,7 @@ class ManageDiscount extends Base
80
  $product_id = Woocommerce::getProductId($product);
81
  self::updateProductsAsOnSale($product_id);
82
  }
83
-
84
  return $on_sale OR $price_html;
85
  }
86
 
@@ -165,6 +168,7 @@ class ManageDiscount extends Base
165
  */
166
  function getPriceHtml($price_html, $product, $quantity = 1, $ajax_price = false)
167
  {
 
168
  if ($ajax_price) {
169
  $calculate_discount_from = self::$config->getConfig('calculate_discount_from', 'sale_price');
170
  if ($calculate_discount_from == 'regular_price') {
@@ -180,20 +184,35 @@ class ManageDiscount extends Base
180
  }
181
 
182
  if (empty(self::$available_rules)) {
 
 
 
183
  return $price_html;
184
  }
185
 
186
  $modify_price = apply_filters('advanced_woo_discount_rules_modify_price_html', true, $price_html, $product, $quantity);
187
  if (!$modify_price) {
 
 
 
188
  return $price_html;
189
  }
190
  if (is_product() && empty(self::$config->getConfig('modify_price_at_product_page', 1))) {
 
 
 
191
  return $price_html;
192
  }
193
  if (is_shop() && empty(self::$config->getConfig('modify_price_at_shop_page', 1))) {
 
 
 
194
  return $price_html;
195
  }
196
  if (is_product_category() && empty(self::$config->getConfig('modify_price_at_category_page', 1))) {
 
 
 
197
  return $price_html;
198
  }
199
 
@@ -210,20 +229,34 @@ class ManageDiscount extends Base
210
  if($ajax_price){
211
  $discount_details = (isset($prices['total_discount_details'])) ? $prices['total_discount_details'] : false;
212
  if($discount_details) {
213
- $initial_price = (isset($prices['initial_price_with_tax'])) ? $prices['initial_price_with_tax'] : 0;
214
- $discounted_price = (isset($prices['discounted_price_with_tax'])) ? $prices['discounted_price_with_tax'] : 0;
 
 
215
  if(empty($initial_price) || empty($discounted_price) || empty($discount_details)){
216
  return $price_html;
217
  }
218
  return $this->getSetDiscountItemPriceHtml($discount_details, $initial_price, $discounted_price, $product, $price_html = true, $quantity, $ajax_price);
 
 
219
  }
220
  }else {
221
  if (!$prices) {
222
  return $price_html;
223
  }
224
  self::$calculated_product_discount[$product_id] = $prices;
225
- $price_html = $this->getStrikeoutPrice($prices['initial_price_with_tax'], $prices['discounted_price_with_tax']);
226
- $price_html = $price_html.Woocommerce::getProductPriceSuffix($product, $prices['discounted_price_with_tax'], $prices);
 
 
 
 
 
 
 
 
 
 
227
  }
228
 
229
  }
@@ -310,11 +343,11 @@ class ManageDiscount extends Base
310
  }
311
  $variation = Woocommerce::getProduct($variation_id);
312
  $prices = self::calculateInitialAndDiscountedPrice($variation, $quantity);
313
- if (!isset($prices['initial_price_with_tax']) || !isset($prices['discounted_price_with_tax'])) {
314
  return $this->removeDuplicateStrikeoutPrice($price_html);
315
  }
316
- $original_prices_list[] = $prices['initial_price_with_tax'];
317
- $discount_prices_lists[] = $prices['discounted_price_with_tax'];
318
  }
319
  }
320
  $discount_prices_lists = array_unique($discount_prices_lists);
@@ -323,6 +356,19 @@ class ManageDiscount extends Base
323
  $max_price = max($discount_prices_lists);
324
  $min_original_price = min($original_prices_list);
325
  $max_original_price = max($original_prices_list);
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  $price_range_suffix = self::$woocommerce_helper->getProductPriceSuffix($product);
327
  if ($min_original_price == $max_original_price) {
328
  $price_html = self::$woocommerce_helper->formatPrice($min_original_price) . $price_range_suffix;
@@ -347,9 +393,10 @@ class ManageDiscount extends Base
347
  * @param $discounted_price
348
  * @param $format_price
349
  * @param $is_variable_product
 
350
  * @return string
351
  */
352
- function getStrikeoutPrice($original_price, $discounted_price, $format_price = true, $is_variable_product = false)
353
  {
354
  if ($original_price == $discounted_price) {
355
  if ($format_price) {
@@ -362,7 +409,12 @@ class ManageDiscount extends Base
362
  $discounted_price = self::$woocommerce_helper->formatPrice($discounted_price);
363
  }
364
  $separator = ($is_variable_product) ? '<br>' : '&nbsp;';
365
- $html = '<del>' . $original_price . '</del>' . $separator . '<ins>' . $discounted_price . '</ins>';
 
 
 
 
 
366
  }
367
  return apply_filters('advanced_woo_discount_rules_strikeout_price_html', $html, $original_price, $discounted_price);
368
  }
@@ -434,12 +486,18 @@ class ManageDiscount extends Base
434
  if ($discounted_price <= 0) {
435
  $discounted_price = 0;
436
  }
437
- $discounted_price = $calculator->mayHaveTax($product_obj, $discounted_price);
 
 
 
 
 
 
438
  if (!empty($discounted_price)) {
439
  $calculate_product_price[] = $discounted_price * $last_applied;
440
  }
441
  $price_suffix = Woocommerce::getProductPriceSuffix($product_obj, $discounted_price);
442
- $price_html .= '<del>' . self::$woocommerce_helper->formatPrice($original_price) . '</del>&nbsp;<ins>' . self::$woocommerce_helper->formatPrice($discounted_price) .$price_suffix. '&nbsp;x&nbsp;' . $last_applied . '</ins><br/>';
443
  //remove calculated set
444
  $min_applied_range_keys = array_keys($partially_qualified_sets, $min_applied_quantity);
445
  foreach ($min_applied_range_keys as $key) {
@@ -447,7 +505,7 @@ class ManageDiscount extends Base
447
  }
448
  }
449
  }
450
-
451
  //get original price quantity
452
  if ($discount_operator === 'total_qty_in_cart') {
453
  $total_quantity = $current_product_quantity;
@@ -455,26 +513,35 @@ class ManageDiscount extends Base
455
  $not_applied = (int)$total_quantity - (int)$total_applied;
456
 
457
  //calculate original price quantities discount.
 
458
  if (!empty($other_discounts)) {
459
  $discounted_price = $original_price - $other_discounts;
460
- $discounted_price = $calculator->mayHaveTax($product_obj, $discounted_price);
461
  if ($discounted_price < 0) {
462
  $discounted_price = 0;
463
  }
464
  $calculate_product_price[] = $discounted_price * $not_applied;
465
- $price_suffix = Woocommerce::getProductPriceSuffix($product_obj, $discounted_price);
466
- $price_html .= '<del>' . self::$woocommerce_helper->formatPrice($original_price) . '</del>&nbsp;<ins>' . self::$woocommerce_helper->formatPrice($discounted_price) .$price_suffix. '&nbsp;x&nbsp;' . $not_applied . '</ins>';
 
 
 
 
 
 
467
  } else {
468
- $price_suffix = Woocommerce::getProductPriceSuffix($product_obj, $original_price);
 
 
 
469
  $calculate_product_price[] = $original_price * $not_applied;
470
- $price_html .= '<ins>' . self::$woocommerce_helper->formatPrice($original_price) .$price_suffix. '&nbsp;x&nbsp;' . $not_applied . '</ins>';
471
  }
472
  if ($return_html) {
473
  return apply_filters('advanced_woo_discount_rules_strikeout_for_set_discount_price_html', $price_html, $original_price, $discounted_price, $total_discount, $other_discounts, $not_applied);
474
  } else {
475
  $total_product_price = array_sum($calculate_product_price);
476
  $single_product_price = $total_product_price / $total_quantity;
477
-
478
  return $single_product_price;
479
  }
480
  }
@@ -491,7 +558,6 @@ class ManageDiscount extends Base
491
  $combine_all_discounts = self::$config->getConfig('combine_all_cart_discounts', 0);
492
  $total_combined_discounts = 0;
493
  $apply_as_cart_fee_details = DiscountCalculator::$price_discount_apply_as_cart_discount;
494
- //echo "<pre>"; print_r($apply_as_cart_fee_details); echo "</pre>"; die;
495
  $flat_in_subtotal = array();
496
  if(!empty($apply_as_cart_fee_details)){
497
  foreach ($apply_as_cart_fee_details as $rule_id => $product_id){
@@ -538,6 +604,7 @@ class ManageDiscount extends Base
538
  self::$woocommerce_helper->addCartFee($cart, apply_filters('advanced_woo_discount_rules_additional_fee_label', $label, $cart), apply_filters('advanced_woo_discount_rules_additional_fee_value', $total_combined_discounts, $cart));
539
  }
540
  }
 
541
  }
542
 
543
  /**
@@ -657,6 +724,37 @@ class ManageDiscount extends Base
657
  * */
658
  function removeThirdPartyCouponIfRequired($calculated_cart_item_discount, $processed_rule){
659
  if($processed_rule === true){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
660
  $disable_coupon_when_rule_applied = self::$config->getConfig('disable_coupon_when_rule_applied', 'run_both');//run_both, disable_coupon, disable_rules
661
  if($disable_coupon_when_rule_applied == 'disable_coupon'){
662
  $used_coupons = DiscountCalculator::getUsedCoupons();
@@ -668,12 +766,13 @@ class ManageDiscount extends Base
668
  }
669
  foreach ($applied_coupons as $applied_coupon){
670
  if(empty($used_coupons) || !in_array($applied_coupon, $used_coupons)){
671
- $this->removeAppliedCoupon($applied_coupon);
672
  }
673
  }
674
  }
675
  }
676
  }
 
677
  }
678
 
679
  /**
@@ -688,16 +787,8 @@ class ManageDiscount extends Base
688
 
689
  //Remove message: Coupon code applied successfully.
690
  $this->removeCouponAppliedMessage();
691
-
692
- //Display coupon cannot apply message in cart and checkout
693
- add_action('woocommerce_before_cart', function() use ($msg, $coupon_code){
694
- Woocommerce::printNotice( $msg, 'notice' );
695
- Woocommerce::remove_coupon($coupon_code);
696
- }, 10);
697
- add_action('woocommerce_before_checkout_form', function() use ($msg, $coupon_code){
698
- Woocommerce::printNotice( $msg, 'notice' );
699
- Woocommerce::remove_coupon($coupon_code);
700
- }, 10);
701
  }
702
 
703
  /**
@@ -714,7 +805,7 @@ class ManageDiscount extends Base
714
  *
715
  * @return boolean
716
  * */
717
- function doApplyDiscount(){
718
  $run_rule = true;
719
  $disable_coupon_when_rule_applied = self::$config->getConfig('disable_coupon_when_rule_applied', 'run_both');//run_both, disable_coupon, disable_rules
720
  if($disable_coupon_when_rule_applied == 'disable_rules'){
@@ -724,7 +815,7 @@ class ManageDiscount extends Base
724
  }
725
  }
726
 
727
- return apply_filters('advanced_woo_discount_rules_run_discount_rules', $run_rule);
728
  }
729
 
730
  /**
@@ -735,7 +826,8 @@ class ManageDiscount extends Base
735
  function applyCartProductDiscount($cart_object)
736
  {
737
  remove_action('woocommerce_cart_calculate_fees', array($this, 'applyCartDiscount'));
738
- $do_apply_discount = $this->doApplyDiscount();
 
739
  if($do_apply_discount){
740
  $this->calculateCartPageDiscounts();
741
  $processed_rule = false;
@@ -754,20 +846,22 @@ class ManageDiscount extends Base
754
  $product_obj = isset($cart_item['data']) ? $cart_item['data'] : $cart_item;
755
  $item_quantity = isset($cart_item['quantity']) ? $cart_item['quantity'] : 0;
756
  //product price
757
- $initial_price = self::$calculated_cart_item_discount[$key]['initial_price_with_tax'];
758
- $discounted_price = self::$calculated_cart_item_discount[$key]['discounted_price_with_tax'];
759
  $calculator = self::$calculator;
760
  $total_discounts = $calculator::$total_discounts;
761
  //get discount details per product
762
- $discount_details = (isset($total_discounts[$product_id])) ? $total_discounts[$product_id] : array();
763
  $item_price = $this->getSetDiscountItemPriceHtml($discount_details, $initial_price, $discounted_price, $product_obj, $price_html = false, $item_quantity);
764
  if ($item_price) {
765
  $price = $item_price;
 
 
 
766
  } else {
767
  $price = self::$calculated_cart_item_discount[$key]['discounted_price'];
768
  }
769
  $price = apply_filters('advanced_woo_discount_rules_discounted_price_of_cart_item', $price, $cart_item, $cart_object, self::$calculated_cart_item_discount[$key]);
770
-
771
  self::$woocommerce_helper->setCartProductPrice($product_obj, $price);
772
 
773
  }
@@ -888,7 +982,7 @@ class ManageDiscount extends Base
888
  $total_discount_details = isset($discount['total_discount_details']) ? $discount['total_discount_details'] : array();
889
  $cart_discount_details = isset($discount['cart_discount_details']) ? $discount['cart_discount_details'] : array();
890
  if (!empty($total_discount_details)) {
891
- $save_order_item_discounts_array = $total_discount_details[$product_id];
892
  } else {
893
  $save_order_item_discounts_array = $cart_discount_details;
894
  }
@@ -1008,23 +1102,33 @@ class ManageDiscount extends Base
1008
  {
1009
  $original_price_html = $item_price;
1010
  if (isset(self::$calculated_cart_item_discount[$cart_item_key])) {
1011
- $discounted_price = self::$calculated_cart_item_discount[$cart_item_key]['discounted_price_with_tax'];
 
 
1012
  $show_strikeout_on_cart = self::$config->getConfig('show_strikeout_on_cart', 1);
1013
  if (!empty($show_strikeout_on_cart)) {
1014
  $product_obj = isset($cart_item['data']) ? $cart_item['data'] : $cart_item;
1015
  $cart_item_qty = isset($cart_item['quantity']) ? $cart_item['quantity'] : 0;
1016
  $product_id = self::$woocommerce_helper->getProductId($product_obj);
1017
  //product price
1018
- $initial_price = self::$calculated_cart_item_discount[$cart_item_key]['initial_price_with_tax'];
 
1019
  $calculator = self::$calculator;
1020
  $total_discounts = $calculator::$total_discounts;
1021
  //get discount details per product
1022
- $discount_details = (isset($total_discounts[$product_id])) ? $total_discounts[$product_id] : array();
1023
  $price = $this->getSetDiscountItemPriceHtml($discount_details, $initial_price, $discounted_price, $product_obj, $price_html = true, $cart_item_qty);
1024
  if ($price) {
1025
  $item_price = $price;
1026
  } else {
1027
- $item_price = $this->getStrikeoutPrice($initial_price, $discounted_price);
 
 
 
 
 
 
 
1028
  }
1029
  } else {
1030
  $item_price = self::$woocommerce_helper->formatPrice($discounted_price);
@@ -1075,6 +1179,11 @@ class ManageDiscount extends Base
1075
  */
1076
  function getDiscountPerItem($discount_details)
1077
  {
 
 
 
 
 
1078
  $discounted_price = isset($discount_details['discounted_price_with_tax']) ? $discount_details['discounted_price_with_tax'] : 0;
1079
  $initial_price = isset($discount_details['initial_price_with_tax']) ? $discount_details['initial_price_with_tax'] : 0;
1080
  $cart_quantity = isset($discount_details['cart_quantity']) ? $discount_details['cart_quantity'] : 0;
@@ -1160,6 +1269,7 @@ class ManageDiscount extends Base
1160
  function getSetDiscountItemPriceHtml($discount_details, $initial_price, $discounted_price, $product_obj, $price_html, $cart_item_qty=0, $ajax_price = false)
1161
  {
1162
  if (is_array($discount_details) && !empty($discount_details)) {
 
1163
  $other_discounts = $total_discount_price = $total_quantity = $current_product_quantity = $discount_operator = 0;
1164
  $partially_qualified_set = array();
1165
  $partially_qualified_set_amount_duplicate = array();
@@ -1253,6 +1363,7 @@ class ManageDiscount extends Base
1253
  }
1254
  $other_discounts += $simple_discount + $bulk_discounts + $fully_qualified_set + $bogo_cheapest_full_matched_set;
1255
  }
 
1256
  if (empty($partially_qualified_set) || $apply_full_set == true) {
1257
  if ($price_html) {
1258
  if($ajax_price){
@@ -1260,11 +1371,25 @@ class ManageDiscount extends Base
1260
  if($discounted_price < 0){
1261
  $discounted_price = 0;
1262
  }
1263
- $item_price = $this->getStrikeoutPrice($initial_price, $discounted_price);
1264
- return $item_price.Woocommerce::getProductPriceSuffix($product_obj, $discounted_price);
 
 
 
 
 
 
 
 
 
 
 
 
 
1265
  }
1266
- $item_price = $this->getStrikeoutPrice($initial_price, $discounted_price);
1267
- return $item_price.Woocommerce::getProductPriceSuffix($product_obj, $discounted_price);
 
1268
  } else {
1269
  return false;
1270
  }
@@ -1286,7 +1411,7 @@ class ManageDiscount extends Base
1286
  * @param string $get_only
1287
  * @return bool
1288
  */
1289
- static function calculateProductDiscountPrice($price, $product, $quantity = 1, $custom_price = 0, $get_only = 'discounted_price')
1290
  {
1291
  if (!is_a($product, 'WC_Product')) {
1292
  if (is_integer($product)) {
@@ -1298,7 +1423,7 @@ class ManageDiscount extends Base
1298
  if (!$product) {
1299
  return false;
1300
  }
1301
- $discounts = self::$calculator->mayApplyPriceDiscount($product, $quantity, $custom_price);
1302
  if ($discounts) {
1303
  switch ($get_only) {
1304
  case 'all':
@@ -1550,4 +1675,36 @@ class ManageDiscount extends Base
1550
  }
1551
  return $coupon_html;
1552
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1553
  }
49
  $awdr_front_end_script = array(
50
  'ajaxurl' => admin_url('admin-ajax.php'),
51
  'enable_update_price_with_qty' => $ajax_update_price,
52
+ 'custom_target_simple_product' => apply_filters('advanced_woo_discount_rules_custom_target_for_simple_product_on_qty_update', ""),
53
+ 'custom_target_variable_product' => apply_filters('advanced_woo_discount_rules_custom_target_for_variable_product_on_qty_update', ""),
54
  'js_init_trigger' => apply_filters('advanced_woo_discount_rules_update_discount_price_init_trigger', ""),
55
  );
56
  wp_enqueue_script('awdr-dynamic-price', WDR_PLUGIN_URL . 'Assets/Js/awdr-dynamic-price.js', array('jquery'));
65
  */
66
  function isProductInSale($on_sale, $product)
67
  {
68
+ remove_filter('woocommerce_product_is_on_sale', array($this, 'isProductInSale'), 100);
69
  //Need to check if conditions also passed
70
  $show_on_sale_badge = self::$config->getConfig('show_on_sale_badge', 'disabled');
71
  if ($show_on_sale_badge == 'when_condition_matches') {
83
  $product_id = Woocommerce::getProductId($product);
84
  self::updateProductsAsOnSale($product_id);
85
  }
86
+ add_filter('woocommerce_product_is_on_sale', array($this, 'isProductInSale'), 100, 2);
87
  return $on_sale OR $price_html;
88
  }
89
 
168
  */
169
  function getPriceHtml($price_html, $product, $quantity = 1, $ajax_price = false)
170
  {
171
+ $initial_price_html = $price_html;
172
  if ($ajax_price) {
173
  $calculate_discount_from = self::$config->getConfig('calculate_discount_from', 'sale_price');
174
  if ($calculate_discount_from == 'regular_price') {
184
  }
185
 
186
  if (empty(self::$available_rules)) {
187
+ if($ajax_price){
188
+ return false;
189
+ }
190
  return $price_html;
191
  }
192
 
193
  $modify_price = apply_filters('advanced_woo_discount_rules_modify_price_html', true, $price_html, $product, $quantity);
194
  if (!$modify_price) {
195
+ if($ajax_price){
196
+ return false;
197
+ }
198
  return $price_html;
199
  }
200
  if (is_product() && empty(self::$config->getConfig('modify_price_at_product_page', 1))) {
201
+ if($ajax_price){
202
+ return false;
203
+ }
204
  return $price_html;
205
  }
206
  if (is_shop() && empty(self::$config->getConfig('modify_price_at_shop_page', 1))) {
207
+ if($ajax_price){
208
+ return false;
209
+ }
210
  return $price_html;
211
  }
212
  if (is_product_category() && empty(self::$config->getConfig('modify_price_at_category_page', 1))) {
213
+ if($ajax_price){
214
+ return false;
215
+ }
216
  return $price_html;
217
  }
218
 
229
  if($ajax_price){
230
  $discount_details = (isset($prices['total_discount_details'])) ? $prices['total_discount_details'] : false;
231
  if($discount_details) {
232
+ // $initial_price = (isset($prices['initial_price_with_tax'])) ? $prices['initial_price_with_tax'] : 0;
233
+ //$discounted_price = (isset($prices['discounted_price_with_tax'])) ? $prices['discounted_price_with_tax'] : 0;
234
+ $initial_price = isset($prices['initial_price']) ? $prices['initial_price'] : 0;
235
+ $discounted_price = isset($prices['discounted_price']) ? $prices['discounted_price'] : 0;
236
  if(empty($initial_price) || empty($discounted_price) || empty($discount_details)){
237
  return $price_html;
238
  }
239
  return $this->getSetDiscountItemPriceHtml($discount_details, $initial_price, $discounted_price, $product, $price_html = true, $quantity, $ajax_price);
240
+ }else{
241
+ return false;
242
  }
243
  }else {
244
  if (!$prices) {
245
  return $price_html;
246
  }
247
  self::$calculated_product_discount[$product_id] = $prices;
248
+ $initial_price_with_tax_call = $discounted_price_with_tax_call = 0;
249
+ $calculator = self::$calculator;
250
+ $initial_price = isset($prices['initial_price']) ? $prices['initial_price'] : 0;
251
+ $discounted_price = isset($prices['discounted_price']) ? $prices['discounted_price'] : 0;
252
+ if(!empty($initial_price)){
253
+ $initial_price_with_tax_call = $calculator->mayHaveTax($product, $initial_price);
254
+ }
255
+ if(!empty($discounted_price)){
256
+ $discounted_price_with_tax_call = $calculator->mayHaveTax($product, $discounted_price);
257
+ }
258
+ $price_html = $this->getStrikeoutPrice($initial_price_with_tax_call, $discounted_price_with_tax_call, true, false, $initial_price_html);
259
+ $price_html = $price_html.Woocommerce::getProductPriceSuffix($product, $discounted_price_with_tax_call, $prices);
260
  }
261
 
262
  }
343
  }
344
  $variation = Woocommerce::getProduct($variation_id);
345
  $prices = self::calculateInitialAndDiscountedPrice($variation, $quantity);
346
+ if (!isset($prices['initial_price']) || !isset($prices['discounted_price'])) {
347
  return $this->removeDuplicateStrikeoutPrice($price_html);
348
  }
349
+ $original_prices_list[] = $prices['initial_price'];
350
+ $discount_prices_lists[] = $prices['discounted_price'];
351
  }
352
  }
353
  $discount_prices_lists = array_unique($discount_prices_lists);
356
  $max_price = max($discount_prices_lists);
357
  $min_original_price = min($original_prices_list);
358
  $max_original_price = max($original_prices_list);
359
+ $calculator = self::$calculator;
360
+ if(!empty($min_original_price)){
361
+ $min_original_price = $calculator->mayHaveTax($product, $min_original_price);
362
+ }
363
+ if(!empty($max_original_price)){
364
+ $max_original_price = $calculator->mayHaveTax($product, $max_original_price);
365
+ }
366
+ if(!empty($min_price)){
367
+ $max_original_price = $calculator->mayHaveTax($product, $min_price);
368
+ }
369
+ if(!empty($max_price)){
370
+ $max_original_price = $calculator->mayHaveTax($product, $max_price);
371
+ }
372
  $price_range_suffix = self::$woocommerce_helper->getProductPriceSuffix($product);
373
  if ($min_original_price == $max_original_price) {
374
  $price_html = self::$woocommerce_helper->formatPrice($min_original_price) . $price_range_suffix;
393
  * @param $discounted_price
394
  * @param $format_price
395
  * @param $is_variable_product
396
+ * @param $initial_price_html
397
  * @return string
398
  */
399
+ function getStrikeoutPrice($original_price, $discounted_price, $format_price = true, $is_variable_product = false, $initial_price_html=false)
400
  {
401
  if ($original_price == $discounted_price) {
402
  if ($format_price) {
409
  $discounted_price = self::$woocommerce_helper->formatPrice($discounted_price);
410
  }
411
  $separator = ($is_variable_product) ? '<br>' : '&nbsp;';
412
+ if($initial_price_html){
413
+ $initial_price_html = preg_replace('/<del>.*<\/del>/', '', $initial_price_html);
414
+ $html = '<del>' . $initial_price_html . '</del>' . $separator . '<ins>' . $discounted_price . '</ins>';
415
+ }else{
416
+ $html = '<del>' . $original_price . '</del>' . $separator . '<ins>' . $discounted_price . '</ins>';
417
+ }
418
  }
419
  return apply_filters('advanced_woo_discount_rules_strikeout_price_html', $html, $original_price, $discounted_price);
420
  }
486
  if ($discounted_price <= 0) {
487
  $discounted_price = 0;
488
  }
489
+ $original_price_with_tax_call = $discounted_price_with_tax_call = 0;
490
+ if(!empty($original_price)){
491
+ $original_price_with_tax_call = $calculator->mayHaveTax($product_obj, $original_price);
492
+ }
493
+ if(!empty($discounted_price)){
494
+ $discounted_price_with_tax_call = $calculator->mayHaveTax($product_obj, $discounted_price);
495
+ }
496
  if (!empty($discounted_price)) {
497
  $calculate_product_price[] = $discounted_price * $last_applied;
498
  }
499
  $price_suffix = Woocommerce::getProductPriceSuffix($product_obj, $discounted_price);
500
+ $price_html .= '<del>' . self::$woocommerce_helper->formatPrice($original_price_with_tax_call) . '</del>&nbsp;<ins>' . self::$woocommerce_helper->formatPrice($discounted_price_with_tax_call) .$price_suffix. '&nbsp;x&nbsp;' . $last_applied . '</ins><br/>';
501
  //remove calculated set
502
  $min_applied_range_keys = array_keys($partially_qualified_sets, $min_applied_quantity);
503
  foreach ($min_applied_range_keys as $key) {
505
  }
506
  }
507
  }
508
+ $original_price_with_tax_call = $discounted_price_with_tax_call = 0;
509
  //get original price quantity
510
  if ($discount_operator === 'total_qty_in_cart') {
511
  $total_quantity = $current_product_quantity;
513
  $not_applied = (int)$total_quantity - (int)$total_applied;
514
 
515
  //calculate original price quantities discount.
516
+
517
  if (!empty($other_discounts)) {
518
  $discounted_price = $original_price - $other_discounts;
519
+ //$discounted_price = $calculator->mayHaveTax($product_obj, $discounted_price);
520
  if ($discounted_price < 0) {
521
  $discounted_price = 0;
522
  }
523
  $calculate_product_price[] = $discounted_price * $not_applied;
524
+ if(!empty($original_price)){
525
+ $original_price_with_tax_call = $calculator->mayHaveTax($product_obj, $original_price);
526
+ }
527
+ if(!empty($discounted_price)){
528
+ $discounted_price_with_tax_call = $calculator->mayHaveTax($product_obj, $discounted_price);
529
+ }
530
+ $price_suffix = Woocommerce::getProductPriceSuffix($product_obj, $discounted_price_with_tax_call);
531
+ $price_html .= '<del>' . self::$woocommerce_helper->formatPrice($original_price_with_tax_call) . '</del>&nbsp;<ins>' . self::$woocommerce_helper->formatPrice($discounted_price_with_tax_call) .$price_suffix. '&nbsp;x&nbsp;' . $not_applied . '</ins>';
532
  } else {
533
+ if(!empty($original_price)){
534
+ $original_price_with_tax_call = $calculator->mayHaveTax($product_obj, $original_price);
535
+ }
536
+ $price_suffix = Woocommerce::getProductPriceSuffix($product_obj, $original_price_with_tax_call);
537
  $calculate_product_price[] = $original_price * $not_applied;
538
+ $price_html .= '<ins>' . self::$woocommerce_helper->formatPrice($original_price_with_tax_call) .$price_suffix. '&nbsp;x&nbsp;' . $not_applied . '</ins>';
539
  }
540
  if ($return_html) {
541
  return apply_filters('advanced_woo_discount_rules_strikeout_for_set_discount_price_html', $price_html, $original_price, $discounted_price, $total_discount, $other_discounts, $not_applied);
542
  } else {
543
  $total_product_price = array_sum($calculate_product_price);
544
  $single_product_price = $total_product_price / $total_quantity;
 
545
  return $single_product_price;
546
  }
547
  }
558
  $combine_all_discounts = self::$config->getConfig('combine_all_cart_discounts', 0);
559
  $total_combined_discounts = 0;
560
  $apply_as_cart_fee_details = DiscountCalculator::$price_discount_apply_as_cart_discount;
 
561
  $flat_in_subtotal = array();
562
  if(!empty($apply_as_cart_fee_details)){
563
  foreach ($apply_as_cart_fee_details as $rule_id => $product_id){
604
  self::$woocommerce_helper->addCartFee($cart, apply_filters('advanced_woo_discount_rules_additional_fee_label', $label, $cart), apply_filters('advanced_woo_discount_rules_additional_fee_value', $total_combined_discounts, $cart));
605
  }
606
  }
607
+ DiscountCalculator::$price_discount_apply_as_cart_discount = array();
608
  }
609
 
610
  /**
724
  * */
725
  function removeThirdPartyCouponIfRequired($calculated_cart_item_discount, $processed_rule){
726
  if($processed_rule === true){
727
+ add_action('woocommerce_after_calculate_totals', array($this, 'removeThirdPartyCoupon'), 20);
728
+ }
729
+ }
730
+
731
+ /**
732
+ * Remove third party coupon if exists
733
+ * */
734
+ function removeThirdPartyCoupon(){
735
+ $disable_coupon_when_rule_applied = self::$config->getConfig('disable_coupon_when_rule_applied', 'run_both');//run_both, disable_coupon, disable_rules
736
+ if($disable_coupon_when_rule_applied == 'disable_coupon'){
737
+ $used_coupons = DiscountCalculator::getUsedCoupons();
738
+ $applied_coupons = Woocommerce::getAppliedCoupons();
739
+
740
+ if(!empty($applied_coupons) && is_array($applied_coupons)){
741
+ if(!empty($used_coupons)){
742
+ $used_coupons = array_map('\Wdr\App\Helpers\Woocommerce::formatStringToLower', $used_coupons);
743
+ }
744
+ foreach ($applied_coupons as $applied_coupon){
745
+ if(empty($used_coupons) || !in_array($applied_coupon, $used_coupons)){
746
+ $this->removeAppliedCoupon($applied_coupon);
747
+ }
748
+ }
749
+ }
750
+ }
751
+ }
752
+
753
+ /**
754
+ * Remove applied message for the coupon we are going to remove
755
+ * */
756
+ function removeAppliedMessageOfThirdPartyCoupon($msg, $msg_code, $coupon){
757
+ if(!empty($coupon)){
758
  $disable_coupon_when_rule_applied = self::$config->getConfig('disable_coupon_when_rule_applied', 'run_both');//run_both, disable_coupon, disable_rules
759
  if($disable_coupon_when_rule_applied == 'disable_coupon'){
760
  $used_coupons = DiscountCalculator::getUsedCoupons();
766
  }
767
  foreach ($applied_coupons as $applied_coupon){
768
  if(empty($used_coupons) || !in_array($applied_coupon, $used_coupons)){
769
+ $msg = '';
770
  }
771
  }
772
  }
773
  }
774
  }
775
+ return $msg;
776
  }
777
 
778
  /**
787
 
788
  //Remove message: Coupon code applied successfully.
789
  $this->removeCouponAppliedMessage();
790
+ Woocommerce::remove_coupon($coupon_code);
791
+ Woocommerce::wc_add_notice( $msg, 'notice' );
 
 
 
 
 
 
 
 
792
  }
793
 
794
  /**
805
  *
806
  * @return boolean
807
  * */
808
+ function doApplyDiscount($cart_object){
809
  $run_rule = true;
810
  $disable_coupon_when_rule_applied = self::$config->getConfig('disable_coupon_when_rule_applied', 'run_both');//run_both, disable_coupon, disable_rules
811
  if($disable_coupon_when_rule_applied == 'disable_rules'){
815
  }
816
  }
817
 
818
+ return apply_filters('advanced_woo_discount_rules_run_discount_rules', $run_rule, $cart_object);
819
  }
820
 
821
  /**
826
  function applyCartProductDiscount($cart_object)
827
  {
828
  remove_action('woocommerce_cart_calculate_fees', array($this, 'applyCartDiscount'));
829
+ Helper::clearPromotionMessages();
830
+ $do_apply_discount = $this->doApplyDiscount($cart_object);
831
  if($do_apply_discount){
832
  $this->calculateCartPageDiscounts();
833
  $processed_rule = false;
846
  $product_obj = isset($cart_item['data']) ? $cart_item['data'] : $cart_item;
847
  $item_quantity = isset($cart_item['quantity']) ? $cart_item['quantity'] : 0;
848
  //product price
849
+ $initial_price = self::$calculated_cart_item_discount[$key]['initial_price'];
850
+ $discounted_price = self::$calculated_cart_item_discount[$key]['discounted_price'];
851
  $calculator = self::$calculator;
852
  $total_discounts = $calculator::$total_discounts;
853
  //get discount details per product
854
+ $discount_details = (isset($total_discounts[$key])) ? $total_discounts[$key] : array();
855
  $item_price = $this->getSetDiscountItemPriceHtml($discount_details, $initial_price, $discounted_price, $product_obj, $price_html = false, $item_quantity);
856
  if ($item_price) {
857
  $price = $item_price;
858
+ $saved_amount = (($initial_price-$item_price)*$item_quantity);
859
+ self::$calculated_cart_item_discount[$key]['saved_amount'] = $saved_amount;
860
+ self::$calculated_cart_item_discount[$key]['saved_amount_with_tax'] = $calculator->mayHaveTax($product_obj, $saved_amount);
861
  } else {
862
  $price = self::$calculated_cart_item_discount[$key]['discounted_price'];
863
  }
864
  $price = apply_filters('advanced_woo_discount_rules_discounted_price_of_cart_item', $price, $cart_item, $cart_object, self::$calculated_cart_item_discount[$key]);
 
865
  self::$woocommerce_helper->setCartProductPrice($product_obj, $price);
866
 
867
  }
982
  $total_discount_details = isset($discount['total_discount_details']) ? $discount['total_discount_details'] : array();
983
  $cart_discount_details = isset($discount['cart_discount_details']) ? $discount['cart_discount_details'] : array();
984
  if (!empty($total_discount_details)) {
985
+ $save_order_item_discounts_array = isset($total_discount_details[$product_id])? $total_discount_details[$product_id]: array();
986
  } else {
987
  $save_order_item_discounts_array = $cart_discount_details;
988
  }
1102
  {
1103
  $original_price_html = $item_price;
1104
  if (isset(self::$calculated_cart_item_discount[$cart_item_key])) {
1105
+ $discounted_price = self::$calculated_cart_item_discount[$cart_item_key]['discounted_price'];
1106
+ //$discounted_price = self::$calculator->mayHaveTax($product_obj, $discounted_price);
1107
+
1108
  $show_strikeout_on_cart = self::$config->getConfig('show_strikeout_on_cart', 1);
1109
  if (!empty($show_strikeout_on_cart)) {
1110
  $product_obj = isset($cart_item['data']) ? $cart_item['data'] : $cart_item;
1111
  $cart_item_qty = isset($cart_item['quantity']) ? $cart_item['quantity'] : 0;
1112
  $product_id = self::$woocommerce_helper->getProductId($product_obj);
1113
  //product price
1114
+ $initial_price = self::$calculated_cart_item_discount[$cart_item_key]['initial_price'];
1115
+ // $initial_price = self::$calculator->mayHaveTax($product_obj, $initial_price);
1116
  $calculator = self::$calculator;
1117
  $total_discounts = $calculator::$total_discounts;
1118
  //get discount details per product
1119
+ $discount_details = (isset($total_discounts[$cart_item_key])) ? $total_discounts[$cart_item_key] : array();
1120
  $price = $this->getSetDiscountItemPriceHtml($discount_details, $initial_price, $discounted_price, $product_obj, $price_html = true, $cart_item_qty);
1121
  if ($price) {
1122
  $item_price = $price;
1123
  } else {
1124
+ $initial_price_with_tax_call = $discounted_price_with_tax_call = 0;
1125
+ if(!empty($initial_price)){
1126
+ $initial_price_with_tax_call = $calculator->mayHaveTax($product_obj, $initial_price);
1127
+ }
1128
+ if(!empty($discounted_price)){
1129
+ $discounted_price_with_tax_call = $calculator->mayHaveTax($product_obj, $discounted_price);
1130
+ }
1131
+ $item_price = $this->getStrikeoutPrice($initial_price_with_tax_call, $discounted_price_with_tax_call);
1132
  }
1133
  } else {
1134
  $item_price = self::$woocommerce_helper->formatPrice($discounted_price);
1179
  */
1180
  function getDiscountPerItem($discount_details)
1181
  {
1182
+ if(isset($discount_details['saved_amount_with_tax'])){
1183
+ if ($discount_details['saved_amount_with_tax'] > 0) {
1184
+ return $discount_details['saved_amount_with_tax'];
1185
+ }
1186
+ }
1187
  $discounted_price = isset($discount_details['discounted_price_with_tax']) ? $discount_details['discounted_price_with_tax'] : 0;
1188
  $initial_price = isset($discount_details['initial_price_with_tax']) ? $discount_details['initial_price_with_tax'] : 0;
1189
  $cart_quantity = isset($discount_details['cart_quantity']) ? $discount_details['cart_quantity'] : 0;
1269
  function getSetDiscountItemPriceHtml($discount_details, $initial_price, $discounted_price, $product_obj, $price_html, $cart_item_qty=0, $ajax_price = false)
1270
  {
1271
  if (is_array($discount_details) && !empty($discount_details)) {
1272
+ $calculator = self::$calculator;
1273
  $other_discounts = $total_discount_price = $total_quantity = $current_product_quantity = $discount_operator = 0;
1274
  $partially_qualified_set = array();
1275
  $partially_qualified_set_amount_duplicate = array();
1363
  }
1364
  $other_discounts += $simple_discount + $bulk_discounts + $fully_qualified_set + $bogo_cheapest_full_matched_set;
1365
  }
1366
+ $initial_price_with_tax_call = $discounted_price_with_tax_call = 0;
1367
  if (empty($partially_qualified_set) || $apply_full_set == true) {
1368
  if ($price_html) {
1369
  if($ajax_price){
1371
  if($discounted_price < 0){
1372
  $discounted_price = 0;
1373
  }
1374
+
1375
+ if(!empty($initial_price)){
1376
+ $initial_price_with_tax_call = $calculator->mayHaveTax($product_obj, $initial_price);
1377
+ }
1378
+ if(!empty($discounted_price)){
1379
+ $discounted_price_with_tax_call = $calculator->mayHaveTax($product_obj, $discounted_price);
1380
+ }
1381
+ $item_price = $this->getStrikeoutPrice($initial_price_with_tax_call, $discounted_price_with_tax_call);
1382
+ return $item_price.Woocommerce::getProductPriceSuffix($product_obj, $discounted_price_with_tax_call);
1383
+ }
1384
+ if(!empty($initial_price)){
1385
+ $initial_price_with_tax_call = $calculator->mayHaveTax($product_obj, $initial_price);
1386
+ }
1387
+ if(!empty($discounted_price)){
1388
+ $discounted_price_with_tax_call = $calculator->mayHaveTax($product_obj, $discounted_price);
1389
  }
1390
+ $item_price = $this->getStrikeoutPrice($initial_price_with_tax_call, $discounted_price_with_tax_call);
1391
+
1392
+ return $item_price.Woocommerce::getProductPriceSuffix($product_obj, $discounted_price_with_tax_call);
1393
  } else {
1394
  return false;
1395
  }
1411
  * @param string $get_only
1412
  * @return bool
1413
  */
1414
+ static function calculateProductDiscountPrice($price, $product, $quantity = 1, $custom_price = 0, $get_only = 'discounted_price', $manual_request = false)
1415
  {
1416
  if (!is_a($product, 'WC_Product')) {
1417
  if (is_integer($product)) {
1423
  if (!$product) {
1424
  return false;
1425
  }
1426
+ $discounts = self::$calculator->mayApplyPriceDiscount($product, $quantity, $custom_price, false, array(), true, $manual_request);
1427
  if ($discounts) {
1428
  switch ($get_only) {
1429
  case 'all':
1675
  }
1676
  return $coupon_html;
1677
  }
1678
+
1679
+ /**
1680
+ * Display promotional messages
1681
+ * */
1682
+ public function displayPromotionMessages(){
1683
+ $messages = Helper::getPromotionMessages();
1684
+ if(!empty($messages) && is_array($messages)){
1685
+ foreach ($messages as $message){
1686
+ wc_print_notice($message, "notice");
1687
+ }
1688
+ }
1689
+ }
1690
+
1691
+ /**
1692
+ * Load outer div for displaying promotional message in check out
1693
+ * */
1694
+ public function displaySubTotalPromotionMessagesInCheckoutContainer(){
1695
+ echo "<div id='awdr_checkout_subtotal_promotion_messages'>";
1696
+ echo "</div>";
1697
+ }
1698
+
1699
+ /**
1700
+ * Display promotional message in check out while processing order review
1701
+ * */
1702
+ public function displaySubTotalPromotionMessagesInCheckout(){
1703
+ echo "<div id='awdr_checkout_subtotal_promotion_messages_data'>";
1704
+ $this->displayPromotionMessages();
1705
+ echo "</div>";
1706
+ echo "<script>";
1707
+ echo "jQuery('#awdr_checkout_subtotal_promotion_messages').html(jQuery('#awdr_checkout_subtotal_promotion_messages_data').html());jQuery('#awdr_checkout_subtotal_promotion_messages_data').remove()";
1708
+ echo "</script>";
1709
+ }
1710
  }
v2/App/Helpers/Filter.php CHANGED
@@ -188,6 +188,7 @@ class Filter
188
  }
189
  }
190
  }
 
191
  foreach ($attrs as $taxonomy => $value) {
192
  if ($value) {
193
  $term_obj = get_term_by('slug', $value, $taxonomy);
@@ -195,7 +196,6 @@ class Filter
195
  $attr_ids = array_merge($attr_ids, (array)($term_obj->term_id));
196
  }
197
  } else {
198
- $product_variation = Woocommerce::getProduct(Woocommerce::getProductParentId($product));
199
  $attrs_variation = Woocommerce::getProductAttributes($product_variation);
200
  foreach ($attrs_variation as $attr) {
201
  if ($taxonomy == Woocommerce::getAttributeName($attr))
@@ -203,6 +203,26 @@ class Filter
203
  }
204
  }
205
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
206
  } else {
207
  foreach ($attrs as $attr) {
208
  $attr_ids = array_merge($attr_ids, Woocommerce::getAttributeOption($attr));
188
  }
189
  }
190
  }
191
+ $product_variation = Woocommerce::getProduct(Woocommerce::getProductParentId($product));
192
  foreach ($attrs as $taxonomy => $value) {
193
  if ($value) {
194
  $term_obj = get_term_by('slug', $value, $taxonomy);
196
  $attr_ids = array_merge($attr_ids, (array)($term_obj->term_id));
197
  }
198
  } else {
 
199
  $attrs_variation = Woocommerce::getProductAttributes($product_variation);
200
  foreach ($attrs_variation as $attr) {
201
  if ($taxonomy == Woocommerce::getAttributeName($attr))
203
  }
204
  }
205
  }
206
+ if(!empty($product_variation)){
207
+ $attributes_parent = Woocommerce::getProductAttributes($product_variation);
208
+ foreach ($attributes_parent as $attributes){
209
+ if(!empty($attributes) && is_object($attributes)){
210
+ $variation = Woocommerce::getAttributeVariation($attributes);
211
+ if(!(int)$variation){
212
+ $options = Woocommerce::getAttributeOption($attributes);
213
+
214
+ if(!empty($options) && is_array($options)){
215
+ $attr_ids = array_merge($attr_ids, $options);
216
+ }
217
+ }
218
+ } else {
219
+ $options = Woocommerce::getAttributeOption($attributes);
220
+ if(!empty($options) && is_array($options)){
221
+ $attr_ids = array_merge($attr_ids, $options);
222
+ }
223
+ }
224
+ }
225
+ }
226
  } else {
227
  foreach ($attrs as $attr) {
228
  $attr_ids = array_merge($attr_ids, Woocommerce::getAttributeOption($attr));
v2/App/Helpers/Helper.php CHANGED
@@ -108,4 +108,36 @@ class Helper
108
  public static function isCartItemConsideredForCalculation($status, $cart_item, $type){
109
  return apply_filters('advanced_woo_discount_rules_include_cart_item_to_count_quantity', $status, $cart_item, $type);
110
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  }
108
  public static function isCartItemConsideredForCalculation($status, $cart_item, $type){
109
  return apply_filters('advanced_woo_discount_rules_include_cart_item_to_count_quantity', $status, $cart_item, $type);
110
  }
111
+
112
+ /**
113
+ * Set messages
114
+ * */
115
+ public static function setPromotionMessage($message, $rule_id = ''){
116
+ $messages = Woocommerce::getSession('awdr_promotion_messages', array());
117
+ if(!is_array($messages)) $messages = array();
118
+ if(!empty($messages) && in_array($message, $messages)){
119
+ } else {
120
+ if(empty($rule_id)){
121
+ $messages[] = $message;
122
+ } else {
123
+ $messages[$rule_id] = $message;
124
+ }
125
+ }
126
+
127
+ Woocommerce::setSession('awdr_promotion_messages', $messages);
128
+ }
129
+
130
+ /**
131
+ * Get promotion messages
132
+ * */
133
+ public static function getPromotionMessages(){
134
+ return Woocommerce::getSession('awdr_promotion_messages', array());
135
+ }
136
+
137
+ /**
138
+ * Clear promotion messages
139
+ * */
140
+ public static function clearPromotionMessages(){
141
+ Woocommerce::setSession('awdr_promotion_messages', array());
142
+ }
143
  }
v2/App/Helpers/Input.php CHANGED
@@ -922,6 +922,77 @@ class Input
922
  return preg_replace('/\s+/s', '', $matches[1]) . $matches[2];
923
  }
924
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
925
  /**
926
  * Sanitize Naughty HTML
927
  * @param $matches
922
  return preg_replace('/\s+/s', '', $matches[1]) . $matches[2];
923
  }
924
 
925
+ /**
926
+ * JS Link Removal
927
+ *
928
+ * Callback function for xss_clean() to sanitize links
929
+ * This limits the PCRE backtracks, making it more performance friendly
930
+ * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in
931
+ * PHP 5.2+ on link-heavy strings
932
+ *
933
+ * @param array
934
+ * @return string
935
+ */
936
+ protected function _js_link_removal($match)
937
+ {
938
+ return str_replace(
939
+ $match[1],
940
+ preg_replace(
941
+ '#href=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|<script|<xss|data\s*:)#si',
942
+ '',
943
+ $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1]))
944
+ ),
945
+ $match[0]
946
+ );
947
+ }
948
+
949
+ /**
950
+ * JS Image Removal
951
+ *
952
+ * Callback function for xss_clean() to sanitize image tags
953
+ * This limits the PCRE backtracks, making it more performance friendly
954
+ * and prevents PREG_BACKTRACK_LIMIT_ERROR from being triggered in
955
+ * PHP 5.2+ on image tag heavy strings
956
+ *
957
+ * @param array
958
+ * @return string
959
+ */
960
+ protected function _js_img_removal($match)
961
+ {
962
+ return str_replace(
963
+ $match[1],
964
+ preg_replace(
965
+ '#src=.*?(alert\(|alert&\#40;|javascript\:|livescript\:|mocha\:|charset\=|window\.|document\.|\.cookie|<script|<xss|base64\s*,)#si',
966
+ '',
967
+ $this->_filter_attributes(str_replace(array('<', '>'), '', $match[1]))
968
+ ),
969
+ $match[0]
970
+ );
971
+ }
972
+
973
+ /**
974
+ * Filter Attributes
975
+ *
976
+ * Filters tag attributes for consistency and safety
977
+ *
978
+ * @param string
979
+ * @return string
980
+ */
981
+ protected function _filter_attributes($str)
982
+ {
983
+ $out = '';
984
+
985
+ if (preg_match_all('#\s*[a-z\-]+\s*=\s*(\042|\047)([^\\1]*?)\\1#is', $str, $matches))
986
+ {
987
+ foreach ($matches[0] as $match)
988
+ {
989
+ $out .= preg_replace("#/\*.*?\*/#s", '', $match);
990
+ }
991
+ }
992
+
993
+ return $out;
994
+ }
995
+
996
  /**
997
  * Sanitize Naughty HTML
998
  * @param $matches
v2/App/Helpers/Migration.php CHANGED
@@ -545,6 +545,12 @@ class Migration
545
  'value' => $discount_rule_condition->subtotal_least,
546
  'calculate_from' => 'from_filter',
547
  );
 
 
 
 
 
 
548
  $has_condition = true;
549
  }
550
  if(isset($discount_rule_condition->item_count_least)){
545
  'value' => $discount_rule_condition->subtotal_least,
546
  'calculate_from' => 'from_filter',
547
  );
548
+ if(isset($rule->promotion_subtotal_from) && isset($rule->promotion_message)){
549
+ $promotion_subtotal_from = $this->getData($rule->promotion_subtotal_from);
550
+ $promotion_message = $rule->promotion_message;
551
+ $option["subtotal_promotion_from"] = $promotion_subtotal_from;
552
+ $option["subtotal_promotion_message"] = $promotion_message;
553
+ }
554
  $has_condition = true;
555
  }
556
  if(isset($discount_rule_condition->item_count_least)){
v2/App/Helpers/ProOptions.php CHANGED
@@ -334,7 +334,7 @@ class ProOptions
334
  $adjustment_type['wdr_set_discount'] = array(
335
  'class' => '',
336
  'enable' => false,
337
- 'label' => __('Set Discount - PRO -', WDR_TEXT_DOMAIN),
338
  'group' => __('Bulk Discount', WDR_TEXT_DOMAIN),
339
  );
340
  }
334
  $adjustment_type['wdr_set_discount'] = array(
335
  'class' => '',
336
  'enable' => false,
337
+ 'label' => __('Bundle (Set) Discount - PRO -', WDR_TEXT_DOMAIN),
338
  'group' => __('Bulk Discount', WDR_TEXT_DOMAIN),
339
  );
340
  }
v2/App/Helpers/Rule.php CHANGED
@@ -97,6 +97,50 @@ class Rule
97
  return false;
98
  }
99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
100
  /**
101
  * get all rules and set object
102
  * @param $available_conditions array
@@ -357,19 +401,16 @@ class Rule
357
  }
358
  if($user_role_passed || $user_list_passed){
359
  if($filter_passed_user_role || $filter_passed_user_list){
360
- return $filter_passed;
361
- }else{
362
- return false;
363
  }
364
  }
365
- if(!$user_role_passed && !$user_list_passed){
366
- return $filter_passed;
367
- }
368
  }
369
- return $filter_passed;
370
  } else {
371
- return true;
372
  }
 
 
373
  }
374
 
375
  /**
@@ -556,7 +597,7 @@ class Rule
556
  * @param $cart_item
557
  * @return int
558
  */
559
- function calculateDiscount($product_price, $quantity, $product, $ajax_price, $cart_item = array(), $price_display_condition, $is_cart=true)
560
  {
561
  $product_id = self::$woocommerce_helper->getProductId($product);
562
  self::$simple_discounts[$product_id] = 0;
@@ -564,7 +605,7 @@ class Rule
564
  self::$set_discounts[$product_id] = 0;
565
  $product_discount = 0;
566
  if ($this->hasProductDiscount()) {
567
- $product_discount = $this->calculateProductDiscount($product_price, $product, $product_id, $price_display_condition, $is_cart);
568
  self::$simple_discounts[$product_id] = $product_discount;
569
  }
570
  if ($this->hasCartDiscount()) {
@@ -572,7 +613,7 @@ class Rule
572
  }
573
  $product_bulk_discount = 0;
574
  if ($this->hasBulkDiscount()) {
575
- $product_bulk_discount = $this->calculateProductBulkDiscount($product_price, $quantity, $product, $price_display_condition, $is_cart);
576
  self::$bulk_discounts[$product_id] = $product_bulk_discount;
577
  }
578
  $rule = $this;
@@ -617,14 +658,20 @@ class Rule
617
  * @param $is_cart
618
  * @return float|int
619
  */
620
- function calculateProductDiscount($price, $product, $product_id, $price_display_condition, $is_cart)
621
  {
622
- $quantity = $cart_quantity = 0;
 
 
 
623
  $cart_items = self::$woocommerce_helper->getCart();
624
  $discount = $this->getProductAdjustments();
625
  if($discount){
626
  if(($price_display_condition == "show_when_matched" && !$is_cart) || ($price_display_condition == "show_dynamically" && !$is_cart)){
627
- $quantity = 1;
 
 
 
628
  }else if($price_display_condition == "show_after_matched" || $is_cart){
629
  if(!empty($cart_items)){
630
  foreach ($cart_items as $cart_item){
@@ -642,7 +689,11 @@ class Rule
642
  }
643
  }
644
  }
645
- $quantity = $cart_quantity;
 
 
 
 
646
  }
647
  }
648
 
@@ -664,13 +715,13 @@ class Rule
664
  * @param $is_cart
665
  * @return float|int
666
  */
667
- function calculateProductBulkDiscount($price, $quantity, $product, $price_display_condition, $is_cart)
668
  {
669
  if ($bulk_discount_data = $this->getBulkAdjustments()) {
670
  if (!isset($bulk_discount_data->ranges) || !isset($bulk_discount_data->operator) || empty($bulk_discount_data->ranges)) {
671
  return 0;
672
  }
673
- return $this->getMatchedBulkDiscount($product, $price, $bulk_discount_data->operator, $bulk_discount_data->ranges, $quantity, $bulk_discount_data, $price_display_condition, $is_cart);
674
  } else {
675
  return 0;
676
  }
@@ -688,16 +739,20 @@ class Rule
688
  * @param $is_cart
689
  * @return float|int
690
  */
691
- function getMatchedBulkDiscount( $product, $price, $operator, $ranges, $quantity, $bulk_discount_data, $price_display_condition, $is_cart)
692
  {
693
  if (empty($ranges)) {
694
  return 0;
695
  }
696
  $cart_items = self::$woocommerce_helper->getCart();
697
  if($price_display_condition == "show_when_matched" && !$is_cart){
698
- $quantity = 1;
 
 
699
  }else if($price_display_condition == "show_after_matched" || $is_cart){
700
- $quantity = 0;
 
 
701
  }
702
  switch ($operator) {
703
  case 'product_cumulative':
@@ -1134,6 +1189,13 @@ class Rule
1134
  */
1135
  function save($post)
1136
  {
 
 
 
 
 
 
 
1137
  $rule_id = $this->getFromArray($post, 'edit_rule', NULL);
1138
  $title = $this->getFromArray($post, 'title', esc_html__('Untitled Rule', WDR_TEXT_DOMAIN));
1139
  $enabled = $this->getFromArray($post, 'enabled', '0');
@@ -1211,6 +1273,7 @@ class Rule
1211
  if(!empty($awdr_coupon_names)){
1212
  $awdr_coupon_names = array_unique($awdr_coupon_names);
1213
  }
 
1214
  $arg = array(
1215
  'title' => (empty($title)) ? esc_html__('Untitled Rule', WDR_TEXT_DOMAIN) : $title,
1216
  'enabled' => $enabled,
@@ -1232,8 +1295,19 @@ class Rule
1232
  'discount_type' => $discount_type,
1233
  'used_coupons' => json_encode($awdr_coupon_names),
1234
  );
 
 
 
 
 
 
 
 
 
 
 
1235
  $arg = apply_filters( 'advanced_woo_discount_rules_before_save_rule_column', $arg, $rule_id, $post);
1236
- $column_format = array('%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s');
1237
  $rule_id = DBTable::saveRule($column_format, $arg, $rule_id);
1238
  if($rule_id){
1239
  OnSaleShortCode::updateOnsaleRebuildPageStatus($rule_id);
97
  return false;
98
  }
99
 
100
+ /**
101
+ * Get rule created by
102
+ * @return bool || Type
103
+ */
104
+ function getRuleCreatedBy(){
105
+ if (isset($this->rule->created_by)) {
106
+ return $this->rule->created_by;
107
+ }
108
+ return false;
109
+ }
110
+
111
+ /**
112
+ * Get rule created by
113
+ * @return bool || Type
114
+ */
115
+ function getRuleCreatedOn(){
116
+ if (isset($this->rule->created_on)) {
117
+ return $this->rule->created_on;
118
+ }
119
+ return false;
120
+ }
121
+
122
+ /**
123
+ * Get rule created by
124
+ * @return bool || Type
125
+ */
126
+ function getRuleModifiedBy(){
127
+ if (isset($this->rule->modified_by)) {
128
+ return $this->rule->modified_by;
129
+ }
130
+ return false;
131
+ }
132
+
133
+ /**
134
+ * Get rule created by
135
+ * @return bool || Type
136
+ */
137
+ function getRuleModifiedOn(){
138
+ if (isset($this->rule->modified_on)) {
139
+ return $this->rule->modified_on;
140
+ }
141
+ return false;
142
+ }
143
+
144
  /**
145
  * get all rules and set object
146
  * @param $available_conditions array
401
  }
402
  if($user_role_passed || $user_list_passed){
403
  if($filter_passed_user_role || $filter_passed_user_list){
404
+ } else {
405
+ $filter_passed = false;
 
406
  }
407
  }
 
 
 
408
  }
 
409
  } else {
410
+ $filter_passed = false;
411
  }
412
+ $rule = $this;
413
+ return apply_filters('advanced_woo_discount_rules_filter_passed', $filter_passed, $rule, $product);
414
  }
415
 
416
  /**
597
  * @param $cart_item
598
  * @return int
599
  */
600
+ function calculateDiscount($product_price, $quantity, $product, $ajax_price, $cart_item = array(), $price_display_condition, $is_cart=true, $manual_request = false)
601
  {
602
  $product_id = self::$woocommerce_helper->getProductId($product);
603
  self::$simple_discounts[$product_id] = 0;
605
  self::$set_discounts[$product_id] = 0;
606
  $product_discount = 0;
607
  if ($this->hasProductDiscount()) {
608
+ $product_discount = $this->calculateProductDiscount($product_price, $quantity, $product, $product_id, $price_display_condition, $is_cart, $manual_request);
609
  self::$simple_discounts[$product_id] = $product_discount;
610
  }
611
  if ($this->hasCartDiscount()) {
613
  }
614
  $product_bulk_discount = 0;
615
  if ($this->hasBulkDiscount()) {
616
+ $product_bulk_discount = $this->calculateProductBulkDiscount($product_price, $quantity, $product, $price_display_condition, $is_cart, $manual_request);
617
  self::$bulk_discounts[$product_id] = $product_bulk_discount;
618
  }
619
  $rule = $this;
658
  * @param $is_cart
659
  * @return float|int
660
  */
661
+ function calculateProductDiscount($price, $quantity, $product, $product_id, $price_display_condition, $is_cart, $manual_request = false)
662
  {
663
+ $cart_quantity = 0;
664
+ if($manual_request === false){
665
+ $quantity = 0;
666
+ }
667
  $cart_items = self::$woocommerce_helper->getCart();
668
  $discount = $this->getProductAdjustments();
669
  if($discount){
670
  if(($price_display_condition == "show_when_matched" && !$is_cart) || ($price_display_condition == "show_dynamically" && !$is_cart)){
671
+ if($manual_request === false){
672
+ $quantity = 1;
673
+ }
674
+
675
  }else if($price_display_condition == "show_after_matched" || $is_cart){
676
  if(!empty($cart_items)){
677
  foreach ($cart_items as $cart_item){
689
  }
690
  }
691
  }
692
+ if($manual_request === true){
693
+ $quantity += $cart_quantity;
694
+ } else {
695
+ $quantity = $cart_quantity;
696
+ }
697
  }
698
  }
699
 
715
  * @param $is_cart
716
  * @return float|int
717
  */
718
+ function calculateProductBulkDiscount($price, $quantity, $product, $price_display_condition, $is_cart, $manual_request = false)
719
  {
720
  if ($bulk_discount_data = $this->getBulkAdjustments()) {
721
  if (!isset($bulk_discount_data->ranges) || !isset($bulk_discount_data->operator) || empty($bulk_discount_data->ranges)) {
722
  return 0;
723
  }
724
+ return $this->getMatchedBulkDiscount($product, $price, $bulk_discount_data->operator, $bulk_discount_data->ranges, $quantity, $bulk_discount_data, $price_display_condition, $is_cart, $manual_request);
725
  } else {
726
  return 0;
727
  }
739
  * @param $is_cart
740
  * @return float|int
741
  */
742
+ function getMatchedBulkDiscount( $product, $price, $operator, $ranges, $quantity, $bulk_discount_data, $price_display_condition, $is_cart, $manual_request = false)
743
  {
744
  if (empty($ranges)) {
745
  return 0;
746
  }
747
  $cart_items = self::$woocommerce_helper->getCart();
748
  if($price_display_condition == "show_when_matched" && !$is_cart){
749
+ if(!$manual_request){
750
+ $quantity = 1;
751
+ }
752
  }else if($price_display_condition == "show_after_matched" || $is_cart){
753
+ if(!$manual_request){
754
+ $quantity = 0;
755
+ }
756
  }
757
  switch ($operator) {
758
  case 'product_cumulative':
1189
  */
1190
  function save($post)
1191
  {
1192
+ //$current_time = current_time('mysql', true);
1193
+ $current_date_time = '';
1194
+ if (function_exists('current_time')) {
1195
+ $current_time = current_time('timestamp');
1196
+ $current_date_time = date('Y-m-d H:i:s', $current_time);
1197
+ }
1198
+ $current_user = get_current_user_id();
1199
  $rule_id = $this->getFromArray($post, 'edit_rule', NULL);
1200
  $title = $this->getFromArray($post, 'title', esc_html__('Untitled Rule', WDR_TEXT_DOMAIN));
1201
  $enabled = $this->getFromArray($post, 'enabled', '0');
1273
  if(!empty($awdr_coupon_names)){
1274
  $awdr_coupon_names = array_unique($awdr_coupon_names);
1275
  }
1276
+ $current_time = current_time('mysql', true);
1277
  $arg = array(
1278
  'title' => (empty($title)) ? esc_html__('Untitled Rule', WDR_TEXT_DOMAIN) : $title,
1279
  'enabled' => $enabled,
1295
  'discount_type' => $discount_type,
1296
  'used_coupons' => json_encode($awdr_coupon_names),
1297
  );
1298
+ if (!is_null($rule_id) && !empty($rule_id)) {
1299
+ $arg['modified_by'] = $current_user;
1300
+ $arg['modified_on'] = $current_date_time;
1301
+ $column_format = array('%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%s');
1302
+ }else{
1303
+ $arg['created_by'] = $current_user;
1304
+ $arg['created_on'] = $current_date_time;
1305
+ $arg['modified_by'] = $current_user;
1306
+ $arg['modified_on'] = $current_date_time;
1307
+ $column_format = array('%s', '%d', '%d', '%d', '%d', '%d', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%d', '%s', '%d', '%s');
1308
+ }
1309
  $arg = apply_filters( 'advanced_woo_discount_rules_before_save_rule_column', $arg, $rule_id, $post);
1310
+
1311
  $rule_id = DBTable::saveRule($column_format, $arg, $rule_id);
1312
  if($rule_id){
1313
  OnSaleShortCode::updateOnsaleRebuildPageStatus($rule_id);
v2/App/Helpers/Woocommerce.php CHANGED
@@ -323,6 +323,19 @@ class Woocommerce
323
  return array();
324
  }
325
 
 
 
 
 
 
 
 
 
 
 
 
 
 
326
  /**
327
  * Get product custom taxonomy
328
  * @return array|null
@@ -576,7 +589,7 @@ class Woocommerce
576
  public static function wc_add_notice($message, $type = 'success', $data = array())
577
  {
578
  if (function_exists('wc_add_notice')) {
579
- wc_add_notice( $message, $type. $data);
580
  }
581
  }
582
 
@@ -689,7 +702,21 @@ class Woocommerce
689
  static function addCartFee($cart, $name, $fee)
690
  {
691
  if (method_exists($cart, 'add_fee')) {
692
- return $cart->add_fee($name, $fee);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
693
  }
694
  return array();
695
  }
323
  return array();
324
  }
325
 
326
+ /**
327
+ * Get attribute Option
328
+ * @param $attribute
329
+ * @return array
330
+ */
331
+ static function getAttributeVariation($attribute)
332
+ {
333
+ if (method_exists($attribute, 'get_variation')) {
334
+ return $attribute->get_variation();
335
+ }
336
+ return true;
337
+ }
338
+
339
  /**
340
  * Get product custom taxonomy
341
  * @return array|null
589
  public static function wc_add_notice($message, $type = 'success', $data = array())
590
  {
591
  if (function_exists('wc_add_notice')) {
592
+ wc_add_notice( $message, $type, $data);
593
  }
594
  }
595
 
702
  static function addCartFee($cart, $name, $fee)
703
  {
704
  if (method_exists($cart, 'add_fee')) {
705
+ if(apply_filters('advanced_discount_rules_do_add_fee', true, $cart)){
706
+ if(!apply_filters('advanced_discount_rules_calculate_tax_with_fee', false, $name, $cart)){
707
+ add_filter('woocommerce_cart_totals_get_fees_from_cart_taxes', function ($fee_taxes, $fee, $cart) use ($name) {
708
+ if(isset($fee->object->name)){
709
+ if($fee->object->name == $name) {
710
+ $fee_taxes = array();
711
+ }
712
+ }
713
+
714
+ return $fee_taxes;
715
+ }, 10, 3);
716
+ }
717
+ $fee = apply_filters('advanced_discount_rules_discount_fee_amount', $fee, $name, $cart);
718
+ return $cart->add_fee($name, $fee);
719
+ }
720
  }
721
  return array();
722
  }
v2/App/Models/DBTable.php CHANGED
@@ -67,6 +67,10 @@ class DBTable
67
  `advanced_discount_message` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
68
  `discount_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
69
  `used_coupons` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
 
 
 
 
70
  PRIMARY KEY (`id`)
71
  ) $charset_collate;";
72
  $order_discount_table_name = $wpdb->prefix . self::ORDER_DISCOUNT_TABLE_NAME;
@@ -257,38 +261,6 @@ class DBTable
257
  return $row_id;
258
  }
259
 
260
- /**
261
- * @param $from
262
- * @param $to
263
- * @param $option
264
- * @return array|object|null|bool
265
- */
266
- /*static function getRulesByPeriod($from, $to, $option='basic')
267
- {
268
- global $wpdb;
269
- $rules_table_name = $wpdb->prefix.self::RULES_TABLE_NAME;
270
- $order_item_discount_table_name = $wpdb->prefix.self::ORDER_ITEM_DISCOUNT_TABLE_NAME;
271
- $result = false;
272
- if(empty($from) || empty($to)){
273
- return $result;
274
- }
275
- switch ($option) {
276
- case 'all':
277
- break;
278
- case 'simple':
279
- break;
280
- case 'bulk':
281
- break;
282
- case 'set':
283
- break;
284
- default:
285
- case 'basic':
286
- $query = "SELECT discount_table.order_id, discount_table.rule_id, discount_table.created_at, SUM(discount_table.quantity * discount_table.discount) as amount , rules.title FROM {$order_item_discount_table_name} as discount_table INNER JOIN {$rules_table_name} as rules ON discount_table.rule_id=rules.id WHERE (discount_table.created_at BETWEEN {$from} AND {$to}) GROUP BY discount_table.rule_id,discount_table.order_id ORDER BY discount_table.id ASC";
287
- $result = $wpdb->get_results($query, OBJECT);
288
- break;
289
- }
290
- return $result;
291
- }*/
292
 
293
  /**
294
  * @param $params
@@ -311,25 +283,14 @@ class DBTable
311
  return false;
312
  }
313
 
314
-
315
-
316
  $summary_components = array();
317
- if ( $params['include_gifted_qty'] ) {
318
- $summary_components[] = 'rules_stats.gifted_qty';
319
- } else {
320
- if ( $params['include_amount'] ) {
321
- $summary_components[] = 'rules_stats.discount';
322
- }
323
- if ( $params['include_cart_discount'] ) {
324
- $summary_components[] = 'rules_stats.cart_discount';
325
- }
326
- if ( $params['include_shipping'] ) {
327
- $summary_components[] = 'rules_stats.shipping';
328
- }
329
- if ( $params['include_gifted_amount'] ) {
330
- $summary_components[] = 'rules_stats.gifted_amount';
331
- }
332
  }
 
 
 
 
333
  if ( empty( $summary_components ) ) {
334
  return false;
335
  }
@@ -372,4 +333,78 @@ class DBTable
372
 
373
  return $rows;
374
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
375
  }
67
  `advanced_discount_message` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
68
  `discount_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
69
  `used_coupons` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
70
+ `created_by` int(11) DEFAULT NULL,
71
+ `created_on` datetime DEFAULT NULL,
72
+ `modified_by` int(11) DEFAULT NULL,
73
+ `modified_on` datetime DEFAULT NULL,
74
  PRIMARY KEY (`id`)
75
  ) $charset_collate;";
76
  $order_discount_table_name = $wpdb->prefix . self::ORDER_DISCOUNT_TABLE_NAME;
261
  return $row_id;
262
  }
263
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
264
 
265
  /**
266
  * @param $params
283
  return false;
284
  }
285
 
 
 
286
  $summary_components = array();
287
+ if ( $params['include_amount'] ) {
288
+ $summary_components[] = 'rules_stats.discount';
 
 
 
 
 
 
 
 
 
 
 
 
 
289
  }
290
+ if ( $params['include_cart_discount'] ) {
291
+ $summary_components[] = 'rules_stats.cart_discount';
292
+ }
293
+
294
  if ( empty( $summary_components ) ) {
295
  return false;
296
  }
333
 
334
  return $rows;
335
  }
336
+
337
+ /**
338
+ * update new table structure
339
+ */
340
+ function updateDBTables(){
341
+ global $wpdb;
342
+ if (is_multisite()) {
343
+ // get ids of all sites
344
+ $blog_table = $wpdb->blogs;
345
+ $blog_ids = $wpdb->get_col("SELECT blog_id FROM {$blog_table}");
346
+ foreach ($blog_ids as $blog_id) {
347
+ switch_to_blog($blog_id);
348
+ // create tables for each site
349
+ $this->updateTable();
350
+ restore_current_blog();
351
+ }
352
+ } else {
353
+ // activated on a single site
354
+ $this->updateTable();
355
+ }
356
+ }
357
+
358
+ /**
359
+ * Create new coloumns
360
+ * https://code.tutsplus.com/tutorials/custom-database-tables-maintaining-the-database--wp-28455
361
+ */
362
+ public function updateTable(){
363
+ //Version of currently activated plugin
364
+ $current_version = '1.9.9';
365
+ //Database version - this may need upgrading.
366
+ $installed_version = get_option('awdr_activity_log_version');
367
+ if( $installed_version != $current_version ){
368
+ global $wpdb;
369
+ require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
370
+ $charset_collate = $wpdb->get_charset_collate();
371
+ $rules_table_name = $wpdb->prefix . self::RULES_TABLE_NAME;
372
+ $rules_table_query = "CREATE TABLE $rules_table_name (
373
+ `id` int(11) NOT NULL AUTO_INCREMENT,
374
+ `enabled` tinyint(1) DEFAULT '1',
375
+ `deleted` tinyint(1) DEFAULT '0',
376
+ `exclusive` tinyint(1) DEFAULT '0',
377
+ `title` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
378
+ `priority` int(11) DEFAULT NULL,
379
+ `apply_to` text COLLATE utf8mb4_unicode_ci,
380
+ `filters` text COLLATE utf8mb4_unicode_ci NOT NULL,
381
+ `conditions` text COLLATE utf8mb4_unicode_ci,
382
+ `product_adjustments` text COLLATE utf8mb4_unicode_ci,
383
+ `cart_adjustments` text COLLATE utf8mb4_unicode_ci,
384
+ `buy_x_get_x_adjustments` text COLLATE utf8mb4_unicode_ci,
385
+ `buy_x_get_y_adjustments` text COLLATE utf8mb4_unicode_ci,
386
+ `bulk_adjustments` text COLLATE utf8mb4_unicode_ci NOT NULL,
387
+ `set_adjustments` text COLLATE utf8mb4_unicode_ci NOT NULL,
388
+ `other_discounts` text COLLATE utf8mb4_unicode_ci,
389
+ `date_from` int(11) DEFAULT NULL,
390
+ `date_to` int(11) DEFAULT NULL,
391
+ `usage_limits` int(11) DEFAULT NULL,
392
+ `rule_language` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
393
+ `used_limits` int(11) DEFAULT NULL,
394
+ `additional` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
395
+ `max_discount_sum` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
396
+ `advanced_discount_message` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
397
+ `discount_type` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
398
+ `used_coupons` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
399
+ `created_by` int(11) DEFAULT NULL,
400
+ `created_on` datetime DEFAULT NULL,
401
+ `modified_by` int(11) DEFAULT NULL,
402
+ `modified_on` datetime DEFAULT NULL,
403
+ PRIMARY KEY (`id`)
404
+ ) $charset_collate;";
405
+ dbDelta($rules_table_query);
406
+
407
+ update_option('awdr_activity_log_version', $current_version);
408
+ }
409
+ }
410
  }
v2/App/Router.php CHANGED
@@ -41,6 +41,7 @@ class Router
41
  //admin ajax requests
42
  add_action('wp_ajax_wdr_ajax', array(self::$ajax_requests, 'wdr_ajax_requests'));
43
  add_action('wp_ajax_awdr_get_product_discount', array(self::$ajax_requests, 'awdr_get_discount_of_a_product'));
 
44
  // All hooks needed for Admin
45
  if (is_admin() || wp_doing_ajax()) {
46
  add_action('admin_menu', array(self::$admin, 'AddMenu'));
@@ -59,7 +60,7 @@ class Router
59
  */
60
  $manage_discount_class = self::$manage_discount = (!empty(self::$manage_discount)) ? self::$manage_discount : new ManageDiscount();
61
  add_filter('advanced_woo_discount_rules_get_product_discount_price', array(self::$manage_discount, 'calculateProductDiscountPrice'), 100, 3);
62
- add_filter('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', array(self::$manage_discount, 'calculateProductDiscountPrice'), 100, 5);
63
  //Showing you saved text
64
  $display_saving_text = $manage_discount_class::$config->getConfig('display_saving_text', 'disabled');
65
  add_action('woocommerce_checkout_create_order_line_item', array(self::$manage_discount, 'onCreateWoocommerceOrderLineItem'), 10, 4);
@@ -76,6 +77,24 @@ class Router
76
  add_action('woocommerce_get_formatted_order_total', array(self::$manage_discount, 'displayTotalSavingsInOrderAfterOrderTotal'), 10,2);
77
  }
78
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  /**
80
  * All hooks needed for front End
81
  */
@@ -94,6 +113,8 @@ class Router
94
  add_filter('woocommerce_get_price_html', array(self::$manage_discount, 'getPriceHtmlSalePriceAdjustment'), 9, 2);
95
  add_filter('woocommerce_variable_price_html', array(self::$manage_discount, 'getVariablePriceHtml'), 100, 2);
96
 
 
 
97
  //Show on sale badge
98
  $show_on_sale_badge = $manage_discount_class::$config->getConfig('show_on_sale_badge', 'disabled');
99
  if (in_array($show_on_sale_badge, array('when_condition_matches', 'at_least_has_any_rules'))) {
41
  //admin ajax requests
42
  add_action('wp_ajax_wdr_ajax', array(self::$ajax_requests, 'wdr_ajax_requests'));
43
  add_action('wp_ajax_awdr_get_product_discount', array(self::$ajax_requests, 'awdr_get_discount_of_a_product'));
44
+ add_action('wp_ajax_nopriv_awdr_get_product_discount', array(self::$ajax_requests, 'awdr_get_discount_of_a_product'));
45
  // All hooks needed for Admin
46
  if (is_admin() || wp_doing_ajax()) {
47
  add_action('admin_menu', array(self::$admin, 'AddMenu'));
60
  */
61
  $manage_discount_class = self::$manage_discount = (!empty(self::$manage_discount)) ? self::$manage_discount : new ManageDiscount();
62
  add_filter('advanced_woo_discount_rules_get_product_discount_price', array(self::$manage_discount, 'calculateProductDiscountPrice'), 100, 3);
63
+ add_filter('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', array(self::$manage_discount, 'calculateProductDiscountPrice'), 100, 6);
64
  //Showing you saved text
65
  $display_saving_text = $manage_discount_class::$config->getConfig('display_saving_text', 'disabled');
66
  add_action('woocommerce_checkout_create_order_line_item', array(self::$manage_discount, 'onCreateWoocommerceOrderLineItem'), 10, 4);
77
  add_action('woocommerce_get_formatted_order_total', array(self::$manage_discount, 'displayTotalSavingsInOrderAfterOrderTotal'), 10,2);
78
  }
79
  }
80
+
81
+ $show_promo_message = $manage_discount_class::$config->getConfig('show_promo_text', '');
82
+ if(!empty($show_promo_message) && is_array($show_promo_message)){
83
+ if(in_array('shop_page', $show_promo_message)){
84
+ add_action('woocommerce_before_shop_loop', array(self::$manage_discount, 'displayPromotionMessages'), 10);
85
+ }
86
+ if(in_array('product_page', $show_promo_message)){
87
+ add_action('woocommerce_before_single_product', array(self::$manage_discount, 'displayPromotionMessages'), 10);
88
+ }
89
+ if(in_array('cart_page', $show_promo_message)){
90
+ add_action('woocommerce_before_cart', array(self::$manage_discount, 'displayPromotionMessages'), 10);
91
+ }
92
+ if(in_array('checkout_page', $show_promo_message)){
93
+ add_action('woocommerce_before_checkout_form', array(self::$manage_discount, 'displaySubTotalPromotionMessagesInCheckoutContainer'), 10);
94
+ add_action('woocommerce_review_order_before_cart_contents', array(self::$manage_discount, 'displaySubTotalPromotionMessagesInCheckout'), 10);
95
+ }
96
+ }
97
+
98
  /**
99
  * All hooks needed for front End
100
  */
113
  add_filter('woocommerce_get_price_html', array(self::$manage_discount, 'getPriceHtmlSalePriceAdjustment'), 9, 2);
114
  add_filter('woocommerce_variable_price_html', array(self::$manage_discount, 'getVariablePriceHtml'), 100, 2);
115
 
116
+ add_filter('woocommerce_coupon_message', array(self::$manage_discount, 'removeAppliedMessageOfThirdPartyCoupon'), 10, 3);
117
+
118
  //Show on sale badge
119
  $show_on_sale_badge = $manage_discount_class::$config->getConfig('show_on_sale_badge', 'disabled');
120
  if (in_array($show_on_sale_badge, array('when_condition_matches', 'at_least_has_any_rules'))) {
v2/App/Views/Admin/Rules/Conditions/Cart/LineItemCount.php CHANGED
@@ -18,7 +18,7 @@ echo ($render_saved_condition == true) ? '' : '<div class="cart_line_items_count
18
  </div>
19
 
20
  <div class="cart-subtotal-value wdr-input-filed-hight">
21
- <input name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][value]" type="text" class="number_only_field awdr-left-align"
22
  value="<?php echo (isset($options->value)) ? $options->value : '' ?>" placeholder="<?php _e('1', WDR_TEXT_DOMAIN);?>">
23
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Line item count', WDR_TEXT_DOMAIN); ?></span>
24
  </div>
18
  </div>
19
 
20
  <div class="cart-subtotal-value wdr-input-filed-hight">
21
+ <input name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][value]" type="text" class="float_only_field awdr-left-align"
22
  value="<?php echo (isset($options->value)) ? $options->value : '' ?>" placeholder="<?php _e('1', WDR_TEXT_DOMAIN);?>">
23
  <span class="wdr_desc_text awdr-clear-both"><?php _e('Line item count', WDR_TEXT_DOMAIN); ?></span>
24
  </div>
v2/App/Views/Admin/Rules/Conditions/Cart/Subtotal.php CHANGED
@@ -9,7 +9,7 @@ echo ($render_saved_condition == true) ? '' : '<div class="cart_subtotal">';
9
  <div class="wdr_cart_subtotal_group wdr-condition-type-options">
10
  <div class="wdr_cart_subtotal_group">
11
  <div class="cart-subtotal-methods wdr-select-filed-hight">
12
- <select name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][operator]" class="awdr-left-align">
13
  <option value="less_than" <?php echo ($operator == "less_than") ? "selected" : ""; ?>><?php _e('Less than ( &lt; )', WDR_TEXT_DOMAIN) ?></option>
14
  <option value="less_than_or_equal" <?php echo ($operator == "less_than_or_equal") ? "selected" : ""; ?>><?php _e('Less than or equal ( &lt;= )', WDR_TEXT_DOMAIN) ?></option>
15
  <option value="greater_than_or_equal" <?php echo ($operator == "greater_than_or_equal") ? "selected" : ""; ?>><?php _e('Greater than or equal ( &gt;= )', WDR_TEXT_DOMAIN) ?></option>
9
  <div class="wdr_cart_subtotal_group wdr-condition-type-options">
10
  <div class="wdr_cart_subtotal_group">
11
  <div class="cart-subtotal-methods wdr-select-filed-hight">
12
+ <select name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][operator]" class="awdr-left-align subtotal_operator">
13
  <option value="less_than" <?php echo ($operator == "less_than") ? "selected" : ""; ?>><?php _e('Less than ( &lt; )', WDR_TEXT_DOMAIN) ?></option>
14
  <option value="less_than_or_equal" <?php echo ($operator == "less_than_or_equal") ? "selected" : ""; ?>><?php _e('Less than or equal ( &lt;= )', WDR_TEXT_DOMAIN) ?></option>
15
  <option value="greater_than_or_equal" <?php echo ($operator == "greater_than_or_equal") ? "selected" : ""; ?>><?php _e('Greater than or equal ( &gt;= )', WDR_TEXT_DOMAIN) ?></option>
v2/App/Views/Admin/Rules/Conditions/Main.php CHANGED
@@ -13,7 +13,7 @@ if (!defined('ABSPATH')) {
13
  if ($conditions = $rule->getConditions()) {
14
  $condition_relationship = $rule->getRelationship('condition', 'and');
15
  $wdr_product_conditions = $base->getProductConditionsTypes();?>
16
- <!--Product Condition Start-->
17
  <div class="wdr-condition-template">
18
  <div class="wdr-block">
19
  <div class="wdr-conditions-relationship">
@@ -31,6 +31,7 @@ if (!defined('ABSPATH')) {
31
  $render_saved_condition = false;
32
  foreach ($conditions as $condition) {
33
  $type = isset($condition->type) ? $condition->type : NULL;
 
34
  if (!empty($type) && isset($rule->available_conditions[$type]['object'])) {
35
  $template = $rule->available_conditions[$type]['template'];
36
  $extra_params = isset($rule->available_conditions[$type]['extra_params']) ? $rule->available_conditions[$type]['extra_params'] : array();
@@ -73,13 +74,23 @@ if (!defined('ABSPATH')) {
73
  extract($extra_params);
74
  $render_saved_condition = true;
75
  include $template;
76
- $i++;
77
  ?>
78
  <div class="wdr-btn-remove" style="float: left">
79
  <span class="dashicons dashicons-no-alt remove-current-row"></span>
80
  </div>
81
- </div>
82
- <?php
 
 
 
 
 
 
 
 
 
 
83
  }
84
  }
85
  } ?>
@@ -117,10 +128,9 @@ if (!defined('ABSPATH')) {
117
  <div class="wdr-block">
118
  <div class="wdr-conditions-relationship">
119
  <label><b><?php _e('Rule Limits', WDR_TEXT_DOMAIN); ?></b>
120
- <span class="awdr-rule-limit-timestamp">
121
- <?php
122
- if(!empty($current_time)) echo sprintf(esc_html__('Current date and time: %s', WDR_TEXT_DOMAIN), '<b>' . date('Y-m-d H:i', $current_time) . '</b>'); ?>
123
- </span>
124
  </label>
125
 
126
  </div>
13
  if ($conditions = $rule->getConditions()) {
14
  $condition_relationship = $rule->getRelationship('condition', 'and');
15
  $wdr_product_conditions = $base->getProductConditionsTypes();?>
16
+ <!--Product Condition Start promo_show_hide_-->
17
  <div class="wdr-condition-template">
18
  <div class="wdr-block">
19
  <div class="wdr-conditions-relationship">
31
  $render_saved_condition = false;
32
  foreach ($conditions as $condition) {
33
  $type = isset($condition->type) ? $condition->type : NULL;
34
+ //echo "<pre>"; print_r($type); echo "</pre>"; die;
35
  if (!empty($type) && isset($rule->available_conditions[$type]['object'])) {
36
  $template = $rule->available_conditions[$type]['template'];
37
  $extra_params = isset($rule->available_conditions[$type]['extra_params']) ? $rule->available_conditions[$type]['extra_params'] : array();
74
  extract($extra_params);
75
  $render_saved_condition = true;
76
  include $template;
77
+
78
  ?>
79
  <div class="wdr-btn-remove" style="float: left">
80
  <span class="dashicons dashicons-no-alt remove-current-row"></span>
81
  </div>
82
+ </div><?php
83
+ $config = new \Wdr\App\Controllers\Configuration();
84
+ $subtotal_promo = $config->getConfig("show_promo_text", '');
85
+ if($type == 'cart_subtotal' && !empty($subtotal_promo)){
86
+ $operator = isset($options->operator) ? $options->operator : 'less_than';?>
87
+ <div class="wdr-grid wdr-conditions-container wdr-condition-group <?php echo 'promo_show_hide_'.$i; ?>" data-index="<?php echo $i; ?>" style="<?php echo ($operator == 'greater_than_or_equal' || $operator == 'greater_than') ? '': 'display: none'; ?>">
88
+ <?php include(WDR_PLUGIN_PATH . 'App/Views/Admin/Rules/Others/SubtotalPromotion.php'); ?>
89
+ </div>
90
+ <?php
91
+
92
+ }
93
+ $i++;
94
  }
95
  }
96
  } ?>
128
  <div class="wdr-block">
129
  <div class="wdr-conditions-relationship">
130
  <label><b><?php _e('Rule Limits', WDR_TEXT_DOMAIN); ?></b>
131
+ <span class="awdr-rule-limit-timestamp"><?php
132
+ if(!empty($current_time)) echo sprintf(esc_html__('Current date and time: %s', WDR_TEXT_DOMAIN), '<b>' . date('Y-m-d H:i', $current_time) . '</b>'); ?>
133
+ </span>
 
134
  </label>
135
 
136
  </div>
v2/App/Views/Admin/Rules/Discounts/Bulk.php CHANGED
@@ -4,7 +4,7 @@ if (!defined('ABSPATH')) {
4
  }
5
  $is_pro = \Wdr\App\Helpers\Helper::hasPro();
6
  ?>
7
- <div class="wdr-discount-group" data-index="<?php echo $bulk_index; ?>">
8
  <div class="range_setter_inner">
9
  <div class="bulk-row-main">
10
  <div class="bulk-row-start wdr-input-filed-hight bulk-row-inner">
4
  }
5
  $is_pro = \Wdr\App\Helpers\Helper::hasPro();
6
  ?>
7
+ <div class="wdr-discount-group awdr-bulk-group" data-index="<?php echo $bulk_index; ?>">
8
  <div class="range_setter_inner">
9
  <div class="bulk-row-main">
10
  <div class="bulk-row-start wdr-input-filed-hight bulk-row-inner">
v2/App/Views/Admin/Rules/Discounts/Cart.php CHANGED
@@ -26,7 +26,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
26
  <div class="cart_discount_value wdr-input-filed-hight">
27
  <input name="cart_adjustments[value]"
28
  type="number"
29
- class="cart_discount_value awdr-left-align"
30
  value="<?php echo (isset($cart_adjustment->value)) ? $cart_adjustment->value : ''; ?>"
31
  placeholder="0.00" min="0" step="any"
32
  style="width: 100%;">
@@ -35,7 +35,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
35
  <div class="cart_discount_lable wdr-input-filed-hight">
36
  <input name="cart_adjustments[label]"
37
  type="text"
38
- class="cart_discount_value awdr-left-align"
39
  value="<?php echo (isset($cart_adjustment->label)) ? $cart_adjustment->label : ''; ?>"
40
  placeholder="<?php _e('Discount label', WDR_TEXT_DOMAIN); ?>"
41
  style="width: 100%;">
26
  <div class="cart_discount_value wdr-input-filed-hight">
27
  <input name="cart_adjustments[value]"
28
  type="number"
29
+ class="awdr_cart_discount_value awdr-left-align"
30
  value="<?php echo (isset($cart_adjustment->value)) ? $cart_adjustment->value : ''; ?>"
31
  placeholder="0.00" min="0" step="any"
32
  style="width: 100%;">
35
  <div class="cart_discount_lable wdr-input-filed-hight">
36
  <input name="cart_adjustments[label]"
37
  type="text"
38
+ class="awdr-left-align"
39
  value="<?php echo (isset($cart_adjustment->label)) ? $cart_adjustment->label : ''; ?>"
40
  placeholder="<?php _e('Discount label', WDR_TEXT_DOMAIN); ?>"
41
  style="width: 100%;">
v2/App/Views/Admin/Rules/Filters/Main.php CHANGED
@@ -58,13 +58,14 @@ if (!defined('ABSPATH')) {
58
  <div class="awdr-product-selector">
59
  <?php
60
  $placeholder = '';
 
61
  if (!empty($filter->value) && is_array($filter->value)) {
62
  $item_name = '';
63
- $selected_options = '';
64
  foreach ($filter->value as $option) {
65
  switch ($filter->type) {
66
  case 'products':
67
- $item_name = get_the_title($option);
68
  $placeholder = 'Products';
69
  break;
70
  }
@@ -75,7 +76,7 @@ if (!defined('ABSPATH')) {
75
  }
76
  ?>
77
  <select multiple
78
- class="edit-filters"
79
  data-list="<?php echo $filter->type; ?>"
80
  data-field="autocomplete"
81
  data-placeholder="<?php _e('Select ' . $placeholder, WDR_TEXT_DOMAIN); ?>"
58
  <div class="awdr-product-selector">
59
  <?php
60
  $placeholder = '';
61
+ $selected_options = '';
62
  if (!empty($filter->value) && is_array($filter->value)) {
63
  $item_name = '';
64
+
65
  foreach ($filter->value as $option) {
66
  switch ($filter->type) {
67
  case 'products':
68
+ $item_name = '#'.$option.' '.get_the_title($option);
69
  $placeholder = 'Products';
70
  break;
71
  }
76
  }
77
  ?>
78
  <select multiple
79
+ class="edit-filters awdr_validation"
80
  data-list="<?php echo $filter->type; ?>"
81
  data-field="autocomplete"
82
  data-placeholder="<?php _e('Select ' . $placeholder, WDR_TEXT_DOMAIN); ?>"
v2/App/Views/Admin/Rules/Filters/Products.php CHANGED
@@ -14,6 +14,7 @@ if (!defined('ABSPATH')) {
14
  </div>
15
  <div class="awdr-product-selector">
16
  <select multiple="" name="filters[{i}][value][]"
 
17
  data-placeholder="<?php _e('Select Products', WDR_TEXT_DOMAIN);?>"
18
  data-list="products"
19
  data-field="autocomplete"
14
  </div>
15
  <div class="awdr-product-selector">
16
  <select multiple="" name="filters[{i}][value][]"
17
+ class="awdr_validation"
18
  data-placeholder="<?php _e('Select Products', WDR_TEXT_DOMAIN);?>"
19
  data-list="products"
20
  data-field="autocomplete"
v2/App/Views/Admin/Rules/Manage.php CHANGED
@@ -42,7 +42,7 @@
42
  <div class="wdr-enable-rule">
43
  <div class="wdr-field-title" style="width: 45%">
44
  <input class="wdr-title" type="text" name="title" placeholder="Rule Title"
45
- value="<?php echo esc_attr($rule->getTitle()); ?>">
46
  </div>
47
  <div class="page__toggle">
48
  <label class="toggle">
@@ -86,6 +86,7 @@
86
  $rule_discount_type = $rule->getRuleDiscountType();
87
  ?>
88
  <div class="wdr-discount-type">
 
89
  <select name="discount_type" class="awdr-product-discount-type wdr-discount-type-selector"
90
  data-placement="wdr-discount-template-placement">
91
  <optgroup label="">
@@ -227,7 +228,7 @@
227
  foreach ($discount_types as $type => $discount_type) {
228
  (isset($discount_type['template']) && !empty($discount_type['template'])) ? include $discount_type['template'] : '';
229
  }
230
- include "Others/CommonTemplates.php"; ?>
231
  </div>
232
 
233
 
42
  <div class="wdr-enable-rule">
43
  <div class="wdr-field-title" style="width: 45%">
44
  <input class="wdr-title" type="text" name="title" placeholder="Rule Title"
45
+ value="<?php echo esc_attr($rule->getTitle()); ?>"><!--awdr-clear-both-->
46
  </div>
47
  <div class="page__toggle">
48
  <label class="toggle">
86
  $rule_discount_type = $rule->getRuleDiscountType();
87
  ?>
88
  <div class="wdr-discount-type">
89
+ <b style="display: block;"><?php _e('Choose a discount type', WDR_TEXT_DOMAIN); ?></b>
90
  <select name="discount_type" class="awdr-product-discount-type wdr-discount-type-selector"
91
  data-placement="wdr-discount-template-placement">
92
  <optgroup label="">
228
  foreach ($discount_types as $type => $discount_type) {
229
  (isset($discount_type['template']) && !empty($discount_type['template'])) ? include $discount_type['template'] : '';
230
  }
231
+ include "Others/CommonTemplates.php";?>
232
  </div>
233
 
234
 
v2/App/Views/Admin/Rules/Others/CommonTemplates.php CHANGED
@@ -92,5 +92,7 @@ if (!defined('ABSPATH')) {
92
  foreach ($wdr_product_conditions_templates as $wdr_conditions_template) {
93
  echo $wdr_conditions_template;
94
  }
95
- }?>
 
 
96
  </div>
92
  foreach ($wdr_product_conditions_templates as $wdr_conditions_template) {
93
  echo $wdr_conditions_template;
94
  }
95
+ }
96
+ $render_saved_condition = false;
97
+ include'SubtotalPromotion.php';?>
98
  </div>
v2/App/Views/Admin/Rules/Others/SubtotalPromotion.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) {
3
+ exit; // Exit if accessed directly
4
+ }
5
+
6
+ $operator = isset($options->operator) ? $options->operator : 'less_than';
7
+ $subtotal_promotion_from = isset($options->subtotal_promotion_from) ? $options->subtotal_promotion_from : false;
8
+ $subtotal_promotion_message = isset($options->subtotal_promotion_message) ? $options->subtotal_promotion_message : false;
9
+ echo ($render_saved_condition == true) ? '' : '<div class="wdr-subtotal-promo-messeage-main">';
10
+ ?>
11
+
12
+ <div class="wdr_subtotal_promotion_container" style="display: grid;">
13
+ <label style="padding-bottom: 20px;"><b><?php _e('Promotion Message', WDR_TEXT_DOMAIN); ?></b></label>
14
+ <div class="wdr_cart_subtotal_promo_from">
15
+ <label class="awdr-left-align wdr_subtotal_promo_filed_name" style="padding-right: 5px;"><?php _e('Subtotal from', WDR_TEXT_DOMAIN); ?></label>
16
+ <input name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][subtotal_promotion_from]"
17
+ type="text" class="float_only_field awdr-left-align"
18
+ value="<?php echo ($subtotal_promotion_from) ? $subtotal_promotion_from : '' ?>"
19
+ placeholder="<?php _e('0.00', WDR_TEXT_DOMAIN);?>"
20
+ min="0">
21
+ <span class="wdr_desc_text awdr-clear-both"><?php _e('Set a threshold from which you want to start showing promotion message', WDR_TEXT_DOMAIN); ?></span>
22
+ <span class="wdr_desc_text awdr-clear-both"><?php _e("<b>Example:</b> Let's say you offer a 10% discount for 1000 and above. you may want to set 900 here. So that the customer can see the promo text when his cart subtotal reaches 900", WDR_TEXT_DOMAIN); ?></span>
23
+ </div>
24
+ <div class="wdr_cart_subtotal_promo_msg">
25
+ <p class="wdr_subtotal_promo_filed_name"><?php _e('Message', WDR_TEXT_DOMAIN); ?></p>
26
+ <textarea
27
+ name="conditions[<?php echo (isset($i)) ? $i : '{i}' ?>][options][subtotal_promotion_message]"
28
+ style="height: 60px;"
29
+ placeholder="<?php _e('Spent {{difference_amount}} more and get 10% discount', WDR_TEXT_DOMAIN); ?>"><?php echo ($subtotal_promotion_message) ? $subtotal_promotion_message : ''; ?></textarea>
30
+ <span class="wdr_desc_text awdr-clear-both"><?php _e('{{difference_amount}} -> Difference amount to get discount', WDR_TEXT_DOMAIN); ?></span>
31
+ <span class="wdr_desc_text awdr-clear-both"><?php _e('<b>Eg:</b> Spent {{difference_amount}} more and get 10% discount', WDR_TEXT_DOMAIN); ?></span>
32
+ </div>
33
+ </div><?php
34
+ echo ($render_saved_condition == true) ? '' : '</div>'; ?>
35
+
v2/App/Views/Admin/Tabs/DiscountRule.php CHANGED
@@ -104,6 +104,8 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
104
  <span class="sorting-indicator"></span>
105
  </a>
106
  </th>
 
 
107
  <th scope="col" id="author"
108
  class="manage-column column-author"><?php _e('Start Date', WDR_TEXT_DOMAIN); ?></th>
109
  <th scope="col" id="tags"
@@ -147,6 +149,66 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
147
  <span class="awdr-exclusive-disable-listing"><?php _e('Exclusive', WDR_TEXT_DOMAIN); ?></span> <?php
148
  }?></a>
149
  </strong>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  </td>
151
  <td class="author column-author" data-colname="Author"><?php
152
  $get_start_date = $rule_row->getStartDate($timestamp = false, $format = "Y-m-d H:i");
@@ -213,7 +275,7 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
213
  }?>
214
  </span>
215
  </td>
216
- <td>
217
  <a class="btn btn-primary"
218
  href="<?php echo admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_row->getId()))); ?>">
219
  <?php _e('Edit', WDR_TEXT_DOMAIN); ?></a>
@@ -249,6 +311,8 @@ $is_pro = \Wdr\App\Helpers\Helper::hasPro();
249
  <span class="sorting-indicator"></span>
250
  </a>
251
  </th>
 
 
252
  <th scope="col" id="author"
253
  class="manage-column column-author"><?php _e('Start Date', WDR_TEXT_DOMAIN); ?></th>
254
  <th scope="col" id="tags"
104
  <span class="sorting-indicator"></span>
105
  </a>
106
  </th>
107
+ <th scope="col" id="author"
108
+ class="manage-column column-author"><?php _e('Discount Type', WDR_TEXT_DOMAIN); ?></th>
109
  <th scope="col" id="author"
110
  class="manage-column column-author"><?php _e('Start Date', WDR_TEXT_DOMAIN); ?></th>
111
  <th scope="col" id="tags"
149
  <span class="awdr-exclusive-disable-listing"><?php _e('Exclusive', WDR_TEXT_DOMAIN); ?></span> <?php
150
  }?></a>
151
  </strong>
152
+ <div class="awdr_created_date_html">
153
+ <?php
154
+ $created_by = $rule_row->getRuleCreatedBy();
155
+ if($created_by) {
156
+ if (function_exists('get_userdata')) {
157
+ if ($user = get_userdata($created_by)) {
158
+ if (isset($user->data->display_name)) {
159
+ $created_by = $user->data->display_name;
160
+ }
161
+ }
162
+ }
163
+ }
164
+ $created_on = $rule_row->getRuleCreatedOn();
165
+
166
+ $modified_by = $rule_row->getRuleModifiedBy();
167
+ if($modified_by) {
168
+ if (function_exists('get_userdata')) {
169
+ if ($user = get_userdata($modified_by)) {
170
+ if (isset($user->data->display_name)) {
171
+ $modified_by = $user->data->display_name;
172
+ }
173
+ }
174
+ }
175
+ }
176
+ $modified_on = $rule_row->getRuleModifiedOn();
177
+ if($created_by && !empty($created_by) && !empty($created_on)){ ?>
178
+ <span class="wdr_desc_text"><?php _e('Created by: ' .$created_by.'' , WDR_TEXT_DOMAIN);?>,<?php _e(' On: ' . $created_on , WDR_TEXT_DOMAIN); ?> &nbsp;</span><?php }
179
+ if($modified_by && !empty($modified_by) && !empty($modified_on)){?>
180
+ <span class="wdr_desc_text"><?php _e('Modified by: ' .$modified_by.'' , WDR_TEXT_DOMAIN);?>,<?php _e(' On: ' . $modified_on , WDR_TEXT_DOMAIN); ?> </span><?php
181
+ }?>
182
+ </div>
183
+ </td>
184
+ <td class="author column-author" data-colname="Author"><?php
185
+ $get_discount_type = $rule_row->getRuleDiscountType();
186
+ $discount_type_name = '-';
187
+ switch ($get_discount_type){
188
+ case'wdr_simple_discount':
189
+ $discount_type_name = __('Product Adjustment', WDR_TEXT_DOMAIN);
190
+ break;
191
+ case'wdr_cart_discount':
192
+ $discount_type_name = __('Cart Adjustment', WDR_TEXT_DOMAIN);
193
+ break;
194
+ case'wdr_free_shipping':
195
+ $discount_type_name = __('Free Shipping', WDR_TEXT_DOMAIN);
196
+ break;
197
+ case'wdr_bulk_discount':
198
+ $discount_type_name = __('Bulk Discount', WDR_TEXT_DOMAIN);
199
+ break;
200
+ case'wdr_set_discount':
201
+ $discount_type_name = __('Set Discount', WDR_TEXT_DOMAIN);
202
+ break;
203
+ case'wdr_buy_x_get_x_discount':
204
+ $discount_type_name = __('Buy X get X', WDR_TEXT_DOMAIN);
205
+ break;
206
+ case'wdr_buy_x_get_y_discount':
207
+ $discount_type_name = __('Buy X get Y', WDR_TEXT_DOMAIN);
208
+ break;
209
+ }
210
+ ?>
211
+ <abbr><?php echo $discount_type_name; ?></abbr>
212
  </td>
213
  <td class="author column-author" data-colname="Author"><?php
214
  $get_start_date = $rule_row->getStartDate($timestamp = false, $format = "Y-m-d H:i");
275
  }?>
276
  </span>
277
  </td>
278
+ <td class="awdr-rule-buttons">
279
  <a class="btn btn-primary"
280
  href="<?php echo admin_url("admin.php?" . http_build_query(array('page' => WDR_SLUG, 'tab' => 'rules', 'task' => 'view', 'id' => $rule_row->getId()))); ?>">
281
  <?php _e('Edit', WDR_TEXT_DOMAIN); ?></a>
311
  <span class="sorting-indicator"></span>
312
  </a>
313
  </th>
314
+ <th scope="col" id="author"
315
+ class="manage-column column-author"><?php _e('Discount Type', WDR_TEXT_DOMAIN); ?></th>
316
  <th scope="col" id="author"
317
  class="manage-column column-author"><?php _e('Start Date', WDR_TEXT_DOMAIN); ?></th>
318
  <th scope="col" id="tags"
v2/App/Views/Admin/Tabs/ImportExport.php CHANGED
@@ -31,7 +31,10 @@ function forceDownloadFile($filepath)
31
  if (isset($_POST['wdr-export'])) {
32
  $file_name = 'advanced-discount-rules-' . date("Y-m-d-h-i-a") . '.csv';
33
  if (!file_exists(WDR_PLUGIN_PATH . 'Export')) {
34
- mkdir(WDR_PLUGIN_PATH . 'Export', 0777, true);
 
 
 
35
  }
36
  $file_path = WDR_PLUGIN_PATH . 'Export/' . $file_name;
37
  $file = fopen($file_path, "w");
@@ -46,6 +49,9 @@ function forceDownloadFile($filepath)
46
  $rm_dir = WDR_PLUGIN_PATH . 'Export';
47
  if (forceDownloadFile($filepath)) {
48
  rmdir(WDR_PLUGIN_PATH . 'Export');
 
 
 
49
  }
50
  }
51
  ?>
31
  if (isset($_POST['wdr-export'])) {
32
  $file_name = 'advanced-discount-rules-' . date("Y-m-d-h-i-a") . '.csv';
33
  if (!file_exists(WDR_PLUGIN_PATH . 'Export')) {
34
+ if(!mkdir(WDR_PLUGIN_PATH . 'Export', 0777, true)){?>
35
+ <h4><?php _e('Oops!. Download failed!!', WDR_TEXT_DOMAIN);?></h4><?php
36
+ return false;
37
+ }
38
  }
39
  $file_path = WDR_PLUGIN_PATH . 'Export/' . $file_name;
40
  $file = fopen($file_path, "w");
49
  $rm_dir = WDR_PLUGIN_PATH . 'Export';
50
  if (forceDownloadFile($filepath)) {
51
  rmdir(WDR_PLUGIN_PATH . 'Export');
52
+ }else{?>
53
+ <h4><?php _e('Oops!. Download failed!!', WDR_TEXT_DOMAIN);?></h4><?php
54
+ return false;
55
  }
56
  }
57
  ?>
v2/App/Views/Admin/Tabs/settings.php CHANGED
@@ -295,6 +295,21 @@
295
  <h1><?php _e('Promotion', WDR_TEXT_DOMAIN); ?></h1>
296
  <table class="wdr-general-setting form-table">
297
  <tbody style="background-color: #fff;">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  <tr>
299
  <td scope="row">
300
  <label for="display_saving_text" class="awdr-left-align"><?php _e('Display you saved text', WDR_TEXT_DOMAIN) ?></label>
295
  <h1><?php _e('Promotion', WDR_TEXT_DOMAIN); ?></h1>
296
  <table class="wdr-general-setting form-table">
297
  <tbody style="background-color: #fff;">
298
+ <tr>
299
+ <td scope="row">
300
+ <label for="show_promo_text" class="awdr-left-align"><?php _e('Subtotal based promo text', WDR_TEXT_DOMAIN) ?></label>
301
+ <span class="wdr_settings_desc_text awdr-clear-both"><?php esc_attr_e('Subtotal based promo text (available only for subtotal based discounts) ', WDR_TEXT_DOMAIN); ?></span>
302
+ </td>
303
+ <td>
304
+ <?php $show_promo_text = $configuration->getConfig('show_promo_text', ''); ?>
305
+ <select name="show_promo_text[]" multiple class="edit-all-loaded-values" id="show_promo_text" data-placeholder="<?php esc_attr_e("Select the page to display promotion message", WDR_TEXT_DOMAIN);?>">
306
+ <option value="shop_page" <?php echo (!empty($show_promo_text) && is_array($show_promo_text) && in_array('shop_page', $show_promo_text)) ? 'selected' : ''; ?>><?php _e('Shop page', WDR_TEXT_DOMAIN); ?></option>
307
+ <option value="product_page" <?php echo (!empty($show_promo_text) && is_array($show_promo_text) && in_array('product_page', $show_promo_text)) ? 'selected' : ''; ?> ><?php _e('Product page', WDR_TEXT_DOMAIN); ?></option>
308
+ <option value="cart_page" <?php echo (!empty($show_promo_text) && is_array($show_promo_text) && in_array('cart_page', $show_promo_text)) ? 'selected' : ''; ?> ><?php _e('Cart page', WDR_TEXT_DOMAIN); ?></option>
309
+ <option value="checkout_page" <?php echo (!empty($show_promo_text) && is_array($show_promo_text) && in_array('checkout_page', $show_promo_text)) ? 'selected' : ''; ?> ><?php _e('Checkout page', WDR_TEXT_DOMAIN); ?></option>
310
+ </select>
311
+ </td>
312
+ </tr>
313
  <tr>
314
  <td scope="row">
315
  <label for="display_saving_text" class="awdr-left-align"><?php _e('Display you saved text', WDR_TEXT_DOMAIN) ?></label>
v2/Assets/Css/admin_style.css CHANGED
@@ -813,7 +813,8 @@ span#awdr_shortcode_text{
813
  }
814
  .wdr-discount-block-remove .remove-clicked-discount-block,
815
  .wdr-btn-remove .wdr_discount_remove,
816
- .wdr_filter_remove .remove-current-row{
 
817
  color: #fff;
818
  background-color: #d9534f;
819
  border-radius: 3px;
@@ -1226,7 +1227,7 @@ tr.awdr-listing-rule-tr td {
1226
  top: 0;
1227
  left: 0;
1228
  width: 100%;
1229
- height: 70%;
1230
  text-align: center;
1231
  }
1232
  .woo_discount_loader .lds-ripple {
@@ -1292,7 +1293,6 @@ tr.awdr-listing-rule-tr td {
1292
  }
1293
  fieldset{
1294
  border: 1px solid darkgray !important;
1295
- width: max-content;
1296
  float: left;
1297
  margin: 5px;
1298
  }
@@ -1321,6 +1321,11 @@ fieldset{
1321
 
1322
  div.wdr {
1323
  margin-top: 30px;
 
 
 
 
 
1324
  }
1325
  /*
1326
  ##Device = Most of the Smartphones Mobiles (Portrait)
@@ -1392,4 +1397,7 @@ div.wdr {
1392
  }
1393
  .awdr_rebuild_on_sale_list_con .select2-search{
1394
  width: 120%;
 
 
 
1395
  }
813
  }
814
  .wdr-discount-block-remove .remove-clicked-discount-block,
815
  .wdr-btn-remove .wdr_discount_remove,
816
+ .wdr_filter_remove .remove-current-row,
817
+ .wdr-condition-group .remove-current-row{
818
  color: #fff;
819
  background-color: #d9534f;
820
  border-radius: 3px;
1227
  top: 0;
1228
  left: 0;
1229
  width: 100%;
1230
+ height: 100%;
1231
  text-align: center;
1232
  }
1233
  .woo_discount_loader .lds-ripple {
1293
  }
1294
  fieldset{
1295
  border: 1px solid darkgray !important;
 
1296
  float: left;
1297
  margin: 5px;
1298
  }
1321
 
1322
  div.wdr {
1323
  margin-top: 30px;
1324
+ margin-right: 20px;
1325
+ }
1326
+ .awdr-common-save > button,
1327
+ .awdr-rule-buttons > a {
1328
+ margin-bottom: 2px;
1329
  }
1330
  /*
1331
  ##Device = Most of the Smartphones Mobiles (Portrait)
1397
  }
1398
  .awdr_rebuild_on_sale_list_con .select2-search{
1399
  width: 120%;
1400
+ }
1401
+ .wdr_subtotal_promo_filed_name {
1402
+ color: black;
1403
  }
v2/Assets/Js/admin_script.js CHANGED
@@ -107,6 +107,29 @@ jQuery(document).ready(function ($) {
107
  ruleAppendTo: ".wdr-condition-group-items",
108
  newIndex: last_index
109
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
  });
111
 
112
  /*Remove section*/
@@ -116,6 +139,13 @@ jQuery(document).ready(function ($) {
116
  parentsRow: ".wdr-conditions-container",
117
  thisObject: this,
118
  });
 
 
 
 
 
 
 
119
  }
120
  });
121
 
@@ -231,16 +261,6 @@ jQuery(document).ready(function ($) {
231
  $('.' + show_discount_content).show();
232
  });
233
 
234
- /*Hide input for Free shipping value*/
235
- $(document).on('change', '.cart_free_shipping', function () {
236
- var if_free_shipping = $(this).val();
237
- if (if_free_shipping == 'free_shipping') {
238
- $(this).parent().siblings('.cart_discount_value').hide();
239
- } else {
240
- $(this).parent().siblings('.cart_discount_value').show();
241
- }
242
- });
243
-
244
  function awdr_process_v1_to_v2_migration(){
245
  $.ajax({
246
  data: {method: 'do_v1_v2_migration', action: 'wdr_ajax'},
@@ -359,10 +379,17 @@ jQuery(document).ready(function ($) {
359
  * Duplicate Rule
360
  */
361
  $(document).on('click', '.wdr_duplicate_rule', function () {
 
362
  $.ajax({
363
  data: {rowid: $(this).data('duplicate-rule'), method: 'duplicate_rule', action: 'wdr_ajax'},
364
  type: 'post',
365
  url: ajaxurl,
 
 
 
 
 
 
366
  error: function (request, error) {
367
  notify(wdr_data.localization_data.error, 'error', alert_counter);
368
  },
@@ -383,10 +410,17 @@ jQuery(document).ready(function ($) {
383
  $(document).on('click', '.wdr_delete_rule', function () {
384
  var wdr_delete_rule_row = $(this).closest('tr');
385
  if (confirm(wdr_data.localization_data.delete_confirm)) {
 
386
  $.ajax({
387
  data: {rowid: $(this).data('delete-rule'), method: 'delete_rule', action: 'wdr_ajax'},
388
  type: 'post',
389
  url: ajaxurl,
 
 
 
 
 
 
390
  error: function (request, error) {
391
  notify(wdr_data.localization_data.error, 'error', alert_counter);
392
  },
@@ -415,6 +449,7 @@ jQuery(document).ready(function ($) {
415
  } else {
416
  change_status = 0;
417
  }
 
418
  $.ajax({
419
  data: {
420
  rowid: $(this).data('manage-status'),
@@ -424,6 +459,12 @@ jQuery(document).ready(function ($) {
424
  },
425
  type: 'post',
426
  url: ajaxurl,
 
 
 
 
 
 
427
  error: function (request, error) {
428
  notify(wdr_data.localization_data.error, 'error', alert_counter);
429
  },
@@ -691,7 +732,12 @@ jQuery(document).ready(function ($) {
691
  */
692
  $('#wdr-save-rule').submit(function (e) {
693
  e.preventDefault();
 
 
 
 
694
  let loader = $('.woo_discount_loader');
 
695
  $.ajax({
696
  data: $(this).serialize(),
697
  type: 'post',
@@ -715,7 +761,6 @@ jQuery(document).ready(function ($) {
715
  window.location.href = data.redirect;
716
  notify(wdr_data.localization_data.save_rule, 'success', alert_counter);
717
  } else if (data.coupon_message) {
718
- $(".wdr-btn-add-condition").trigger("click");
719
  $(".coupon_name_msg").css("border", "1px solid #FF0000").focus();
720
  notify(wdr_data.localization_data.coupon_exists, 'error', alert_counter);
721
  } else {
@@ -736,6 +781,824 @@ jQuery(document).ready(function ($) {
736
  $(".wdr_save_stay").click();
737
  });
738
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  /**
740
  * save default configuration settings
741
  */
@@ -745,17 +1608,17 @@ jQuery(document).ready(function ($) {
745
  $("#awdr_banner_editor-tmce").click();
746
  let awdr_banner_editer = $('#awdr_banner_editor').val();
747
  let values = $(this).serialize();
748
- //let loader = $('.woo_discount_loader');
749
  values += "&banner_content=" + awdr_banner_editer;
750
  $.ajax({
751
  data: values,
752
  type: 'post',
753
  url: ajaxurl,
754
  beforeSend: function() {
755
- //loader.show();
756
  },
757
  complete: function() {
758
- //loader.hide();
759
  },
760
  error: function (request, error) {
761
  notify(wdr_data.localization_data.error, 'error', alert_counter);
@@ -824,10 +1687,17 @@ jQuery(document).ready(function ($) {
824
  }else{
825
  return false;
826
  }
 
827
  $.ajax({
828
  data: $(this).serialize(),
829
  type: 'post',
830
  url: ajaxurl,
 
 
 
 
 
 
831
  error: function (request, error) {
832
  notify(wdr_data.localization_data.error, 'error', alert_counter);
833
  },
107
  ruleAppendTo: ".wdr-condition-group-items",
108
  newIndex: last_index
109
  });
110
+
111
+ if(wdr_data.enable_subtotal_promo_text != ''){
112
+ wdr_buildrule.wdr_clone_field({
113
+ addConditionType: 'empty-promo',
114
+ addFilterMethod: '.wdr-subtotal-promo-messeage-main',
115
+ addRemoveIcon: '.wdr-icon-remove',
116
+ ruleAppendTo: ".wdr-condition-group-items",
117
+ newIndex: last_index
118
+ });
119
+ }
120
+ });
121
+
122
+ $(document).on('change', '.subtotal_operator', function () {
123
+ // alert($(this).val());
124
+ if(wdr_data.enable_subtotal_promo_text != '') {
125
+ let subtotal_operator = $(this).val();
126
+ let current_promo_index = $(this).parents('.wdr-conditions-container').attr("data-index");
127
+ if (subtotal_operator == 'greater_than_or_equal' || subtotal_operator == 'greater_than') {
128
+ $('.promo_show_hide_' + current_promo_index).show();
129
+ } else {
130
+ $('.promo_show_hide_' + current_promo_index).hide();
131
+ }
132
+ }
133
  });
134
 
135
  /*Remove section*/
139
  parentsRow: ".wdr-conditions-container",
140
  thisObject: this,
141
  });
142
+ if(wdr_data.enable_subtotal_promo_text != '') {
143
+ let condition_type = $(this).parent('.wdr-btn-remove').siblings('.wdr-condition-type').find('.wdr-product-condition-type').val();
144
+ if (condition_type == 'cart_subtotal') {
145
+ let promo_index = $(this).parents('.wdr-conditions-container').attr("data-index");
146
+ $('.promo_show_hide_' + promo_index).remove();
147
+ }
148
+ }
149
  }
150
  });
151
 
261
  $('.' + show_discount_content).show();
262
  });
263
 
 
 
 
 
 
 
 
 
 
 
264
  function awdr_process_v1_to_v2_migration(){
265
  $.ajax({
266
  data: {method: 'do_v1_v2_migration', action: 'wdr_ajax'},
379
  * Duplicate Rule
380
  */
381
  $(document).on('click', '.wdr_duplicate_rule', function () {
382
+ let loader = $('.woo_discount_loader');
383
  $.ajax({
384
  data: {rowid: $(this).data('duplicate-rule'), method: 'duplicate_rule', action: 'wdr_ajax'},
385
  type: 'post',
386
  url: ajaxurl,
387
+ beforeSend: function() {
388
+ loader.show();
389
+ },
390
+ complete: function() {
391
+ loader.hide();
392
+ },
393
  error: function (request, error) {
394
  notify(wdr_data.localization_data.error, 'error', alert_counter);
395
  },
410
  $(document).on('click', '.wdr_delete_rule', function () {
411
  var wdr_delete_rule_row = $(this).closest('tr');
412
  if (confirm(wdr_data.localization_data.delete_confirm)) {
413
+ let loader = $('.woo_discount_loader');
414
  $.ajax({
415
  data: {rowid: $(this).data('delete-rule'), method: 'delete_rule', action: 'wdr_ajax'},
416
  type: 'post',
417
  url: ajaxurl,
418
+ beforeSend: function() {
419
+ loader.show();
420
+ },
421
+ complete: function() {
422
+ loader.hide();
423
+ },
424
  error: function (request, error) {
425
  notify(wdr_data.localization_data.error, 'error', alert_counter);
426
  },
449
  } else {
450
  change_status = 0;
451
  }
452
+ let loader = $('.woo_discount_loader');
453
  $.ajax({
454
  data: {
455
  rowid: $(this).data('manage-status'),
459
  },
460
  type: 'post',
461
  url: ajaxurl,
462
+ beforeSend: function() {
463
+ loader.show();
464
+ },
465
+ complete: function() {
466
+ loader.hide();
467
+ },
468
  error: function (request, error) {
469
  notify(wdr_data.localization_data.error, 'error', alert_counter);
470
  },
732
  */
733
  $('#wdr-save-rule').submit(function (e) {
734
  e.preventDefault();
735
+ let validation = woo_discount_rule_validation( $(this) );
736
+ if(!validation){
737
+ return false;
738
+ }
739
  let loader = $('.woo_discount_loader');
740
+
741
  $.ajax({
742
  data: $(this).serialize(),
743
  type: 'post',
761
  window.location.href = data.redirect;
762
  notify(wdr_data.localization_data.save_rule, 'success', alert_counter);
763
  } else if (data.coupon_message) {
 
764
  $(".coupon_name_msg").css("border", "1px solid #FF0000").focus();
765
  notify(wdr_data.localization_data.coupon_exists, 'error', alert_counter);
766
  } else {
781
  $(".wdr_save_stay").click();
782
  });
783
 
784
+ /**
785
+ * Rule validation starts here
786
+ * @param form
787
+ * @returns {boolean}
788
+ */
789
+ function woo_discount_rule_validation( form ){
790
+ let discount_type = $('.awdr-product-discount-type').val();
791
+ let wdr_filter_validations = [];
792
+ let wdr_discount_validations = [];
793
+ let wdr_condition_validations = [];
794
+ switch(discount_type){
795
+ case 'wdr_simple_discount':
796
+ wdr_filter_validations = wdr_filter_validation();
797
+ wdr_discount_validations = wdr_discount_validation(discount_type);
798
+ wdr_condition_validations = wdr_condition_validation();
799
+ break;
800
+ case 'wdr_cart_discount':
801
+ wdr_filter_validations = wdr_filter_validation();
802
+ wdr_discount_validations = wdr_discount_validation(discount_type);
803
+ wdr_condition_validations = wdr_condition_validation();
804
+ break;
805
+ case 'wdr_free_shipping':
806
+ wdr_condition_validations = wdr_condition_validation();
807
+ break;
808
+ case 'wdr_bulk_discount':
809
+ wdr_filter_validations = wdr_filter_validation();
810
+ wdr_discount_validations = wdr_discount_validation(discount_type);
811
+ wdr_condition_validations = wdr_condition_validation();
812
+ break;
813
+ case 'wdr_set_discount':
814
+ wdr_filter_validations = wdr_filter_validation();
815
+ wdr_discount_validations = wdr_discount_validation(discount_type);
816
+ wdr_condition_validations = wdr_condition_validation();
817
+ break;
818
+ case 'wdr_buy_x_get_x_discount':
819
+ wdr_filter_validations = wdr_filter_validation();
820
+ wdr_discount_validations = wdr_discount_validation(discount_type);
821
+ wdr_condition_validations = wdr_condition_validation();
822
+ break;
823
+ case 'wdr_buy_x_get_y_discount':
824
+ wdr_filter_validations = wdr_filter_validation();
825
+ wdr_discount_validations = wdr_discount_validation(discount_type);
826
+ wdr_condition_validations = wdr_condition_validation();
827
+ break
828
+ default:
829
+ case 'not_selected':
830
+ break;
831
+ }
832
+ if(wdr_filter_validations.indexOf("fails") !== -1){
833
+ return false;
834
+ }
835
+ if(wdr_discount_validations.indexOf("fails") !== -1){
836
+ return false;
837
+ }
838
+ if(wdr_condition_validations.indexOf("fails") !== -1){
839
+ return false;
840
+ }
841
+ return true;
842
+ }
843
+
844
+ /**
845
+ * Validate Filter section
846
+ * @returns {[]}
847
+ */
848
+ function wdr_filter_validation(){
849
+ let filter_array = [];
850
+ $('.wdr-filter-group').each(function (index,element) {
851
+ let product_filter = $(element).find('.wdr-product-filter-type').val();
852
+ let product_filter_val = $(element).find('.awdr_validation').val();
853
+ switch (product_filter) {
854
+ case 'all_products':
855
+ break;
856
+ case 'products':
857
+ if(!product_filter_val){
858
+ filter_array.push("fails");
859
+ $(element).find('.select2-selection').css("border", "1px solid red");
860
+ $(element).find('.select2-selection').focus();
861
+ }else{
862
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
863
+ }
864
+ break;
865
+ case 'product_category':
866
+ if(!product_filter_val){
867
+ filter_array.push("fails");
868
+ $(element).find('.select2-selection').css("border", "1px solid red");
869
+ $(element).find('.select2-selection').focus();
870
+ }else{
871
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
872
+ }
873
+ break;
874
+ case 'product_attributes':
875
+ if(!product_filter_val){
876
+ filter_array.push("fails");
877
+ $(element).find('.select2-selection').css("border", "1px solid red");
878
+ $(element).find('.select2-selection').focus();
879
+ }else{
880
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
881
+ }
882
+ break;
883
+ case 'product_tags':
884
+ if(!product_filter_val){
885
+ filter_array.push("fails");
886
+ $(element).find('.select2-selection').css("border", "1px solid red");
887
+ $(element).find('.select2-selection').focus();
888
+ }else{
889
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
890
+ }
891
+ break;
892
+ case 'product_sku':
893
+ if(!product_filter_val){
894
+ filter_array.push("fails");
895
+ $(element).find('.select2-selection').css("border", "1px solid red");
896
+ $(element).find('.select2-selection').focus();
897
+ }else{
898
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
899
+ }
900
+ break;
901
+ case 'product_on_sale':
902
+ break;
903
+ default:
904
+ if(!product_filter_val){
905
+ filter_array.push("fails");
906
+ $(element).find('.select2-selection').css("border", "1px solid red");
907
+ $(element).find('.select2-selection').focus();
908
+ }else{
909
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
910
+ }
911
+ break;
912
+ }
913
+ });
914
+ return filter_array;
915
+ }
916
+
917
+ /**
918
+ * validate Discount section
919
+ * @param discount_type
920
+ * @returns {[]}
921
+ */
922
+ function wdr_discount_validation(discount_type){
923
+ let discount_array = [];
924
+ switch(discount_type){
925
+ case 'wdr_simple_discount':
926
+ let product_discount = $('.product_discount_value').val();
927
+ if( product_discount == '' || !product_discount ){
928
+ discount_array.push("fails");
929
+ $('.product_discount_value').css("border", "1px solid red");
930
+ $('.product_discount_value').focus();
931
+ }else{
932
+ $('.product_discount_value').css("border", "1px solid #7e8993");
933
+ }
934
+ break;
935
+ case 'wdr_cart_discount':
936
+ let cart_discount = $('.awdr_cart_discount_value').val();
937
+ if( cart_discount == '' || !cart_discount ){
938
+ discount_array.push("fails");
939
+ $('.awdr_cart_discount_value').css("border", "1px solid red");
940
+ $('.awdr_cart_discount_value').focus();
941
+ }else{
942
+ $('.awdr_cart_discount_value').css("border", "1px solid #7e8993");
943
+ }
944
+ break;
945
+ case 'wdr_free_shipping':
946
+ break;
947
+ case 'wdr_bulk_discount':
948
+ $('.bulk_range_setter').find('.awdr-bulk-group').each(function (index,element) {
949
+ let min_qty = $(element).find('.bulk_discount_min').val();
950
+ let max_qty = $(element).find('.bulk_discount_max').val();
951
+ let max_val = $(element).find('.bulk_discount_value').val();
952
+ if( min_qty == '' && max_qty == ''){
953
+ discount_array.push("fails");
954
+ $(element).find('.bulk_discount_min').css("border", "1px solid red");
955
+ $(element).find('.bulk_discount_min').focus();
956
+ $(element).find('.bulk_discount_max').css("border", "1px solid red");
957
+ $(element).find('.bulk_discount_max').focus();
958
+ }else{
959
+ $(element).find('.bulk_discount_min').css("border", "1px solid #7e8993");
960
+ $(element).find('.bulk_discount_max').css("border", "1px solid #7e8993");
961
+ }
962
+ if(max_val == ''){
963
+ discount_array.push("fails");
964
+ $(element).find('.bulk_discount_value').css("border", "1px solid red");
965
+ $(element).find('.bulk_discount_value').focus();
966
+ }else{
967
+ $(element).find('.bulk_discount_value').css("border", "1px solid #7e8993");
968
+ }
969
+ });
970
+ break;
971
+ case 'wdr_set_discount':
972
+ $('.set_range_setter').find('.awdr-set-group').each(function (index,element) {
973
+ let min_qty = $(element).find('.set_discount_min').val();
974
+ let max_val = $(element).find('.set_discount_value').val();
975
+ if( min_qty == ''){
976
+ discount_array.push("fails");
977
+ $(element).find('.set_discount_min').css("border", "1px solid red");
978
+ $(element).find('.set_discount_min').focus();
979
+ }else{
980
+ $(element).find('.set_discount_min').css("border", "1px solid #7e8993");
981
+ }
982
+ if(max_val == ''){
983
+ discount_array.push("fails");
984
+ $(element).find('.set_discount_value').css("border", "1px solid red");
985
+ $(element).find('.set_discount_value').focus();
986
+ }else{
987
+ $(element).find('.set_discount_value').css("border", "1px solid #7e8993");
988
+ }
989
+ });
990
+ break;
991
+ case 'wdr_buy_x_get_x_discount':
992
+ $('.buyx_getx_range_setter').find('.buyx_getx_individual_range').each(function (index,element) {
993
+ let min_qty = $(element).find('.bxgx-min').val();
994
+ let max_qty = $(element).find('.bxgx-max').val();
995
+ let free_qty = $(element).find('.bxgx-qty').val();
996
+ let select_type = $(element).find('.buyx_getx_discount_select').val();
997
+ let max_val = $(element).find('.bxgx-value').val();
998
+ if($(element).find('.awdr-bogo-recurcive').prop("checked") == true){
999
+ if( min_qty == ''){
1000
+ discount_array.push("fails");
1001
+ $(element).find('.bxgx-min').css("border", "1px solid red");
1002
+ $(element).find('.bxgx-min').focus();
1003
+ }else{
1004
+ $(element).find('.bxgx-min').css("border", "1px solid #7e8993");
1005
+ }
1006
+ }
1007
+ if( min_qty == '' && max_qty == ''){
1008
+ discount_array.push("fails");
1009
+ $(element).find('.bxgx-min').css("border", "1px solid red");
1010
+ $(element).find('.bxgx-min').focus();
1011
+ $(element).find('.bxgx-max').css("border", "1px solid red");
1012
+ $(element).find('.bxgx-max').focus();
1013
+ }else{
1014
+ $(element).find('.bxgx-min').css("border", "1px solid #7e8993");
1015
+ $(element).find('.bxgx-max').css("border", "1px solid #7e8993");
1016
+ }
1017
+ if(free_qty == ''){
1018
+ discount_array.push("fails");
1019
+ $(element).find('.bxgx-qty').css("border", "1px solid red");
1020
+ $(element).find('.bxgx-qty').focus();
1021
+ }else{
1022
+ $(element).find('.bxgx-qty').css("border", "1px solid #7e8993");
1023
+ }
1024
+
1025
+ if(select_type != 'free_product' && max_val == ''){
1026
+ discount_array.push("fails");
1027
+ $(element).find('.bxgx-value').css("border", "1px solid red");
1028
+ $(element).find('.bxgx-value').focus();
1029
+ }else{
1030
+ $(element).find('.bxgx-value').css("border", "1px solid #7e8993");
1031
+ }
1032
+ });
1033
+ break;
1034
+ case 'wdr_buy_x_get_y_discount':
1035
+ let bxgy_type = $('.select_bxgy_type').val();
1036
+ $('.awdr_buyx_gety_range_setter').find('.buyx_gety_individual_range').each(function (index,element) {
1037
+ let min_qty = $(element).find('.bxgy-min').val();
1038
+ let max_qty = $(element).find('.bxgy-max').val();
1039
+ let product_qty = $(element).find('.bxgy-product-selector').val();
1040
+ let category_qty = $(element).find('.bxgy-category-selector').val();
1041
+ let free_qty = $(element).find('.bxgy-qty').val();
1042
+ let select_type = $(element).find('.buyx_gety_discount_select').val();
1043
+ let max_val = $(element).find('.bxgy-val').val();
1044
+
1045
+ if(bxgy_type == 'bxgy_product'){
1046
+ if(!product_qty){
1047
+ discount_array.push("fails");
1048
+ $(element).find('.select2-selection').css("border", "1px solid red");
1049
+ $(element).find('.select2-selection').focus();
1050
+ }else{
1051
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1052
+ }
1053
+ }else if(bxgy_type == 'bxgy_category'){
1054
+ if(!category_qty){
1055
+ discount_array.push("fails");
1056
+ $(element).find('.select2-selection').css("border", "1px solid red");
1057
+ $(element).find('.select2-selection').focus();
1058
+ }else{
1059
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1060
+ }
1061
+ }else if(bxgy_type == '0' || !bxgy_type){
1062
+ discount_array.push("fails");
1063
+ $('.select_bxgy_type').css("border", "1px solid red");
1064
+ $('.select_bxgy_type').focus();
1065
+ }else {
1066
+ $('.select_bxgy_type').css("border", "1px solid #7e8993");
1067
+ }
1068
+
1069
+ if($(element).find('.awdr-bogo-recurcive').prop("checked") == true){
1070
+ if( min_qty == ''){
1071
+ discount_array.push("fails");
1072
+ $(element).find('.bxgy-min').css("border", "1px solid red");
1073
+ $(element).find('.bxgy-min').focus();
1074
+ }else{
1075
+ $(element).find('.bxgy-min').css("border", "1px solid #7e8993");
1076
+ }
1077
+ }
1078
+ if( min_qty == '' && max_qty == ''){
1079
+ discount_array.push("fails");
1080
+ $(element).find('.bxgy-min').css("border", "1px solid red");
1081
+ $(element).find('.bxgy-min').focus();
1082
+ $(element).find('.bxgy-max').css("border", "1px solid red");
1083
+ $(element).find('.bxgy-max').focus();
1084
+ }else{
1085
+ $(element).find('.bxgy-min').css("border", "1px solid #7e8993");
1086
+ $(element).find('.bxgy-max').css("border", "1px solid #7e8993");
1087
+ }
1088
+ if(free_qty == ''){
1089
+ discount_array.push("fails");
1090
+ $(element).find('.bxgy-qty').css("border", "1px solid red");
1091
+ $(element).find('.bxgy-qty').focus();
1092
+ }else{
1093
+ $(element).find('.bxgy-qty').css("border", "1px solid #7e8993");
1094
+ }
1095
+
1096
+ if(select_type != 'free_product' && max_val == ''){
1097
+ discount_array.push("fails");
1098
+ $(element).find('.bxgy-val').css("border", "1px solid red");
1099
+ $(element).find('.bxgy-val').focus();
1100
+ }else{
1101
+ $(element).find('.bxgy-val').css("border", "1px solid #7e8993");
1102
+ }
1103
+ });
1104
+ break
1105
+ default:
1106
+ case 'not_selected':
1107
+ discount_array.push("fails");
1108
+ break;
1109
+ }
1110
+ return discount_array;
1111
+ }
1112
+
1113
+ function wdr_condition_validation(){
1114
+ let condition_array = [];
1115
+ $('.wdr-condition-group').each(function (index,element) {
1116
+ let condition_type = $(element).find('.wdr-product-condition-type').val();
1117
+ if (typeof condition_type !== 'undefined') {
1118
+ switch (condition_type) {
1119
+ case 'cart_subtotal':
1120
+ let sub_total = $(element).find('.float_only_field').val();
1121
+ if(sub_total == ''){
1122
+ condition_array.push("fails");
1123
+ $(element).find('.float_only_field').css("border", "1px solid red");
1124
+ $(element).find('.float_only_field').focus();
1125
+ }else{
1126
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1127
+ }
1128
+ break;
1129
+ case 'cart_items_quantity':
1130
+ let item_qty = $(element).find('.float_only_field').val();
1131
+ if(item_qty == ''){
1132
+ condition_array.push("fails");
1133
+ $(element).find('.float_only_field').css("border", "1px solid red");
1134
+ $(element).find('.float_only_field').focus();
1135
+ }else{
1136
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1137
+ }
1138
+ break;
1139
+ case 'cart_coupon':
1140
+ let coupon_type = $(element).find('.wdr_copon_type').val();
1141
+ let custom_coupon = $(element).find('.coupon_name_msg').val();
1142
+ let wc_coupon_val = $(element).find('#rm-coupon').val();
1143
+ if(coupon_type == 'custom_coupon'){
1144
+ if(custom_coupon == ''){
1145
+ condition_array.push("fails");
1146
+ $(element).find('.coupon_name_msg').css("border", "1px solid red");
1147
+ $(element).find('.coupon_name_msg').focus();
1148
+ }else{
1149
+ $(element).find('.coupon_name_msg').css("border", "1px solid #7e8993");
1150
+ }
1151
+ }else{
1152
+ if(!wc_coupon_val){
1153
+ condition_array.push("fails");
1154
+ $(element).find('.select2-selection').css("border", "1px solid red");
1155
+ $(element).find('.select2-selection').focus();
1156
+ }else{
1157
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1158
+ }
1159
+ }
1160
+ break;
1161
+ case 'cart_items_weight':
1162
+ let item_weight = $(element).find('.float_only_field').val();
1163
+ if(item_weight == ''){
1164
+ condition_array.push("fails");
1165
+ $(element).find('.float_only_field').css("border", "1px solid red");
1166
+ $(element).find('.float_only_field').focus();
1167
+ }else{
1168
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1169
+ }
1170
+ break;
1171
+ case 'cart_payment_method':
1172
+ let wc_payment_gateway = $(element).find('.select2-hidden-accessible').val();
1173
+ if(!wc_payment_gateway){
1174
+ condition_array.push("fails");
1175
+ $(element).find('.select2-selection').css("border", "1px solid red");
1176
+ $(element).find('.select2-selection').focus();
1177
+ }else{
1178
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1179
+ }
1180
+ break;
1181
+ case 'cart_line_items_count':
1182
+ let line_item_count = $(element).find('.float_only_field').val();
1183
+ if(line_item_count == ''){
1184
+ condition_array.push("fails");
1185
+ $(element).find('.float_only_field').css("border", "1px solid red");
1186
+ $(element).find('.float_only_field').focus();
1187
+ }else{
1188
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1189
+ }
1190
+ break;
1191
+ case 'cart_item_product_attributes':
1192
+ let wc_attributes = $(element).find('.awdr-attribute-validation').val();
1193
+ let attribute_qty = $(element).find('.awdr-num-validation').val();
1194
+ if(!wc_attributes){
1195
+ condition_array.push("fails");
1196
+ $(element).find('.select2-selection').css("border", "1px solid red");
1197
+ $(element).find('.select2-selection').focus();
1198
+ }else{
1199
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1200
+ }
1201
+ if(attribute_qty == ''){
1202
+ condition_array.push("fails");
1203
+ $(element).find('.awdr-num-validation').css("border", "1px solid red");
1204
+ $(element).find('.awdr-num-validation').focus();
1205
+ }else{
1206
+ $(element).find('.awdr-num-validation').css("border", "1px solid #7e8993");
1207
+ }
1208
+ break;
1209
+ case 'cart_item_product_category':
1210
+ let wc_category = $(element).find('.awdr-category-validation').val();
1211
+ let category_qty = $(element).find('.awdr-num-validation').val();
1212
+ if(!wc_category){
1213
+ condition_array.push("fails");
1214
+ $(element).find('.select2-selection').css("border", "1px solid red");
1215
+ $(element).find('.select2-selection').focus();
1216
+ }else{
1217
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1218
+ }
1219
+ if(category_qty == ''){
1220
+ condition_array.push("fails");
1221
+ $(element).find('.awdr-num-validation').css("border", "1px solid red");
1222
+ $(element).find('.awdr-num-validation').focus();
1223
+ }else{
1224
+ $(element).find('.awdr-num-validation').css("border", "1px solid #7e8993");
1225
+ }
1226
+ break;
1227
+ case 'cart_item_product_combination':
1228
+ let wc_product = $(element).find('.awdr-product-validation').val();
1229
+ let min_qty = $(element).find('.product_from_qty').val();
1230
+ let max_qty = $(element).find('.product_to_qty').val();
1231
+ let combination_operator = $(element).find('.combination_operator').val();
1232
+ if(!wc_product){
1233
+ condition_array.push("fails");
1234
+ $(element).find('.select2-selection').css("border", "1px solid red");
1235
+ $(element).find('.select2-selection').focus();
1236
+ }else{
1237
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1238
+ }
1239
+ if(combination_operator == 'in_range'){
1240
+ if(min_qty == '' && max_qty == ''){
1241
+ condition_array.push("fails");
1242
+ $(element).find('.product_from_qty').css("border", "1px solid red");
1243
+ $(element).find('.product_from_qty').focus();
1244
+ $(element).find('.product_to_qty').css("border", "1px solid red");
1245
+ $(element).find('.product_to_qty').focus();
1246
+ }else{
1247
+ $(element).find('.product_from_qty').css("border", "1px solid #7e8993");
1248
+ $(element).find('.product_to_qty').css("border", "1px solid #7e8993");
1249
+ }
1250
+ }else{
1251
+ if(min_qty == ''){
1252
+ condition_array.push("fails");
1253
+ $(element).find('.product_from_qty').css("border", "1px solid red");
1254
+ $(element).find('.product_from_qty').focus();
1255
+ }else{
1256
+ $(element).find('.product_from_qty').css("border", "1px solid #7e8993");
1257
+ }
1258
+ }
1259
+ break;
1260
+ case 'cart_item_product_sku':
1261
+ let wc_sku = $(element).find('.awdr-sku-validation').val();
1262
+ let sku_qty = $(element).find('.awdr-num-validation').val();
1263
+ if(!wc_sku){
1264
+ condition_array.push("fails");
1265
+ $(element).find('.select2-selection').css("border", "1px solid red");
1266
+ $(element).find('.select2-selection').focus();
1267
+ }else{
1268
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1269
+ }
1270
+ if(sku_qty == ''){
1271
+ condition_array.push("fails");
1272
+ $(element).find('.awdr-num-validation').css("border", "1px solid red");
1273
+ $(element).find('.awdr-num-validation').focus();
1274
+ }else{
1275
+ $(element).find('.awdr-num-validation').css("border", "1px solid #7e8993");
1276
+ }
1277
+ break;
1278
+ case 'cart_item_product_tags':
1279
+ let wc_tags = $(element).find('.awdr-tag-validation').val();
1280
+ let tag_qty = $(element).find('.awdr-num-validation').val();
1281
+ if(!wc_tags){
1282
+ condition_array.push("fails");
1283
+ $(element).find('.select2-selection').css("border", "1px solid red");
1284
+ $(element).find('.select2-selection').focus();
1285
+ }else{
1286
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1287
+ }
1288
+ if(tag_qty == ''){
1289
+ condition_array.push("fails");
1290
+ $(element).find('.awdr-num-validation').css("border", "1px solid red");
1291
+ $(element).find('.awdr-num-validation').focus();
1292
+ }else{
1293
+ $(element).find('.awdr-num-validation').css("border", "1px solid #7e8993");
1294
+ }
1295
+ break;
1296
+ case 'cart_item_products':
1297
+ let wc_products = $(element).find('.awdr-product-validation').val();
1298
+ let product_qty = $(element).find('.awdr-num-validation').val();
1299
+ if(!wc_products){
1300
+ condition_array.push("fails");
1301
+ $(element).find('.select2-selection').css("border", "1px solid red");
1302
+ $(element).find('.select2-selection').focus();
1303
+ }else{
1304
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1305
+ }
1306
+ if(product_qty == ''){
1307
+ condition_array.push("fails");
1308
+ $(element).find('.awdr-num-validation').css("border", "1px solid red");
1309
+ $(element).find('.awdr-num-validation').focus();
1310
+ }else{
1311
+ $(element).find('.awdr-num-validation').css("border", "1px solid #7e8993");
1312
+ }
1313
+ break;
1314
+ case 'cart_item_category_combination':
1315
+ let wc_cat = $(element).find('.awdr-cat-validation').val();
1316
+ let from_qty = $(element).find('.cat_from_qty').val();
1317
+ let to_qty = $(element).find('.cat_to_qty').val();
1318
+ let cat_combination = $(element).find('.cat_combination_operator').val();
1319
+ if(!wc_cat){
1320
+ condition_array.push("fails");
1321
+ $(element).find('.select2-selection').css("border", "1px solid red");
1322
+ $(element).find('.select2-selection').focus();
1323
+ }else{
1324
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1325
+ }
1326
+ if(cat_combination == 'in_range'){
1327
+ if(from_qty == '' && to_qty == ''){
1328
+ condition_array.push("fails");
1329
+ $(element).find('.cat_from_qty').css("border", "1px solid red");
1330
+ $(element).find('.cat_from_qty').focus();
1331
+ $(element).find('.cat_to_qty').css("border", "1px solid red");
1332
+ $(element).find('.cat_to_qty').focus();
1333
+ }else{
1334
+ $(element).find('.cat_from_qty').css("border", "1px solid #7e8993");
1335
+ $(element).find('.cat_to_qty').css("border", "1px solid #7e8993");
1336
+ }
1337
+ }else{
1338
+ if(from_qty == ''){
1339
+ condition_array.push("fails");
1340
+ $(element).find('.cat_from_qty').css("border", "1px solid red");
1341
+ $(element).find('.cat_from_qty').focus();
1342
+ }else{
1343
+ $(element).find('.cat_from_qty').css("border", "1px solid #7e8993");
1344
+ }
1345
+ }
1346
+ break;
1347
+ case 'order_date':
1348
+ let from_date = $(element).find('.awdr-from-date').val();
1349
+ let end_date = $(element).find('.awdr-end-date').val();
1350
+ if(from_date == '' && end_date == ''){
1351
+ condition_array.push("fails");
1352
+ $(element).find('.awdr-from-date').css("border", "1px solid red");
1353
+ $(element).find('.awdr-from-date').focus();
1354
+ $(element).find('.awdr-end-date').css("border", "1px solid red");
1355
+ $(element).find('.awdr-end-date').focus();
1356
+ }else{
1357
+ $(element).find('.awdr-from-date').css("border", "1px solid #7e8993");
1358
+ $(element).find('.awdr-end-date').css("border", "1px solid #7e8993");
1359
+ }
1360
+ break;
1361
+ case 'order_date_and_time':
1362
+ let from_date_time = $(element).find('.awdr-from-date').val();
1363
+ let end_date_time = $(element).find('.awdr-end-date').val();
1364
+ if(from_date_time == '' && end_date_time == ''){
1365
+ condition_array.push("fails");
1366
+ $(element).find('.awdr-from-date').css("border", "1px solid red");
1367
+ $(element).find('.awdr-from-date').focus();
1368
+ $(element).find('.awdr-end-date').css("border", "1px solid red");
1369
+ $(element).find('.awdr-end-date').focus();
1370
+ }else{
1371
+ $(element).find('.awdr-from-date').css("border", "1px solid #7e8993");
1372
+ $(element).find('.awdr-end-date').css("border", "1px solid #7e8993");
1373
+ }
1374
+ break;
1375
+ case 'order_days':
1376
+ let order_days = $(element).find('.order_days').val();
1377
+ if(!order_days){
1378
+ condition_array.push("fails");
1379
+ $(element).find('.select2-selection').css("border", "1px solid red");
1380
+ $(element).find('.select2-selection').focus();
1381
+ }else{
1382
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1383
+ }
1384
+ break;
1385
+ case 'order_time':
1386
+ let from_time = $(element).find('.wdr-from-time').val();
1387
+ let end_time = $(element).find('.wdr-to-time').val();
1388
+ if(from_time == '' && end_time == ''){
1389
+ condition_array.push("fails");
1390
+ $(element).find('.wdr-from-time').css("border", "1px solid red");
1391
+ $(element).find('.wdr-from-time').focus();
1392
+ $(element).find('.wdr-to-time').css("border", "1px solid red");
1393
+ $(element).find('.wdr-to-time').focus();
1394
+ }else{
1395
+ $(element).find('.wdr-from-time').css("border", "1px solid #7e8993");
1396
+ $(element).find('.wdr-to-time').css("border", "1px solid #7e8993");
1397
+ }
1398
+ break;
1399
+ case 'purchase_last_order':
1400
+ let last_order = $(element).find('.wdr-wc-order-status').val();
1401
+ if(!last_order){
1402
+ condition_array.push("fails");
1403
+ $(element).find('.select2-selection').css("border", "1px solid red");
1404
+ $(element).find('.select2-selection').focus();
1405
+ }else{
1406
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1407
+ }
1408
+ break;
1409
+ case 'purchase_last_order_amount':
1410
+ let last_order_amount_status = $(element).find('.wdr-wc-order-status').val();
1411
+ let last_order_amount = $(element).find('.float_only_field').val();
1412
+ if(!last_order_amount_status){
1413
+ condition_array.push("fails");
1414
+ $(element).find('.select2-selection').css("border", "1px solid red");
1415
+ $(element).find('.select2-selection').focus();
1416
+ }else{
1417
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1418
+ }
1419
+ if(last_order_amount == ''){
1420
+ condition_array.push("fails");
1421
+ $(element).find('.float_only_field').css("border", "1px solid red");
1422
+ $(element).find('.float_only_field').focus();
1423
+ }else{
1424
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1425
+ }
1426
+ break;
1427
+ case 'purchase_previous_orders':
1428
+ let made_order_status = $(element).find('.wdr-wc-order-status').val();
1429
+ let made_order_amount = $(element).find('.float_only_field').val();
1430
+ if(!made_order_status){
1431
+ condition_array.push("fails");
1432
+ $(element).find('.select2-selection').css("border", "1px solid red");
1433
+ $(element).find('.select2-selection').focus();
1434
+ }else{
1435
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1436
+ }
1437
+ if(made_order_amount == ''){
1438
+ condition_array.push("fails");
1439
+ $(element).find('.float_only_field').css("border", "1px solid red");
1440
+ $(element).find('.float_only_field').focus();
1441
+ }else{
1442
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1443
+ }
1444
+ break;
1445
+ case 'purchase_previous_orders_for_specific_product':
1446
+ let made_order_status_for_product = $(element).find('.wdr-wc-order-status').val();
1447
+ let made_order_amount_for_product = $(element).find('.float_only_field').val();
1448
+ let ordered_product = $(element).find('.specific_product').val();
1449
+ if(!ordered_product){
1450
+ condition_array.push("fails");
1451
+ $(element).find('.wdr-previous-order-product-selector .select2-selection').css("border", "1px solid red");
1452
+ $(element).find('.wdr-previous-order-product-selector .select2-selection').focus();
1453
+ }else{
1454
+ $(element).find('.wdr-previous-order-product-selector .select2-selection').css("border", "1px solid #7e8993");
1455
+ }
1456
+ if(!made_order_status_for_product){
1457
+ condition_array.push("fails");
1458
+ $(element).find('.wdr-previous-order-product-status .select2-selection').css("border", "1px solid red");
1459
+ $(element).find('.wdr-previous-order-product-status .select2-selection').focus();
1460
+ }else{
1461
+ $(element).find('.wdr-previous-order-product-status .select2-selection').css("border", "1px solid #7e8993");
1462
+ }
1463
+ if(made_order_amount_for_product == ''){
1464
+ condition_array.push("fails");
1465
+ $(element).find('.float_only_field').css("border", "1px solid red");
1466
+ $(element).find('.float_only_field').focus();
1467
+ }else{
1468
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1469
+ }
1470
+ break;
1471
+ case 'purchase_quantities_for_specific_product':
1472
+ let status_for_product_qty = $(element).find('.wdr-wc-order-status').val();
1473
+ let amount_for_product_qty = $(element).find('.float_only_field').val();
1474
+ let product_ordered = $(element).find('.specific_product').val();
1475
+ if(!product_ordered){
1476
+ condition_array.push("fails");
1477
+ $(element).find('.wdr-previous-order-product-selector .select2-selection').css("border", "1px solid red");
1478
+ $(element).find('.wdr-previous-order-product-selector .select2-selection').focus();
1479
+ }else{
1480
+ $(element).find('.wdr-previous-order-product-selector .select2-selection').css("border", "1px solid #7e8993");
1481
+ }
1482
+ if(!status_for_product_qty){
1483
+ condition_array.push("fails");
1484
+ $(element).find('.wdr-previous-order-product-status .select2-selection').css("border", "1px solid red");
1485
+ $(element).find('.wdr-previous-order-product-status .select2-selection').focus();
1486
+ }else{
1487
+ $(element).find('.wdr-previous-order-product-status .select2-selection').css("border", "1px solid #7e8993");
1488
+ }
1489
+ if(amount_for_product_qty == ''){
1490
+ condition_array.push("fails");
1491
+ $(element).find('.float_only_field').css("border", "1px solid red");
1492
+ $(element).find('.float_only_field').focus();
1493
+ }else{
1494
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1495
+ }
1496
+
1497
+ break;
1498
+ case 'purchase_spent':
1499
+ let spent_status = $(element).find('.wdr-wc-order-status').val();
1500
+ let spent_amount = $(element).find('.float_only_field').val();
1501
+ if(!spent_status){
1502
+ condition_array.push("fails");
1503
+ $(element).find('.select2-selection').css("border", "1px solid red");
1504
+ $(element).find('.select2-selection').focus();
1505
+ }else{
1506
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1507
+ }
1508
+ if(spent_amount == ''){
1509
+ condition_array.push("fails");
1510
+ $(element).find('.float_only_field').css("border", "1px solid red");
1511
+ $(element).find('.float_only_field').focus();
1512
+ }else{
1513
+ $(element).find('.float_only_field').css("border", "1px solid #7e8993");
1514
+ }
1515
+ break;
1516
+ case 'shipping_city':
1517
+ let shipping_city = $(element).find('.awdr-validation').val();
1518
+ if(shipping_city == ''){
1519
+ condition_array.push("fails");
1520
+ $(element).find('.awdr-validation').css("border", "1px solid red");
1521
+ $(element).find('.awdr-validation').focus();
1522
+ }else{
1523
+ $(element).find('.awdr-validation').css("border", "1px solid #7e8993");
1524
+ }
1525
+ break;
1526
+ case 'shipping_country':
1527
+ let shipping_country = $(element).find('.shipping_country').val();
1528
+ if(!shipping_country){
1529
+ condition_array.push("fails");
1530
+ $(element).find('.select2-selection').css("border", "1px solid red");
1531
+ $(element).find('.select2-selection').focus();
1532
+ }else{
1533
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1534
+ }
1535
+ break;
1536
+ case 'shipping_state':
1537
+ let shipping_state = $(element).find('.shipping_state').val();
1538
+ if(!shipping_state){
1539
+ condition_array.push("fails");
1540
+ $(element).find('.select2-selection').css("border", "1px solid red");
1541
+ $(element).find('.select2-selection').focus();
1542
+ }else{
1543
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1544
+ }
1545
+ break;
1546
+ case 'shipping_zipcode':
1547
+ let shipping_zipcode = $(element).find('.awdr-validation').val();
1548
+ if(shipping_zipcode == ''){
1549
+ condition_array.push("fails");
1550
+ $(element).find('.awdr-validation').css("border", "1px solid red");
1551
+ $(element).find('.awdr-validation').focus();
1552
+ }else{
1553
+ $(element).find('.awdr-validation').css("border", "1px solid #7e8993");
1554
+ }
1555
+ break;
1556
+ case 'Billing_city':
1557
+ let Billing_city = $(element).find('.awdr-validation').val();
1558
+ if(Billing_city == ''){
1559
+ condition_array.push("fails");
1560
+ $(element).find('.awdr-validation').css("border", "1px solid red");
1561
+ $(element).find('.awdr-validation').focus();
1562
+ }else{
1563
+ $(element).find('.awdr-validation').css("border", "1px solid #7e8993");
1564
+ }
1565
+ break;
1566
+ case 'user_email':
1567
+ let user_email = $(element).find('.awdr-validation').val();
1568
+ if(user_email == ''){
1569
+ condition_array.push("fails");
1570
+ $(element).find('.awdr-validation').css("border", "1px solid red");
1571
+ $(element).find('.awdr-validation').focus();
1572
+ }else{
1573
+ $(element).find('.awdr-validation').css("border", "1px solid #7e8993");
1574
+ }
1575
+ break;
1576
+ case 'user_list':
1577
+ let user_list = $(element).find('.wdr_user_list').val();
1578
+ if(!user_list){
1579
+ condition_array.push("fails");
1580
+ $(element).find('.select2-selection').css("border", "1px solid red");
1581
+ $(element).find('.select2-selection').focus();
1582
+ }else{
1583
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1584
+ }
1585
+ break;
1586
+ case 'user_role':
1587
+ let user_role = $(element).find('.wdr_user_role').val();
1588
+ if(!user_role){
1589
+ condition_array.push("fails");
1590
+ $(element).find('.select2-selection').css("border", "1px solid red");
1591
+ $(element).find('.select2-selection').focus();
1592
+ }else{
1593
+ $(element).find('.select2-selection').css("border", "1px solid #7e8993");
1594
+ }
1595
+ break;
1596
+ }
1597
+ }
1598
+ });
1599
+ return condition_array;
1600
+ }
1601
+
1602
  /**
1603
  * save default configuration settings
1604
  */
1608
  $("#awdr_banner_editor-tmce").click();
1609
  let awdr_banner_editer = $('#awdr_banner_editor').val();
1610
  let values = $(this).serialize();
1611
+ let loader = $('.woo_discount_loader');
1612
  values += "&banner_content=" + awdr_banner_editer;
1613
  $.ajax({
1614
  data: values,
1615
  type: 'post',
1616
  url: ajaxurl,
1617
  beforeSend: function() {
1618
+ loader.show();
1619
  },
1620
  complete: function() {
1621
+ loader.hide();
1622
  },
1623
  error: function (request, error) {
1624
  notify(wdr_data.localization_data.error, 'error', alert_counter);
1687
  }else{
1688
  return false;
1689
  }
1690
+ let loader = $('.woo_discount_loader');
1691
  $.ajax({
1692
  data: $(this).serialize(),
1693
  type: 'post',
1694
  url: ajaxurl,
1695
+ beforeSend: function() {
1696
+ loader.show();
1697
+ },
1698
+ complete: function() {
1699
+ loader.hide();
1700
+ },
1701
  error: function (request, error) {
1702
  notify(wdr_data.localization_data.error, 'error', alert_counter);
1703
  },
v2/Assets/Js/awdr-dynamic-price.js CHANGED
@@ -24,7 +24,7 @@
24
  this.getDiscountPriceForProduct();
25
  },
26
  getDiscountPriceForProduct: function () {
27
- if(this.product_id === null){
28
  this.logError("Invalid product");
29
  return [];
30
  }
24
  this.getDiscountPriceForProduct();
25
  },
26
  getDiscountPriceForProduct: function () {
27
+ if(this.product_id === null || this.product_id == 0){
28
  this.logError("Invalid product");
29
  return [];
30
  }
v2/Assets/Js/rulebuilder.js CHANGED
@@ -49,10 +49,19 @@ var wdr_buildrule;
49
  $(settings.ruleAppendTo).append(filter_method + remove_icon);
50
  } else if (settings.addDiscountElement === null && settings.addConditionType !== null && settings.addFilterMethod !== null && settings.ruleAppendTo !== null) {
51
  var condition_type = $(settings.addConditionType).html();
52
- condition_type = condition_type.replace(new RegExp('{i}', 'g'), settings.newIndex);
 
 
 
 
 
 
 
 
 
53
  var condition_method = $(settings.addFilterMethod).html();
54
  condition_method = condition_method.replace(new RegExp('{i}', 'g'), settings.newIndex);
55
- $(settings.ruleAppendTo).append('<div class="wdr-conditions-container wdr-condition-group" data-index="' + settings.newIndex + '">' + condition_type + condition_method + remove_icon + '</div>');
56
  } else if (settings.addDiscountType == null && settings.addDiscountElement !== null && settings.addFilterMethod !== null && settings.ruleAppendTo !== null) {
57
  filter_method = filter_method.replace(new RegExp('{i}', 'g'), settings.newIndex);
58
  $(settings.ruleAppendTo).append(filter_method);
49
  $(settings.ruleAppendTo).append(filter_method + remove_icon);
50
  } else if (settings.addDiscountElement === null && settings.addConditionType !== null && settings.addFilterMethod !== null && settings.ruleAppendTo !== null) {
51
  var condition_type = $(settings.addConditionType).html();
52
+ let style_inline = "";
53
+ let class_inline = "";
54
+ if(!condition_type || condition_type == 'undefined'){
55
+ condition_type = '';
56
+ style_inline = "display:none";
57
+ class_inline = "promo_show_hide_"+settings.newIndex;
58
+ remove_icon = '';
59
+ }else{
60
+ condition_type = condition_type.replace(new RegExp('{i}', 'g'), settings.newIndex);
61
+ }
62
  var condition_method = $(settings.addFilterMethod).html();
63
  condition_method = condition_method.replace(new RegExp('{i}', 'g'), settings.newIndex);
64
+ $(settings.ruleAppendTo).append('<div class="'+class_inline+' wdr-conditions-container wdr-condition-group" style="'+style_inline+'" data-index="' + settings.newIndex + '">' + condition_type + condition_method + remove_icon + '</div>');
65
  } else if (settings.addDiscountType == null && settings.addDiscountElement !== null && settings.addFilterMethod !== null && settings.ruleAppendTo !== null) {
66
  filter_method = filter_method.replace(new RegExp('{i}', 'g'), settings.newIndex);
67
  $(settings.ruleAppendTo).append(filter_method);
v2/Assets/Js/site_main.js CHANGED
@@ -26,16 +26,27 @@
26
 
27
  if (jQuery('button[name="add-to-cart"]').length) {
28
  $product_id = jQuery('button[name="add-to-cart"]').val();
29
- $price_place = jQuery('div.product p.price').first();
 
 
 
 
 
 
30
  } else if (jQuery('input[name="variation_id"]').length) {
31
  $product_id = jQuery('input[name="variation_id"]').val();
32
-
33
- $price_place = jQuery('div.product .woocommerce-variation-price');
34
- if (!jQuery('div.product .woocommerce-variation-price .price').length) {
 
 
 
 
 
35
  $price_place.html("<div class='price'></div>");
36
  }
37
 
38
- $price_place = jQuery('div.product .woocommerce-variation-price .price')
39
  }
40
  if (!$product_id || !$price_place || $product_id == 0) {
41
  return;
@@ -54,8 +65,6 @@
54
  success: function (response) {
55
  if (response.price_html) {
56
  $price_place.html(response.price_html)
57
- } else {
58
- $price_place.html("");
59
  }
60
  },
61
  error: function (response) {
26
 
27
  if (jQuery('button[name="add-to-cart"]').length) {
28
  $product_id = jQuery('button[name="add-to-cart"]').val();
29
+ var target = 'div.product p.price';
30
+ if(awdr_params.custom_target_simple_product != undefined){
31
+ if(awdr_params.custom_target_simple_product != ""){
32
+ target = awdr_params.custom_target_simple_product;
33
+ }
34
+ }
35
+ $price_place = jQuery(target).first();
36
  } else if (jQuery('input[name="variation_id"]').length) {
37
  $product_id = jQuery('input[name="variation_id"]').val();
38
+ var target = 'div.product .woocommerce-variation-price';
39
+ if(awdr_params.custom_target_variable_product != undefined){
40
+ if(awdr_params.custom_target_variable_product != ""){
41
+ target = awdr_params.custom_target_variable_product;
42
+ }
43
+ }
44
+ $price_place = jQuery(target);
45
+ if (!jQuery(target+' .price').length) {
46
  $price_place.html("<div class='price'></div>");
47
  }
48
 
49
+ $price_place = jQuery(target+' .price')
50
  }
51
  if (!$product_id || !$price_place || $product_id == 0) {
52
  return;
65
  success: function (response) {
66
  if (response.price_html) {
67
  $price_place.html(response.price_html)
 
 
68
  }
69
  },
70
  error: function (response) {
woo-discount-rules.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Simple to complex discount rules for your WooCommerce store. Core package.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
- * Version: 1.9.8
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/
@@ -133,6 +133,7 @@ if ($awdr_load_version == "v2") {
133
  {
134
  $database = new \Wdr\App\Models\DBTable();
135
  $database->createDBTables();
 
136
  \Wdr\App\Helpers\Migration::checkForMigration();
137
  }
138
  }
@@ -146,6 +147,10 @@ if ($awdr_load_version == "v2") {
146
  if ($awdr_switched_to_version == "v2") {
147
  awdr_create_required_tables();
148
  }
 
 
 
 
149
  // This is required to load the pro events before core initialize
150
  add_action( 'plugins_loaded', function(){
151
  do_action('advanced_woo_discount_rules_before_loaded');
5
  * Description: Simple to complex discount rules for your WooCommerce store. Core package.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
+ * Version: 1.9.9
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/
133
  {
134
  $database = new \Wdr\App\Models\DBTable();
135
  $database->createDBTables();
136
+ $database->updateDBTables();
137
  \Wdr\App\Helpers\Migration::checkForMigration();
138
  }
139
  }
147
  if ($awdr_switched_to_version == "v2") {
148
  awdr_create_required_tables();
149
  }
150
+ add_action('admin_init', function(){
151
+ awdr_create_required_tables();
152
+ });
153
+
154
  // This is required to load the pro events before core initialize
155
  add_action( 'plugins_loaded', function(){
156
  do_action('advanced_woo_discount_rules_before_loaded');