Discount Rules for WooCommerce - Version 1.7.12

Version Description

  • 02/04/19 =
  • Feature - Option to disable third party coupon while any rule applied.
  • Feature - Option to change coupon name in front end.
  • Feature - Option to add additional taxonomies(custom taxonomies) in categories.
  • Improvement - Settings layout improvement.
  • Fix - Notice while BOGO product in cart rule is not selected.
  • Fix - Coupons which are in disabled rules are not considering as third-pary coupon.
  • Fix - Displaying same price in price strikeout.
  • Fix - In few cases the strikeout doesn't applies while auto add products(BOGO cart rule).
  • Fix - Wrong strike out for variable products while set apply discount from Regular price.
  • Fix - Negative Value displays when the Product price is less than Discounted price for the shortcode {{discounted_price}} in discount table.
  • Fix - Product field has no width while browser is in 90% zoom.
  • Fix - Warning when discount range is not Set
Download this release

Release Info

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

Code changes from version 1.7.11 to 1.7.12

assets/css/style.css CHANGED
@@ -193,7 +193,7 @@ span.wdr_block_span{
193
  .small-text{
194
  width: unset !important;
195
  }
196
- .customize_sale_tag_html_textarea{
197
  width: 100%;
198
  }
199
  .coupons_selectbox_multi_select{
@@ -201,4 +201,10 @@ span.wdr_block_span{
201
  }
202
  .coupons_selectbox_multi_select_wdr{
203
  min-width: 200px;
 
 
 
 
 
 
204
  }
193
  .small-text{
194
  width: unset !important;
195
  }
196
+ .customize_sale_tag_html_textarea,.customize_coupon_name_html_textarea{
197
  width: 100%;
198
  }
199
  .coupons_selectbox_multi_select{
201
  }
202
  .coupons_selectbox_multi_select_wdr{
203
  min-width: 200px;
204
+ }
205
+ .select2-container{
206
+ min-width: 150px;
207
+ }
208
+ .price_rules_s_block_c{
209
+ margin-top: 25px;
210
  }
assets/js/app.js CHANGED
@@ -1049,9 +1049,34 @@ function trigger_woocommerce_tooltip(){
1049
  //-----------------------------------------------SETTINGS-------------------------------------------------------
1050
  //--------------------------------------------------------------------------------------------------------------
1051
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1052
  $('#saveConfig').on('click', function (event) {
1053
  event.preventDefault();
1054
- var form = $('#discount_config').serialize();
 
1055
  var current = $(this);
1056
  var loader = $('.woo_discount_loader_outer > .woo_discount_loader');
1057
  current.val(woo_discount_localization.saving);
@@ -1072,7 +1097,11 @@ function trigger_woocommerce_tooltip(){
1072
  }, 300);
1073
  adminNotice();
1074
  }
1075
- });
 
 
 
 
1076
  });
1077
 
1078
  $('#refresh_wdr_cache').on('click', function (event) {
1049
  //-----------------------------------------------SETTINGS-------------------------------------------------------
1050
  //--------------------------------------------------------------------------------------------------------------
1051
 
1052
+ function woo_email_customizer_save_settings(type, current){
1053
+ var form = $('#discount_config').serialize();
1054
+ var loader = $('.woo_discount_loader_outer > .woo_discount_loader');
1055
+ current.val(woo_discount_localization.saving);
1056
+ $.ajax({
1057
+ url: ajax_url,
1058
+ type: 'POST',
1059
+ data: {action: 'saveConfig', from: type, data: form},
1060
+ beforeSend: function() {
1061
+ loader.show();
1062
+ },
1063
+ complete: function() {
1064
+ loader.hide();
1065
+ },
1066
+ success: function () {
1067
+ // After Removed.
1068
+ resizeChart = setTimeout(function () {
1069
+ current.val(woo_discount_localization.save_text);
1070
+ }, 300);
1071
+ adminNotice();
1072
+ }
1073
+ });
1074
+ }
1075
+
1076
  $('#saveConfig').on('click', function (event) {
1077
  event.preventDefault();
1078
+ woo_email_customizer_save_settings('settings', $(this))
1079
+ /*var form = $('#discount_config').serialize();
1080
  var current = $(this);
1081
  var loader = $('.woo_discount_loader_outer > .woo_discount_loader');
1082
  current.val(woo_discount_localization.saving);
1097
  }, 300);
1098
  adminNotice();
1099
  }
1100
+ });*/
1101
+ });
1102
+ $('#save_taxonomy_config').on('click', function (event) {
1103
+ event.preventDefault();
1104
+ woo_email_customizer_save_settings('taxonomy', $(this))
1105
  });
1106
 
1107
  $('#refresh_wdr_cache').on('click', function (event) {
helper/general-helper.php CHANGED
@@ -269,6 +269,28 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
269
  return $result;
270
  }
271
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
272
  /**
273
  * Get Category by passing product ID or Product.
274
  *
@@ -427,7 +449,7 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
427
  $status = true;
428
  $config = new FlycartWooDiscountBase();
429
  $do_not_run_while_have_third_party_coupon = $config->getConfigData('do_not_run_while_have_third_party_coupon', 0);
430
- if($do_not_run_while_have_third_party_coupon){
431
  $hasCoupon = self::hasCouponInCart();
432
  if($hasCoupon){
433
  self::resetTheCartValues();
@@ -452,6 +474,7 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
452
  if(is_array($appliedCoupons) && count($appliedCoupons) > 0){
453
  $used_coupons = self::getUsedCouponsInRules();
454
  $used_coupons[] = $coupon_code;
 
455
  foreach ($appliedCoupons as $appliedCoupon){
456
  if(!in_array($appliedCoupon, $used_coupons)){
457
  $result = true;
@@ -481,10 +504,16 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
481
  /**
482
  * get Used Coupons
483
  * */
484
- protected static function getUsedCouponsInRules(){
485
  $coupons = array();
486
  $post_args = array('post_type' => array('woo_discount', 'woo_discount_cart'), 'numberposts' => '-1', 'post_status' => 'publish');
487
  $post_args['meta_key'] = 'used_coupon';
 
 
 
 
 
 
488
  $posts = get_posts($post_args);
489
  if(!empty($posts) && count($posts) > 0){
490
  foreach ($posts as $post){
@@ -778,6 +807,7 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
778
  echo "<style>".$styles."</style>";
779
  }
780
  add_action('woocommerce_before_cart_totals', 'FlycartWooDiscountRulesGeneralHelper::woo_discount_rules_custom_styles');
 
781
  }
782
  }
783
  }
269
  return $result;
270
  }
271
 
272
+ /**
273
+ * get taxonomy list
274
+ */
275
+ public static function getTaxonomyList()
276
+ {
277
+ $skip_default_taxonomies = array('category', 'post_tag', 'nav_menu', 'link_category', 'post_format', 'action-group', 'product_type', 'product_visibility', 'product_shipping_class', 'product_cat');
278
+ $args = array();
279
+ $output = 'objects';
280
+ $taxonomies = get_taxonomies($args, $output);
281
+ $additional_taxonomies = array();
282
+ foreach ($taxonomies as $taxonomy){
283
+ if(!in_array($taxonomy->name, $skip_default_taxonomies)){
284
+ $load_attributes_in_categories = apply_filters('woo_discount_rules_load_attributes_in_categories', false);
285
+ if(!(substr( $taxonomy->name, 0, 3 ) === "pa_") || $load_attributes_in_categories){
286
+ $additional_taxonomies[$taxonomy->name] = $taxonomy->label;
287
+ }
288
+ }
289
+ }
290
+
291
+ return $additional_taxonomies;
292
+ }
293
+
294
  /**
295
  * Get Category by passing product ID or Product.
296
  *
449
  $status = true;
450
  $config = new FlycartWooDiscountBase();
451
  $do_not_run_while_have_third_party_coupon = $config->getConfigData('do_not_run_while_have_third_party_coupon', 0);
452
+ if($do_not_run_while_have_third_party_coupon == '1'){
453
  $hasCoupon = self::hasCouponInCart();
454
  if($hasCoupon){
455
  self::resetTheCartValues();
474
  if(is_array($appliedCoupons) && count($appliedCoupons) > 0){
475
  $used_coupons = self::getUsedCouponsInRules();
476
  $used_coupons[] = $coupon_code;
477
+ $used_coupons = apply_filters('woo_discount_rules_coupons_to_skip_while_apply_third_party_coupon_and_disable_rules', $used_coupons);
478
  foreach ($appliedCoupons as $appliedCoupon){
479
  if(!in_array($appliedCoupon, $used_coupons)){
480
  $result = true;
504
  /**
505
  * get Used Coupons
506
  * */
507
+ public static function getUsedCouponsInRules(){
508
  $coupons = array();
509
  $post_args = array('post_type' => array('woo_discount', 'woo_discount_cart'), 'numberposts' => '-1', 'post_status' => 'publish');
510
  $post_args['meta_key'] = 'used_coupon';
511
+ $post_args['meta_query'] = array(
512
+ array(
513
+ 'key' => 'status',
514
+ 'value' => 'publish',
515
+ )
516
+ );
517
  $posts = get_posts($post_args);
518
  if(!empty($posts) && count($posts) > 0){
519
  foreach ($posts as $post){
807
  echo "<style>".$styles."</style>";
808
  }
809
  add_action('woocommerce_before_cart_totals', 'FlycartWooDiscountRulesGeneralHelper::woo_discount_rules_custom_styles');
810
+ add_action('woocommerce_review_order_before_cart_contents', 'FlycartWooDiscountRulesGeneralHelper::woo_discount_rules_custom_styles');
811
  }
812
  }
813
  }
helper/woo-function.php CHANGED
@@ -174,7 +174,14 @@ if(!class_exists('FlycartWoocommerceProduct')){
174
  if($cart_rule === false){
175
  $do_discount_from_regular_price = FlycartWooDiscountRulesGeneralHelper::applyDiscountFromRegularPrice();
176
  if($do_discount_from_regular_price){
177
- return self::get_regular_price($product);
 
 
 
 
 
 
 
178
  }
179
  }
180
 
@@ -517,6 +524,18 @@ if(!class_exists('FlycartWoocommerceCartProduct')){
517
  }
518
  }
519
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  /**
521
  * set quantity
522
  *
@@ -529,6 +548,18 @@ if(!class_exists('FlycartWoocommerceCartProduct')){
529
  public static function set_quantity( $cart_item_key, $quantity = 1, $refresh_totals = true ){
530
  return WC()->cart->set_quantity($cart_item_key, $quantity, $refresh_totals);
531
  }
 
 
 
 
 
 
 
 
 
 
 
 
532
  }
533
  }
534
 
@@ -684,6 +715,18 @@ if(!class_exists('FlycartWoocommerceCoupon')){
684
  {
685
  return FlycartWoocommerceVersion::wcVersion('3.0') ? $coupon->get_individual_use() : $coupon->individual_use;
686
  }
 
 
 
 
 
 
 
 
 
 
 
 
687
  }
688
  }
689
 
174
  if($cart_rule === false){
175
  $do_discount_from_regular_price = FlycartWooDiscountRulesGeneralHelper::applyDiscountFromRegularPrice();
176
  if($do_discount_from_regular_price){
177
+ if(method_exists($product, 'get_type')){
178
+ if($product->get_type() != 'variable'){
179
+ return self::get_regular_price($product);
180
+ }
181
+ } else {
182
+ return self::get_regular_price($product);
183
+ }
184
+
185
  }
186
  }
187
 
524
  }
525
  }
526
 
527
+ /**
528
+ * Get cart item
529
+ *
530
+ * @access public
531
+ * @param string $cart_item_key
532
+ * @return array
533
+ */
534
+ public static function get_cart_item($cart_item_key)
535
+ {
536
+ return WC()->cart->get_cart_item($cart_item_key);
537
+ }
538
+
539
  /**
540
  * set quantity
541
  *
548
  public static function set_quantity( $cart_item_key, $quantity = 1, $refresh_totals = true ){
549
  return WC()->cart->set_quantity($cart_item_key, $quantity, $refresh_totals);
550
  }
551
+
552
+ /**
553
+ * Remove coupon from cart
554
+ *
555
+ * @access public
556
+ * @param string $code
557
+ * @return boolean
558
+ */
559
+ public static function remove_coupon($code)
560
+ {
561
+ return WC()->cart->remove_coupon($code);
562
+ }
563
  }
564
  }
565
 
715
  {
716
  return FlycartWoocommerceVersion::wcVersion('3.0') ? $coupon->get_individual_use() : $coupon->individual_use;
717
  }
718
+
719
+ /**
720
+ * Get Coupon code
721
+ *
722
+ * @access public
723
+ * @param object $coupon
724
+ * @return boolean
725
+ */
726
+ public static function get_code($coupon)
727
+ {
728
+ return FlycartWoocommerceVersion::wcVersion('3.0') ? $coupon->get_code() : $coupon->code;
729
+ }
730
  }
731
  }
732
 
i18n/languages/woo-discount-rules.pot CHANGED
@@ -15,31 +15,31 @@ msgstr ""
15
  msgid "Guest"
16
  msgstr ""
17
 
18
- #: helper/general-helper.php:551
19
  msgid "Start date and time is set in the future date"
20
  msgstr ""
21
 
22
- #: helper/general-helper.php:554
23
  msgid "Validity expired"
24
  msgstr ""
25
 
26
- #: helper/general-helper.php:571
27
  msgid "Will run in future"
28
  msgstr ""
29
 
30
- #: helper/general-helper.php:574
31
  msgid "Not running - validity expired"
32
  msgstr ""
33
 
34
- #: helper/general-helper.php:591
35
  msgid "Running"
36
  msgstr ""
37
 
38
- #: helper/general-helper.php:596
39
  msgid "Your server current date and time: "
40
  msgstr ""
41
 
42
- #: helper/general-helper.php:712
43
  msgid "Read Docs"
44
  msgstr ""
45
 
@@ -99,15 +99,15 @@ msgstr ""
99
  msgid "License key check : Passed."
100
  msgstr ""
101
 
102
- #: helper/purchase.php:178 view/settings.php:62
103
  msgid "License key seems to be Invalid. Please enter a valid license key"
104
  msgstr ""
105
 
106
- #: helper/woo-function.php:380 helper/woo-function.php:390
107
  msgid "Search for a product&hellip;"
108
  msgstr ""
109
 
110
- #: helper/woo-function.php:423 helper/woo-function.php:435
111
  msgid "Search for a user&hellip;"
112
  msgstr ""
113
 
@@ -119,13 +119,15 @@ msgstr ""
119
  msgid "Custom Shipping Method for Woocommerce Discount Rules"
120
  msgstr ""
121
 
122
- #: includes/advanced/free_shipping_method.php:68 view/settings.php:574
 
123
  msgid "Free Shipping"
124
  msgstr ""
125
 
126
- #: includes/advanced/free_shipping_method.php:73 includes/discount-base.php:990
127
- #: view/cart-rules.php:133 view/pricing-rules.php:163 view/settings.php:655
128
- #: view/settings.php:690
 
129
  msgid "Enable"
130
  msgstr ""
131
 
@@ -141,432 +143,434 @@ msgstr ""
141
  msgid "Title to be display on site"
142
  msgstr ""
143
 
144
- #: includes/discount-base.php:188 view/cart-rules.php:147
145
  #: view/pricing-rules.php:177
146
  msgid "Active"
147
  msgstr ""
148
 
149
- #: includes/discount-base.php:190 view/cart-rules.php:149
150
- #: view/pricing-rules.php:179 view/settings.php:297 view/settings.php:444
151
- #: view/settings.php:543 view/settings.php:550 view/settings.php:652
152
- #: view/settings.php:687
 
153
  msgid "Disabled"
154
  msgstr ""
155
 
156
- #: includes/discount-base.php:478
157
  msgid "Cache cleared successfully"
158
  msgstr ""
159
 
160
- #: includes/discount-base.php:480
161
  msgid "Failed to clear cache"
162
  msgstr ""
163
 
164
- #: includes/discount-base.php:586 includes/discount-base.php:621
165
  msgid "Failed to do action"
166
  msgstr ""
167
 
168
- #: includes/discount-base.php:625
169
  msgid "Disabled successfully"
170
  msgstr ""
171
 
172
- #: includes/discount-base.php:628
173
  msgid "Deleted successfully"
174
  msgstr ""
175
 
176
- #: includes/discount-base.php:631
177
  msgid "Enabled successfully"
178
  msgstr ""
179
 
180
- #: includes/discount-base.php:651 includes/discount-base.php:652
181
- #: includes/discount-base.php:669
182
  msgid "copy"
183
  msgstr ""
184
 
185
- #: includes/discount-base.php:677
186
  msgid "Duplicate rule created successfully"
187
  msgstr ""
188
 
189
- #: includes/discount-base.php:681
190
  msgid "Failed to create duplicate rule"
191
  msgstr ""
192
 
193
- #: includes/discount-base.php:945
194
  msgid "Please fill this field"
195
  msgstr ""
196
 
197
- #: includes/discount-base.php:946
198
  msgid "Please Enter the Rule Name to Create / Save."
199
  msgstr ""
200
 
201
- #: includes/discount-base.php:947
202
  msgid "Saving..."
203
  msgstr ""
204
 
205
- #: includes/discount-base.php:948 view/view-cart-rules.php:54
206
  #: view/view-pricing-rules.php:37
207
  msgid "Save Rule"
208
  msgstr ""
209
 
210
- #: includes/discount-base.php:949
211
  msgid "Please enter a Key"
212
  msgstr ""
213
 
214
- #: includes/discount-base.php:950 view/view-pricing-rules.php:654
215
  msgid "Min Quantity"
216
  msgstr ""
217
 
218
- #: includes/discount-base.php:951 view/view-pricing-rules.php:661
219
  msgid "Max Quantity"
220
  msgstr ""
221
 
222
- #: includes/discount-base.php:952 view/view-cart-rules.php:91
223
  #: view/view-pricing-rules.php:75 view/view-pricing-rules.php:659
224
  #: view/view-pricing-rules.php:725 view/view-pricing-rules.php:742
225
  #: view/view-pricing-rules.php:749
226
  msgid "ex. 1"
227
  msgstr ""
228
 
229
- #: includes/discount-base.php:953 view/view-pricing-rules.php:787
230
  msgid "ex. 10"
231
  msgstr ""
232
 
233
- #: includes/discount-base.php:954 view/view-pricing-rules.php:666
234
  #: view/view-pricing-rules.php:702
235
  msgid "ex. 50"
236
  msgstr ""
237
 
238
- #: includes/discount-base.php:955
239
  msgid "Search for a user"
240
  msgstr ""
241
 
242
- #: includes/discount-base.php:956 view/view-pricing-rules.php:667
243
  msgid "Adjustment Type"
244
  msgstr ""
245
 
246
- #: includes/discount-base.php:957 view/view-pricing-rules.php:776
247
  msgid "Discount percentage"
248
  msgstr ""
249
 
250
- #: includes/discount-base.php:958 view/view-cart-rules.php:612
251
  #: view/view-pricing-rules.php:673
252
  msgid "Percentage Discount"
253
  msgstr ""
254
 
255
- #: includes/discount-base.php:959 view/view-cart-rules.php:618
256
  #: view/view-cart-rules.php:620 view/view-pricing-rules.php:681
257
  #: view/view-pricing-rules.php:683
258
  msgid "Price Discount"
259
  msgstr ""
260
 
261
- #: includes/discount-base.php:960 view/view-pricing-rules.php:691
262
  #: view/view-pricing-rules.php:693
263
  msgid "BOGO Product Discount"
264
  msgstr ""
265
 
266
- #: includes/discount-base.php:961
267
  msgid "Product Discount - Not support for subtotal based rule"
268
  msgstr ""
269
 
270
- #: includes/discount-base.php:962 view/view-cart-rules.php:398
271
  #: view/view-pricing-rules.php:697 view/view-pricing-rules.php:816
272
  msgid "Value"
273
  msgstr ""
274
 
275
- #: includes/discount-base.php:963 view/view-pricing-rules.php:708
276
  msgid "receive discount for"
277
  msgstr ""
278
 
279
- #: includes/discount-base.php:964 view/view-pricing-rules.php:710
280
  msgid "Auto add all selected products"
281
  msgstr ""
282
 
283
- #: includes/discount-base.php:965 view/view-pricing-rules.php:711
284
  msgid "Same product"
285
  msgstr ""
286
 
287
- #: includes/discount-base.php:966 view/view-pricing-rules.php:712
288
  msgid "Any one cheapest from selected"
289
  msgstr ""
290
 
291
- #: includes/discount-base.php:967 view/view-pricing-rules.php:713
292
  msgid "Any one cheapest from all products"
293
  msgstr ""
294
 
295
- #: includes/discount-base.php:968 view/view-pricing-rules.php:714
296
  msgid "Cheapest in cart - selected category(ies)"
297
  msgstr ""
298
 
299
- #: includes/discount-base.php:969 view/view-pricing-rules.php:715
300
  msgid "Cheapest in cart - selected item(s)"
301
  msgstr ""
302
 
303
- #: includes/discount-base.php:970 view/view-pricing-rules.php:716
304
  msgid "Cheapest among all items in cart"
305
  msgstr ""
306
 
307
- #: includes/discount-base.php:971 view/view-pricing-rules.php:720
308
  msgid "Free quantity"
309
  msgstr ""
310
 
311
- #: includes/discount-base.php:972 view/view-pricing-rules.php:720
312
  msgid "Number of quantity(ies) in each selected product(s)"
313
  msgstr ""
314
 
315
- #: includes/discount-base.php:973 view/view-pricing-rules.php:734
316
  msgid "Fixed item count (not recommended)"
317
  msgstr ""
318
 
319
- #: includes/discount-base.php:974 view/view-pricing-rules.php:733
320
  msgid "Dynamic item count"
321
  msgstr ""
322
 
323
- #: includes/discount-base.php:975 view/view-pricing-rules.php:736
324
  msgid ""
325
  "Fixed item count - You need to provide item count manually. Dynamic item "
326
  "count - System will choose dynamically based on cart"
327
  msgstr ""
328
 
329
- #: includes/discount-base.php:976 view/view-pricing-rules.php:737
330
  msgid "Item count"
331
  msgstr ""
332
 
333
- #: includes/discount-base.php:977 view/view-pricing-rules.php:737
334
  msgid "Discount for number of item(s) in cart"
335
  msgstr ""
336
 
337
- #: includes/discount-base.php:978 view/view-pricing-rules.php:744
338
  msgid "Discount for number of quantity(ies) in each item"
339
  msgstr ""
340
 
341
- #: includes/discount-base.php:979 view/view-pricing-rules.php:744
342
  msgid "Item quantity"
343
  msgstr ""
344
 
345
- #: includes/discount-base.php:980
346
  msgid "Search for a products"
347
  msgstr ""
348
 
349
- #: includes/discount-base.php:981
350
  msgid "and"
351
  msgstr ""
352
 
353
- #: includes/discount-base.php:982 view/view-pricing-rules.php:778
354
  msgid "100% percent"
355
  msgstr ""
356
 
357
- #: includes/discount-base.php:983 view/view-pricing-rules.php:779
358
  msgid "Limited percent"
359
  msgstr ""
360
 
361
- #: includes/discount-base.php:984 view/view-pricing-rules.php:787
362
  msgid "Percentage"
363
  msgstr ""
364
 
365
- #: includes/discount-base.php:985
366
  msgid "as discount"
367
  msgstr ""
368
 
369
- #: includes/discount-base.php:986 view/view-cart-rules.php:575
370
  #: view/view-pricing-rules.php:793
371
  msgid "Remove"
372
  msgstr ""
373
 
374
- #: includes/discount-base.php:987 view/cart-rules.php:170
375
  #: view/pricing-rules.php:200 view/view-pricing-rules.php:796
376
  msgid "Duplicate"
377
  msgstr ""
378
 
379
- #: includes/discount-base.php:988
380
  msgid "none"
381
  msgstr ""
382
 
383
- #: includes/discount-base.php:989
384
  msgid "Are you sure to remove this ?"
385
  msgstr ""
386
 
387
- #: includes/discount-base.php:991 view/cart-rules.php:130
388
  #: view/pricing-rules.php:160
389
  msgid "Disable"
390
  msgstr ""
391
 
392
- #: includes/discount-base.php:992
393
  msgid "Are you sure to remove ?"
394
  msgstr ""
395
 
396
- #: includes/discount-base.php:993 view/view-cart-rules.php:171
397
  msgid "Type"
398
  msgstr ""
399
 
400
- #: includes/discount-base.php:994 view/view-cart-rules.php:175
401
  msgid "Cart Subtotal"
402
  msgstr ""
403
 
404
- #: includes/discount-base.php:995 view/view-cart-rules.php:178
405
  msgid "Subtotal at least"
406
  msgstr ""
407
 
408
- #: includes/discount-base.php:996 view/view-cart-rules.php:182
409
  msgid "Subtotal less than"
410
  msgstr ""
411
 
412
- #: includes/discount-base.php:997 view/view-cart-rules.php:185
413
  msgid "Cart Item Count"
414
  msgstr ""
415
 
416
- #: includes/discount-base.php:998 view/view-cart-rules.php:188
417
  msgid "Number of line items in the cart (not quantity) at least"
418
  msgstr ""
419
 
420
- #: includes/discount-base.php:999 view/view-cart-rules.php:192
421
  msgid "Number of line items in the cart (not quantity) less than"
422
  msgstr ""
423
 
424
- #: includes/discount-base.php:1000 view/view-cart-rules.php:195
425
  msgid "Quantity Sum"
426
  msgstr ""
427
 
428
- #: includes/discount-base.php:1001 view/view-cart-rules.php:201
429
  #: view/view-cart-rules.php:204
430
  msgid "Total number of quantities in the cart at least"
431
  msgstr ""
432
 
433
- #: includes/discount-base.php:1002 view/view-cart-rules.php:213
434
  #: view/view-cart-rules.php:216
435
  msgid "Total number of quantities in the cart less than"
436
  msgstr ""
437
 
438
- #: includes/discount-base.php:1003 view/view-cart-rules.php:225
439
  msgid "Categories in cart"
440
  msgstr ""
441
 
442
- #: includes/discount-base.php:1004 view/view-cart-rules.php:231
443
  msgid "Including sub-categories in cart"
444
  msgstr ""
445
 
446
- #: includes/discount-base.php:1005 view/view-cart-rules.php:240
447
  msgid "Customer Details (must be logged in)"
448
  msgstr ""
449
 
450
- #: includes/discount-base.php:1006 view/view-cart-rules.php:246
451
  #: view/view-cart-rules.php:248
452
  msgid "User in list"
453
  msgstr ""
454
 
455
- #: includes/discount-base.php:1007 view/view-cart-rules.php:256
456
  #: view/view-cart-rules.php:258
457
  msgid "User role in list"
458
  msgstr ""
459
 
460
- #: includes/discount-base.php:1008 view/view-cart-rules.php:266
461
  #: view/view-cart-rules.php:268
462
  msgid "Shipping country in list"
463
  msgstr ""
464
 
465
- #: includes/discount-base.php:1009 view/view-cart-rules.php:272
466
  msgid "Customer Email"
467
  msgstr ""
468
 
469
- #: includes/discount-base.php:1010
470
  msgid "Email with TLD (Ege: edu)"
471
  msgstr ""
472
 
473
- #: includes/discount-base.php:1011 view/view-cart-rules.php:288
474
  #: view/view-cart-rules.php:290
475
  msgid "Email with Domain (Eg: gmail.com)"
476
  msgstr ""
477
 
478
- #: includes/discount-base.php:1012 view/view-cart-rules.php:294
479
  msgid "Customer Billing Details"
480
  msgstr ""
481
 
482
- #: includes/discount-base.php:1013 view/view-cart-rules.php:300
483
  #: view/view-cart-rules.php:302
484
  msgid "Billing city"
485
  msgstr ""
486
 
487
- #: includes/discount-base.php:1014 view/view-cart-rules.php:306
488
  msgid "Customer Shipping Details"
489
  msgstr ""
490
 
491
- #: includes/discount-base.php:1015 view/view-cart-rules.php:312
492
  #: view/view-cart-rules.php:314
493
  msgid "Shipping state"
494
  msgstr ""
495
 
496
- #: includes/discount-base.php:1016 view/view-cart-rules.php:322
497
  #: view/view-cart-rules.php:324
498
  msgid "Shipping city"
499
  msgstr ""
500
 
501
- #: includes/discount-base.php:1017 view/view-cart-rules.php:332
502
  #: view/view-cart-rules.php:334
503
  msgid "Shipping zip code"
504
  msgstr ""
505
 
506
- #: includes/discount-base.php:1018 view/view-cart-rules.php:338
507
  #: view/view-pricing-rules.php:483
508
  msgid "Purchase History"
509
  msgstr ""
510
 
511
- #: includes/discount-base.php:1019 view/view-cart-rules.php:344
512
  #: view/view-cart-rules.php:346 view/view-pricing-rules.php:491
513
  msgid "Purchased amount"
514
  msgstr ""
515
 
516
- #: includes/discount-base.php:1020 view/view-cart-rules.php:354
517
  #: view/view-cart-rules.php:356 view/view-pricing-rules.php:492
518
  msgid "Number of previous orders made"
519
  msgstr ""
520
 
521
- #: includes/discount-base.php:1021 view/view-cart-rules.php:364
522
  #: view/view-cart-rules.php:366 view/view-pricing-rules.php:493
523
  msgid "Number of previous orders made with following products"
524
  msgstr ""
525
 
526
- #: includes/discount-base.php:1022 view/view-cart-rules.php:370
527
  msgid "Coupon applied"
528
  msgstr ""
529
 
530
- #: includes/discount-base.php:1023 view/view-cart-rules.php:376
531
  #: view/view-cart-rules.php:378
532
  msgid "Atleast any one"
533
  msgstr ""
534
 
535
- #: includes/discount-base.php:1024 view/view-cart-rules.php:386
536
  #: view/view-cart-rules.php:388
537
  msgid "All selected"
538
  msgstr ""
539
 
540
- #: includes/discount-base.php:1025 view/view-cart-rules.php:544
541
  #: view/view-pricing-rules.php:528
542
  msgid "Greater than or equal to"
543
  msgstr ""
544
 
545
- #: includes/discount-base.php:1026 view/view-cart-rules.php:545
546
  #: view/view-pricing-rules.php:529
547
  msgid "Less than or equal to"
548
  msgstr ""
549
 
550
- #: includes/discount-base.php:1027 view/view-cart-rules.php:547
551
  #: view/view-pricing-rules.php:532
552
  msgid "and the order status should be"
553
  msgstr ""
554
 
555
- #: includes/discount-base.php:1028 view/cart-rules.php:114
556
  #: view/cart-rules.php:209 view/pricing-rules.php:144
557
  #: view/pricing-rules.php:239 view/view-cart-rules.php:574
558
  msgid "Action"
559
  msgstr ""
560
 
561
- #: includes/discount-base.php:1029 view/settings.php:21
 
562
  msgid "Save"
563
  msgstr ""
564
 
565
- #: includes/discount-base.php:1030
566
  msgid "Saved Successfully!"
567
  msgstr ""
568
 
569
- #: includes/discount-base.php:1031 view/view-cart-rules.php:427
570
  #: view/view-cart-rules.php:462 view/view-cart-rules.php:482
571
  #: view/view-cart-rules.php:503 view/view-cart-rules.php:552
572
  #: view/view-pricing-rules.php:234 view/view-pricing-rules.php:250
@@ -575,44 +579,45 @@ msgstr ""
575
  msgid "None selected"
576
  msgstr ""
577
 
578
- #: includes/discount-base.php:1032 view/view-cart-rules.php:237
579
  msgid "In each category"
580
  msgstr ""
581
 
582
- #: includes/discount-base.php:1033 view/settings.php:212 view/settings.php:336
583
- #: view/settings.php:354 view/settings.php:372 view/settings.php:390
 
584
  msgid "Show"
585
  msgstr ""
586
 
587
- #: includes/discount-base.php:1034 view/template/sidebar.php:12
588
  msgid "Hide"
589
  msgstr ""
590
 
591
- #: includes/discount-base.php:1035
592
  msgid "Please select at least one rule"
593
  msgstr ""
594
 
595
- #: includes/discount-base.php:1036
596
  msgid "Please select an action to apply"
597
  msgstr ""
598
 
599
- #: includes/discount-base.php:1037
600
  msgid "Are you sure to remove the selected rules"
601
  msgstr ""
602
 
603
- #: includes/discount-base.php:1038 view/view-pricing-rules.php:753
604
  msgid "Choose product(s)"
605
  msgstr ""
606
 
607
- #: includes/discount-base.php:1039 view/view-pricing-rules.php:763
608
  msgid "Choose category(ies)"
609
  msgstr ""
610
 
611
- #: includes/discount-base.php:1040
612
  msgid "Search for a coupon"
613
  msgstr ""
614
 
615
- #: includes/discount-base.php:1041 view/view-pricing-rules.php:718
616
  msgid ""
617
  "Auto add all selected products - Automatically added to the cart <br> Same "
618
  "product - get discount in same product <br> Any one cheapest from selected - "
@@ -623,92 +628,92 @@ msgid ""
623
  "no.of quantities"
624
  msgstr ""
625
 
626
- #: includes/pricing-rules.php:2582 view/view-pricing-rules.php:565
627
  msgid "Buy"
628
  msgstr ""
629
 
630
- #: includes/pricing-rules.php:2586
631
  msgid " less than or equal to "
632
  msgstr ""
633
 
634
- #: includes/pricing-rules.php:2586 includes/pricing-rules.php:2592
635
  msgid " Quantity"
636
  msgstr ""
637
 
638
- #: includes/pricing-rules.php:2589
639
  msgid " Quantity "
640
  msgstr ""
641
 
642
- #: includes/pricing-rules.php:2596
643
  msgid " or more Quantity"
644
  msgstr ""
645
 
646
- #: includes/pricing-rules.php:2605
647
  msgid " any "
648
  msgstr ""
649
 
650
- #: includes/pricing-rules.php:2605
651
  msgid " products from "
652
  msgstr ""
653
 
654
- #: includes/pricing-rules.php:2612
655
  msgid " in each products"
656
  msgstr ""
657
 
658
- #: includes/pricing-rules.php:2624
659
  msgid " and get discount in "
660
  msgstr ""
661
 
662
- #: includes/pricing-rules.php:2627
663
  msgid " first "
664
  msgstr ""
665
 
666
- #: includes/pricing-rules.php:2629 includes/pricing-rules.php:2633
667
  msgid " quantity of product(s) - "
668
  msgstr ""
669
 
670
- #: includes/pricing-rules.php:2631
671
  msgid " after first "
672
  msgstr ""
673
 
674
- #: includes/pricing-rules.php:2649
675
  msgid "Category(ies) "
676
  msgstr ""
677
 
678
- #: includes/pricing-rules.php:2716
679
  msgid "Get "
680
  msgstr ""
681
 
682
- #: includes/pricing-rules.php:2718
683
  #, php-format
684
  msgid "% discount in "
685
  msgstr ""
686
 
687
- #: includes/pricing-rules.php:2721
688
  msgid "same product"
689
  msgstr ""
690
 
691
- #: includes/pricing-rules.php:2723
692
  msgid "any cheapest one from cart"
693
  msgstr ""
694
 
695
- #: includes/pricing-rules.php:2726
696
  msgid "any cheapest one of "
697
  msgstr ""
698
 
699
- #: includes/pricing-rules.php:2731
700
  msgid " quantity of any "
701
  msgstr ""
702
 
703
- #: includes/pricing-rules.php:2733
704
  msgid " cheapest item "
705
  msgstr ""
706
 
707
- #: includes/pricing-rules.php:2736
708
  msgid " quantity of cheapest item "
709
  msgstr ""
710
 
711
- #: includes/pricing-rules.php:2740
712
  msgid "from the category "
713
  msgstr ""
714
 
@@ -907,6 +912,10 @@ msgid "Settings"
907
  msgstr ""
908
 
909
  #: view/includes/menu.php:17
 
 
 
 
910
  msgid "Read documentation"
911
  msgstr ""
912
 
@@ -934,316 +943,381 @@ msgstr ""
934
  msgid "Promotion"
935
  msgstr ""
936
 
937
- #: view/settings.php:37
938
- msgid "General Settings"
939
  msgstr ""
940
 
941
- #: view/settings.php:44
942
- msgid "License Key :"
943
  msgstr ""
944
 
945
- #: view/settings.php:50
946
- msgid "Your Unique License Key"
947
  msgstr ""
948
 
949
- #: view/settings.php:51
950
- msgid "Validate Key"
951
  msgstr ""
952
 
953
- #: view/settings.php:75
954
- msgid "Tip: Install pro package before validating the licence"
955
  msgstr ""
956
 
957
- #: view/settings.php:83
958
- msgid "Enable dropdowns (applies only for the rule engine in the backend.)"
 
 
959
  msgstr ""
960
 
961
- #: view/settings.php:88 view/settings.php:105 view/settings.php:117
962
- #: view/settings.php:130 view/settings.php:406 view/settings.php:418
963
- #: view/settings.php:430 view/settings.php:617
964
- msgid "Yes"
965
  msgstr ""
966
 
967
- #: view/settings.php:89 view/settings.php:106 view/settings.php:118
968
- #: view/settings.php:131 view/settings.php:407 view/settings.php:419
969
- #: view/settings.php:431 view/settings.php:618
970
- msgid "No"
971
  msgstr ""
972
 
973
- #: view/settings.php:92
974
- msgid ""
975
- "Disabling this setting may affect dropdowns in rule engine (Disabling this "
976
- "setting is not recommended). Change this only if you know what you are doing."
977
  msgstr ""
978
 
979
- #: view/settings.php:100
980
- msgid "Force refresh the cart widget while add and remove item to cart"
 
981
  msgstr ""
982
 
983
- #: view/settings.php:112
984
- msgid "Disable the rules while having a coupon (Third party) in cart"
 
985
  msgstr ""
986
 
987
- #: view/settings.php:125
988
- msgid ""
989
- "Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a "
990
- "coupon used with discount rule conditions"
991
  msgstr ""
992
 
993
- #: view/settings.php:142
994
- msgid "Price rules settings"
 
 
 
995
  msgstr ""
996
 
997
- #: view/settings.php:150
998
- msgid "Rule Setup"
999
  msgstr ""
1000
 
1001
- #: view/settings.php:156 view/settings.php:507
1002
- msgid "Apply first matched rule"
1003
  msgstr ""
1004
 
1005
- #: view/settings.php:162 view/settings.php:164 view/settings.php:513
1006
- #: view/settings.php:515
1007
- msgid "Apply all matched rules"
1008
  msgstr ""
1009
 
1010
- #: view/settings.php:171 view/settings.php:173 view/settings.php:522
1011
- #: view/settings.php:524
1012
- msgid "Apply biggest discount"
1013
  msgstr ""
1014
 
1015
- #: view/settings.php:182
1016
- msgid "Apply discount based on"
1017
  msgstr ""
1018
 
1019
- #: view/settings.php:189
1020
- msgid "Sale price"
1021
  msgstr ""
1022
 
1023
- #: view/settings.php:192
1024
- msgid "Regular price"
1025
  msgstr ""
1026
 
1027
- #: view/settings.php:197
1028
- msgid ""
1029
- "If sale price is not entered in your products, the regular price will be "
1030
- "taken"
1031
  msgstr ""
1032
 
1033
- #: view/settings.php:206
1034
- msgid "Show Price discount on product pages :"
1035
  msgstr ""
1036
 
1037
- #: view/settings.php:215 view/settings.php:339 view/settings.php:357
1038
- #: view/settings.php:375 view/settings.php:393
1039
- msgid "Don't Show"
1040
  msgstr ""
1041
 
1042
- #: view/settings.php:225
1043
- msgid "Show a Sale badge on product pages :"
1044
  msgstr ""
1045
 
1046
- #: view/settings.php:231
1047
- msgid "Do not show"
1048
  msgstr ""
1049
 
1050
- #: view/settings.php:234
1051
- msgid "Show only after a rule condition is matched exactly"
 
 
 
 
 
 
 
 
 
 
1052
  msgstr ""
1053
 
1054
- #: view/settings.php:237
1055
  msgid ""
1056
- "Show on products that are covered under any price based discount rule in the "
1057
- "plugin"
1058
  msgstr ""
1059
 
1060
- #: view/settings.php:247
1061
- msgid "Do you want to customize the sale badge?"
1062
  msgstr ""
1063
 
1064
- #: view/settings.php:254
1065
- msgid "Yes, I would like to customize the sale badge"
 
 
1066
  msgstr ""
1067
 
1068
- #: view/settings.php:257 view/settings.php:540 view/view-pricing-rules.php:299
1069
- #: view/view-pricing-rules.php:356 view/view-pricing-rules.php:426
1070
- #: view/view-pricing-rules.php:472 view/view-pricing-rules.php:501
1071
- msgid "Supported in PRO version"
1072
  msgstr ""
1073
 
1074
- #: view/settings.php:269
1075
- msgid "Sale badge content (TIP: You can use HTML inside)"
 
 
 
 
1076
  msgstr ""
1077
 
1078
- #: view/settings.php:276
1079
  msgid ""
1080
- "IMPORTANT NOTE: This customized sale badge will be applicable only for "
1081
- "products that are part of the discount rules configured in this plugin"
1082
  msgstr ""
1083
 
1084
- #: view/settings.php:280
1085
- msgid "Eg:"
1086
  msgstr ""
1087
 
1088
- #: view/settings.php:291
1089
- msgid "Discount Table :"
1090
  msgstr ""
1091
 
1092
- #: view/settings.php:300
1093
- msgid "Default layout"
1094
  msgstr ""
1095
 
1096
- #: view/settings.php:303
1097
- msgid "Advance layout"
1098
  msgstr ""
1099
 
1100
- #: view/settings.php:312
1101
- msgid "Table placement:"
1102
  msgstr ""
1103
 
1104
- #: view/settings.php:318
1105
- msgid "Before cart form"
1106
  msgstr ""
1107
 
1108
- #: view/settings.php:321
1109
- msgid "After cart form"
1110
  msgstr ""
1111
 
1112
- #: view/settings.php:330
1113
- msgid "Table header :"
1114
  msgstr ""
1115
 
1116
- #: view/settings.php:348
1117
- msgid "Title column on table :"
1118
  msgstr ""
1119
 
1120
- #: view/settings.php:366
1121
- msgid "Range column on table :"
1122
  msgstr ""
1123
 
1124
- #: view/settings.php:384
1125
- msgid "Discount column on table :"
1126
  msgstr ""
1127
 
1128
- #: view/settings.php:401
 
 
 
 
1129
  msgid ""
1130
- "Show a crossed-out original price along with discounted price at line items "
1131
- "in cart"
1132
  msgstr ""
1133
 
1134
- #: view/settings.php:413
1135
  msgid ""
1136
  "Auto add free product when coupon is applied (For coupon-activated rules)"
1137
  msgstr ""
1138
 
1139
- #: view/settings.php:425
1140
  msgid "Include variants when just parent products are chosen in the rules"
1141
  msgstr ""
1142
 
1143
- #: view/settings.php:438
1144
- msgid "Display savings text"
1145
  msgstr ""
1146
 
1147
- #: view/settings.php:447
1148
- msgid "On each line item"
 
 
1149
  msgstr ""
1150
 
1151
- #: view/settings.php:450
1152
- msgid "On after total"
 
 
1153
  msgstr ""
1154
 
1155
- #: view/settings.php:453
1156
- msgid "Both in line item and after total"
1157
  msgstr ""
1158
 
1159
- #: view/settings.php:461
1160
- msgid "Savings text to show"
1161
  msgstr ""
1162
 
1163
- #: view/settings.php:469
1164
- msgid "{{total_discount_price}} -> Total discount applied"
1165
  msgstr ""
1166
 
1167
- #: view/settings.php:481
1168
- msgid "Cart rules settings"
1169
  msgstr ""
1170
 
1171
- #: view/settings.php:488
1172
- msgid "Coupon Name to be displayed :"
1173
  msgstr ""
1174
 
1175
- #: view/settings.php:494
1176
- msgid "Discount Coupon Name"
1177
  msgstr ""
1178
 
1179
- #: view/settings.php:501
1180
- msgid "Rule Setup for Cart:"
1181
  msgstr ""
1182
 
1183
- #: view/settings.php:533
1184
- msgid "Enable free shipping option"
1185
  msgstr ""
1186
 
1187
- #: view/settings.php:553
1188
- msgid "Use Woocommerce free shipping"
1189
  msgstr ""
1190
 
1191
- #: view/settings.php:556
1192
- msgid "Use Woo-Discount free shipping"
1193
  msgstr ""
1194
 
1195
- #: view/settings.php:570
1196
- msgid "Free shipping text to be displayed"
1197
  msgstr ""
1198
 
1199
- #: view/settings.php:577
1200
- msgid "Free Shipping title"
1201
  msgstr ""
1202
 
1203
- #: view/settings.php:584
1204
- msgid "Draft"
1205
  msgstr ""
1206
 
1207
- #: view/settings.php:594
1208
- msgid "Exclude Draft products in product select box."
 
 
1209
  msgstr ""
1210
 
1211
- #: view/settings.php:604
1212
- msgid "Performance settings"
1213
  msgstr ""
1214
 
1215
- #: view/settings.php:612
1216
- msgid "Enable cache for variable products table content"
1217
  msgstr ""
1218
 
1219
- #: view/settings.php:624 view/settings.php:628
1220
- msgid "Clear cache"
 
 
 
 
 
 
1221
  msgstr ""
1222
 
1223
- #: view/settings.php:638
 
 
 
 
1224
  msgid "Promotion settings"
1225
  msgstr ""
1226
 
1227
- #: view/settings.php:645
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1228
  msgid "Show a message on applying price rules in cart"
1229
  msgstr ""
1230
 
1231
- #: view/settings.php:663 view/settings.php:698
1232
  msgid "Message"
1233
  msgstr ""
1234
 
1235
- #: view/settings.php:671 view/settings.php:706
1236
  msgid "{{title}} -> Rule title"
1237
  msgstr ""
1238
 
1239
- #: view/settings.php:672 view/settings.php:707
1240
  msgid "{{description}} -> Rule description"
1241
  msgstr ""
1242
 
1243
- #: view/settings.php:680
1244
  msgid "Show a message on applying cart rules in cart"
1245
  msgstr ""
1246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1247
  #: view/template/discount-table.php:24
1248
  msgid "Range"
1249
  msgstr ""
15
  msgid "Guest"
16
  msgstr ""
17
 
18
+ #: helper/general-helper.php:580
19
  msgid "Start date and time is set in the future date"
20
  msgstr ""
21
 
22
+ #: helper/general-helper.php:583
23
  msgid "Validity expired"
24
  msgstr ""
25
 
26
+ #: helper/general-helper.php:600
27
  msgid "Will run in future"
28
  msgstr ""
29
 
30
+ #: helper/general-helper.php:603
31
  msgid "Not running - validity expired"
32
  msgstr ""
33
 
34
+ #: helper/general-helper.php:620
35
  msgid "Running"
36
  msgstr ""
37
 
38
+ #: helper/general-helper.php:625
39
  msgid "Your server current date and time: "
40
  msgstr ""
41
 
42
+ #: helper/general-helper.php:741
43
  msgid "Read Docs"
44
  msgstr ""
45
 
99
  msgid "License key check : Passed."
100
  msgstr ""
101
 
102
+ #: helper/purchase.php:178 view/settings_general.php:31
103
  msgid "License key seems to be Invalid. Please enter a valid license key"
104
  msgstr ""
105
 
106
+ #: helper/woo-function.php:387 helper/woo-function.php:397
107
  msgid "Search for a product&hellip;"
108
  msgstr ""
109
 
110
+ #: helper/woo-function.php:430 helper/woo-function.php:442
111
  msgid "Search for a user&hellip;"
112
  msgstr ""
113
 
119
  msgid "Custom Shipping Method for Woocommerce Discount Rules"
120
  msgstr ""
121
 
122
+ #: includes/advanced/free_shipping_method.php:68
123
+ #: view/settings_cart_rules.php:126
124
  msgid "Free Shipping"
125
  msgstr ""
126
 
127
+ #: includes/advanced/free_shipping_method.php:73
128
+ #: includes/discount-base.php:1011 view/cart-rules.php:133
129
+ #: view/pricing-rules.php:163 view/settings_promotion.php:65
130
+ #: view/settings_promotion.php:100
131
  msgid "Enable"
132
  msgstr ""
133
 
143
  msgid "Title to be display on site"
144
  msgstr ""
145
 
146
+ #: includes/discount-base.php:189 view/cart-rules.php:147
147
  #: view/pricing-rules.php:177
148
  msgid "Active"
149
  msgstr ""
150
 
151
+ #: includes/discount-base.php:191 view/cart-rules.php:149
152
+ #: view/pricing-rules.php:179 view/settings_cart_rules.php:95
153
+ #: view/settings_cart_rules.php:102 view/settings_price_rules.php:151
154
+ #: view/settings_promotion.php:22 view/settings_promotion.php:62
155
+ #: view/settings_promotion.php:97
156
  msgid "Disabled"
157
  msgstr ""
158
 
159
+ #: includes/discount-base.php:490
160
  msgid "Cache cleared successfully"
161
  msgstr ""
162
 
163
+ #: includes/discount-base.php:492
164
  msgid "Failed to clear cache"
165
  msgstr ""
166
 
167
+ #: includes/discount-base.php:603 includes/discount-base.php:638
168
  msgid "Failed to do action"
169
  msgstr ""
170
 
171
+ #: includes/discount-base.php:642
172
  msgid "Disabled successfully"
173
  msgstr ""
174
 
175
+ #: includes/discount-base.php:645
176
  msgid "Deleted successfully"
177
  msgstr ""
178
 
179
+ #: includes/discount-base.php:648
180
  msgid "Enabled successfully"
181
  msgstr ""
182
 
183
+ #: includes/discount-base.php:668 includes/discount-base.php:669
184
+ #: includes/discount-base.php:686
185
  msgid "copy"
186
  msgstr ""
187
 
188
+ #: includes/discount-base.php:694
189
  msgid "Duplicate rule created successfully"
190
  msgstr ""
191
 
192
+ #: includes/discount-base.php:698
193
  msgid "Failed to create duplicate rule"
194
  msgstr ""
195
 
196
+ #: includes/discount-base.php:966
197
  msgid "Please fill this field"
198
  msgstr ""
199
 
200
+ #: includes/discount-base.php:967
201
  msgid "Please Enter the Rule Name to Create / Save."
202
  msgstr ""
203
 
204
+ #: includes/discount-base.php:968
205
  msgid "Saving..."
206
  msgstr ""
207
 
208
+ #: includes/discount-base.php:969 view/view-cart-rules.php:54
209
  #: view/view-pricing-rules.php:37
210
  msgid "Save Rule"
211
  msgstr ""
212
 
213
+ #: includes/discount-base.php:970
214
  msgid "Please enter a Key"
215
  msgstr ""
216
 
217
+ #: includes/discount-base.php:971 view/view-pricing-rules.php:654
218
  msgid "Min Quantity"
219
  msgstr ""
220
 
221
+ #: includes/discount-base.php:972 view/view-pricing-rules.php:661
222
  msgid "Max Quantity"
223
  msgstr ""
224
 
225
+ #: includes/discount-base.php:973 view/view-cart-rules.php:91
226
  #: view/view-pricing-rules.php:75 view/view-pricing-rules.php:659
227
  #: view/view-pricing-rules.php:725 view/view-pricing-rules.php:742
228
  #: view/view-pricing-rules.php:749
229
  msgid "ex. 1"
230
  msgstr ""
231
 
232
+ #: includes/discount-base.php:974 view/view-pricing-rules.php:787
233
  msgid "ex. 10"
234
  msgstr ""
235
 
236
+ #: includes/discount-base.php:975 view/view-pricing-rules.php:666
237
  #: view/view-pricing-rules.php:702
238
  msgid "ex. 50"
239
  msgstr ""
240
 
241
+ #: includes/discount-base.php:976
242
  msgid "Search for a user"
243
  msgstr ""
244
 
245
+ #: includes/discount-base.php:977 view/view-pricing-rules.php:667
246
  msgid "Adjustment Type"
247
  msgstr ""
248
 
249
+ #: includes/discount-base.php:978 view/view-pricing-rules.php:776
250
  msgid "Discount percentage"
251
  msgstr ""
252
 
253
+ #: includes/discount-base.php:979 view/view-cart-rules.php:612
254
  #: view/view-pricing-rules.php:673
255
  msgid "Percentage Discount"
256
  msgstr ""
257
 
258
+ #: includes/discount-base.php:980 view/view-cart-rules.php:618
259
  #: view/view-cart-rules.php:620 view/view-pricing-rules.php:681
260
  #: view/view-pricing-rules.php:683
261
  msgid "Price Discount"
262
  msgstr ""
263
 
264
+ #: includes/discount-base.php:981 view/view-pricing-rules.php:691
265
  #: view/view-pricing-rules.php:693
266
  msgid "BOGO Product Discount"
267
  msgstr ""
268
 
269
+ #: includes/discount-base.php:982
270
  msgid "Product Discount - Not support for subtotal based rule"
271
  msgstr ""
272
 
273
+ #: includes/discount-base.php:983 view/view-cart-rules.php:398
274
  #: view/view-pricing-rules.php:697 view/view-pricing-rules.php:816
275
  msgid "Value"
276
  msgstr ""
277
 
278
+ #: includes/discount-base.php:984 view/view-pricing-rules.php:708
279
  msgid "receive discount for"
280
  msgstr ""
281
 
282
+ #: includes/discount-base.php:985 view/view-pricing-rules.php:710
283
  msgid "Auto add all selected products"
284
  msgstr ""
285
 
286
+ #: includes/discount-base.php:986 view/view-pricing-rules.php:711
287
  msgid "Same product"
288
  msgstr ""
289
 
290
+ #: includes/discount-base.php:987 view/view-pricing-rules.php:712
291
  msgid "Any one cheapest from selected"
292
  msgstr ""
293
 
294
+ #: includes/discount-base.php:988 view/view-pricing-rules.php:713
295
  msgid "Any one cheapest from all products"
296
  msgstr ""
297
 
298
+ #: includes/discount-base.php:989 view/view-pricing-rules.php:714
299
  msgid "Cheapest in cart - selected category(ies)"
300
  msgstr ""
301
 
302
+ #: includes/discount-base.php:990 view/view-pricing-rules.php:715
303
  msgid "Cheapest in cart - selected item(s)"
304
  msgstr ""
305
 
306
+ #: includes/discount-base.php:991 view/view-pricing-rules.php:716
307
  msgid "Cheapest among all items in cart"
308
  msgstr ""
309
 
310
+ #: includes/discount-base.php:992 view/view-pricing-rules.php:720
311
  msgid "Free quantity"
312
  msgstr ""
313
 
314
+ #: includes/discount-base.php:993 view/view-pricing-rules.php:720
315
  msgid "Number of quantity(ies) in each selected product(s)"
316
  msgstr ""
317
 
318
+ #: includes/discount-base.php:994 view/view-pricing-rules.php:734
319
  msgid "Fixed item count (not recommended)"
320
  msgstr ""
321
 
322
+ #: includes/discount-base.php:995 view/view-pricing-rules.php:733
323
  msgid "Dynamic item count"
324
  msgstr ""
325
 
326
+ #: includes/discount-base.php:996 view/view-pricing-rules.php:736
327
  msgid ""
328
  "Fixed item count - You need to provide item count manually. Dynamic item "
329
  "count - System will choose dynamically based on cart"
330
  msgstr ""
331
 
332
+ #: includes/discount-base.php:997 view/view-pricing-rules.php:737
333
  msgid "Item count"
334
  msgstr ""
335
 
336
+ #: includes/discount-base.php:998 view/view-pricing-rules.php:737
337
  msgid "Discount for number of item(s) in cart"
338
  msgstr ""
339
 
340
+ #: includes/discount-base.php:999 view/view-pricing-rules.php:744
341
  msgid "Discount for number of quantity(ies) in each item"
342
  msgstr ""
343
 
344
+ #: includes/discount-base.php:1000 view/view-pricing-rules.php:744
345
  msgid "Item quantity"
346
  msgstr ""
347
 
348
+ #: includes/discount-base.php:1001
349
  msgid "Search for a products"
350
  msgstr ""
351
 
352
+ #: includes/discount-base.php:1002
353
  msgid "and"
354
  msgstr ""
355
 
356
+ #: includes/discount-base.php:1003 view/view-pricing-rules.php:778
357
  msgid "100% percent"
358
  msgstr ""
359
 
360
+ #: includes/discount-base.php:1004 view/view-pricing-rules.php:779
361
  msgid "Limited percent"
362
  msgstr ""
363
 
364
+ #: includes/discount-base.php:1005 view/view-pricing-rules.php:787
365
  msgid "Percentage"
366
  msgstr ""
367
 
368
+ #: includes/discount-base.php:1006
369
  msgid "as discount"
370
  msgstr ""
371
 
372
+ #: includes/discount-base.php:1007 view/view-cart-rules.php:575
373
  #: view/view-pricing-rules.php:793
374
  msgid "Remove"
375
  msgstr ""
376
 
377
+ #: includes/discount-base.php:1008 view/cart-rules.php:170
378
  #: view/pricing-rules.php:200 view/view-pricing-rules.php:796
379
  msgid "Duplicate"
380
  msgstr ""
381
 
382
+ #: includes/discount-base.php:1009
383
  msgid "none"
384
  msgstr ""
385
 
386
+ #: includes/discount-base.php:1010
387
  msgid "Are you sure to remove this ?"
388
  msgstr ""
389
 
390
+ #: includes/discount-base.php:1012 view/cart-rules.php:130
391
  #: view/pricing-rules.php:160
392
  msgid "Disable"
393
  msgstr ""
394
 
395
+ #: includes/discount-base.php:1013
396
  msgid "Are you sure to remove ?"
397
  msgstr ""
398
 
399
+ #: includes/discount-base.php:1014 view/view-cart-rules.php:171
400
  msgid "Type"
401
  msgstr ""
402
 
403
+ #: includes/discount-base.php:1015 view/view-cart-rules.php:175
404
  msgid "Cart Subtotal"
405
  msgstr ""
406
 
407
+ #: includes/discount-base.php:1016 view/view-cart-rules.php:178
408
  msgid "Subtotal at least"
409
  msgstr ""
410
 
411
+ #: includes/discount-base.php:1017 view/view-cart-rules.php:182
412
  msgid "Subtotal less than"
413
  msgstr ""
414
 
415
+ #: includes/discount-base.php:1018 view/view-cart-rules.php:185
416
  msgid "Cart Item Count"
417
  msgstr ""
418
 
419
+ #: includes/discount-base.php:1019 view/view-cart-rules.php:188
420
  msgid "Number of line items in the cart (not quantity) at least"
421
  msgstr ""
422
 
423
+ #: includes/discount-base.php:1020 view/view-cart-rules.php:192
424
  msgid "Number of line items in the cart (not quantity) less than"
425
  msgstr ""
426
 
427
+ #: includes/discount-base.php:1021 view/view-cart-rules.php:195
428
  msgid "Quantity Sum"
429
  msgstr ""
430
 
431
+ #: includes/discount-base.php:1022 view/view-cart-rules.php:201
432
  #: view/view-cart-rules.php:204
433
  msgid "Total number of quantities in the cart at least"
434
  msgstr ""
435
 
436
+ #: includes/discount-base.php:1023 view/view-cart-rules.php:213
437
  #: view/view-cart-rules.php:216
438
  msgid "Total number of quantities in the cart less than"
439
  msgstr ""
440
 
441
+ #: includes/discount-base.php:1024 view/view-cart-rules.php:225
442
  msgid "Categories in cart"
443
  msgstr ""
444
 
445
+ #: includes/discount-base.php:1025 view/view-cart-rules.php:231
446
  msgid "Including sub-categories in cart"
447
  msgstr ""
448
 
449
+ #: includes/discount-base.php:1026 view/view-cart-rules.php:240
450
  msgid "Customer Details (must be logged in)"
451
  msgstr ""
452
 
453
+ #: includes/discount-base.php:1027 view/view-cart-rules.php:246
454
  #: view/view-cart-rules.php:248
455
  msgid "User in list"
456
  msgstr ""
457
 
458
+ #: includes/discount-base.php:1028 view/view-cart-rules.php:256
459
  #: view/view-cart-rules.php:258
460
  msgid "User role in list"
461
  msgstr ""
462
 
463
+ #: includes/discount-base.php:1029 view/view-cart-rules.php:266
464
  #: view/view-cart-rules.php:268
465
  msgid "Shipping country in list"
466
  msgstr ""
467
 
468
+ #: includes/discount-base.php:1030 view/view-cart-rules.php:272
469
  msgid "Customer Email"
470
  msgstr ""
471
 
472
+ #: includes/discount-base.php:1031
473
  msgid "Email with TLD (Ege: edu)"
474
  msgstr ""
475
 
476
+ #: includes/discount-base.php:1032 view/view-cart-rules.php:288
477
  #: view/view-cart-rules.php:290
478
  msgid "Email with Domain (Eg: gmail.com)"
479
  msgstr ""
480
 
481
+ #: includes/discount-base.php:1033 view/view-cart-rules.php:294
482
  msgid "Customer Billing Details"
483
  msgstr ""
484
 
485
+ #: includes/discount-base.php:1034 view/view-cart-rules.php:300
486
  #: view/view-cart-rules.php:302
487
  msgid "Billing city"
488
  msgstr ""
489
 
490
+ #: includes/discount-base.php:1035 view/view-cart-rules.php:306
491
  msgid "Customer Shipping Details"
492
  msgstr ""
493
 
494
+ #: includes/discount-base.php:1036 view/view-cart-rules.php:312
495
  #: view/view-cart-rules.php:314
496
  msgid "Shipping state"
497
  msgstr ""
498
 
499
+ #: includes/discount-base.php:1037 view/view-cart-rules.php:322
500
  #: view/view-cart-rules.php:324
501
  msgid "Shipping city"
502
  msgstr ""
503
 
504
+ #: includes/discount-base.php:1038 view/view-cart-rules.php:332
505
  #: view/view-cart-rules.php:334
506
  msgid "Shipping zip code"
507
  msgstr ""
508
 
509
+ #: includes/discount-base.php:1039 view/view-cart-rules.php:338
510
  #: view/view-pricing-rules.php:483
511
  msgid "Purchase History"
512
  msgstr ""
513
 
514
+ #: includes/discount-base.php:1040 view/view-cart-rules.php:344
515
  #: view/view-cart-rules.php:346 view/view-pricing-rules.php:491
516
  msgid "Purchased amount"
517
  msgstr ""
518
 
519
+ #: includes/discount-base.php:1041 view/view-cart-rules.php:354
520
  #: view/view-cart-rules.php:356 view/view-pricing-rules.php:492
521
  msgid "Number of previous orders made"
522
  msgstr ""
523
 
524
+ #: includes/discount-base.php:1042 view/view-cart-rules.php:364
525
  #: view/view-cart-rules.php:366 view/view-pricing-rules.php:493
526
  msgid "Number of previous orders made with following products"
527
  msgstr ""
528
 
529
+ #: includes/discount-base.php:1043 view/view-cart-rules.php:370
530
  msgid "Coupon applied"
531
  msgstr ""
532
 
533
+ #: includes/discount-base.php:1044 view/view-cart-rules.php:376
534
  #: view/view-cart-rules.php:378
535
  msgid "Atleast any one"
536
  msgstr ""
537
 
538
+ #: includes/discount-base.php:1045 view/view-cart-rules.php:386
539
  #: view/view-cart-rules.php:388
540
  msgid "All selected"
541
  msgstr ""
542
 
543
+ #: includes/discount-base.php:1046 view/view-cart-rules.php:544
544
  #: view/view-pricing-rules.php:528
545
  msgid "Greater than or equal to"
546
  msgstr ""
547
 
548
+ #: includes/discount-base.php:1047 view/view-cart-rules.php:545
549
  #: view/view-pricing-rules.php:529
550
  msgid "Less than or equal to"
551
  msgstr ""
552
 
553
+ #: includes/discount-base.php:1048 view/view-cart-rules.php:547
554
  #: view/view-pricing-rules.php:532
555
  msgid "and the order status should be"
556
  msgstr ""
557
 
558
+ #: includes/discount-base.php:1049 view/cart-rules.php:114
559
  #: view/cart-rules.php:209 view/pricing-rules.php:144
560
  #: view/pricing-rules.php:239 view/view-cart-rules.php:574
561
  msgid "Action"
562
  msgstr ""
563
 
564
+ #: includes/discount-base.php:1050 view/settings.php:21
565
+ #: view/settings_taxonomy.php:21
566
  msgid "Save"
567
  msgstr ""
568
 
569
+ #: includes/discount-base.php:1051
570
  msgid "Saved Successfully!"
571
  msgstr ""
572
 
573
+ #: includes/discount-base.php:1052 view/view-cart-rules.php:427
574
  #: view/view-cart-rules.php:462 view/view-cart-rules.php:482
575
  #: view/view-cart-rules.php:503 view/view-cart-rules.php:552
576
  #: view/view-pricing-rules.php:234 view/view-pricing-rules.php:250
579
  msgid "None selected"
580
  msgstr ""
581
 
582
+ #: includes/discount-base.php:1053 view/view-cart-rules.php:237
583
  msgid "In each category"
584
  msgstr ""
585
 
586
+ #: includes/discount-base.php:1054 view/settings_price_rules.php:116
587
+ #: view/settings_price_rules.php:190 view/settings_price_rules.php:208
588
+ #: view/settings_price_rules.php:226 view/settings_price_rules.php:244
589
  msgid "Show"
590
  msgstr ""
591
 
592
+ #: includes/discount-base.php:1055 view/template/sidebar.php:12
593
  msgid "Hide"
594
  msgstr ""
595
 
596
+ #: includes/discount-base.php:1056
597
  msgid "Please select at least one rule"
598
  msgstr ""
599
 
600
+ #: includes/discount-base.php:1057
601
  msgid "Please select an action to apply"
602
  msgstr ""
603
 
604
+ #: includes/discount-base.php:1058
605
  msgid "Are you sure to remove the selected rules"
606
  msgstr ""
607
 
608
+ #: includes/discount-base.php:1059 view/view-pricing-rules.php:753
609
  msgid "Choose product(s)"
610
  msgstr ""
611
 
612
+ #: includes/discount-base.php:1060 view/view-pricing-rules.php:763
613
  msgid "Choose category(ies)"
614
  msgstr ""
615
 
616
+ #: includes/discount-base.php:1061
617
  msgid "Search for a coupon"
618
  msgstr ""
619
 
620
+ #: includes/discount-base.php:1062 view/view-pricing-rules.php:718
621
  msgid ""
622
  "Auto add all selected products - Automatically added to the cart <br> Same "
623
  "product - get discount in same product <br> Any one cheapest from selected - "
628
  "no.of quantities"
629
  msgstr ""
630
 
631
+ #: includes/pricing-rules.php:2647 view/view-pricing-rules.php:565
632
  msgid "Buy"
633
  msgstr ""
634
 
635
+ #: includes/pricing-rules.php:2651
636
  msgid " less than or equal to "
637
  msgstr ""
638
 
639
+ #: includes/pricing-rules.php:2651 includes/pricing-rules.php:2657
640
  msgid " Quantity"
641
  msgstr ""
642
 
643
+ #: includes/pricing-rules.php:2654
644
  msgid " Quantity "
645
  msgstr ""
646
 
647
+ #: includes/pricing-rules.php:2661
648
  msgid " or more Quantity"
649
  msgstr ""
650
 
651
+ #: includes/pricing-rules.php:2670
652
  msgid " any "
653
  msgstr ""
654
 
655
+ #: includes/pricing-rules.php:2670
656
  msgid " products from "
657
  msgstr ""
658
 
659
+ #: includes/pricing-rules.php:2677
660
  msgid " in each products"
661
  msgstr ""
662
 
663
+ #: includes/pricing-rules.php:2689
664
  msgid " and get discount in "
665
  msgstr ""
666
 
667
+ #: includes/pricing-rules.php:2692
668
  msgid " first "
669
  msgstr ""
670
 
671
+ #: includes/pricing-rules.php:2694 includes/pricing-rules.php:2698
672
  msgid " quantity of product(s) - "
673
  msgstr ""
674
 
675
+ #: includes/pricing-rules.php:2696
676
  msgid " after first "
677
  msgstr ""
678
 
679
+ #: includes/pricing-rules.php:2714
680
  msgid "Category(ies) "
681
  msgstr ""
682
 
683
+ #: includes/pricing-rules.php:2782
684
  msgid "Get "
685
  msgstr ""
686
 
687
+ #: includes/pricing-rules.php:2784
688
  #, php-format
689
  msgid "% discount in "
690
  msgstr ""
691
 
692
+ #: includes/pricing-rules.php:2787
693
  msgid "same product"
694
  msgstr ""
695
 
696
+ #: includes/pricing-rules.php:2789
697
  msgid "any cheapest one from cart"
698
  msgstr ""
699
 
700
+ #: includes/pricing-rules.php:2792
701
  msgid "any cheapest one of "
702
  msgstr ""
703
 
704
+ #: includes/pricing-rules.php:2797
705
  msgid " quantity of any "
706
  msgstr ""
707
 
708
+ #: includes/pricing-rules.php:2799
709
  msgid " cheapest item "
710
  msgstr ""
711
 
712
+ #: includes/pricing-rules.php:2802
713
  msgid " quantity of cheapest item "
714
  msgstr ""
715
 
716
+ #: includes/pricing-rules.php:2806
717
  msgid "from the category "
718
  msgstr ""
719
 
912
  msgstr ""
913
 
914
  #: view/includes/menu.php:17
915
+ msgid "Taxonomy Settings"
916
+ msgstr ""
917
+
918
+ #: view/includes/menu.php:19
919
  msgid "Read documentation"
920
  msgstr ""
921
 
943
  msgid "Promotion"
944
  msgstr ""
945
 
946
+ #: view/settings_cart_rules.php:8
947
+ msgid "Cart rules settings"
948
  msgstr ""
949
 
950
+ #: view/settings_cart_rules.php:15
951
+ msgid "Discount identifier in the backend"
952
  msgstr ""
953
 
954
+ #: view/settings_cart_rules.php:21
955
+ msgid "Discount Coupon Name"
956
  msgstr ""
957
 
958
+ #: view/settings_cart_rules.php:31
959
+ msgid "Coupon name to be used in the cart/checkout in the storefront"
960
  msgstr ""
961
 
962
+ #: view/settings_cart_rules.php:35
963
+ msgid "Discounts applied: {rule_name}"
964
  msgstr ""
965
 
966
+ #: view/settings_cart_rules.php:38
967
+ msgid ""
968
+ "- Rule name. If more than one rule applies in cart, then the rule names will "
969
+ "be shown separated by comma(,)"
970
  msgstr ""
971
 
972
+ #: view/settings_cart_rules.php:42
973
+ msgid "Eg: "
 
 
974
  msgstr ""
975
 
976
+ #: view/settings_cart_rules.php:53
977
+ msgid "Rule Setup for Cart:"
 
 
978
  msgstr ""
979
 
980
+ #: view/settings_cart_rules.php:59 view/settings_price_rules.php:32
981
+ msgid "Apply first matched rule"
 
 
982
  msgstr ""
983
 
984
+ #: view/settings_cart_rules.php:65 view/settings_cart_rules.php:67
985
+ #: view/settings_price_rules.php:38 view/settings_price_rules.php:40
986
+ msgid "Apply all matched rules"
987
  msgstr ""
988
 
989
+ #: view/settings_cart_rules.php:74 view/settings_cart_rules.php:76
990
+ #: view/settings_price_rules.php:47 view/settings_price_rules.php:49
991
+ msgid "Apply biggest discount"
992
  msgstr ""
993
 
994
+ #: view/settings_cart_rules.php:85
995
+ msgid "Enable free shipping option"
 
 
996
  msgstr ""
997
 
998
+ #: view/settings_cart_rules.php:92 view/settings_price_rules.php:292
999
+ #: view/view-pricing-rules.php:299 view/view-pricing-rules.php:356
1000
+ #: view/view-pricing-rules.php:426 view/view-pricing-rules.php:472
1001
+ #: view/view-pricing-rules.php:501
1002
+ msgid "Supported in PRO version"
1003
  msgstr ""
1004
 
1005
+ #: view/settings_cart_rules.php:105
1006
+ msgid "Use Woocommerce free shipping"
1007
  msgstr ""
1008
 
1009
+ #: view/settings_cart_rules.php:108
1010
+ msgid "Use Woo-Discount free shipping"
1011
  msgstr ""
1012
 
1013
+ #: view/settings_cart_rules.php:122
1014
+ msgid "Free shipping text to be displayed"
 
1015
  msgstr ""
1016
 
1017
+ #: view/settings_cart_rules.php:129
1018
+ msgid "Free Shipping title"
 
1019
  msgstr ""
1020
 
1021
+ #: view/settings_cart_rules.php:136
1022
+ msgid "Draft"
1023
  msgstr ""
1024
 
1025
+ #: view/settings_cart_rules.php:146
1026
+ msgid "Exclude Draft products in product select box."
1027
  msgstr ""
1028
 
1029
+ #: view/settings_general.php:6
1030
+ msgid "General Settings"
1031
  msgstr ""
1032
 
1033
+ #: view/settings_general.php:13
1034
+ msgid "License Key :"
 
 
1035
  msgstr ""
1036
 
1037
+ #: view/settings_general.php:19
1038
+ msgid "Your Unique License Key"
1039
  msgstr ""
1040
 
1041
+ #: view/settings_general.php:20
1042
+ msgid "Validate Key"
 
1043
  msgstr ""
1044
 
1045
+ #: view/settings_general.php:44
1046
+ msgid "Tip: Install pro package before validating the licence"
1047
  msgstr ""
1048
 
1049
+ #: view/settings_general.php:52
1050
+ msgid "Enable dropdowns (applies only for the rule engine in the backend.)"
1051
  msgstr ""
1052
 
1053
+ #: view/settings_general.php:57 view/settings_general.php:74
1054
+ #: view/settings_general.php:108 view/settings_performance.php:21
1055
+ #: view/settings_price_rules.php:86 view/settings_price_rules.php:98
1056
+ #: view/settings_price_rules.php:133
1057
+ msgid "Yes"
1058
+ msgstr ""
1059
+
1060
+ #: view/settings_general.php:58 view/settings_general.php:75
1061
+ #: view/settings_general.php:109 view/settings_performance.php:22
1062
+ #: view/settings_price_rules.php:87 view/settings_price_rules.php:99
1063
+ #: view/settings_price_rules.php:134
1064
+ msgid "No"
1065
  msgstr ""
1066
 
1067
+ #: view/settings_general.php:61
1068
  msgid ""
1069
+ "Disabling this setting may affect dropdowns in rule engine (Disabling this "
1070
+ "setting is not recommended). Change this only if you know what you are doing."
1071
  msgstr ""
1072
 
1073
+ #: view/settings_general.php:69
1074
+ msgid "Force refresh the cart widget while add and remove item to cart"
1075
  msgstr ""
1076
 
1077
+ #: view/settings_general.php:81
1078
+ msgid ""
1079
+ "Choose how discount rules should work when WooCommerce coupons (or third "
1080
+ "party) coupons are used?"
1081
  msgstr ""
1082
 
1083
+ #: view/settings_general.php:88
1084
+ msgid "Let both coupons and discount rules run together"
 
 
1085
  msgstr ""
1086
 
1087
+ #: view/settings_general.php:91
1088
+ msgid "Disable the discount rules (coupons will work)"
1089
+ msgstr ""
1090
+
1091
+ #: view/settings_general.php:94
1092
+ msgid "Disable the coupons (discount rules will work)"
1093
  msgstr ""
1094
 
1095
+ #: view/settings_general.php:103
1096
  msgid ""
1097
+ "Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a "
1098
+ "coupon used with discount rule conditions"
1099
  msgstr ""
1100
 
1101
+ #: view/settings_performance.php:8
1102
+ msgid "Performance settings"
1103
  msgstr ""
1104
 
1105
+ #: view/settings_performance.php:16
1106
+ msgid "Enable cache for variable products table content"
1107
  msgstr ""
1108
 
1109
+ #: view/settings_performance.php:28 view/settings_performance.php:32
1110
+ msgid "Clear cache"
1111
  msgstr ""
1112
 
1113
+ #: view/settings_price_rules.php:8
1114
+ msgid "Price rules settings"
1115
  msgstr ""
1116
 
1117
+ #: view/settings_price_rules.php:14
1118
+ msgid "Rule setup"
1119
  msgstr ""
1120
 
1121
+ #: view/settings_price_rules.php:15
1122
+ msgid "Display"
1123
  msgstr ""
1124
 
1125
+ #: view/settings_price_rules.php:16
1126
+ msgid "Offer table"
1127
  msgstr ""
1128
 
1129
+ #: view/settings_price_rules.php:17
1130
+ msgid "Sale badge"
1131
  msgstr ""
1132
 
1133
+ #: view/settings_price_rules.php:26
1134
+ msgid "Rule Setup"
1135
  msgstr ""
1136
 
1137
+ #: view/settings_price_rules.php:58
1138
+ msgid "Apply discount based on"
1139
  msgstr ""
1140
 
1141
+ #: view/settings_price_rules.php:65
1142
+ msgid "Sale price"
1143
  msgstr ""
1144
 
1145
+ #: view/settings_price_rules.php:68
1146
+ msgid "Regular price"
1147
+ msgstr ""
1148
+
1149
+ #: view/settings_price_rules.php:73
1150
  msgid ""
1151
+ "If sale price is not entered in your products, the regular price will be "
1152
+ "taken"
1153
  msgstr ""
1154
 
1155
+ #: view/settings_price_rules.php:81
1156
  msgid ""
1157
  "Auto add free product when coupon is applied (For coupon-activated rules)"
1158
  msgstr ""
1159
 
1160
+ #: view/settings_price_rules.php:93
1161
  msgid "Include variants when just parent products are chosen in the rules"
1162
  msgstr ""
1163
 
1164
+ #: view/settings_price_rules.php:110
1165
+ msgid "Show Price discount on product pages :"
1166
  msgstr ""
1167
 
1168
+ #: view/settings_price_rules.php:119 view/settings_price_rules.php:193
1169
+ #: view/settings_price_rules.php:211 view/settings_price_rules.php:229
1170
+ #: view/settings_price_rules.php:247
1171
+ msgid "Don't Show"
1172
  msgstr ""
1173
 
1174
+ #: view/settings_price_rules.php:128
1175
+ msgid ""
1176
+ "Show a crossed-out original price along with discounted price at line items "
1177
+ "in cart"
1178
  msgstr ""
1179
 
1180
+ #: view/settings_price_rules.php:145
1181
+ msgid "Discount Table :"
1182
  msgstr ""
1183
 
1184
+ #: view/settings_price_rules.php:154
1185
+ msgid "Default layout"
1186
  msgstr ""
1187
 
1188
+ #: view/settings_price_rules.php:157
1189
+ msgid "Advance layout"
1190
  msgstr ""
1191
 
1192
+ #: view/settings_price_rules.php:166
1193
+ msgid "Table placement:"
1194
  msgstr ""
1195
 
1196
+ #: view/settings_price_rules.php:172
1197
+ msgid "Before cart form"
1198
  msgstr ""
1199
 
1200
+ #: view/settings_price_rules.php:175
1201
+ msgid "After cart form"
1202
  msgstr ""
1203
 
1204
+ #: view/settings_price_rules.php:184
1205
+ msgid "Table header :"
1206
  msgstr ""
1207
 
1208
+ #: view/settings_price_rules.php:202
1209
+ msgid "Title column on table :"
1210
  msgstr ""
1211
 
1212
+ #: view/settings_price_rules.php:220
1213
+ msgid "Range column on table :"
1214
  msgstr ""
1215
 
1216
+ #: view/settings_price_rules.php:238
1217
+ msgid "Discount column on table :"
1218
  msgstr ""
1219
 
1220
+ #: view/settings_price_rules.php:260
1221
+ msgid "Show a Sale badge on product pages :"
1222
  msgstr ""
1223
 
1224
+ #: view/settings_price_rules.php:266
1225
+ msgid "Do not show"
1226
  msgstr ""
1227
 
1228
+ #: view/settings_price_rules.php:269
1229
+ msgid "Show only after a rule condition is matched exactly"
1230
  msgstr ""
1231
 
1232
+ #: view/settings_price_rules.php:272
1233
+ msgid ""
1234
+ "Show on products that are covered under any price based discount rule in the "
1235
+ "plugin"
1236
  msgstr ""
1237
 
1238
+ #: view/settings_price_rules.php:282
1239
+ msgid "Do you want to customize the sale badge?"
1240
  msgstr ""
1241
 
1242
+ #: view/settings_price_rules.php:289
1243
+ msgid "Yes, I would like to customize the sale badge"
1244
  msgstr ""
1245
 
1246
+ #: view/settings_price_rules.php:304
1247
+ msgid "Sale badge content (TIP: You can use HTML inside)"
1248
+ msgstr ""
1249
+
1250
+ #: view/settings_price_rules.php:311
1251
+ msgid ""
1252
+ "IMPORTANT NOTE: This customized sale badge will be applicable only for "
1253
+ "products that are part of the discount rules configured in this plugin"
1254
  msgstr ""
1255
 
1256
+ #: view/settings_price_rules.php:315
1257
+ msgid "Eg:"
1258
+ msgstr ""
1259
+
1260
+ #: view/settings_promotion.php:8
1261
  msgid "Promotion settings"
1262
  msgstr ""
1263
 
1264
+ #: view/settings_promotion.php:16
1265
+ msgid "Display savings text (for price rules)"
1266
+ msgstr ""
1267
+
1268
+ #: view/settings_promotion.php:25
1269
+ msgid "On each line item"
1270
+ msgstr ""
1271
+
1272
+ #: view/settings_promotion.php:28
1273
+ msgid "On after total"
1274
+ msgstr ""
1275
+
1276
+ #: view/settings_promotion.php:31
1277
+ msgid "Both in line item and after total"
1278
+ msgstr ""
1279
+
1280
+ #: view/settings_promotion.php:39
1281
+ msgid "Savings text to show"
1282
+ msgstr ""
1283
+
1284
+ #: view/settings_promotion.php:47
1285
+ msgid "{{total_discount_price}} -> Total discount applied"
1286
+ msgstr ""
1287
+
1288
+ #: view/settings_promotion.php:55
1289
  msgid "Show a message on applying price rules in cart"
1290
  msgstr ""
1291
 
1292
+ #: view/settings_promotion.php:73 view/settings_promotion.php:108
1293
  msgid "Message"
1294
  msgstr ""
1295
 
1296
+ #: view/settings_promotion.php:81 view/settings_promotion.php:116
1297
  msgid "{{title}} -> Rule title"
1298
  msgstr ""
1299
 
1300
+ #: view/settings_promotion.php:82 view/settings_promotion.php:117
1301
  msgid "{{description}} -> Rule description"
1302
  msgstr ""
1303
 
1304
+ #: view/settings_promotion.php:90
1305
  msgid "Show a message on applying cart rules in cart"
1306
  msgstr ""
1307
 
1308
+ #: view/settings_taxonomy.php:32
1309
+ msgid ""
1310
+ "Choose taxonomies that can be supported in the discount rules (as categories)"
1311
+ msgstr ""
1312
+
1313
+ #: view/settings_taxonomy.php:36
1314
+ msgid ""
1315
+ "Useful when you want to provide a taxonomy based discount. The selected "
1316
+ "taxonomies here will be available as categories. So you can use the category "
1317
+ "specific discount condition to create discounts based on taxonomies.\n"
1318
+ "More examples can be found in the documentation"
1319
+ msgstr ""
1320
+
1321
  #: view/template/discount-table.php:24
1322
  msgid "Range"
1323
  msgstr ""
includes/cart-rules.php CHANGED
@@ -76,6 +76,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
76
 
77
  public $has_free_shipping = 0;
78
  public $bogo_coupon_codes = array();
 
79
 
80
  /**
81
  * FlycartWooDiscountRulesCartRules constructor.
@@ -291,7 +292,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
291
  if ($this->discount_total != 0) {
292
  if(!FlycartWooDiscountRulesGeneralHelper::haveToApplyTheRules()) return false;
293
  add_filter('woocommerce_get_shop_coupon_data', array($this, 'addVirtualCoupon'), 10, 2);
294
- add_action('woocommerce_after_calculate_totals', array($this, 'applyFakeCoupons'));
295
  }
296
  if($this->product_discount_total) {
297
  add_action('woocommerce_after_calculate_totals', array($this, 'applyFakeCouponsForBOGO'));
@@ -453,8 +454,12 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
453
 
454
  // 'newyear' is a temporary coupon for validation.
455
  $coupon_code = apply_filters('woocommerce_coupon_code', $this->coupon_code);
 
456
  // Getting New Instance with the Coupon Code.
457
  $the_coupon = FlycartWoocommerceCoupon::wc_get_coupon($coupon_code);
 
 
 
458
  // Validating the Coupon as Valid and discount status.
459
  if ($the_coupon->is_valid() && !$woocommerce->cart->has_discount($coupon_code)) {
460
 
@@ -509,6 +514,9 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
509
  $coupon_code = apply_filters('woocommerce_coupon_code', $coupon_code);
510
  // Getting New Instance with the Coupon Code.
511
  $the_coupon = FlycartWoocommerceCoupon::wc_get_coupon($coupon_code);
 
 
 
512
  // Validating the Coupon as Valid and discount status.
513
  if ($the_coupon->is_valid() && !$woocommerce->cart->has_discount($coupon_code)) {
514
 
@@ -715,7 +723,9 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
715
  $discounts['to_discount'][$index] = $this->calculateDiscount($this->sub_total, array('type' => 'price', 'value' => $rule['to_discount']));
716
  } else if($rule['discount_type'] == 'product_discount'){
717
  // Calculate product discount
718
- $this->calculateProductDiscount($rule['cart_discounted_products'],$rule['product_discount_quantity']);
 
 
719
  } else {
720
  //we will have to re-calculate the sub-total if it has category selected
721
  if($this->is_category_specific($rule)) {
@@ -755,7 +765,9 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
755
  $discounts['to_discount'][$index] = $this->calculateDiscount($this->sub_total, array('type' => 'price', 'value' => $rule['to_discount']));
756
  } else if($rule['discount_type'] == 'product_discount'){
757
  // Calculate product discount
758
- $this->calculateProductDiscount($rule['cart_discounted_products'],$rule['product_discount_quantity']);
 
 
759
  } else {
760
  //we will have to re-calculate the sub-total if it has category selected
761
  if($this->is_category_specific($rule)) {
@@ -791,7 +803,9 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
791
  $newDiscount = $this->calculateDiscount($this->sub_total, array('type' => 'price', 'value' => $rule['to_discount']));
792
  } else if($rule['discount_type'] == 'product_discount'){
793
  // Calculate product discount
794
- $this->calculateProductDiscount($rule['cart_discounted_products'],$rule['product_discount_quantity']);
 
 
795
  } else {
796
  //we will have to re-calculate the sub-total if it has category selected
797
  if($this->is_category_specific($rule)) {
@@ -1420,17 +1434,18 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1420
  $categoryFound = $sub_total = $quantity = $item_count = 0;
1421
  if(count($woocommerce->cart->cart_contents)){
1422
  foreach ($woocommerce->cart->cart_contents as $key => $cartItem) {
1423
- $terms = get_the_terms( $cartItem['product_id'], 'product_cat' );
1424
  $categoryMatches = 0;
1425
- if($terms){
1426
- foreach ($terms as $term) {
1427
- if(in_array($term->term_id, $rule)){
1428
  $categoryMatches = 1;
1429
  $categoryFound = 1;
1430
  break;
1431
  }
1432
  }
1433
  }
 
1434
  if($categoryMatches){
1435
  $sub_total += $cartItem['line_subtotal'];//+$cartItem['line_subtotal_tax'];
1436
  $quantity += $cartItem['quantity'];
@@ -1613,9 +1628,13 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1613
  $discount = 0;
1614
 
1615
  if ($adjustment['type'] == 'percentage') {
1616
- $discount = $sub_total * ($adjustment['value'] / 100);
 
 
1617
  } else if ($adjustment['type'] == 'price') {
1618
- $discount = $adjustment['value'];
 
 
1619
  }
1620
 
1621
  return ($discount <= 0) ? 0 : $discount;
@@ -1662,7 +1681,16 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1662
  //If product not in cart,then add to cart
1663
  $product = FlycartWoocommerceProduct::wc_get_product($discounted_product_id);
1664
  if($product) {
1665
- FlycartWoocommerceCart::add_to_cart($discounted_product_id, $discount_quantity);
 
 
 
 
 
 
 
 
 
1666
  do_action('woo_discount_rules_cart_rules_after_adding_free_product_to_cart');
1667
  $discounted_price = ($discount_quantity * FlycartWoocommerceProduct::get_price($product, true));
1668
  $coupon_msg = str_replace(array('{{product_name}}', '{{quantity}}'), array(FlycartWoocommerceProduct::get_name($product, true), $discount_quantity), $rule_text);
@@ -2117,5 +2145,21 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
2117
  break;
2118
  }
2119
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2120
  }
2121
  }
76
 
77
  public $has_free_shipping = 0;
78
  public $bogo_coupon_codes = array();
79
+ public static $applied_coupon = array();
80
 
81
  /**
82
  * FlycartWooDiscountRulesCartRules constructor.
292
  if ($this->discount_total != 0) {
293
  if(!FlycartWooDiscountRulesGeneralHelper::haveToApplyTheRules()) return false;
294
  add_filter('woocommerce_get_shop_coupon_data', array($this, 'addVirtualCoupon'), 10, 2);
295
+ add_action('woocommerce_after_calculate_totals', array($this, 'applyFakeCoupons'), 10);
296
  }
297
  if($this->product_discount_total) {
298
  add_action('woocommerce_after_calculate_totals', array($this, 'applyFakeCouponsForBOGO'));
454
 
455
  // 'newyear' is a temporary coupon for validation.
456
  $coupon_code = apply_filters('woocommerce_coupon_code', $this->coupon_code);
457
+
458
  // Getting New Instance with the Coupon Code.
459
  $the_coupon = FlycartWoocommerceCoupon::wc_get_coupon($coupon_code);
460
+ if($the_coupon->is_valid()){
461
+ self::setAppliedCoupon($coupon_code);
462
+ }
463
  // Validating the Coupon as Valid and discount status.
464
  if ($the_coupon->is_valid() && !$woocommerce->cart->has_discount($coupon_code)) {
465
 
514
  $coupon_code = apply_filters('woocommerce_coupon_code', $coupon_code);
515
  // Getting New Instance with the Coupon Code.
516
  $the_coupon = FlycartWoocommerceCoupon::wc_get_coupon($coupon_code);
517
+ if($the_coupon->is_valid()){
518
+ self::setAppliedCoupon($coupon_code);
519
+ }
520
  // Validating the Coupon as Valid and discount status.
521
  if ($the_coupon->is_valid() && !$woocommerce->cart->has_discount($coupon_code)) {
522
 
723
  $discounts['to_discount'][$index] = $this->calculateDiscount($this->sub_total, array('type' => 'price', 'value' => $rule['to_discount']));
724
  } else if($rule['discount_type'] == 'product_discount'){
725
  // Calculate product discount
726
+ if(FlycartWooDiscountRulesGeneralHelper::is_countable($rule['cart_discounted_products'])){
727
+ $this->calculateProductDiscount($rule['cart_discounted_products'],$rule['product_discount_quantity']);
728
+ }
729
  } else {
730
  //we will have to re-calculate the sub-total if it has category selected
731
  if($this->is_category_specific($rule)) {
765
  $discounts['to_discount'][$index] = $this->calculateDiscount($this->sub_total, array('type' => 'price', 'value' => $rule['to_discount']));
766
  } else if($rule['discount_type'] == 'product_discount'){
767
  // Calculate product discount
768
+ if(FlycartWooDiscountRulesGeneralHelper::is_countable($rule['cart_discounted_products'])){
769
+ $this->calculateProductDiscount($rule['cart_discounted_products'],$rule['product_discount_quantity']);
770
+ }
771
  } else {
772
  //we will have to re-calculate the sub-total if it has category selected
773
  if($this->is_category_specific($rule)) {
803
  $newDiscount = $this->calculateDiscount($this->sub_total, array('type' => 'price', 'value' => $rule['to_discount']));
804
  } else if($rule['discount_type'] == 'product_discount'){
805
  // Calculate product discount
806
+ if(FlycartWooDiscountRulesGeneralHelper::is_countable($rule['cart_discounted_products'])){
807
+ $this->calculateProductDiscount($rule['cart_discounted_products'],$rule['product_discount_quantity']);
808
+ }
809
  } else {
810
  //we will have to re-calculate the sub-total if it has category selected
811
  if($this->is_category_specific($rule)) {
1434
  $categoryFound = $sub_total = $quantity = $item_count = 0;
1435
  if(count($woocommerce->cart->cart_contents)){
1436
  foreach ($woocommerce->cart->cart_contents as $key => $cartItem) {
1437
+ $categories = FlycartWoocommerceProduct::get_category_ids($cartItem['data']);
1438
  $categoryMatches = 0;
1439
+ if(!empty($categories)){
1440
+ foreach ($categories as $cat_id){
1441
+ if(in_array($cat_id, $rule)){
1442
  $categoryMatches = 1;
1443
  $categoryFound = 1;
1444
  break;
1445
  }
1446
  }
1447
  }
1448
+
1449
  if($categoryMatches){
1450
  $sub_total += $cartItem['line_subtotal'];//+$cartItem['line_subtotal_tax'];
1451
  $quantity += $cartItem['quantity'];
1628
  $discount = 0;
1629
 
1630
  if ($adjustment['type'] == 'percentage') {
1631
+ if(((int)$adjustment['value']) > 0){
1632
+ $discount = $sub_total * ($adjustment['value'] / 100);
1633
+ }
1634
  } else if ($adjustment['type'] == 'price') {
1635
+ if(((int)$adjustment['value']) > 0){
1636
+ $discount = $adjustment['value'];
1637
+ }
1638
  }
1639
 
1640
  return ($discount <= 0) ? 0 : $discount;
1681
  //If product not in cart,then add to cart
1682
  $product = FlycartWoocommerceProduct::wc_get_product($discounted_product_id);
1683
  if($product) {
1684
+ $cart_item_key = FlycartWoocommerceCart::add_to_cart($discounted_product_id, $discount_quantity);
1685
+ global $flycart_woo_discount_rules;
1686
+ add_filter('woo_discount_rules_apply_rules_repeatedly', '__return_true');//Fix: In few cases the strikeout doesn't applies
1687
+ $flycart_woo_discount_rules->discountBase->handlePriceDiscount();
1688
+ if(!empty($cart_item_key)){
1689
+ $cart_item = FlycartWoocommerceCart::get_cart_item($cart_item_key);
1690
+ if(!empty($cart_item['data'])){
1691
+ $product = $cart_item['data'];
1692
+ }
1693
+ }
1694
  do_action('woo_discount_rules_cart_rules_after_adding_free_product_to_cart');
1695
  $discounted_price = ($discount_quantity * FlycartWoocommerceProduct::get_price($product, true));
1696
  $coupon_msg = str_replace(array('{{product_name}}', '{{quantity}}'), array(FlycartWoocommerceProduct::get_name($product, true), $discount_quantity), $rule_text);
2145
  break;
2146
  }
2147
  }
2148
+
2149
+ /**
2150
+ * Set coupon applied
2151
+ * */
2152
+ protected static function setAppliedCoupon($coupon){
2153
+ if(!in_array($coupon, self::$applied_coupon)){
2154
+ self::$applied_coupon[] = $coupon;
2155
+ }
2156
+ }
2157
+
2158
+ /**
2159
+ * get applied coupon
2160
+ * */
2161
+ public static function getAppliedCoupons(){
2162
+ return self::$applied_coupon;
2163
+ }
2164
  }
2165
  }
includes/compatibility.php ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
+
4
+ /**
5
+ * Class FlycartWooDiscountRulesPricingRules
6
+ */
7
+ if (!class_exists('FlycartWooDiscountRulesCompatibility')) {
8
+ class FlycartWooDiscountRulesCompatibility
9
+ {
10
+ protected static $is_pro_version = false;
11
+
12
+ protected static $discount_base;
13
+
14
+ /**
15
+ * Initialize the scripts
16
+ * */
17
+ public static function init()
18
+ {
19
+ self::set_is_pro_version();
20
+ self::set_discount_base_object();
21
+ if (self::$is_pro_version) {
22
+ add_filter('woocommerce_cart_totals_coupon_label', 'FlycartWooDiscountRulesCompatibility::change_woocommerce_cart_totals_coupon_label', 10, 2);
23
+ $additional_taxonomies = self::$discount_base->getConfigData('additional_taxonomies', array(), 'taxonomy');
24
+ if (FlycartWooDiscountRulesGeneralHelper::is_countable($additional_taxonomies)) {
25
+ add_filter('woo_discount_rules_accepted_taxonomy_for_category', 'FlycartWooDiscountRulesCompatibility::woo_discount_rules_accepted_taxonomy_for_category', 10);
26
+ add_filter('woo_discount_rules_load_additional_taxonomy', 'FlycartWooDiscountRulesCompatibility::woo_discount_rules_load_additional_taxonomy', 10, 2);
27
+ }
28
+ }
29
+ }
30
+
31
+ /**
32
+ * Set is pro version or not
33
+ * */
34
+ protected static function set_is_pro_version()
35
+ {
36
+ $purchase_helper = new FlycartWooDiscountRulesPurchase();
37
+ self::$is_pro_version = $purchase_helper->isPro();
38
+ }
39
+
40
+ /**
41
+ * Set is pro version or not
42
+ * */
43
+ protected static function set_discount_base_object()
44
+ {
45
+ self::$discount_base = FlycartWooDiscountBase::get_instance();
46
+ }
47
+
48
+ /**
49
+ * To support additional taxonomy in categories
50
+ * */
51
+ public static function woo_discount_rules_accepted_taxonomy_for_category($taxonomy)
52
+ {
53
+ $additional_taxonomies = self::$discount_base->getConfigData('additional_taxonomies', array(), 'taxonomy');
54
+ if (FlycartWooDiscountRulesGeneralHelper::is_countable($additional_taxonomies)) {
55
+ foreach ($additional_taxonomies as $additional_taxonomy) {
56
+ $taxonomy[] = $additional_taxonomy;
57
+ }
58
+ }
59
+
60
+ return $taxonomy;
61
+ }
62
+
63
+ /**
64
+ * To support additional taxonomy in categories
65
+ * */
66
+ public static function woo_discount_rules_load_additional_taxonomy($categories, $product_id)
67
+ {
68
+ $additional_taxonomies = self::$discount_base->getConfigData('additional_taxonomies', array(), 'taxonomy');
69
+ if (FlycartWooDiscountRulesGeneralHelper::is_countable($additional_taxonomies)) {
70
+ foreach ($additional_taxonomies as $taxonomy) {
71
+ $terms = get_the_terms($product_id, $taxonomy);
72
+ if (!empty($terms)) {
73
+ if((is_object($terms) || is_array($terms)) && count($terms) > 0) {
74
+ foreach ($terms as $term) {
75
+ if(!empty($term->term_id)){
76
+ $categories[] = $term->term_id;
77
+ }
78
+ }
79
+ }
80
+ }
81
+ }
82
+ }
83
+
84
+ return $categories;
85
+ }
86
+
87
+ /**
88
+ * To change the discount name/code in front end
89
+ * */
90
+ public static function change_woocommerce_cart_totals_coupon_label($text, $coupon)
91
+ {
92
+ $customize_coupon_name_html = self::$discount_base->getConfigData('customize_coupon_name_html', '');
93
+ if (!empty($customize_coupon_name_html)) {
94
+ global $flycart_woo_discount_rules;
95
+ //process only for woo discount rules
96
+ if (!empty($flycart_woo_discount_rules->cart_rules) && !empty($flycart_woo_discount_rules->cart_rules->coupon_code)) {
97
+ $coupon_code = FlycartWoocommerceCoupon::get_code($coupon);
98
+ //process only for woo discount rules
99
+ if (!empty($coupon_code) && $coupon_code == $flycart_woo_discount_rules->cart_rules->coupon_code) {
100
+ $applied_rules = $flycart_woo_discount_rules->cart_rules->matched_discounts;
101
+ $rule_names = '';
102
+
103
+ if (isset($applied_rules) && count($applied_rules) && isset($applied_rules['name'])) {
104
+ $rule_names = implode(', ', $applied_rules['name']);
105
+ }
106
+ $new_text = __($customize_coupon_name_html, 'woo-discount-rules');
107
+ if (!empty($new_text)) {
108
+ if (!empty($rule_names)) {
109
+ $new_text = str_replace('{rule_name}', $rule_names, $new_text);
110
+ }
111
+ //change the value here to have your own customized display
112
+ $text = $new_text;
113
+ }
114
+ }
115
+ }
116
+ }
117
+
118
+ return $text;
119
+ }
120
+ }
121
+
122
+ FlycartWooDiscountRulesCompatibility::init();
123
+ }
includes/discount-base.php CHANGED
@@ -18,6 +18,7 @@ if (!class_exists('FlycartWooDiscountBase')) {
18
  * @var string
19
  */
20
  public $default_option = 'woo-discount-config';
 
21
 
22
  /**
23
  * @var array
@@ -444,6 +445,18 @@ if (!class_exists('FlycartWooDiscountBase')) {
444
  $postData = \FlycartInput\FInput::getInstance();
445
  $request = $postData->getArray();
446
  $params = array();
 
 
 
 
 
 
 
 
 
 
 
 
447
  if (isset($request['data'])) {
448
  parse_str($request['data'], $params);
449
  }
@@ -460,14 +473,11 @@ if (!class_exists('FlycartWooDiscountBase')) {
460
  }
461
  $params = json_encode($params);
462
  }
463
- // else {
464
- // $params = FlycartWooDiscountRulesGeneralHelper::makeString($params);
465
- // }
466
 
467
- if (get_option($this->default_option)) {
468
- update_option($this->default_option, $params);
469
  } else {
470
- add_option($this->default_option, $params);
471
  }
472
  if(!$licenceValidate)
473
  die();
@@ -487,9 +497,14 @@ if (!class_exists('FlycartWooDiscountBase')) {
487
  /**
488
  * @return array
489
  */
490
- public function getBaseConfig()
491
  {
492
- $option = get_option($this->default_option);
 
 
 
 
 
493
  if (!$option || is_null($option)) {
494
  return array();
495
  } else {
@@ -504,8 +519,8 @@ if (!class_exists('FlycartWooDiscountBase')) {
504
  * @param mixed $default
505
  * @return mixed
506
  * */
507
- public function getConfigData($key, $default = ''){
508
- $config = $this->getBaseConfig();
509
  if (is_string($config)) $config = json_decode($config, true);
510
  return isset($config[$key])? $config[$key] : $default;
511
  }
@@ -774,6 +789,9 @@ if (!class_exists('FlycartWooDiscountBase')) {
774
  case 'settings':
775
  $data = $this->getBaseConfig();
776
  break;
 
 
 
777
  case 'documentation':
778
  break;
779
 
@@ -852,6 +870,7 @@ if (!class_exists('FlycartWooDiscountBase')) {
852
  'cart-rules' => WOO_DISCOUNT_DIR . '/view/cart-rules.php',
853
  'settings' => WOO_DISCOUNT_DIR . '/view/settings.php',
854
  'documentation' => WOO_DISCOUNT_DIR . '/view/documentation.php',
 
855
 
856
  // New Rule also access the same "View" to process
857
  'pricing-rules-new' => WOO_DISCOUNT_DIR . '/view/view-pricing-rules.php',
@@ -1043,5 +1062,71 @@ if (!class_exists('FlycartWooDiscountBase')) {
1043
  'discount_product_option_tooltip' => esc_html__("Auto add all selected products - Automatically added to the cart <br> Same product - get discount in same product <br> Any one cheapest from selected - Get discount in one selected product <br> Any one cheapest from all products - Get discount in one cheapest product in cart <br> Cheapest in cart - selected category(ies) - cheapest product from the selected category will be discounted <br> Cheapest in cart - selected item(s) - get discount in chosen no.of quantities", 'woo-discount-rules'),
1044
  );
1045
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1046
  }
1047
  }
18
  * @var string
19
  */
20
  public $default_option = 'woo-discount-config';
21
+ public $taxonomy_option = 'woo-discount-taxonomy';
22
 
23
  /**
24
  * @var array
445
  $postData = \FlycartInput\FInput::getInstance();
446
  $request = $postData->getArray();
447
  $params = array();
448
+ $type = 'default';
449
+ if (isset($request['from'])) {
450
+ if(in_array($request['from'], array('taxonomy'))){
451
+ $type = $request['from'];
452
+ }
453
+ }
454
+ if($type == 'taxonomy'){
455
+ $option_type = $this->taxonomy_option;
456
+ } else {
457
+ $option_type = $this->default_option;
458
+ }
459
+
460
  if (isset($request['data'])) {
461
  parse_str($request['data'], $params);
462
  }
473
  }
474
  $params = json_encode($params);
475
  }
 
 
 
476
 
477
+ if (get_option($option_type)) {
478
+ update_option($option_type, $params);
479
  } else {
480
+ add_option($option_type, $params);
481
  }
482
  if(!$licenceValidate)
483
  die();
497
  /**
498
  * @return array
499
  */
500
+ public function getBaseConfig($type = 'default')
501
  {
502
+ if($type == 'taxonomy'){
503
+ $option_type = $this->taxonomy_option;
504
+ } else {
505
+ $option_type = $this->default_option;
506
+ }
507
+ $option = get_option($option_type);
508
  if (!$option || is_null($option)) {
509
  return array();
510
  } else {
519
  * @param mixed $default
520
  * @return mixed
521
  * */
522
+ public function getConfigData($key, $default = '', $type = "default"){
523
+ $config = $this->getBaseConfig($type);
524
  if (is_string($config)) $config = json_decode($config, true);
525
  return isset($config[$key])? $config[$key] : $default;
526
  }
789
  case 'settings':
790
  $data = $this->getBaseConfig();
791
  break;
792
+ case 'taxonomy':
793
+ $data = $this->getBaseConfig('taxonomy');
794
+ break;
795
  case 'documentation':
796
  break;
797
 
870
  'cart-rules' => WOO_DISCOUNT_DIR . '/view/cart-rules.php',
871
  'settings' => WOO_DISCOUNT_DIR . '/view/settings.php',
872
  'documentation' => WOO_DISCOUNT_DIR . '/view/documentation.php',
873
+ 'taxonomy' => WOO_DISCOUNT_DIR . '/view/settings_taxonomy.php',
874
 
875
  // New Rule also access the same "View" to process
876
  'pricing-rules-new' => WOO_DISCOUNT_DIR . '/view/view-pricing-rules.php',
1062
  'discount_product_option_tooltip' => esc_html__("Auto add all selected products - Automatically added to the cart <br> Same product - get discount in same product <br> Any one cheapest from selected - Get discount in one selected product <br> Any one cheapest from all products - Get discount in one cheapest product in cart <br> Cheapest in cart - selected category(ies) - cheapest product from the selected category will be discounted <br> Cheapest in cart - selected item(s) - get discount in chosen no.of quantities", 'woo-discount-rules'),
1063
  );
1064
  }
1065
+
1066
+ /**
1067
+ * Remove third party coupon
1068
+ * */
1069
+ public function removeThirdPartyCoupon(){
1070
+ $removed_coupon = false;
1071
+ $do_not_run_while_have_third_party_coupon = $this->getConfigData('do_not_run_while_have_third_party_coupon', 0);
1072
+ if($do_not_run_while_have_third_party_coupon == 'remove_coupon'){
1073
+ $has_price_rules = $this->hasPriceRules();
1074
+ $has_cart_rules = $this->hasCartRules();
1075
+ if($has_price_rules || $has_cart_rules){
1076
+ $used_coupons = FlycartWooDiscountRulesGeneralHelper::getUsedCouponsInRules();
1077
+ $applied_coupon = FlycartWooDiscountRulesCartRules::getAppliedCoupons();
1078
+ if(!empty($used_coupons) && is_array($used_coupons)){
1079
+ $applied_coupon = array_merge($applied_coupon, $used_coupons);
1080
+ }
1081
+ $skip_coupons = apply_filters('woo_discount_rules_coupons_to_skip_while_apply_rules_and_remove_third_party_coupon', $applied_coupon);
1082
+ global $woocommerce;
1083
+ if(!empty($woocommerce->cart)){
1084
+ if(!empty($woocommerce->cart->applied_coupons)){
1085
+ foreach ($woocommerce->cart->applied_coupons as $code) {
1086
+ if(!in_array($code, $skip_coupons)){
1087
+ $removed_coupon = true;
1088
+ FlycartWoocommerceCart::remove_coupon($code);
1089
+ }
1090
+ }
1091
+ if($removed_coupon){
1092
+ WC()->cart->calculate_totals();
1093
+ }
1094
+ }
1095
+ }
1096
+ }
1097
+ }
1098
+ }
1099
+
1100
+ /**
1101
+ * Check has price rules
1102
+ * */
1103
+ protected function hasPriceRules(){
1104
+ $has_price_rules = false;
1105
+ $cart = FlycartWoocommerceCart::get_cart();
1106
+ if(FlycartWooDiscountRulesGeneralHelper::is_countable($cart)){
1107
+ foreach ($cart as $key => $cart_item){
1108
+ if(isset($cart_item['woo_discount'])){
1109
+ if(!empty($cart_item['woo_discount'])){
1110
+ $has_price_rules = true;
1111
+ break;
1112
+ }
1113
+ }
1114
+ }
1115
+ }
1116
+
1117
+ return $has_price_rules;
1118
+ }
1119
+
1120
+ /**
1121
+ * Check has cart rules
1122
+ * */
1123
+ protected function hasCartRules(){
1124
+ $applied_coupon = FlycartWooDiscountRulesCartRules::getAppliedCoupons();
1125
+ if(empty($applied_coupon)){
1126
+ return false;
1127
+ }
1128
+
1129
+ return true;
1130
+ }
1131
  }
1132
  }
includes/pricing-rules.php CHANGED
@@ -1629,9 +1629,12 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
1629
  {
1630
  if (is_object($array)) $array = (array)$array;
1631
  if (is_array($array)) return $array;
1632
- foreach ($array as $first) {
1633
- return $first;
 
 
1634
  }
 
1635
  }
1636
 
1637
  /**
@@ -3383,12 +3386,23 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3383
  self::$product_on_sale[$product_id] = 1;
3384
  $price_to_display = FlycartWoocommerceProduct::wc_price($discountPrice);
3385
  $show_original = 0;
3386
- if(FlycartWoocommerceVersion::wcVersion('3.0'))
 
 
 
 
 
 
3387
  $price_to_display = $this->checkForHighestVariantIfExists($product, $price_to_display, $show_original);
 
3388
  if(!$show_original){
3389
  self::$product_has_strike_out[$product_id]['has_strikeout'] = 1;
3390
  self::$product_has_strike_out[$product_id]['new_strikeout_html'] = ($price_to_display).$product->get_price_suffix($discountPrice);
3391
- $item_price = preg_replace('/<del>.*<\/del>/', '', $item_price);
 
 
 
 
3392
  $item_price = apply_filters('woo_discount_rules_price_strikeout_before_discount_price', $item_price, $product);
3393
  $item_price = '<span class="cart_price wdr_product_strikeout"><del>' . $item_price . '</del> <ins>' . ($price_to_display).$product->get_price_suffix($discountPrice) . '</ins></span>';
3394
  $item_price = apply_filters('woo_discount_rules_price_strikeout_after_discount_price', $item_price, $product);
@@ -3401,9 +3415,10 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3401
 
3402
  public function replaceVisiblePricesForSalePriceAdjustment($item_price, $product)
3403
  {
3404
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'show';
3405
- if($show_price_discount_on_product_page == 'show_on_any_rules_matches') {
3406
- if (!$product->is_type(array('variable', 'subscription_variation', 'variable-subscription'))) {
 
3407
  $product_id = FlycartWoocommerceProduct::get_id($product);
3408
  // if(!empty(self::$product_on_sale_details[$product_id])){
3409
  $sale_price = FlycartWoocommerceProduct::get_price($product);
@@ -3458,7 +3473,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3458
  if(self::$product_has_strike_out[$product_id]['has_strikeout'] && !empty(self::$product_has_strike_out[$product_id]['new_strikeout_html'])){
3459
  $do_discount_from_regular_price = FlycartWooDiscountRulesGeneralHelper::applyDiscountFromRegularPrice();
3460
  if($do_discount_from_regular_price){
3461
- if($product->is_type(array('variable', 'subscription_variation', 'variable-subscription'))){
3462
  $item_price = $this->getVariantMinAndMaxRegularPrice($product, $item_price);
3463
  } else {
3464
  $regular_price = FlycartWoocommerceProduct::get_price($product);
@@ -3466,7 +3481,11 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3466
  $item_price = FlycartWoocommerceProduct::wc_price($regular_price);
3467
  }
3468
  }
3469
- $item_price = preg_replace('/<del>.*<\/del>/', '', $item_price);
 
 
 
 
3470
  $item_price = apply_filters('woo_discount_rules_price_strikeout_before_discount_price', $item_price, $product);
3471
  $item_price = '<span class="cart_price wdr_product_strikeout"><del>' . $item_price . '</del> <ins>' . (self::$product_has_strike_out[$product_id]['new_strikeout_html']) . '</ins></span>';
3472
  $item_price = apply_filters('woo_discount_rules_price_strikeout_after_discount_price', $item_price, $product);
@@ -3486,8 +3505,8 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3486
  public function displayProductIsOnSaleTagOptimized($on_sale, $product){
3487
  $runTheRulesEvenInAjax = apply_filters('woo_discount_rules_run_sale_tag_for_ajax', false, $product);
3488
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3489
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'show';
3490
- if(($show_price_discount_on_product_page == 'show' || $show_price_discount_on_product_page == 'show_on_any_rules_matches') && ($notAdmin || $runTheRulesEvenInAjax)){
3491
  $product_id = FlycartWoocommerceProduct::get_id($product);
3492
  if(isset(self::$product_on_sale[$product_id])){
3493
  if(self::$product_on_sale[$product_id]){
@@ -3512,20 +3531,20 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3512
  }
3513
  }
3514
  }
3515
- if($show_price_discount_on_product_page == 'show_on_any_rules_matches'){
3516
  $product_id = FlycartWoocommerceProduct::get_id($product);
3517
  if(!empty($this->matched_sets[$product_id])){
3518
  $on_sale = true;
3519
  self::$woo_discount_product_on_sale_is_active[$product_id] = true;
3520
  }
3521
  if(!$on_sale){
3522
- if(!empty(self::$product_on_sale_details[$product_id])){
3523
  $has_discount = $this->generateDiscountTableData($product);
3524
  if(!empty($has_discount) && count($has_discount) > 0){
3525
  $on_sale = true;
3526
  self::$woo_discount_product_on_sale_is_active[$product_id] = true;
3527
  }
3528
- }
3529
  }
3530
  }
3531
  }
1629
  {
1630
  if (is_object($array)) $array = (array)$array;
1631
  if (is_array($array)) return $array;
1632
+ if(!empty($array)){
1633
+ foreach ($array as $first) {
1634
+ return $first;
1635
+ }
1636
  }
1637
+ return $array;
1638
  }
1639
 
1640
  /**
3386
  self::$product_on_sale[$product_id] = 1;
3387
  $price_to_display = FlycartWoocommerceProduct::wc_price($discountPrice);
3388
  $show_original = 0;
3389
+ $do_discount_from_regular_price = FlycartWooDiscountRulesGeneralHelper::applyDiscountFromRegularPrice();
3390
+ if(FlycartWoocommerceVersion::wcVersion('3.0')){
3391
+ if($do_discount_from_regular_price){
3392
+ if($product->is_type(array('variable', 'subscription_variation', 'variable-subscription'))){
3393
+ $item_price = $this->getVariantMinAndMaxRegularPrice($product, $item_price);
3394
+ }
3395
+ }
3396
  $price_to_display = $this->checkForHighestVariantIfExists($product, $price_to_display, $show_original);
3397
+ }
3398
  if(!$show_original){
3399
  self::$product_has_strike_out[$product_id]['has_strikeout'] = 1;
3400
  self::$product_has_strike_out[$product_id]['new_strikeout_html'] = ($price_to_display).$product->get_price_suffix($discountPrice);
3401
+ if($do_discount_from_regular_price){
3402
+ $item_price = preg_replace('/<ins>.*<\/ins>/', '', $item_price);
3403
+ } else {
3404
+ $item_price = preg_replace('/<del>.*<\/del>/', '', $item_price);
3405
+ }
3406
  $item_price = apply_filters('woo_discount_rules_price_strikeout_before_discount_price', $item_price, $product);
3407
  $item_price = '<span class="cart_price wdr_product_strikeout"><del>' . $item_price . '</del> <ins>' . ($price_to_display).$product->get_price_suffix($discountPrice) . '</ins></span>';
3408
  $item_price = apply_filters('woo_discount_rules_price_strikeout_after_discount_price', $item_price, $product);
3415
 
3416
  public function replaceVisiblePricesForSalePriceAdjustment($item_price, $product)
3417
  {
3418
+ $show_sale_tag_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'show';
3419
+ $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'show';
3420
+ if($show_sale_tag_on_product_page == 'show_on_any_rules_matches' || ($show_sale_tag_on_product_page == 'show' && $show_price_discount_on_product_page == 'dont')) {
3421
+ if (!$product->is_type(array('variable', 'subscription_variation', 'variable-subscription', 'grouped'))) {
3422
  $product_id = FlycartWoocommerceProduct::get_id($product);
3423
  // if(!empty(self::$product_on_sale_details[$product_id])){
3424
  $sale_price = FlycartWoocommerceProduct::get_price($product);
3473
  if(self::$product_has_strike_out[$product_id]['has_strikeout'] && !empty(self::$product_has_strike_out[$product_id]['new_strikeout_html'])){
3474
  $do_discount_from_regular_price = FlycartWooDiscountRulesGeneralHelper::applyDiscountFromRegularPrice();
3475
  if($do_discount_from_regular_price){
3476
+ if($product->is_type(array('variable', 'subscription_variation', 'variable-subscription', 'grouped'))){
3477
  $item_price = $this->getVariantMinAndMaxRegularPrice($product, $item_price);
3478
  } else {
3479
  $regular_price = FlycartWoocommerceProduct::get_price($product);
3481
  $item_price = FlycartWoocommerceProduct::wc_price($regular_price);
3482
  }
3483
  }
3484
+ if($do_discount_from_regular_price){
3485
+ $item_price = preg_replace('/<ins>.*<\/ins>/', '', $item_price);
3486
+ } else {
3487
+ $item_price = preg_replace('/<del>.*<\/del>/', '', $item_price);
3488
+ }
3489
  $item_price = apply_filters('woo_discount_rules_price_strikeout_before_discount_price', $item_price, $product);
3490
  $item_price = '<span class="cart_price wdr_product_strikeout"><del>' . $item_price . '</del> <ins>' . (self::$product_has_strike_out[$product_id]['new_strikeout_html']) . '</ins></span>';
3491
  $item_price = apply_filters('woo_discount_rules_price_strikeout_after_discount_price', $item_price, $product);
3505
  public function displayProductIsOnSaleTagOptimized($on_sale, $product){
3506
  $runTheRulesEvenInAjax = apply_filters('woo_discount_rules_run_sale_tag_for_ajax', false, $product);
3507
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3508
+ $show_sale_tag_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'show';
3509
+ if(($show_sale_tag_on_product_page == 'show' || $show_sale_tag_on_product_page == 'show_on_any_rules_matches') && ($notAdmin || $runTheRulesEvenInAjax)){
3510
  $product_id = FlycartWoocommerceProduct::get_id($product);
3511
  if(isset(self::$product_on_sale[$product_id])){
3512
  if(self::$product_on_sale[$product_id]){
3531
  }
3532
  }
3533
  }
3534
+ if($show_sale_tag_on_product_page == 'show_on_any_rules_matches'){
3535
  $product_id = FlycartWoocommerceProduct::get_id($product);
3536
  if(!empty($this->matched_sets[$product_id])){
3537
  $on_sale = true;
3538
  self::$woo_discount_product_on_sale_is_active[$product_id] = true;
3539
  }
3540
  if(!$on_sale){
3541
+ // if(!empty(self::$product_on_sale_details[$product_id])){
3542
  $has_discount = $this->generateDiscountTableData($product);
3543
  if(!empty($has_discount) && count($has_discount) > 0){
3544
  $on_sale = true;
3545
  self::$woo_discount_product_on_sale_is_active[$product_id] = true;
3546
  }
3547
+ // }
3548
  }
3549
  }
3550
  }
loader.php CHANGED
@@ -83,6 +83,7 @@ if(!class_exists('FlycartWooDiscountRules')){
83
  include_once(dirname(__FILE__).'/includes/cart-rules.php');
84
  include_once(dirname(__FILE__).'/includes/discount-base.php');
85
  include_once(dirname(__FILE__).'/helper/purchase.php');
 
86
  require_once __DIR__ . '/vendor/autoload.php';
87
  }
88
 
@@ -165,6 +166,7 @@ if(!class_exists('FlycartWooDiscountRules')){
165
  public function script_on_product_page(){
166
  $runVariationStrikeoutAjax = apply_filters('woo_discount_rules_run_variation_strikeout_through_ajax', true);
167
  $script = '<script>';
 
168
  $script .= 'jQuery( document ).ready( function() {';
169
  $do_product_page_strikeout = $this->discountBase->getConfigData('show_price_discount_on_product_page', 'show');
170
  $enable_variable_product_cache = $this->discountBase->getConfigData('enable_variable_product_cache', 0);
@@ -259,6 +261,7 @@ if(!class_exists('FlycartWooDiscountRules')){
259
  }, 1);';
260
  $script .= ' }';
261
  $script .= '});';
 
262
  $script .= '</script>';
263
 
264
  echo $script;
@@ -309,6 +312,8 @@ if(!class_exists('FlycartWooDiscountRules')){
309
  add_action('woocommerce_cart_loaded_from_session', array($this->discountBase, 'handleDiscount'), 100);
310
  }
311
 
 
 
312
  add_action('woocommerce_add_to_cart', array($this->pricingRules, 'handleBOGODiscount'), 10, 6);
313
 
314
  $add_free_product_on_coupon_applied = $this->discountBase->getConfigData('add_free_product_on_coupon_applied', 0);
@@ -385,7 +390,6 @@ if(!class_exists('FlycartWooDiscountRules')){
385
  add_action('woocommerce_before_cart', array($this, 'displayAppliedDiscountMessagesForPriceRules'));
386
  add_action('woocommerce_before_cart', array($this, 'displayAppliedDiscountMessagesForCartRules'));
387
 
388
-
389
  add_filter('woo_discount_rule_products_to_exclude', array($this, 'woo_discount_get_variations'));
390
  add_filter('woo_discount_rule_products_to_include', array($this, 'woo_discount_get_variations'));
391
  }
83
  include_once(dirname(__FILE__).'/includes/cart-rules.php');
84
  include_once(dirname(__FILE__).'/includes/discount-base.php');
85
  include_once(dirname(__FILE__).'/helper/purchase.php');
86
+ include_once(dirname(__FILE__).'/includes/compatibility.php');
87
  require_once __DIR__ . '/vendor/autoload.php';
88
  }
89
 
166
  public function script_on_product_page(){
167
  $runVariationStrikeoutAjax = apply_filters('woo_discount_rules_run_variation_strikeout_through_ajax', true);
168
  $script = '<script>';
169
+ $script .= 'if(flycart_woo_discount_rules_strikeout_script_executed == undefined){';
170
  $script .= 'jQuery( document ).ready( function() {';
171
  $do_product_page_strikeout = $this->discountBase->getConfigData('show_price_discount_on_product_page', 'show');
172
  $enable_variable_product_cache = $this->discountBase->getConfigData('enable_variable_product_cache', 0);
261
  }, 1);';
262
  $script .= ' }';
263
  $script .= '});';
264
+ $script .= 'var flycart_woo_discount_rules_strikeout_script_executed = 1; }';
265
  $script .= '</script>';
266
 
267
  echo $script;
312
  add_action('woocommerce_cart_loaded_from_session', array($this->discountBase, 'handleDiscount'), 100);
313
  }
314
 
315
+ add_action('woocommerce_after_calculate_totals', array($this->discountBase, 'removeThirdPartyCoupon'), 20);
316
+
317
  add_action('woocommerce_add_to_cart', array($this->pricingRules, 'handleBOGODiscount'), 10, 6);
318
 
319
  $add_free_product_on_coupon_applied = $this->discountBase->getConfigData('add_free_product_on_coupon_applied', 0);
390
  add_action('woocommerce_before_cart', array($this, 'displayAppliedDiscountMessagesForPriceRules'));
391
  add_action('woocommerce_before_cart', array($this, 'displayAppliedDiscountMessagesForCartRules'));
392
 
 
393
  add_filter('woo_discount_rule_products_to_exclude', array($this, 'woo_discount_get_variations'));
394
  add_filter('woo_discount_rule_products_to_include', array($this, 'woo_discount_get_variations'));
395
  }
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: flycart
3
  Donate link: https://flycart.org/
4
  Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts, pricing deals
5
  Requires at least: 4.4.1
6
- Tested up to: 5.0
7
- Stable tag: 1.7.11
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -312,6 +312,20 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
312
 
313
  == Changelog ==
314
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
  = 1.7.11 - 13/02/19 =
316
  * Fix - Discount table not showing data
317
 
3
  Donate link: https://flycart.org/
4
  Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts, pricing deals
5
  Requires at least: 4.4.1
6
+ Tested up to: 5.1
7
+ Stable tag: 1.7.12
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
312
 
313
  == Changelog ==
314
 
315
+ = 1.7.12 - 02/04/19 =
316
+ * Feature - Option to disable third party coupon while any rule applied.
317
+ * Feature - Option to change coupon name in front end.
318
+ * Feature - Option to add additional taxonomies(custom taxonomies) in categories.
319
+ * Improvement - Settings layout improvement.
320
+ * Fix - Notice while BOGO product in cart rule is not selected.
321
+ * Fix - Coupons which are in disabled rules are not considering as third-pary coupon.
322
+ * Fix - Displaying same price in price strikeout.
323
+ * Fix - In few cases the strikeout doesn't applies while auto add products(BOGO cart rule).
324
+ * Fix - Wrong strike out for variable products while set apply discount from Regular price.
325
+ * Fix - Negative Value displays when the Product price is less than Discounted price for the shortcode {{discounted_price}} in discount table.
326
+ * Fix - Product field has no width while browser is in 90% zoom.
327
+ * Fix - Warning when discount range is not Set
328
+
329
  = 1.7.11 - 13/02/19 =
330
  * Fix - Discount table not showing data
331
 
vendor/yahnis-elsts/plugin-update-checker/Puc/v4/Plugin/UpdateChecker.php CHANGED
@@ -112,6 +112,7 @@ if ( !class_exists('Puc_v4_Plugin_UpdateChecker', false) ):
112
 
113
  /* Edited By CartRabbit starts here */
114
  try{
 
115
  // include an unmodified $wp_version
116
  include( ABSPATH . WPINC . '/version.php' );
117
  $args = array('slug' => $this->slug, 'fields' => array('active_installs'));
112
 
113
  /* Edited By CartRabbit starts here */
114
  try{
115
+ global $wp_version;
116
  // include an unmodified $wp_version
117
  include( ABSPATH . WPINC . '/version.php' );
118
  $args = array('slug' => $this->slug, 'fields' => array('active_installs'));
view/includes/menu.php CHANGED
@@ -6,15 +6,17 @@ $isPro = $purchase->isPro();
6
  <i><h2><?php esc_html_e('Woo Discount Rules', 'woo-discount-rules'); ?> <?php echo $proText; ?> <span class="woo-discount-version">v<?php echo WOO_DISCOUNT_VERSION; ?></span></h2></i><hr>
7
  <h3 class="nav-tab-wrapper">
8
  <a class="nav-tab <?php if ($active == 'pricing-rules') { echo 'nav-tab-active'; } ?>" href="?page=woo_discount_rules&amp;tab=pricing-rules">
9
- <i class="fa fa-tags" style="font-size: 0.8em;"></i> &nbsp;<?php esc_html_e('Price Discount Rules', 'woo-discount-rules'); ?> </a>
10
  <a class="nav-tab <?php if ($active == 'cart-rules') { echo 'nav-tab-active'; } ?>" href="?page=woo_discount_rules&amp;tab=cart-rules">
11
- <i class="fa fa-shopping-cart" style="font-size: 0.8em;"></i> &nbsp;<?php esc_html_e('Cart Discount Rules', 'woo-discount-rules'); ?> </a>
12
  <a class="nav-tab <?php if ($active == 'settings') { echo 'nav-tab-active'; } ?>" href="?page=woo_discount_rules&amp;tab=settings">
13
- <i class="fa fa-cogs" style="font-size: 0.8em;"></i> &nbsp;<?php esc_html_e('Settings', 'woo-discount-rules'); ?> </a>
14
  <?php if($isPro){
15
  ?>
16
- <a class="nav-tab <?php if ($active == 'settings') { echo 'nav-tab-active'; } ?> btn-success" href="?page=woo_discount_rules&amp;tab=documentation">
17
- &nbsp;<?php esc_html_e('Read documentation', 'woo-discount-rules'); ?> </a>
18
- <?php
 
 
19
  } ?>
20
  </h3>
6
  <i><h2><?php esc_html_e('Woo Discount Rules', 'woo-discount-rules'); ?> <?php echo $proText; ?> <span class="woo-discount-version">v<?php echo WOO_DISCOUNT_VERSION; ?></span></h2></i><hr>
7
  <h3 class="nav-tab-wrapper">
8
  <a class="nav-tab <?php if ($active == 'pricing-rules') { echo 'nav-tab-active'; } ?>" href="?page=woo_discount_rules&amp;tab=pricing-rules">
9
+ <?php esc_html_e('Price Discount Rules', 'woo-discount-rules'); ?> </a>
10
  <a class="nav-tab <?php if ($active == 'cart-rules') { echo 'nav-tab-active'; } ?>" href="?page=woo_discount_rules&amp;tab=cart-rules">
11
+ <?php esc_html_e('Cart Discount Rules', 'woo-discount-rules'); ?> </a>
12
  <a class="nav-tab <?php if ($active == 'settings') { echo 'nav-tab-active'; } ?>" href="?page=woo_discount_rules&amp;tab=settings">
13
+ <?php esc_html_e('Settings', 'woo-discount-rules'); ?> </a>
14
  <?php if($isPro){
15
  ?>
16
+ <a class="nav-tab <?php if ($active == 'taxonomy') { echo 'nav-tab-active'; } ?>" href="?page=woo_discount_rules&amp;tab=taxonomy">
17
+ <?php esc_html_e('Taxonomy Settings', 'woo-discount-rules'); ?> </a>
18
+ <a class="nav-tab <?php if ($active == 'documentation') { echo 'nav-tab-active'; } ?> btn-success" href="?page=woo_discount_rules&amp;tab=documentation">
19
+ &nbsp;<?php esc_html_e('Read documentation', 'woo-discount-rules'); ?> </a>
20
+ <?php
21
  } ?>
22
  </h3>
view/settings.php CHANGED
@@ -32,684 +32,19 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
32
 
33
  <div class="tab-content">
34
  <div id="wdr_s_general" class="tab-pane fade in active">
35
- <div class="">
36
- <br/>
37
- <h4><?php esc_html_e('General Settings', 'woo-discount-rules'); ?></h4>
38
- <hr>
39
- </div>
40
- <div class="">
41
- <div class="row form-group">
42
- <div class="col-md-2">
43
- <label>
44
- <?php esc_html_e('License Key :', 'woo-discount-rules'); ?>
45
- </label>
46
- </div>
47
- <div class="col-md-6">
48
- <input type="text" class="" name="license_key" id="woo-disc-license-key"
49
- value="<?php if (isset($data['license_key'])) echo $data['license_key']; ?>"
50
- placeholder="<?php esc_attr_e('Your Unique License Key', 'woo-discount-rules'); ?>">
51
- <input type="button" id="woo-disc-license-check" value="<?php esc_attr_e('Validate Key', 'woo-discount-rules'); ?>" class="button button-info">
52
- <?php
53
- $verifiedLicense = get_option('woo_discount_rules_verified_key', 0);
54
- if (isset($data['license_key']) && $data['license_key'] != '') {
55
- if ($verifiedLicense) {
56
- ?>
57
- <span class="license-success">&#10004;</span>
58
- <?php
59
- } else {
60
- ?>
61
- <div class="license-failed notice-message error inline notice-error notice-alt">
62
- <?php esc_html_e('License key seems to be Invalid. Please enter a valid license key', 'woo-discount-rules'); ?>
63
- </div>
64
- <?php
65
- }
66
- }
67
- ?>
68
- <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('introduction/license-key-activation', 'license'); ?>
69
- <br>
70
- <div id="woo-disc-license-check-msg">
71
-
72
- </div>
73
- <div class="wdr_desc_text_con">
74
- <span class="wdr_desc_text">
75
- <?php esc_html_e('Tip: Install pro package before validating the licence', 'woo-discount-rules'); ?>
76
- </span>
77
- </div>
78
- </div>
79
- </div>
80
- <div class="row form-group">
81
- <div class="col-md-2">
82
- <label>
83
- <?php esc_html_e('Enable dropdowns (applies only for the rule engine in the backend.)', 'woo-discount-rules'); ?>
84
- </label>
85
- </div>
86
- <?php $data['enable_bootstrap'] = (isset($data['enable_bootstrap']) ? $data['enable_bootstrap'] : 1); ?>
87
- <div class="col-md-6">
88
- <label><input type="radio" name="enable_bootstrap" value="1" <?php echo ($data['enable_bootstrap'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
89
- <label><input type="radio" name="enable_bootstrap" value="0" <?php echo ($data['enable_bootstrap'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
90
- <div class="wdr_desc_text_con">
91
- <span class="wdr_desc_text">
92
- <?php esc_html_e('Disabling this setting may affect dropdowns in rule engine (Disabling this setting is not recommended). Change this only if you know what you are doing.', 'woo-discount-rules'); ?>
93
- </span>
94
- </div>
95
- </div>
96
- </div>
97
- <div class="row form-group">
98
- <div class="col-md-2">
99
- <label>
100
- <?php esc_html_e('Force refresh the cart widget while add and remove item to cart', 'woo-discount-rules'); ?>
101
- </label>
102
- </div>
103
- <?php $data['force_refresh_cart_widget'] = (isset($data['force_refresh_cart_widget']) ? $data['force_refresh_cart_widget'] : 0); ?>
104
- <div class="col-md-6">
105
- <label><input type="radio" name="force_refresh_cart_widget" value="1" <?php echo ($data['force_refresh_cart_widget'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
106
- <label><input type="radio" name="force_refresh_cart_widget" value="0" <?php echo ($data['force_refresh_cart_widget'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
107
- </div>
108
- </div>
109
- <div class="row form-group">
110
- <div class="col-md-2">
111
- <label>
112
- <?php esc_html_e('Disable the rules while having a coupon (Third party) in cart', 'woo-discount-rules'); ?>
113
- </label>
114
- </div>
115
- <?php $data['do_not_run_while_have_third_party_coupon'] = (isset($data['do_not_run_while_have_third_party_coupon']) ? $data['do_not_run_while_have_third_party_coupon'] : 0); ?>
116
- <div class="col-md-6">
117
- <label><input type="radio" name="do_not_run_while_have_third_party_coupon" value="1" <?php echo ($data['do_not_run_while_have_third_party_coupon'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
118
- <label><input type="radio" name="do_not_run_while_have_third_party_coupon" value="0" <?php echo ($data['do_not_run_while_have_third_party_coupon'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
119
- </div>
120
- </div>
121
- <?php if($isPro){ ?>
122
- <div class="row form-group">
123
- <div class="col-md-2">
124
- <label>
125
- <?php esc_html_e('Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a coupon used with discount rule conditions', 'woo-discount-rules'); ?>
126
- </label>
127
- </div>
128
- <?php $data['remove_zero_coupon_price'] = (isset($data['remove_zero_coupon_price']) ? $data['remove_zero_coupon_price'] : 1); ?>
129
- <div class="col-md-6">
130
- <label><input type="radio" name="remove_zero_coupon_price" value="1" <?php echo ($data['remove_zero_coupon_price'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
131
- <label><input type="radio" name="remove_zero_coupon_price" value="0" <?php echo ($data['remove_zero_coupon_price'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
132
- </div>
133
- </div>
134
- <?php } ?>
135
- </div>
136
  </div>
137
  <div id="wdr_s_price_rules" class="tab-pane fade">
138
- <div class="">
139
- <div class="row form-group">
140
- <div class="col-md-12">
141
- <br/>
142
- <h4><?php esc_html_e('Price rules settings', 'woo-discount-rules'); ?></h4>
143
- <hr>
144
- </div>
145
- </div>
146
- <div class="row form-group">
147
- <?php $data['price_setup'] = (isset($data['price_setup']) ? $data['price_setup'] : 'first'); ?>
148
- <div class="col-md-2">
149
- <label>
150
- <?php esc_html_e('Rule Setup', 'woo-discount-rules'); ?>
151
- </label>
152
- </div>
153
- <div class="col-md-6">
154
- <select class="selectpicker" name="price_setup">
155
- <option <?php if ($data['price_setup'] == 'first') { ?> selected=selected <?php } ?>
156
- value="first" selected="selected"><?php esc_html_e('Apply first matched rule', 'woo-discount-rules'); ?>
157
- </option>
158
- <option
159
- value="all" <?php if (!$pro) { ?> disabled <?php }
160
- if ($data['price_setup'] == 'all') { ?> selected=selected <?php } ?>>
161
- <?php if (!$pro) { ?>
162
- <?php esc_html_e('Apply all matched rules', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
163
- <?php } else { ?>
164
- <?php esc_html_e('Apply all matched rules', 'woo-discount-rules'); ?>
165
- <?php } ?>
166
- </option>
167
- <option
168
- value="biggest" <?php if (!$pro) { ?> disabled <?php }
169
- if ($data['price_setup'] == 'biggest') { ?> selected=selected <?php } ?>>
170
- <?php if (!$pro) { ?>
171
- <?php esc_html_e('Apply biggest discount', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
172
- <?php } else { ?>
173
- <?php esc_html_e('Apply biggest discount', 'woo-discount-rules'); ?>
174
- <?php } ?>
175
- </option>
176
- </select>
177
- </div>
178
- </div>
179
- <div class="row form-group">
180
- <div class="col-md-2">
181
- <label>
182
- <?php esc_html_e('Apply discount based on', 'woo-discount-rules'); ?>
183
- </label>
184
- </div>
185
- <?php $data['do_discount_from_regular_price'] = (isset($data['do_discount_from_regular_price']) ? $data['do_discount_from_regular_price'] : 'sale'); ?>
186
- <div class="col-md-6">
187
- <select class="selectpicker" name="do_discount_from_regular_price" id="do_discount_from_regular_price">
188
- <option <?php if ($data['do_discount_from_regular_price'] == 'sale') { ?> selected=selected <?php } ?>
189
- value="sale"><?php esc_html_e('Sale price', 'woo-discount-rules'); ?>
190
- </option>
191
- <option <?php if ($data['do_discount_from_regular_price'] == 'regular') { ?> selected=selected <?php } ?>
192
- value="regular"><?php esc_html_e('Regular price', 'woo-discount-rules'); ?>
193
- </option>
194
- </select>
195
- <div class="wdr_desc_text_con">
196
- <span class="wdr_desc_text">
197
- <?php esc_html_e('If sale price is not entered in your products, the regular price will be taken', 'woo-discount-rules'); ?>
198
- </span>
199
- </div>
200
- </div>
201
- </div>
202
- <div class="row form-group">
203
- <?php $data['show_price_discount_on_product_page'] = (isset($data['show_price_discount_on_product_page']) ? $data['show_price_discount_on_product_page'] : 'show'); ?>
204
- <div class="col-md-2">
205
- <label>
206
- <?php esc_html_e('Show Price discount on product pages :', 'woo-discount-rules'); ?>
207
- </label>
208
- </div>
209
- <div class="col-md-6">
210
- <select class="selectpicker" name="show_price_discount_on_product_page" id="show_price_discount_on_product_page">
211
- <option <?php if ($data['show_price_discount_on_product_page'] == 'show') { ?> selected=selected <?php } ?>
212
- value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
213
- </option>
214
- <option <?php if ($data['show_price_discount_on_product_page'] == 'dont') { ?> selected=selected <?php } ?>
215
- value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
216
- </option>
217
- </select>
218
-
219
- </div>
220
- </div>
221
- <div class="row form-group">
222
- <?php $data['show_sale_tag_on_product_page'] = (isset($data['show_sale_tag_on_product_page']) ? $data['show_sale_tag_on_product_page'] : 'show'); ?>
223
- <div class="col-md-2">
224
- <label>
225
- <?php esc_html_e('Show a Sale badge on product pages :', 'woo-discount-rules'); ?>
226
- </label>
227
- </div>
228
- <div class="col-md-6">
229
- <select class="selectpicker" name="show_sale_tag_on_product_page">
230
- <option <?php if ($data['show_sale_tag_on_product_page'] == 'dont') { ?> selected=selected <?php } ?>
231
- value="dont"><?php esc_html_e("Do not show", 'woo-discount-rules'); ?>
232
- </option>
233
- <option <?php if ($data['show_sale_tag_on_product_page'] == 'show') { ?> selected=selected <?php } ?>
234
- value="show"><?php esc_html_e('Show only after a rule condition is matched exactly', 'woo-discount-rules'); ?>
235
- </option>
236
- <option <?php if ($data['show_sale_tag_on_product_page'] == 'show_on_any_rules_matches') { ?> selected=selected <?php } ?>
237
- value="show_on_any_rules_matches"><?php esc_html_e('Show on products that are covered under any price based discount rule in the plugin', 'woo-discount-rules'); ?>
238
- </option>
239
- </select>
240
-
241
- </div>
242
- </div>
243
- <div class="row form-group">
244
- <?php $data['customize_sale_tag'] = (isset($data['customize_sale_tag']) ? $data['customize_sale_tag'] : 0); ?>
245
- <div class="col-md-2">
246
- <label for="customize_sale_tag">
247
- <?php esc_html_e('Do you want to customize the sale badge?', 'woo-discount-rules'); ?>
248
- </label>
249
- </div>
250
- <div class="col-md-6">
251
- <?php
252
- if($isPro){
253
- ?>
254
- <input type="checkbox" name="customize_sale_tag" id="customize_sale_tag" value="1" <?php if ($data['customize_sale_tag'] == 1) { ?> checked <?php } ?>> <label for="customize_sale_tag"><?php esc_html_e('Yes, I would like to customize the sale badge', 'woo-discount-rules'); ?></label>
255
- <?php
256
- } else {
257
- esc_html_e('Supported in PRO version', 'woo-discount-rules');
258
- }
259
- ?>
260
- </div>
261
- </div>
262
- <?php
263
- if($isPro){
264
- ?>
265
- <div class="row form-group customize_sale_tag_option">
266
- <?php $data['customize_sale_tag_html'] = (isset($data['customize_sale_tag_html']) ? $data['customize_sale_tag_html'] : '<span class="onsale">Sale!</span>'); ?>
267
- <div class="col-md-2">
268
- <label>
269
- <?php esc_html_e('Sale badge content (TIP: You can use HTML inside)', 'woo-discount-rules'); ?>
270
- </label>
271
- </div>
272
- <div class="col-md-6">
273
- <textarea name="customize_sale_tag_html" id="customize_sale_tag_html_textarea" class="customize_sale_tag_html_textarea" value="<?php echo esc_attr($data['customize_sale_tag_html']); ?>"><?php echo $data['customize_sale_tag_html']; ?></textarea>
274
- <div class="wdr_desc_text_con">
275
- <span class="wdr_desc_text">
276
- <?php esc_html_e('IMPORTANT NOTE: This customized sale badge will be applicable only for products that are part of the discount rules configured in this plugin', 'woo-discount-rules'); ?>
277
- </span>
278
- <br/>
279
- <span class="wdr_desc_text">
280
- <?php esc_html_e('Eg:', 'woo-discount-rules'); echo htmlentities('<span class="onsale">Sale!</span>'); ?>
281
- </span>
282
- </div>
283
- </div>
284
- </div>
285
- <?php
286
- } ?>
287
- <div class="row form-group">
288
- <?php $data['show_discount_table'] = (isset($data['show_discount_table']) ? $data['show_discount_table'] : 'show'); ?>
289
- <div class="col-md-2">
290
- <label>
291
- <?php esc_html_e('Discount Table :', 'woo-discount-rules'); ?>
292
- </label>
293
- </div>
294
- <div class="col-md-6">
295
- <select class="selectpicker" name="show_discount_table" id="show_discount_table">
296
- <option <?php if ($data['show_discount_table'] == 'dont') { ?> selected=selected <?php } ?>
297
- value="dont"><?php esc_html_e("Disabled", 'woo-discount-rules'); ?>
298
- </option>
299
- <option <?php if ($data['show_discount_table'] == 'show') { ?> selected=selected <?php } ?>
300
- value="show"><?php esc_html_e('Default layout', 'woo-discount-rules'); ?>
301
- </option>
302
- <option <?php if ($data['show_discount_table'] == 'advance') { ?> selected=selected <?php } ?>
303
- value="advance"><?php esc_html_e('Advance layout', 'woo-discount-rules'); ?>
304
- </option>
305
- </select>
306
- </div>
307
- </div>
308
- <div class="row form-group discount_table_options discount_table_option_advance">
309
- <?php $data['discount_table_placement'] = (isset($data['discount_table_placement']) ? $data['discount_table_placement'] : 'before_cart_form'); ?>
310
- <div class="col-md-2">
311
- <label>
312
- <?php esc_html_e('Table placement:', 'woo-discount-rules'); ?>
313
- </label>
314
- </div>
315
- <div class="col-md-6">
316
- <select class="selectpicker" name="discount_table_placement">
317
- <option <?php if ($data['discount_table_placement'] == 'before_cart_form') { ?> selected=selected <?php } ?>
318
- value="before_cart_form"><?php esc_html_e('Before cart form', 'woo-discount-rules'); ?>
319
- </option>
320
- <option <?php if ($data['discount_table_placement'] == 'after_cart_form') { ?> selected=selected <?php } ?>
321
- value="after_cart_form"><?php esc_html_e("After cart form", 'woo-discount-rules'); ?>
322
- </option>
323
- </select>
324
- </div>
325
- </div>
326
- <div class="row form-group discount_table_options">
327
- <?php $data['show_discount_table_header'] = (isset($data['show_discount_table_header']) ? $data['show_discount_table_header'] : 'show'); ?>
328
- <div class="col-md-2">
329
- <label>
330
- <?php esc_html_e('Table header :', 'woo-discount-rules'); ?>
331
- </label>
332
- </div>
333
- <div class="col-md-6">
334
- <select class="selectpicker" name="show_discount_table_header">
335
- <option <?php if ($data['show_discount_table_header'] == 'show') { ?> selected=selected <?php } ?>
336
- value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
337
- </option>
338
- <option <?php if ($data['show_discount_table_header'] == 'dont') { ?> selected=selected <?php } ?>
339
- value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
340
- </option>
341
- </select>
342
- </div>
343
- </div>
344
- <div class="row form-group discount_table_options">
345
- <?php $data['show_discount_title_table'] = (isset($data['show_discount_title_table']) ? $data['show_discount_title_table'] : 'show'); ?>
346
- <div class="col-md-2">
347
- <label>
348
- <?php esc_html_e('Title column on table :', 'woo-discount-rules'); ?>
349
- </label>
350
- </div>
351
- <div class="col-md-6">
352
- <select class="selectpicker" name="show_discount_title_table">
353
- <option <?php if ($data['show_discount_title_table'] == 'show') { ?> selected=selected <?php } ?>
354
- value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
355
- </option>
356
- <option <?php if ($data['show_discount_title_table'] == 'dont') { ?> selected=selected <?php } ?>
357
- value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
358
- </option>
359
- </select>
360
- </div>
361
- </div>
362
- <div class="row form-group discount_table_options">
363
- <?php $data['show_column_range_table'] = (isset($data['show_column_range_table']) ? $data['show_column_range_table'] : 'show'); ?>
364
- <div class="col-md-2">
365
- <label>
366
- <?php esc_html_e('Range column on table :', 'woo-discount-rules'); ?>
367
- </label>
368
- </div>
369
- <div class="col-md-6">
370
- <select class="selectpicker" name="show_column_range_table">
371
- <option <?php if ($data['show_column_range_table'] == 'show') { ?> selected=selected <?php } ?>
372
- value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
373
- </option>
374
- <option <?php if ($data['show_column_range_table'] == 'dont') { ?> selected=selected <?php } ?>
375
- value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
376
- </option>
377
- </select>
378
- </div>
379
- </div>
380
- <div class="row form-group discount_table_options">
381
- <?php $data['show_column_discount_table'] = (isset($data['show_column_discount_table']) ? $data['show_column_discount_table'] : 'show'); ?>
382
- <div class="col-md-2">
383
- <label>
384
- <?php esc_html_e('Discount column on table :', 'woo-discount-rules'); ?>
385
- </label>
386
- </div>
387
- <div class="col-md-6">
388
- <select class="selectpicker" name="show_column_discount_table">
389
- <option <?php if ($data['show_column_discount_table'] == 'show') { ?> selected=selected <?php } ?>
390
- value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
391
- </option>
392
- <option <?php if ($data['show_column_discount_table'] == 'dont') { ?> selected=selected <?php } ?>
393
- value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
394
- </option>
395
- </select>
396
- </div>
397
- </div>
398
- <div class="row form-group">
399
- <div class="col-md-2">
400
- <label>
401
- <?php esc_html_e('Show a crossed-out original price along with discounted price at line items in cart', 'woo-discount-rules'); ?>
402
- </label>
403
- </div>
404
- <?php $data['show_strikeout_in_cart'] = (isset($data['show_strikeout_in_cart']) ? $data['show_strikeout_in_cart'] : 1); ?>
405
- <div class="col-md-6">
406
- <label><input type="radio" name="show_strikeout_in_cart" value="1" <?php echo ($data['show_strikeout_in_cart'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
407
- <label><input type="radio" name="show_strikeout_in_cart" value="0" <?php echo ($data['show_strikeout_in_cart'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
408
- </div>
409
- </div>
410
- <div class="row form-group">
411
- <div class="col-md-2">
412
- <label>
413
- <?php esc_html_e('Auto add free product when coupon is applied (For coupon-activated rules)', 'woo-discount-rules'); ?>
414
- </label>
415
- </div>
416
- <?php $data['add_free_product_on_coupon_applied'] = (isset($data['add_free_product_on_coupon_applied']) ? $data['add_free_product_on_coupon_applied'] : 0); ?>
417
- <div class="col-md-6">
418
- <label><input type="radio" name="add_free_product_on_coupon_applied" value="1" <?php echo ($data['add_free_product_on_coupon_applied'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
419
- <label><input type="radio" name="add_free_product_on_coupon_applied" value="0" <?php echo ($data['add_free_product_on_coupon_applied'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
420
- </div>
421
- </div>
422
- <div class="row form-group">
423
- <div class="col-md-2">
424
- <label>
425
- <?php esc_html_e('Include variants when just parent products are chosen in the rules', 'woo-discount-rules'); ?>
426
- </label>
427
- </div>
428
- <?php $data['include_variants_on_select_parent_product'] = (isset($data['include_variants_on_select_parent_product']) ? $data['include_variants_on_select_parent_product'] : 0); ?>
429
- <div class="col-md-6">
430
- <label><input type="radio" name="include_variants_on_select_parent_product" value="1" <?php echo ($data['include_variants_on_select_parent_product'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
431
- <label><input type="radio" name="include_variants_on_select_parent_product" value="0" <?php echo ($data['include_variants_on_select_parent_product'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
432
- </div>
433
- </div>
434
- <div class="row form-group">
435
- <?php $data['display_you_saved_text'] = (isset($data['display_you_saved_text']) ? $data['display_you_saved_text'] : 'no'); ?>
436
- <div class="col-md-2">
437
- <label>
438
- <?php esc_html_e('Display savings text', 'woo-discount-rules'); ?>
439
- </label>
440
- </div>
441
- <div class="col-md-6">
442
- <select class="selectpicker" id="display_you_saved_text" name="display_you_saved_text">
443
- <option <?php if ($data['display_you_saved_text'] == 'no') { ?> selected=selected <?php } ?>
444
- value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
445
- </option>
446
- <option <?php if ($data['display_you_saved_text'] == 'on_each_line_item') { ?> selected=selected <?php } ?>
447
- value="on_each_line_item"><?php esc_html_e('On each line item', 'woo-discount-rules'); ?>
448
- </option>
449
- <option <?php if ($data['display_you_saved_text'] == 'after_total') { ?> selected=selected <?php } ?>
450
- value="after_total"><?php esc_html_e('On after total', 'woo-discount-rules'); ?>
451
- </option>
452
- <option <?php if ($data['display_you_saved_text'] == 'both_line_item_and_after_total') { ?> selected=selected <?php } ?>
453
- value="both_line_item_and_after_total"><?php esc_html_e('Both in line item and after total', 'woo-discount-rules'); ?>
454
- </option>
455
- </select>
456
- </div>
457
- </div>
458
- <div class="row form-group display_you_saved_text_options">
459
- <div class="col-md-2">
460
- <label>
461
- <?php esc_html_e('Savings text to show', 'woo-discount-rules'); ?>
462
- </label>
463
- </div>
464
- <?php $data['display_you_saved_text_value'] = (isset($data['display_you_saved_text_value']) ? $data['display_you_saved_text_value'] : " You saved: {{total_discount_price}}"); ?>
465
- <div class="col-md-6">
466
- <textarea name="display_you_saved_text_value" class="display_you_saved_text_value" value="<?php echo esc_attr($data['display_you_saved_text_value']); ?>"><?php echo $data['display_you_saved_text_value']; ?></textarea>
467
- <div class="wdr_desc_text_con">
468
- <span class="wdr_desc_text">
469
- <?php esc_html_e('{{total_discount_price}} -> Total discount applied', 'woo-discount-rules'); ?>
470
- </span>
471
- </div>
472
- </div>
473
- </div>
474
- </div>
475
  </div>
476
  <div id="wdr_s_cart_rules" class="tab-pane fade">
477
- <div class="">
478
- <div class="row form-group">
479
- <div class="col-md-12">
480
- <br/>
481
- <h4><?php esc_html_e('Cart rules settings', 'woo-discount-rules'); ?></h4>
482
- <hr>
483
- </div>
484
- </div>
485
- <div class="row form-group">
486
- <div class="col-md-2">
487
- <label>
488
- <?php esc_html_e('Coupon Name to be displayed :', 'woo-discount-rules'); ?>
489
- </label>
490
- </div>
491
- <div class="col-md-6">
492
- <input type="text" class="" name="coupon_name"
493
- value="<?php if (isset($data['coupon_name'])) echo $data['coupon_name']; ?>"
494
- placeholder="<?php esc_html_e('Discount Coupon Name', 'woo-discount-rules'); ?>">
495
- </div>
496
- </div>
497
- <div class="row form-group">
498
- <?php $data['cart_setup'] = (isset($data['cart_setup']) ? $data['cart_setup'] : 'first'); ?>
499
- <div class="col-md-2">
500
- <label>
501
- <?php esc_html_e('Rule Setup for Cart:', 'woo-discount-rules'); ?>
502
- </label>
503
- </div>
504
- <div class="col-md-6">
505
- <select class="selectpicker" name="cart_setup">
506
- <option <?php if ($data['cart_setup'] == 'first') { ?> selected=selected <?php } ?>
507
- value="first"><?php esc_html_e('Apply first matched rule', 'woo-discount-rules'); ?>
508
- </option>
509
- <option
510
- value="all" <?php if (!$pro) { ?> disabled <?php }
511
- if ($data['cart_setup'] == 'all') { ?> selected=selected <?php } ?>>
512
- <?php if (!$pro) { ?>
513
- <?php esc_html_e('Apply all matched rules', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
514
- <?php } else { ?>
515
- <?php esc_html_e('Apply all matched rules', 'woo-discount-rules'); ?>
516
- <?php } ?>
517
- </option>
518
- <option
519
- value="biggest" <?php if (!$pro) { ?> disabled <?php }
520
- if ($data['cart_setup'] == 'biggest') { ?> selected=selected <?php } ?>>
521
- <?php if (!$pro) { ?>
522
- <?php esc_html_e('Apply biggest discount', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
523
- <?php } else { ?>
524
- <?php esc_html_e('Apply biggest discount', 'woo-discount-rules'); ?>
525
- <?php } ?>
526
- </option>
527
- </select>
528
- </div>
529
- </div>
530
- <div class="row form-group">
531
- <div class="col-md-2">
532
- <label>
533
- <?php esc_html_e('Enable free shipping option', 'woo-discount-rules'); ?>
534
- </label>
535
- </div>
536
- <?php $data['enable_free_shipping'] = (isset($data['enable_free_shipping']) ? $data['enable_free_shipping'] : "none"); ?>
537
- <div class="col-md-6">
538
- <?php
539
- if(!$isPro){
540
- esc_html_e('Supported in PRO version', 'woo-discount-rules');
541
- ?>
542
- <select name="enable_free_shipping" id="enable_free_shipping" style="display: none">
543
- <option value="none"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?></option>
544
- </select>
545
- <?php
546
- } else {
547
- ?>
548
- <select class="selectpicker" name="enable_free_shipping" id="enable_free_shipping">
549
- <option <?php if ($data['enable_free_shipping'] == "none") { ?> selected=selected <?php } ?>
550
- value="none"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
551
- </option>
552
- <option <?php if ($data['enable_free_shipping'] == "free_shipping") { ?> selected=selected <?php } ?>
553
- value="free_shipping"><?php esc_html_e('Use Woocommerce free shipping', 'woo-discount-rules'); ?>
554
- </option>
555
- <option <?php if ($data['enable_free_shipping'] == "woodiscountfree") { ?> selected=selected <?php } ?>
556
- value="woodiscountfree"><?php esc_html_e('Use Woo-Discount free shipping', 'woo-discount-rules'); ?>
557
- </option>
558
- </select>
559
- <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('shipping-based-discounts/free-shipping-cart-based-rule', 'free_shipping');
560
- }
561
- ?>
562
- </div>
563
- </div>
564
- <?php
565
- if($isPro){
566
- ?>
567
- <div class="row form-group" id="woodiscount_settings_free_shipping_con">
568
- <div class="col-md-2">
569
- <label>
570
- <?php esc_html_e('Free shipping text to be displayed', 'woo-discount-rules'); ?>
571
- </label>
572
- </div>
573
- <div class="col-md-6">
574
- <?php $data['free_shipping_text'] = ((isset($data['free_shipping_text']) && !empty($data['free_shipping_text'])) ? $data['free_shipping_text'] : __( 'Free Shipping', 'woo-discount-rules' )); ?>
575
- <input type="text" class="" name="free_shipping_text"
576
- value="<?php echo $data['free_shipping_text']; ?>"
577
- placeholder="<?php esc_html_e('Free Shipping title', 'woo-discount-rules'); ?>">
578
- </div>
579
- </div>
580
- <?php } ?>
581
- <div class="row form-group" style="display: none"><!-- Hide this because it is not required after v1.4.36 -->
582
- <div class="col-md-2">
583
- <label>
584
- <?php esc_html_e('Draft', 'woo-discount-rules'); ?>
585
- </label>
586
- </div>
587
- <div class="col-md-6">
588
- <?php
589
- $checked = 0;
590
- if (isset($data['show_draft']) && $data['show_draft'] == 1){
591
- $checked = 1;
592
- } ?>
593
- <input type="checkbox" class="" id="show_draft_1" name="show_draft"
594
- value="1" <?php if($checked){ echo 'checked'; } ?>> <label class="checkbox_label" for="show_draft_1"><?php esc_html_e('Exclude Draft products in product select box.', 'woo-discount-rules'); ?></label>
595
- </div>
596
- </div>
597
- </div>
598
  </div>
599
  <div id="wdr_s_performance" class="tab-pane fade">
600
- <div class="">
601
- <div class="row form-group">
602
- <div class="col-md-12">
603
- <br/>
604
- <h4><?php esc_html_e('Performance settings', 'woo-discount-rules'); ?></h4>
605
- <hr>
606
- </div>
607
- </div>
608
- <?php $data['enable_variable_product_cache'] = (isset($data['enable_variable_product_cache']) ? $data['enable_variable_product_cache'] : 0); ?>
609
- <div class="row form-group">
610
- <div class="col-md-2">
611
- <label>
612
- <?php esc_html_e('Enable cache for variable products table content', 'woo-discount-rules'); ?>
613
- </label>
614
- </div>
615
-
616
- <div class="col-md-6">
617
- <label><input type="radio" name="enable_variable_product_cache" value="1" <?php echo ($data['enable_variable_product_cache'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
618
- <label><input type="radio" name="enable_variable_product_cache" value="0" <?php echo ($data['enable_variable_product_cache'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
619
- </div>
620
- </div>
621
- <div class="row form-group enable_variable_product_cache_con">
622
- <div class="col-md-2">
623
- <label>
624
- <?php esc_html_e('Clear cache', 'woo-discount-rules'); ?>
625
- </label>
626
- </div>
627
- <div class="col-md-6">
628
- <input type="button" id="refresh_wdr_cache" value="<?php esc_attr_e('Clear cache', 'woo-discount-rules'); ?>" class="btn btn-warning">
629
- </div>
630
- </div>
631
- </div>
632
  </div>
633
  <div id="wdr_s_promotion" class="tab-pane fade">
634
- <div class="">
635
- <div class="row form-group">
636
- <div class="col-md-12">
637
- <br/>
638
- <h4><?php esc_html_e('Promotion settings', 'woo-discount-rules'); ?></h4>
639
- <hr>
640
- </div>
641
- </div>
642
- <div class="row form-group">
643
- <div class="col-md-2">
644
- <label>
645
- <?php esc_html_e('Show a message on applying price rules in cart', 'woo-discount-rules'); ?>
646
- </label>
647
- </div>
648
- <?php $data['message_on_apply_price_discount'] = (isset($data['message_on_apply_price_discount']) ? $data['message_on_apply_price_discount'] : "no"); ?>
649
- <div class="col-md-6">
650
- <select class="selectpicker" name="message_on_apply_price_discount" id="message_on_apply_price_discount">
651
- <option <?php if ($data['message_on_apply_price_discount'] == "no") { ?> selected=selected <?php } ?>
652
- value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
653
- </option>
654
- <option <?php if ($data['message_on_apply_price_discount'] == "yes") { ?> selected=selected <?php } ?>
655
- value="yes"><?php esc_html_e('Enable', 'woo-discount-rules'); ?>
656
- </option>
657
- </select>
658
- </div>
659
- </div>
660
- <div class="row form-group message_on_apply_price_discount_options">
661
- <div class="col-md-2">
662
- <label>
663
- <?php esc_html_e('Message', 'woo-discount-rules'); ?>
664
- </label>
665
- </div>
666
- <?php $data['message_on_apply_price_discount_text'] = (isset($data['message_on_apply_price_discount_text']) ? $data['message_on_apply_price_discount_text'] : "Discount <strong>\"{{title}}\"</strong> has been applied to your cart."); ?>
667
- <div class="col-md-6">
668
- <textarea name="message_on_apply_price_discount_text" class="message_on_apply_discount_textarea" value="<?php echo esc_attr($data['message_on_apply_price_discount_text']); ?>"><?php echo $data['message_on_apply_price_discount_text']; ?></textarea>
669
- <div class="wdr_desc_text_con">
670
- <span class="wdr_desc_text">
671
- <?php esc_html_e('{{title}} -> Rule title', 'woo-discount-rules'); ?><br>
672
- <?php esc_html_e('{{description}} -> Rule description', 'woo-discount-rules'); ?>
673
- </span>
674
- </div>
675
- </div>
676
- </div>
677
- <div class="row form-group">
678
- <div class="col-md-2">
679
- <label>
680
- <?php esc_html_e('Show a message on applying cart rules in cart', 'woo-discount-rules'); ?>
681
- </label>
682
- </div>
683
- <?php $data['message_on_apply_cart_discount'] = (isset($data['message_on_apply_cart_discount']) ? $data['message_on_apply_cart_discount'] : "no"); ?>
684
- <div class="col-md-6">
685
- <select class="selectpicker" name="message_on_apply_cart_discount" id="message_on_apply_cart_discount">
686
- <option <?php if ($data['message_on_apply_cart_discount'] == "no") { ?> selected=selected <?php } ?>
687
- value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
688
- </option>
689
- <option <?php if ($data['message_on_apply_cart_discount'] == "yes") { ?> selected=selected <?php } ?>
690
- value="yes"><?php esc_html_e('Enable', 'woo-discount-rules'); ?>
691
- </option>
692
- </select>
693
- </div>
694
- </div>
695
- <div class="row form-group message_on_apply_cart_discount_options">
696
- <div class="col-md-2">
697
- <label>
698
- <?php esc_html_e('Message', 'woo-discount-rules'); ?>
699
- </label>
700
- </div>
701
- <?php $data['message_on_apply_cart_discount_text'] = (isset($data['message_on_apply_cart_discount_text']) ? $data['message_on_apply_cart_discount_text'] : "Discount <strong>\"{{title}}\"</strong> has been applied to your cart."); ?>
702
- <div class="col-md-6">
703
- <textarea name="message_on_apply_cart_discount_text" class="message_on_apply_discount_textarea" value="<?php echo esc_attr($data['message_on_apply_cart_discount_text']); ?>"><?php echo $data['message_on_apply_cart_discount_text']; ?></textarea>
704
- <div class="wdr_desc_text_con">
705
- <span class="wdr_desc_text">
706
- <?php esc_html_e('{{title}} -> Rule title', 'woo-discount-rules'); ?><br>
707
- <?php esc_html_e('{{description}} -> Rule description', 'woo-discount-rules'); ?>
708
- </span>
709
- </div>
710
- </div>
711
- </div>
712
- </div>
713
  </div>
714
  </div>
715
  </div>
32
 
33
  <div class="tab-content">
34
  <div id="wdr_s_general" class="tab-pane fade in active">
35
+ <?php include_once(WOO_DISCOUNT_DIR . '/view/settings_general.php'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  </div>
37
  <div id="wdr_s_price_rules" class="tab-pane fade">
38
+ <?php include_once(WOO_DISCOUNT_DIR . '/view/settings_price_rules.php'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
  </div>
40
  <div id="wdr_s_cart_rules" class="tab-pane fade">
41
+ <?php include_once(WOO_DISCOUNT_DIR . '/view/settings_cart_rules.php'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  </div>
43
  <div id="wdr_s_performance" class="tab-pane fade">
44
+ <?php include_once(WOO_DISCOUNT_DIR . '/view/settings_performance.php'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  </div>
46
  <div id="wdr_s_promotion" class="tab-pane fade">
47
+ <?php include_once(WOO_DISCOUNT_DIR . '/view/settings_promotion.php'); ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  </div>
49
  </div>
50
  </div>
view/settings_cart_rules.php ADDED
@@ -0,0 +1,149 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
+ ?>
4
+ <div class="">
5
+ <div class="row form-group">
6
+ <div class="col-md-12">
7
+ <br/>
8
+ <h4><?php esc_html_e('Cart rules settings', 'woo-discount-rules'); ?></h4>
9
+ <hr>
10
+ </div>
11
+ </div>
12
+ <div class="row form-group">
13
+ <div class="col-md-2">
14
+ <label>
15
+ <?php esc_html_e('Discount identifier in the backend', 'woo-discount-rules'); ?>
16
+ </label>
17
+ </div>
18
+ <div class="col-md-6">
19
+ <input type="text" class="" name="coupon_name"
20
+ value="<?php if (isset($data['coupon_name'])) echo $data['coupon_name']; ?>"
21
+ placeholder="<?php esc_html_e('Discount Coupon Name', 'woo-discount-rules'); ?>">
22
+ </div>
23
+ </div>
24
+ <?php
25
+ if($isPro){
26
+ ?>
27
+ <div class="row form-group customize_coupon_name_option">
28
+ <?php $data['customize_coupon_name_html'] = (isset($data['customize_coupon_name_html']) ? $data['customize_coupon_name_html'] : ''); ?>
29
+ <div class="col-md-2">
30
+ <label>
31
+ <?php esc_html_e('Coupon name to be used in the cart/checkout in the storefront', 'woo-discount-rules'); ?>
32
+ </label>
33
+ </div>
34
+ <div class="col-md-6">
35
+ <textarea name="customize_coupon_name_html" id="customize_coupon_name_html_textarea" class="customize_coupon_name_html_textarea" placeholder="<?php esc_attr_e('Discounts applied: {rule_name}', 'woo-discount-rules'); ?>" value="<?php echo esc_attr($data['customize_coupon_name_html']); ?>"><?php echo $data['customize_coupon_name_html']; ?></textarea>
36
+ <div class="wdr_desc_text_con">
37
+ <span class="wdr_desc_text">
38
+ {rule_name} <?php esc_html_e('- Rule name. If more than one rule applies in cart, then the rule names will be shown separated by comma(,)', 'woo-discount-rules'); ?>
39
+ </span>
40
+ <br/>
41
+ <span class="wdr_desc_text">
42
+ <?php esc_html_e('Eg: ', 'woo-discount-rules'); echo htmlentities('Discounts applied: {rule_name}'); ?>
43
+ </span>
44
+ </div>
45
+ </div>
46
+ </div>
47
+ <?php
48
+ } ?>
49
+ <div class="row form-group">
50
+ <?php $data['cart_setup'] = (isset($data['cart_setup']) ? $data['cart_setup'] : 'first'); ?>
51
+ <div class="col-md-2">
52
+ <label>
53
+ <?php esc_html_e('Rule Setup for Cart:', 'woo-discount-rules'); ?>
54
+ </label>
55
+ </div>
56
+ <div class="col-md-6">
57
+ <select class="selectpicker" name="cart_setup">
58
+ <option <?php if ($data['cart_setup'] == 'first') { ?> selected=selected <?php } ?>
59
+ value="first"><?php esc_html_e('Apply first matched rule', 'woo-discount-rules'); ?>
60
+ </option>
61
+ <option
62
+ value="all" <?php if (!$pro) { ?> disabled <?php }
63
+ if ($data['cart_setup'] == 'all') { ?> selected=selected <?php } ?>>
64
+ <?php if (!$pro) { ?>
65
+ <?php esc_html_e('Apply all matched rules', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
66
+ <?php } else { ?>
67
+ <?php esc_html_e('Apply all matched rules', 'woo-discount-rules'); ?>
68
+ <?php } ?>
69
+ </option>
70
+ <option
71
+ value="biggest" <?php if (!$pro) { ?> disabled <?php }
72
+ if ($data['cart_setup'] == 'biggest') { ?> selected=selected <?php } ?>>
73
+ <?php if (!$pro) { ?>
74
+ <?php esc_html_e('Apply biggest discount', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
75
+ <?php } else { ?>
76
+ <?php esc_html_e('Apply biggest discount', 'woo-discount-rules'); ?>
77
+ <?php } ?>
78
+ </option>
79
+ </select>
80
+ </div>
81
+ </div>
82
+ <div class="row form-group">
83
+ <div class="col-md-2">
84
+ <label>
85
+ <?php esc_html_e('Enable free shipping option', 'woo-discount-rules'); ?>
86
+ </label>
87
+ </div>
88
+ <?php $data['enable_free_shipping'] = (isset($data['enable_free_shipping']) ? $data['enable_free_shipping'] : "none"); ?>
89
+ <div class="col-md-6">
90
+ <?php
91
+ if(!$isPro){
92
+ esc_html_e('Supported in PRO version', 'woo-discount-rules');
93
+ ?>
94
+ <select name="enable_free_shipping" id="enable_free_shipping" style="display: none">
95
+ <option value="none"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?></option>
96
+ </select>
97
+ <?php
98
+ } else {
99
+ ?>
100
+ <select class="selectpicker" name="enable_free_shipping" id="enable_free_shipping">
101
+ <option <?php if ($data['enable_free_shipping'] == "none") { ?> selected=selected <?php } ?>
102
+ value="none"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
103
+ </option>
104
+ <option <?php if ($data['enable_free_shipping'] == "free_shipping") { ?> selected=selected <?php } ?>
105
+ value="free_shipping"><?php esc_html_e('Use Woocommerce free shipping', 'woo-discount-rules'); ?>
106
+ </option>
107
+ <option <?php if ($data['enable_free_shipping'] == "woodiscountfree") { ?> selected=selected <?php } ?>
108
+ value="woodiscountfree"><?php esc_html_e('Use Woo-Discount free shipping', 'woo-discount-rules'); ?>
109
+ </option>
110
+ </select>
111
+ <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('shipping-based-discounts/free-shipping-cart-based-rule', 'free_shipping');
112
+ }
113
+ ?>
114
+ </div>
115
+ </div>
116
+ <?php
117
+ if($isPro){
118
+ ?>
119
+ <div class="row form-group" id="woodiscount_settings_free_shipping_con">
120
+ <div class="col-md-2">
121
+ <label>
122
+ <?php esc_html_e('Free shipping text to be displayed', 'woo-discount-rules'); ?>
123
+ </label>
124
+ </div>
125
+ <div class="col-md-6">
126
+ <?php $data['free_shipping_text'] = ((isset($data['free_shipping_text']) && !empty($data['free_shipping_text'])) ? $data['free_shipping_text'] : __( 'Free Shipping', 'woo-discount-rules' )); ?>
127
+ <input type="text" class="" name="free_shipping_text"
128
+ value="<?php echo $data['free_shipping_text']; ?>"
129
+ placeholder="<?php esc_html_e('Free Shipping title', 'woo-discount-rules'); ?>">
130
+ </div>
131
+ </div>
132
+ <?php } ?>
133
+ <div class="row form-group" style="display: none"><!-- Hide this because it is not required after v1.4.36 -->
134
+ <div class="col-md-2">
135
+ <label>
136
+ <?php esc_html_e('Draft', 'woo-discount-rules'); ?>
137
+ </label>
138
+ </div>
139
+ <div class="col-md-6">
140
+ <?php
141
+ $checked = 0;
142
+ if (isset($data['show_draft']) && $data['show_draft'] == 1){
143
+ $checked = 1;
144
+ } ?>
145
+ <input type="checkbox" class="" id="show_draft_1" name="show_draft"
146
+ value="1" <?php if($checked){ echo 'checked'; } ?>> <label class="checkbox_label" for="show_draft_1"><?php esc_html_e('Exclude Draft products in product select box.', 'woo-discount-rules'); ?></label>
147
+ </div>
148
+ </div>
149
+ </div>
view/settings_general.php ADDED
@@ -0,0 +1,113 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
+ ?>
4
+ <div class="">
5
+ <br/>
6
+ <h4><?php esc_html_e('General Settings', 'woo-discount-rules'); ?></h4>
7
+ <hr>
8
+ </div>
9
+ <div class="">
10
+ <div class="row form-group">
11
+ <div class="col-md-2">
12
+ <label>
13
+ <?php esc_html_e('License Key :', 'woo-discount-rules'); ?>
14
+ </label>
15
+ </div>
16
+ <div class="col-md-6">
17
+ <input type="text" class="" name="license_key" id="woo-disc-license-key"
18
+ value="<?php if (isset($data['license_key'])) echo $data['license_key']; ?>"
19
+ placeholder="<?php esc_attr_e('Your Unique License Key', 'woo-discount-rules'); ?>">
20
+ <input type="button" id="woo-disc-license-check" value="<?php esc_attr_e('Validate Key', 'woo-discount-rules'); ?>" class="button button-info">
21
+ <?php
22
+ $verifiedLicense = get_option('woo_discount_rules_verified_key', 0);
23
+ if (isset($data['license_key']) && $data['license_key'] != '') {
24
+ if ($verifiedLicense) {
25
+ ?>
26
+ <span class="license-success">&#10004;</span>
27
+ <?php
28
+ } else {
29
+ ?>
30
+ <div class="license-failed notice-message error inline notice-error notice-alt">
31
+ <?php esc_html_e('License key seems to be Invalid. Please enter a valid license key', 'woo-discount-rules'); ?>
32
+ </div>
33
+ <?php
34
+ }
35
+ }
36
+ ?>
37
+ <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('introduction/license-key-activation', 'license'); ?>
38
+ <br>
39
+ <div id="woo-disc-license-check-msg">
40
+
41
+ </div>
42
+ <div class="wdr_desc_text_con">
43
+ <span class="wdr_desc_text">
44
+ <?php esc_html_e('Tip: Install pro package before validating the licence', 'woo-discount-rules'); ?>
45
+ </span>
46
+ </div>
47
+ </div>
48
+ </div>
49
+ <div class="row form-group">
50
+ <div class="col-md-2">
51
+ <label>
52
+ <?php esc_html_e('Enable dropdowns (applies only for the rule engine in the backend.)', 'woo-discount-rules'); ?>
53
+ </label>
54
+ </div>
55
+ <?php $data['enable_bootstrap'] = (isset($data['enable_bootstrap']) ? $data['enable_bootstrap'] : 1); ?>
56
+ <div class="col-md-6">
57
+ <label><input type="radio" name="enable_bootstrap" value="1" <?php echo ($data['enable_bootstrap'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
58
+ <label><input type="radio" name="enable_bootstrap" value="0" <?php echo ($data['enable_bootstrap'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
59
+ <div class="wdr_desc_text_con">
60
+ <span class="wdr_desc_text">
61
+ <?php esc_html_e('Disabling this setting may affect dropdowns in rule engine (Disabling this setting is not recommended). Change this only if you know what you are doing.', 'woo-discount-rules'); ?>
62
+ </span>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <div class="row form-group">
67
+ <div class="col-md-2">
68
+ <label>
69
+ <?php esc_html_e('Force refresh the cart widget while add and remove item to cart', 'woo-discount-rules'); ?>
70
+ </label>
71
+ </div>
72
+ <?php $data['force_refresh_cart_widget'] = (isset($data['force_refresh_cart_widget']) ? $data['force_refresh_cart_widget'] : 0); ?>
73
+ <div class="col-md-6">
74
+ <label><input type="radio" name="force_refresh_cart_widget" value="1" <?php echo ($data['force_refresh_cart_widget'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
75
+ <label><input type="radio" name="force_refresh_cart_widget" value="0" <?php echo ($data['force_refresh_cart_widget'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
76
+ </div>
77
+ </div>
78
+ <div class="row form-group">
79
+ <div class="col-md-2">
80
+ <label>
81
+ <?php esc_html_e('Choose how discount rules should work when WooCommerce coupons (or third party) coupons are used?', 'woo-discount-rules'); ?>
82
+ </label>
83
+ </div>
84
+ <?php $data['do_not_run_while_have_third_party_coupon'] = (isset($data['do_not_run_while_have_third_party_coupon']) ? $data['do_not_run_while_have_third_party_coupon'] : 0); ?>
85
+ <div class="col-md-6">
86
+ <select class="selectpicker" name="do_not_run_while_have_third_party_coupon" id="do_not_run_while_have_third_party_coupon">
87
+ <option <?php if ($data['do_not_run_while_have_third_party_coupon'] == '0') { ?> selected=selected <?php } ?>
88
+ value="0"><?php esc_html_e("Let both coupons and discount rules run together", 'woo-discount-rules'); ?>
89
+ </option>
90
+ <option <?php if ($data['do_not_run_while_have_third_party_coupon'] == '1') { ?> selected=selected <?php } ?>
91
+ value="1"><?php esc_html_e('Disable the discount rules (coupons will work)', 'woo-discount-rules'); ?>
92
+ </option>
93
+ <option <?php if ($data['do_not_run_while_have_third_party_coupon'] == 'remove_coupon') { ?> selected=selected <?php } ?>
94
+ value="remove_coupon"><?php esc_html_e('Disable the coupons (discount rules will work)', 'woo-discount-rules'); ?>
95
+ </option>
96
+ </select>
97
+ </div>
98
+ </div>
99
+ <?php if($isPro){ ?>
100
+ <div class="row form-group">
101
+ <div class="col-md-2">
102
+ <label>
103
+ <?php esc_html_e('Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a coupon used with discount rule conditions', 'woo-discount-rules'); ?>
104
+ </label>
105
+ </div>
106
+ <?php $data['remove_zero_coupon_price'] = (isset($data['remove_zero_coupon_price']) ? $data['remove_zero_coupon_price'] : 1); ?>
107
+ <div class="col-md-6">
108
+ <label><input type="radio" name="remove_zero_coupon_price" value="1" <?php echo ($data['remove_zero_coupon_price'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
109
+ <label><input type="radio" name="remove_zero_coupon_price" value="0" <?php echo ($data['remove_zero_coupon_price'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
110
+ </div>
111
+ </div>
112
+ <?php } ?>
113
+ </div>
view/settings_performance.php ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
+ ?>
4
+ <div class="">
5
+ <div class="row form-group">
6
+ <div class="col-md-12">
7
+ <br/>
8
+ <h4><?php esc_html_e('Performance settings', 'woo-discount-rules'); ?></h4>
9
+ <hr>
10
+ </div>
11
+ </div>
12
+ <?php $data['enable_variable_product_cache'] = (isset($data['enable_variable_product_cache']) ? $data['enable_variable_product_cache'] : 0); ?>
13
+ <div class="row form-group">
14
+ <div class="col-md-2">
15
+ <label>
16
+ <?php esc_html_e('Enable cache for variable products table content', 'woo-discount-rules'); ?>
17
+ </label>
18
+ </div>
19
+
20
+ <div class="col-md-6">
21
+ <label><input type="radio" name="enable_variable_product_cache" value="1" <?php echo ($data['enable_variable_product_cache'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
22
+ <label><input type="radio" name="enable_variable_product_cache" value="0" <?php echo ($data['enable_variable_product_cache'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
23
+ </div>
24
+ </div>
25
+ <div class="row form-group enable_variable_product_cache_con">
26
+ <div class="col-md-2">
27
+ <label>
28
+ <?php esc_html_e('Clear cache', 'woo-discount-rules'); ?>
29
+ </label>
30
+ </div>
31
+ <div class="col-md-6">
32
+ <input type="button" id="refresh_wdr_cache" value="<?php esc_attr_e('Clear cache', 'woo-discount-rules'); ?>" class="btn btn-warning">
33
+ </div>
34
+ </div>
35
+ </div>
view/settings_price_rules.php ADDED
@@ -0,0 +1,326 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
+ ?>
4
+ <div>
5
+ <div class="row form-group">
6
+ <div class="col-md-12">
7
+ <br/>
8
+ <h4><?php esc_html_e('Price rules settings', 'woo-discount-rules'); ?></h4>
9
+ <hr>
10
+ </div>
11
+ </div>
12
+ <div class="tabbable tabs-left">
13
+ <ul class="nav nav-tabs">
14
+ <li class="active"><a data-toggle="tab" href="#wdr_price_rule_setup"><?php esc_html_e('Rule setup', 'woo-discount-rules'); ?></a></li>
15
+ <li><a data-toggle="tab" href="#wdr_price_rule_display"><?php esc_html_e('Display', 'woo-discount-rules'); ?></a></li>
16
+ <li><a data-toggle="tab" href="#wdr_price_rule_offer_table"><?php esc_html_e('Offer table', 'woo-discount-rules'); ?></a></li>
17
+ <li><a data-toggle="tab" href="#wdr_price_rule_sale_badge"><?php esc_html_e('Sale badge', 'woo-discount-rules'); ?></a></li>
18
+ </ul>
19
+ <div class="tab-content">
20
+ <div id="wdr_price_rule_setup" class="tab-pane fade in active">
21
+ <div class="price_rules_s_block_c col-md-12">
22
+ <div class="row form-group">
23
+ <?php $data['price_setup'] = (isset($data['price_setup']) ? $data['price_setup'] : 'first'); ?>
24
+ <div class="col-md-2">
25
+ <label>
26
+ <?php esc_html_e('Rule Setup', 'woo-discount-rules'); ?>
27
+ </label>
28
+ </div>
29
+ <div class="col-md-6">
30
+ <select class="selectpicker" name="price_setup">
31
+ <option <?php if ($data['price_setup'] == 'first') { ?> selected=selected <?php } ?>
32
+ value="first" selected="selected"><?php esc_html_e('Apply first matched rule', 'woo-discount-rules'); ?>
33
+ </option>
34
+ <option
35
+ value="all" <?php if (!$pro) { ?> disabled <?php }
36
+ if ($data['price_setup'] == 'all') { ?> selected=selected <?php } ?>>
37
+ <?php if (!$pro) { ?>
38
+ <?php esc_html_e('Apply all matched rules', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
39
+ <?php } else { ?>
40
+ <?php esc_html_e('Apply all matched rules', 'woo-discount-rules'); ?>
41
+ <?php } ?>
42
+ </option>
43
+ <option
44
+ value="biggest" <?php if (!$pro) { ?> disabled <?php }
45
+ if ($data['price_setup'] == 'biggest') { ?> selected=selected <?php } ?>>
46
+ <?php if (!$pro) { ?>
47
+ <?php esc_html_e('Apply biggest discount', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
48
+ <?php } else { ?>
49
+ <?php esc_html_e('Apply biggest discount', 'woo-discount-rules'); ?>
50
+ <?php } ?>
51
+ </option>
52
+ </select>
53
+ </div>
54
+ </div>
55
+ <div class="row form-group">
56
+ <div class="col-md-2">
57
+ <label>
58
+ <?php esc_html_e('Apply discount based on', 'woo-discount-rules'); ?>
59
+ </label>
60
+ </div>
61
+ <?php $data['do_discount_from_regular_price'] = (isset($data['do_discount_from_regular_price']) ? $data['do_discount_from_regular_price'] : 'sale'); ?>
62
+ <div class="col-md-6">
63
+ <select class="selectpicker" name="do_discount_from_regular_price" id="do_discount_from_regular_price">
64
+ <option <?php if ($data['do_discount_from_regular_price'] == 'sale') { ?> selected=selected <?php } ?>
65
+ value="sale"><?php esc_html_e('Sale price', 'woo-discount-rules'); ?>
66
+ </option>
67
+ <option <?php if ($data['do_discount_from_regular_price'] == 'regular') { ?> selected=selected <?php } ?>
68
+ value="regular"><?php esc_html_e('Regular price', 'woo-discount-rules'); ?>
69
+ </option>
70
+ </select>
71
+ <div class="wdr_desc_text_con">
72
+ <span class="wdr_desc_text">
73
+ <?php esc_html_e('If sale price is not entered in your products, the regular price will be taken', 'woo-discount-rules'); ?>
74
+ </span>
75
+ </div>
76
+ </div>
77
+ </div>
78
+ <div class="row form-group">
79
+ <div class="col-md-2">
80
+ <label>
81
+ <?php esc_html_e('Auto add free product when coupon is applied (For coupon-activated rules)', 'woo-discount-rules'); ?>
82
+ </label>
83
+ </div>
84
+ <?php $data['add_free_product_on_coupon_applied'] = (isset($data['add_free_product_on_coupon_applied']) ? $data['add_free_product_on_coupon_applied'] : 0); ?>
85
+ <div class="col-md-6">
86
+ <label><input type="radio" name="add_free_product_on_coupon_applied" value="1" <?php echo ($data['add_free_product_on_coupon_applied'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
87
+ <label><input type="radio" name="add_free_product_on_coupon_applied" value="0" <?php echo ($data['add_free_product_on_coupon_applied'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
88
+ </div>
89
+ </div>
90
+ <div class="row form-group">
91
+ <div class="col-md-2">
92
+ <label>
93
+ <?php esc_html_e('Include variants when just parent products are chosen in the rules', 'woo-discount-rules'); ?>
94
+ </label>
95
+ </div>
96
+ <?php $data['include_variants_on_select_parent_product'] = (isset($data['include_variants_on_select_parent_product']) ? $data['include_variants_on_select_parent_product'] : 0); ?>
97
+ <div class="col-md-6">
98
+ <label><input type="radio" name="include_variants_on_select_parent_product" value="1" <?php echo ($data['include_variants_on_select_parent_product'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
99
+ <label><input type="radio" name="include_variants_on_select_parent_product" value="0" <?php echo ($data['include_variants_on_select_parent_product'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
100
+ </div>
101
+ </div>
102
+ </div>
103
+ </div>
104
+ <div id="wdr_price_rule_display" class="tab-pane fade">
105
+ <div class="price_rules_s_block_c col-md-12">
106
+ <div class="row form-group">
107
+ <?php $data['show_price_discount_on_product_page'] = (isset($data['show_price_discount_on_product_page']) ? $data['show_price_discount_on_product_page'] : 'show'); ?>
108
+ <div class="col-md-2">
109
+ <label>
110
+ <?php esc_html_e('Show Price discount on product pages :', 'woo-discount-rules'); ?>
111
+ </label>
112
+ </div>
113
+ <div class="col-md-6">
114
+ <select class="selectpicker" name="show_price_discount_on_product_page" id="show_price_discount_on_product_page">
115
+ <option <?php if ($data['show_price_discount_on_product_page'] == 'show') { ?> selected=selected <?php } ?>
116
+ value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
117
+ </option>
118
+ <option <?php if ($data['show_price_discount_on_product_page'] == 'dont') { ?> selected=selected <?php } ?>
119
+ value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
120
+ </option>
121
+ </select>
122
+
123
+ </div>
124
+ </div>
125
+ <div class="row form-group">
126
+ <div class="col-md-2">
127
+ <label>
128
+ <?php esc_html_e('Show a crossed-out original price along with discounted price at line items in cart', 'woo-discount-rules'); ?>
129
+ </label>
130
+ </div>
131
+ <?php $data['show_strikeout_in_cart'] = (isset($data['show_strikeout_in_cart']) ? $data['show_strikeout_in_cart'] : 1); ?>
132
+ <div class="col-md-6">
133
+ <label><input type="radio" name="show_strikeout_in_cart" value="1" <?php echo ($data['show_strikeout_in_cart'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
134
+ <label><input type="radio" name="show_strikeout_in_cart" value="0" <?php echo ($data['show_strikeout_in_cart'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
135
+ </div>
136
+ </div>
137
+ </div>
138
+ </div>
139
+ <div id="wdr_price_rule_offer_table" class="tab-pane fade">
140
+ <div class="price_rules_s_block_c col-md-12">
141
+ <div class="row form-group">
142
+ <?php $data['show_discount_table'] = (isset($data['show_discount_table']) ? $data['show_discount_table'] : 'show'); ?>
143
+ <div class="col-md-2">
144
+ <label>
145
+ <?php esc_html_e('Discount Table :', 'woo-discount-rules'); ?>
146
+ </label>
147
+ </div>
148
+ <div class="col-md-6">
149
+ <select class="selectpicker" name="show_discount_table" id="show_discount_table">
150
+ <option <?php if ($data['show_discount_table'] == 'dont') { ?> selected=selected <?php } ?>
151
+ value="dont"><?php esc_html_e("Disabled", 'woo-discount-rules'); ?>
152
+ </option>
153
+ <option <?php if ($data['show_discount_table'] == 'show') { ?> selected=selected <?php } ?>
154
+ value="show"><?php esc_html_e('Default layout', 'woo-discount-rules'); ?>
155
+ </option>
156
+ <option <?php if ($data['show_discount_table'] == 'advance') { ?> selected=selected <?php } ?>
157
+ value="advance"><?php esc_html_e('Advance layout', 'woo-discount-rules'); ?>
158
+ </option>
159
+ </select>
160
+ </div>
161
+ </div>
162
+ <div class="row form-group discount_table_options discount_table_option_advance">
163
+ <?php $data['discount_table_placement'] = (isset($data['discount_table_placement']) ? $data['discount_table_placement'] : 'before_cart_form'); ?>
164
+ <div class="col-md-2">
165
+ <label>
166
+ <?php esc_html_e('Table placement:', 'woo-discount-rules'); ?>
167
+ </label>
168
+ </div>
169
+ <div class="col-md-6">
170
+ <select class="selectpicker" name="discount_table_placement">
171
+ <option <?php if ($data['discount_table_placement'] == 'before_cart_form') { ?> selected=selected <?php } ?>
172
+ value="before_cart_form"><?php esc_html_e('Before cart form', 'woo-discount-rules'); ?>
173
+ </option>
174
+ <option <?php if ($data['discount_table_placement'] == 'after_cart_form') { ?> selected=selected <?php } ?>
175
+ value="after_cart_form"><?php esc_html_e("After cart form", 'woo-discount-rules'); ?>
176
+ </option>
177
+ </select>
178
+ </div>
179
+ </div>
180
+ <div class="row form-group discount_table_options">
181
+ <?php $data['show_discount_table_header'] = (isset($data['show_discount_table_header']) ? $data['show_discount_table_header'] : 'show'); ?>
182
+ <div class="col-md-2">
183
+ <label>
184
+ <?php esc_html_e('Table header :', 'woo-discount-rules'); ?>
185
+ </label>
186
+ </div>
187
+ <div class="col-md-6">
188
+ <select class="selectpicker" name="show_discount_table_header">
189
+ <option <?php if ($data['show_discount_table_header'] == 'show') { ?> selected=selected <?php } ?>
190
+ value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
191
+ </option>
192
+ <option <?php if ($data['show_discount_table_header'] == 'dont') { ?> selected=selected <?php } ?>
193
+ value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
194
+ </option>
195
+ </select>
196
+ </div>
197
+ </div>
198
+ <div class="row form-group discount_table_options">
199
+ <?php $data['show_discount_title_table'] = (isset($data['show_discount_title_table']) ? $data['show_discount_title_table'] : 'show'); ?>
200
+ <div class="col-md-2">
201
+ <label>
202
+ <?php esc_html_e('Title column on table :', 'woo-discount-rules'); ?>
203
+ </label>
204
+ </div>
205
+ <div class="col-md-6">
206
+ <select class="selectpicker" name="show_discount_title_table">
207
+ <option <?php if ($data['show_discount_title_table'] == 'show') { ?> selected=selected <?php } ?>
208
+ value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
209
+ </option>
210
+ <option <?php if ($data['show_discount_title_table'] == 'dont') { ?> selected=selected <?php } ?>
211
+ value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
212
+ </option>
213
+ </select>
214
+ </div>
215
+ </div>
216
+ <div class="row form-group discount_table_options">
217
+ <?php $data['show_column_range_table'] = (isset($data['show_column_range_table']) ? $data['show_column_range_table'] : 'show'); ?>
218
+ <div class="col-md-2">
219
+ <label>
220
+ <?php esc_html_e('Range column on table :', 'woo-discount-rules'); ?>
221
+ </label>
222
+ </div>
223
+ <div class="col-md-6">
224
+ <select class="selectpicker" name="show_column_range_table">
225
+ <option <?php if ($data['show_column_range_table'] == 'show') { ?> selected=selected <?php } ?>
226
+ value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
227
+ </option>
228
+ <option <?php if ($data['show_column_range_table'] == 'dont') { ?> selected=selected <?php } ?>
229
+ value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
230
+ </option>
231
+ </select>
232
+ </div>
233
+ </div>
234
+ <div class="row form-group discount_table_options">
235
+ <?php $data['show_column_discount_table'] = (isset($data['show_column_discount_table']) ? $data['show_column_discount_table'] : 'show'); ?>
236
+ <div class="col-md-2">
237
+ <label>
238
+ <?php esc_html_e('Discount column on table :', 'woo-discount-rules'); ?>
239
+ </label>
240
+ </div>
241
+ <div class="col-md-6">
242
+ <select class="selectpicker" name="show_column_discount_table">
243
+ <option <?php if ($data['show_column_discount_table'] == 'show') { ?> selected=selected <?php } ?>
244
+ value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
245
+ </option>
246
+ <option <?php if ($data['show_column_discount_table'] == 'dont') { ?> selected=selected <?php } ?>
247
+ value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
248
+ </option>
249
+ </select>
250
+ </div>
251
+ </div>
252
+ </div>
253
+ </div>
254
+ <div id="wdr_price_rule_sale_badge" class="tab-pane fade">
255
+ <div class="price_rules_s_block_c col-md-12">
256
+ <div class="row form-group">
257
+ <?php $data['show_sale_tag_on_product_page'] = (isset($data['show_sale_tag_on_product_page']) ? $data['show_sale_tag_on_product_page'] : 'show'); ?>
258
+ <div class="col-md-2">
259
+ <label>
260
+ <?php esc_html_e('Show a Sale badge on product pages :', 'woo-discount-rules'); ?>
261
+ </label>
262
+ </div>
263
+ <div class="col-md-6">
264
+ <select class="selectpicker" name="show_sale_tag_on_product_page">
265
+ <option <?php if ($data['show_sale_tag_on_product_page'] == 'dont') { ?> selected=selected <?php } ?>
266
+ value="dont"><?php esc_html_e("Do not show", 'woo-discount-rules'); ?>
267
+ </option>
268
+ <option <?php if ($data['show_sale_tag_on_product_page'] == 'show') { ?> selected=selected <?php } ?>
269
+ value="show"><?php esc_html_e('Show only after a rule condition is matched exactly', 'woo-discount-rules'); ?>
270
+ </option>
271
+ <option <?php if ($data['show_sale_tag_on_product_page'] == 'show_on_any_rules_matches') { ?> selected=selected <?php } ?>
272
+ value="show_on_any_rules_matches"><?php esc_html_e('Show on products that are covered under any price based discount rule in the plugin', 'woo-discount-rules'); ?>
273
+ </option>
274
+ </select>
275
+
276
+ </div>
277
+ </div>
278
+ <div class="row form-group">
279
+ <?php $data['customize_sale_tag'] = (isset($data['customize_sale_tag']) ? $data['customize_sale_tag'] : 0); ?>
280
+ <div class="col-md-2">
281
+ <label for="customize_sale_tag">
282
+ <?php esc_html_e('Do you want to customize the sale badge?', 'woo-discount-rules'); ?>
283
+ </label>
284
+ </div>
285
+ <div class="col-md-6">
286
+ <?php
287
+ if($isPro){
288
+ ?>
289
+ <input type="checkbox" name="customize_sale_tag" id="customize_sale_tag" value="1" <?php if ($data['customize_sale_tag'] == 1) { ?> checked <?php } ?>> <label for="customize_sale_tag"><?php esc_html_e('Yes, I would like to customize the sale badge', 'woo-discount-rules'); ?></label>
290
+ <?php
291
+ } else {
292
+ esc_html_e('Supported in PRO version', 'woo-discount-rules');
293
+ }
294
+ ?>
295
+ </div>
296
+ </div>
297
+ <?php
298
+ if($isPro){
299
+ ?>
300
+ <div class="row form-group customize_sale_tag_option">
301
+ <?php $data['customize_sale_tag_html'] = (isset($data['customize_sale_tag_html']) ? $data['customize_sale_tag_html'] : '<span class="onsale">Sale!</span>'); ?>
302
+ <div class="col-md-2">
303
+ <label>
304
+ <?php esc_html_e('Sale badge content (TIP: You can use HTML inside)', 'woo-discount-rules'); ?>
305
+ </label>
306
+ </div>
307
+ <div class="col-md-6">
308
+ <textarea name="customize_sale_tag_html" id="customize_sale_tag_html_textarea" class="customize_sale_tag_html_textarea" value="<?php echo esc_attr($data['customize_sale_tag_html']); ?>"><?php echo $data['customize_sale_tag_html']; ?></textarea>
309
+ <div class="wdr_desc_text_con">
310
+ <span class="wdr_desc_text">
311
+ <?php esc_html_e('IMPORTANT NOTE: This customized sale badge will be applicable only for products that are part of the discount rules configured in this plugin', 'woo-discount-rules'); ?>
312
+ </span>
313
+ <br/>
314
+ <span class="wdr_desc_text">
315
+ <?php esc_html_e('Eg:', 'woo-discount-rules'); echo htmlentities('<span class="onsale">Sale!</span>'); ?>
316
+ </span>
317
+ </div>
318
+ </div>
319
+ </div>
320
+ <?php
321
+ } ?>
322
+ </div>
323
+ </div>
324
+ </div>
325
+ </div>
326
+ </div>
view/settings_promotion.php ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
+ ?>
4
+ <div class="">
5
+ <div class="row form-group">
6
+ <div class="col-md-12">
7
+ <br/>
8
+ <h4><?php esc_html_e('Promotion settings', 'woo-discount-rules'); ?></h4>
9
+ <hr>
10
+ </div>
11
+ </div>
12
+ <div class="row form-group">
13
+ <?php $data['display_you_saved_text'] = (isset($data['display_you_saved_text']) ? $data['display_you_saved_text'] : 'no'); ?>
14
+ <div class="col-md-2">
15
+ <label>
16
+ <?php esc_html_e('Display savings text (for price rules)', 'woo-discount-rules'); ?>
17
+ </label>
18
+ </div>
19
+ <div class="col-md-6">
20
+ <select class="selectpicker" id="display_you_saved_text" name="display_you_saved_text">
21
+ <option <?php if ($data['display_you_saved_text'] == 'no') { ?> selected=selected <?php } ?>
22
+ value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
23
+ </option>
24
+ <option <?php if ($data['display_you_saved_text'] == 'on_each_line_item') { ?> selected=selected <?php } ?>
25
+ value="on_each_line_item"><?php esc_html_e('On each line item', 'woo-discount-rules'); ?>
26
+ </option>
27
+ <option <?php if ($data['display_you_saved_text'] == 'after_total') { ?> selected=selected <?php } ?>
28
+ value="after_total"><?php esc_html_e('On after total', 'woo-discount-rules'); ?>
29
+ </option>
30
+ <option <?php if ($data['display_you_saved_text'] == 'both_line_item_and_after_total') { ?> selected=selected <?php } ?>
31
+ value="both_line_item_and_after_total"><?php esc_html_e('Both in line item and after total', 'woo-discount-rules'); ?>
32
+ </option>
33
+ </select>
34
+ </div>
35
+ </div>
36
+ <div class="row form-group display_you_saved_text_options">
37
+ <div class="col-md-2">
38
+ <label>
39
+ <?php esc_html_e('Savings text to show', 'woo-discount-rules'); ?>
40
+ </label>
41
+ </div>
42
+ <?php $data['display_you_saved_text_value'] = (isset($data['display_you_saved_text_value']) ? $data['display_you_saved_text_value'] : " You saved: {{total_discount_price}}"); ?>
43
+ <div class="col-md-6">
44
+ <textarea name="display_you_saved_text_value" class="display_you_saved_text_value" value="<?php echo esc_attr($data['display_you_saved_text_value']); ?>"><?php echo $data['display_you_saved_text_value']; ?></textarea>
45
+ <div class="wdr_desc_text_con">
46
+ <span class="wdr_desc_text">
47
+ <?php esc_html_e('{{total_discount_price}} -> Total discount applied', 'woo-discount-rules'); ?>
48
+ </span>
49
+ </div>
50
+ </div>
51
+ </div>
52
+ <div class="row form-group">
53
+ <div class="col-md-2">
54
+ <label>
55
+ <?php esc_html_e('Show a message on applying price rules in cart', 'woo-discount-rules'); ?>
56
+ </label>
57
+ </div>
58
+ <?php $data['message_on_apply_price_discount'] = (isset($data['message_on_apply_price_discount']) ? $data['message_on_apply_price_discount'] : "no"); ?>
59
+ <div class="col-md-6">
60
+ <select class="selectpicker" name="message_on_apply_price_discount" id="message_on_apply_price_discount">
61
+ <option <?php if ($data['message_on_apply_price_discount'] == "no") { ?> selected=selected <?php } ?>
62
+ value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
63
+ </option>
64
+ <option <?php if ($data['message_on_apply_price_discount'] == "yes") { ?> selected=selected <?php } ?>
65
+ value="yes"><?php esc_html_e('Enable', 'woo-discount-rules'); ?>
66
+ </option>
67
+ </select>
68
+ </div>
69
+ </div>
70
+ <div class="row form-group message_on_apply_price_discount_options">
71
+ <div class="col-md-2">
72
+ <label>
73
+ <?php esc_html_e('Message', 'woo-discount-rules'); ?>
74
+ </label>
75
+ </div>
76
+ <?php $data['message_on_apply_price_discount_text'] = (isset($data['message_on_apply_price_discount_text']) ? $data['message_on_apply_price_discount_text'] : "Discount <strong>\"{{title}}\"</strong> has been applied to your cart."); ?>
77
+ <div class="col-md-6">
78
+ <textarea name="message_on_apply_price_discount_text" class="message_on_apply_discount_textarea" value="<?php echo esc_attr($data['message_on_apply_price_discount_text']); ?>"><?php echo $data['message_on_apply_price_discount_text']; ?></textarea>
79
+ <div class="wdr_desc_text_con">
80
+ <span class="wdr_desc_text">
81
+ <?php esc_html_e('{{title}} -> Rule title', 'woo-discount-rules'); ?><br>
82
+ <?php esc_html_e('{{description}} -> Rule description', 'woo-discount-rules'); ?>
83
+ </span>
84
+ </div>
85
+ </div>
86
+ </div>
87
+ <div class="row form-group">
88
+ <div class="col-md-2">
89
+ <label>
90
+ <?php esc_html_e('Show a message on applying cart rules in cart', 'woo-discount-rules'); ?>
91
+ </label>
92
+ </div>
93
+ <?php $data['message_on_apply_cart_discount'] = (isset($data['message_on_apply_cart_discount']) ? $data['message_on_apply_cart_discount'] : "no"); ?>
94
+ <div class="col-md-6">
95
+ <select class="selectpicker" name="message_on_apply_cart_discount" id="message_on_apply_cart_discount">
96
+ <option <?php if ($data['message_on_apply_cart_discount'] == "no") { ?> selected=selected <?php } ?>
97
+ value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
98
+ </option>
99
+ <option <?php if ($data['message_on_apply_cart_discount'] == "yes") { ?> selected=selected <?php } ?>
100
+ value="yes"><?php esc_html_e('Enable', 'woo-discount-rules'); ?>
101
+ </option>
102
+ </select>
103
+ </div>
104
+ </div>
105
+ <div class="row form-group message_on_apply_cart_discount_options">
106
+ <div class="col-md-2">
107
+ <label>
108
+ <?php esc_html_e('Message', 'woo-discount-rules'); ?>
109
+ </label>
110
+ </div>
111
+ <?php $data['message_on_apply_cart_discount_text'] = (isset($data['message_on_apply_cart_discount_text']) ? $data['message_on_apply_cart_discount_text'] : "Discount <strong>\"{{title}}\"</strong> has been applied to your cart."); ?>
112
+ <div class="col-md-6">
113
+ <textarea name="message_on_apply_cart_discount_text" class="message_on_apply_discount_textarea" value="<?php echo esc_attr($data['message_on_apply_cart_discount_text']); ?>"><?php echo $data['message_on_apply_cart_discount_text']; ?></textarea>
114
+ <div class="wdr_desc_text_con">
115
+ <span class="wdr_desc_text">
116
+ <?php esc_html_e('{{title}} -> Rule title', 'woo-discount-rules'); ?><br>
117
+ <?php esc_html_e('{{description}} -> Rule description', 'woo-discount-rules'); ?>
118
+ </span>
119
+ </div>
120
+ </div>
121
+ </div>
122
+ </div>
view/settings_taxonomy.php ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
+
4
+ $active = 'taxonomy';
5
+ include_once(WOO_DISCOUNT_DIR . '/view/includes/header.php');
6
+ include_once(WOO_DISCOUNT_DIR . '/view/includes/menu.php');
7
+
8
+ $data = $config;
9
+
10
+ if (is_string($data)) $data = json_decode($data, true);
11
+ $flycartWooDiscountRulesPurchase = new FlycartWooDiscountRulesPurchase();
12
+ $isPro = $flycartWooDiscountRulesPurchase->isPro();
13
+ ?>
14
+
15
+ <div class="container-fluid woo_discount_loader_outer">
16
+ <div class="row-fluid">
17
+ <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
18
+ <form method="post" id="discount_config">
19
+ <div class="col-md-12" align="right">
20
+ <br/>
21
+ <input type="submit" id="save_taxonomy_config" value="<?php esc_html_e('Save', 'woo-discount-rules'); ?>" class="btn btn-success"/>
22
+ <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('introduction/discount-price-rules-settings', 'settings', 'btn btn-info'); ?>
23
+ </div>
24
+ <div class="row">
25
+ <div class="">
26
+ <br/>
27
+ </div>
28
+ <div class="">
29
+ <div class="row form-group">
30
+ <div class="col-md-2">
31
+ <label>
32
+ <?php esc_html_e('Choose taxonomies that can be supported in the discount rules (as categories)', 'woo-discount-rules'); ?>
33
+ </label>
34
+ <div class="wdr_desc_text_con">
35
+ <span class="wdr_desc_text">
36
+ <?php esc_html_e('Useful when you want to provide a taxonomy based discount. The selected taxonomies here will be available as categories. So you can use the category specific discount condition to create discounts based on taxonomies.
37
+ More examples can be found in the documentation', 'woo-discount-rules'); ?>
38
+ (<a href="https://docs.flycart.org" target="_blank">https://docs.flycart.org</a>)
39
+ </span>
40
+ </div>
41
+ </div>
42
+ <?php $data['additional_taxonomies'] = (isset($data['additional_taxonomies']) ? $data['additional_taxonomies'] : array()); ?>
43
+ <div class="col-md-6">
44
+ <?php
45
+ $taxonomies = FlycartWooDiscountRulesGeneralHelper::getTaxonomyList();
46
+ ?>
47
+ <select class="selectpicker" multiple name="additional_taxonomies[]">
48
+ <?php
49
+ if(FlycartWooDiscountRulesGeneralHelper::is_countable($taxonomies)){
50
+ foreach ($taxonomies as $taxonomy_key => $taxonomy_text){
51
+ $selected_taxonomy = '';
52
+ if(in_array($taxonomy_key, $data['additional_taxonomies'])){
53
+ $selected_taxonomy = ' selected="selected" ';
54
+ }
55
+ ?>
56
+ <option value="<?php echo $taxonomy_key; ?>"<?php echo $selected_taxonomy; ?>><?php echo $taxonomy_text; ?></option>
57
+ <?php
58
+ }
59
+ }
60
+ ?>
61
+ </select>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ </div>
66
+ <input type="hidden" id="ajax_path" value="<?php echo admin_url('admin-ajax.php') ?>">
67
+ </form>
68
+ </div>
69
+ <?php if(!$isPro){ ?>
70
+ <div class="col-md-1"></div>
71
+ <!-- Sidebar -->
72
+ <?php include_once(__DIR__ . '/template/sidebar.php'); ?>
73
+ <!-- Sidebar END -->
74
+ <?php } ?>
75
+ </div>
76
+ <div class="woo_discount_loader">
77
+ <div class="lds-ripple"><div></div><div></div></div>
78
+ </div>
79
+ </div>
view/template/discount-table-advance.php CHANGED
@@ -32,6 +32,7 @@ $i = 1;
32
  if ($value->discount_product_percent > 0) {
33
  $discount = ($product_price / 100) * $value->discount_product_percent;
34
  $discounted_price = $product_price - $discount;
 
35
  $discounted_price_text = wc_price($discounted_price);
36
  }
37
  } else {
@@ -42,11 +43,13 @@ $i = 1;
42
  if ($value->to_discount > 0) {
43
  $discount = ($product_price / 100) * $value->to_discount;
44
  $discounted_price = $product_price - $discount;
 
45
  $discounted_price_text = wc_price($discounted_price);
46
  }
47
  } else {
48
  if ($value->to_discount > 0) {
49
  $discounted_price = $product_price - $value->to_discount;
 
50
  $discounted_price_text = wc_price($discounted_price);
51
  }
52
  }
32
  if ($value->discount_product_percent > 0) {
33
  $discount = ($product_price / 100) * $value->discount_product_percent;
34
  $discounted_price = $product_price - $discount;
35
+ if($discounted_price < 0) $discounted_price = 0;
36
  $discounted_price_text = wc_price($discounted_price);
37
  }
38
  } else {
43
  if ($value->to_discount > 0) {
44
  $discount = ($product_price / 100) * $value->to_discount;
45
  $discounted_price = $product_price - $discount;
46
+ if($discounted_price < 0) $discounted_price = 0;
47
  $discounted_price_text = wc_price($discounted_price);
48
  }
49
  } else {
50
  if ($value->to_discount > 0) {
51
  $discounted_price = $product_price - $value->to_discount;
52
+ if($discounted_price < 0) $discounted_price = 0;
53
  $discounted_price_text = wc_price($discounted_price);
54
  }
55
  }
woo-discount-rules.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
- * Version: 1.7.11
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
+ * Version: 1.7.12
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/