Discount Rules for WooCommerce - Version 1.6.8

Version Description

  • 03/07/18 =
  • Feature - Bulk action, Ordering by order id
  • Feature - In each category option for cart rule(Pro)
  • Feature - Duplicate a rule (pro)
  • Improvement - UI improvement
Download this release

Release Info

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

Code changes from version 1.6.7 to 1.6.8

assets/css/style.css CHANGED
@@ -92,6 +92,9 @@
92
  .wdr_hide{
93
  display: none;
94
  }
 
 
 
95
  .woo_discount_loader_outer{
96
  position: relative;
97
  }
92
  .wdr_hide{
93
  display: none;
94
  }
95
+ .woo_discount_rules_bulk_action_con{
96
+ margin-top: 10px;
97
+ }
98
  .woo_discount_loader_outer{
99
  position: relative;
100
  }
assets/js/app.js CHANGED
@@ -234,12 +234,12 @@ function trigger_woocommerce_tooltip(){
234
  success: function (status) {
235
  // After Status Changed.
236
  if (status == 'Disable') {
237
- current.addClass('btn-success');
238
- current.removeClass('btn-warning');
239
- current.html(woo_discount_localization.enable_text);
240
- } else if (status == 'Publish') {
241
  current.removeClass('btn-success');
242
  current.addClass('btn-warning');
 
 
 
 
243
  current.html(woo_discount_localization.disable_text);
244
  }
245
  }
@@ -397,6 +397,7 @@ function trigger_woocommerce_tooltip(){
397
  '<optgroup label="'+woo_discount_localization.quantity_sum+'"><option value="quantity_least">'+woo_discount_localization.total_number_of_quantities_in_cart_at_least+'</option><option value="quantity_less">'+woo_discount_localization.total_number_of_quantities_in_cart_less_than+'</option></optgroup>' +
398
  '<optgroup label="'+woo_discount_localization.categories_in_cart+'">' +
399
  '<option value="categories_in">'+woo_discount_localization.categories_in_cart+'</option>' +
 
400
  '</optgroup>' +
401
  '<optgroup label="'+woo_discount_localization.customer_details_must_be_logged_in+'"><option value="users_in">'+woo_discount_localization.user_in_list+'</option><option value="roles_in">'+woo_discount_localization.user_role_in_list+'</option><option value="shipping_countries_in">'+woo_discount_localization.shipping_country_list+'</option></optgroup>' +
402
  '<optgroup label="'+woo_discount_localization.customer_email+'"><option value="customer_email_tld">'+woo_discount_localization.customer_email_tld+'</option><option value="customer_email_domain">'+woo_discount_localization.customer_email_domain+'</option></optgroup>' +
@@ -437,6 +438,7 @@ function trigger_woocommerce_tooltip(){
437
  '<optgroup label="'+woo_discount_localization.quantity_sum+'"><option disabled>'+woo_discount_localization.total_number_of_quantities_in_cart_at_least+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.total_number_of_quantities_in_cart_less_than+' <b>' + pro_suffix + '</b></option></optgroup>' +
438
  '<optgroup label="'+woo_discount_localization.categories_in_cart+'">' +
439
  '<option disabled>'+woo_discount_localization.categories_in_cart+' <b>' + pro_suffix + '</b></option>' +
 
440
  '</optgroup>' +
441
  '<optgroup label="'+woo_discount_localization.customer_details_must_be_logged_in+'"><option disabled>'+woo_discount_localization.user_in_list+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.user_role_in_list+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.shipping_country_list+' <b>' + pro_suffix + '</b></option></optgroup>' +
442
  '<optgroup label="'+woo_discount_localization.customer_email+'"><option disabled>'+woo_discount_localization.customer_email_tld+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.customer_email_domain+'<b>' + pro_suffix + '</b></option></optgroup>' +
@@ -649,12 +651,12 @@ function trigger_woocommerce_tooltip(){
649
  success: function (status) {
650
  // After Status Changed.
651
  if (status == 'Disable') {
652
- current.removeClass('btn-warning');
653
- current.addClass('btn-success');
654
- current.html(woo_discount_localization.enable_text);
655
- } else if (status == 'Publish') {
656
  current.addClass('btn-warning');
657
  current.removeClass('btn-success');
 
 
 
 
658
  current.html(woo_discount_localization.disable_text);
659
  }
660
  }
@@ -733,13 +735,80 @@ function trigger_woocommerce_tooltip(){
733
  }
734
  });
735
  $('#product_based_condition_product_to_apply_count_option').trigger('change');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
736
  //--------------------------------------------------------------------------------------------------------------
737
  //-----------------------------------------------SETTINGS-------------------------------------------------------
738
  //--------------------------------------------------------------------------------------------------------------
739
 
740
  $('#saveConfig').on('click', function (event) {
741
  event.preventDefault();
742
- console.log(ajax_url);
743
  var form = $('#discount_config').serialize();
744
  var current = $(this);
745
  var loader = $('.woo_discount_loader_outer > .woo_discount_loader');
@@ -780,13 +849,13 @@ function trigger_woocommerce_tooltip(){
780
 
781
  $('.woo-side-button').on('click', function () {
782
  //$('#woo-side-panel').toggle();
783
- if ($('#sidebar_text').html() == 'Show') {
784
- $('#sidebar_text').html('Hide');
785
  $('.woo-side-panel').show();
786
  $('#sidebar_icon').addClass('dashicons-arrow-left');
787
  $('#sidebar_icon').removeClass('dashicons-arrow-down');
788
  } else {
789
- $('#sidebar_text').html('Show');
790
  $('.woo-side-panel').hide();
791
  $('#sidebar_icon').removeClass('dashicons-arrow-left');
792
  $('#sidebar_icon').addClass('dashicons-arrow-down');
@@ -808,7 +877,7 @@ function trigger_woocommerce_tooltip(){
808
  function showOnly(option, id) {
809
  if (option == 'products_atleast_one' || option == 'products_not_in') {
810
  processShowOnlyTags('product_div_', id);
811
- } else if (option == 'categories_atleast_one' || option == 'categories_not_in' || option == 'categories_in') {
812
  processShowOnlyTags('category_div_', id);
813
  } else if (option == 'users_in') {
814
  processShowOnlyTags('user_div_', id);
234
  success: function (status) {
235
  // After Status Changed.
236
  if (status == 'Disable') {
 
 
 
 
237
  current.removeClass('btn-success');
238
  current.addClass('btn-warning');
239
+ current.html(woo_discount_localization.enable_text);
240
+ } else if (status == 'Publish') {
241
+ current.addClass('btn-success');
242
+ current.removeClass('btn-warning');
243
  current.html(woo_discount_localization.disable_text);
244
  }
245
  }
397
  '<optgroup label="'+woo_discount_localization.quantity_sum+'"><option value="quantity_least">'+woo_discount_localization.total_number_of_quantities_in_cart_at_least+'</option><option value="quantity_less">'+woo_discount_localization.total_number_of_quantities_in_cart_less_than+'</option></optgroup>' +
398
  '<optgroup label="'+woo_discount_localization.categories_in_cart+'">' +
399
  '<option value="categories_in">'+woo_discount_localization.categories_in_cart+'</option>' +
400
+ '<option value="in_each_category">'+woo_discount_localization.in_each_category_cart+'</option>' +
401
  '</optgroup>' +
402
  '<optgroup label="'+woo_discount_localization.customer_details_must_be_logged_in+'"><option value="users_in">'+woo_discount_localization.user_in_list+'</option><option value="roles_in">'+woo_discount_localization.user_role_in_list+'</option><option value="shipping_countries_in">'+woo_discount_localization.shipping_country_list+'</option></optgroup>' +
403
  '<optgroup label="'+woo_discount_localization.customer_email+'"><option value="customer_email_tld">'+woo_discount_localization.customer_email_tld+'</option><option value="customer_email_domain">'+woo_discount_localization.customer_email_domain+'</option></optgroup>' +
438
  '<optgroup label="'+woo_discount_localization.quantity_sum+'"><option disabled>'+woo_discount_localization.total_number_of_quantities_in_cart_at_least+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.total_number_of_quantities_in_cart_less_than+' <b>' + pro_suffix + '</b></option></optgroup>' +
439
  '<optgroup label="'+woo_discount_localization.categories_in_cart+'">' +
440
  '<option disabled>'+woo_discount_localization.categories_in_cart+' <b>' + pro_suffix + '</b></option>' +
441
+ '<option disabled>'+woo_discount_localization.in_each_category_cart+' <b>' + pro_suffix + '</b></option>' +
442
  '</optgroup>' +
443
  '<optgroup label="'+woo_discount_localization.customer_details_must_be_logged_in+'"><option disabled>'+woo_discount_localization.user_in_list+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.user_role_in_list+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.shipping_country_list+' <b>' + pro_suffix + '</b></option></optgroup>' +
444
  '<optgroup label="'+woo_discount_localization.customer_email+'"><option disabled>'+woo_discount_localization.customer_email_tld+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.customer_email_domain+'<b>' + pro_suffix + '</b></option></optgroup>' +
651
  success: function (status) {
652
  // After Status Changed.
653
  if (status == 'Disable') {
 
 
 
 
654
  current.addClass('btn-warning');
655
  current.removeClass('btn-success');
656
+ current.html(woo_discount_localization.enable_text);
657
+ } else if (status == 'Publish') {
658
+ current.removeClass('btn-warning');
659
+ current.addClass('btn-success');
660
  current.html(woo_discount_localization.disable_text);
661
  }
662
  }
735
  }
736
  });
737
  $('#product_based_condition_product_to_apply_count_option').trigger('change');
738
+
739
+ $('#wdr_do_bulk_action').on('click', function (event) {
740
+ event.preventDefault();
741
+ var formData = $('#woo_discount_list_form').serializeArray();
742
+ var loader = $('.woo_discount_loader_outer > .woo_discount_loader');
743
+ if($('#bulk-action-selector-top').val() != ''){
744
+ if($('#bulk-action-selector-top').val() == 'delete'){
745
+ if(!confirm(woo_discount_localization.are_you_sure_to_delete)){
746
+ return false;
747
+ }
748
+ }
749
+
750
+ if ($("#woo_discount_list_form input:checkbox:checked").length > 0) {
751
+ formData.push({'name': 'action', 'value': 'doBulkAction'});
752
+ $.ajax({
753
+ url: ajax_url,
754
+ type: 'POST',
755
+ data: formData,
756
+ beforeSend: function() {
757
+ loader.show();
758
+ },
759
+ complete: function() {
760
+ loader.hide();
761
+ },
762
+ success: function (response) {
763
+ jQuery('#woo-admin-message').html(' <div class="notice notice-success is-dismissable"><p>'+response+'</p></div>');
764
+ location.reload();
765
+ }
766
+ });
767
+ } else {
768
+ alert(woo_discount_localization.please_select_at_least_one_checkbox);
769
+ return false;
770
+ }
771
+ } else {
772
+ alert(woo_discount_localization.please_select_bulk_action);
773
+ return false;
774
+ }
775
+ });
776
+
777
+ function createDuplicateRule(id, type) {
778
+ if(id != undefined && type != undefined){
779
+ var loader = $('.woo_discount_loader_outer > .woo_discount_loader');
780
+ $.ajax({
781
+ url: ajax_url,
782
+ type: 'POST',
783
+ data: {'action': 'createDuplicateRule', 'id': id, 'type': type},
784
+ beforeSend: function() {
785
+ loader.show();
786
+ },
787
+ complete: function() {
788
+ loader.hide();
789
+ },
790
+ success: function (response) {
791
+ jQuery('#woo-admin-message').html(' <div class="notice notice-success is-dismissable"><p>'+response+'</p></div>');
792
+ location.reload();
793
+ }
794
+ });
795
+ }
796
+ }
797
+
798
+ $('.duplicate_price_rule_btn').on('click', function (event) {
799
+ event.preventDefault();
800
+ ; createDuplicateRule($(this).attr('data-id'), 'price_rule');
801
+ });
802
+ $('.duplicate_cart_rule_btn').on('click', function (event) {
803
+ event.preventDefault();
804
+ createDuplicateRule($(this).attr('data-id'), 'cart_rule');
805
+ });
806
  //--------------------------------------------------------------------------------------------------------------
807
  //-----------------------------------------------SETTINGS-------------------------------------------------------
808
  //--------------------------------------------------------------------------------------------------------------
809
 
810
  $('#saveConfig').on('click', function (event) {
811
  event.preventDefault();
 
812
  var form = $('#discount_config').serialize();
813
  var current = $(this);
814
  var loader = $('.woo_discount_loader_outer > .woo_discount_loader');
849
 
850
  $('.woo-side-button').on('click', function () {
851
  //$('#woo-side-panel').toggle();
852
+ if ($('#sidebar_text').html() == woo_discount_localization.show_text) {
853
+ $('#sidebar_text').html(woo_discount_localization.hide_text);
854
  $('.woo-side-panel').show();
855
  $('#sidebar_icon').addClass('dashicons-arrow-left');
856
  $('#sidebar_icon').removeClass('dashicons-arrow-down');
857
  } else {
858
+ $('#sidebar_text').html(woo_discount_localization.show_text);
859
  $('.woo-side-panel').hide();
860
  $('#sidebar_icon').removeClass('dashicons-arrow-left');
861
  $('#sidebar_icon').addClass('dashicons-arrow-down');
877
  function showOnly(option, id) {
878
  if (option == 'products_atleast_one' || option == 'products_not_in') {
879
  processShowOnlyTags('product_div_', id);
880
+ } else if (option == 'categories_atleast_one' || option == 'categories_not_in' || option == 'categories_in' || option == 'in_each_category') {
881
  processShowOnlyTags('category_div_', id);
882
  } else if (option == 'users_in') {
883
  processShowOnlyTags('user_div_', id);
i18n/languages/woo-discount-rules.pot CHANGED
@@ -22,9 +22,9 @@ msgid "100% percent"
22
  msgstr ""
23
 
24
  #. Text in echo
25
- #: woo-discount-rules/view/cart-rules.php:118
26
- #: woo-discount-rules/view/pricing-rules.php:147
27
- #: woo-discount-rules/view/view-cart-rules.php:500
28
  msgid "Action"
29
  msgstr ""
30
 
@@ -39,8 +39,8 @@ msgid "Add New Range"
39
  msgstr ""
40
 
41
  #. Text in echo
42
- #: woo-discount-rules/view/cart-rules.php:42
43
- #: woo-discount-rules/view/pricing-rules.php:73
44
  msgid "Add New Rule"
45
  msgstr ""
46
 
@@ -61,12 +61,17 @@ msgid "All products"
61
  msgstr ""
62
 
63
  #. Text in echo
64
- #: woo-discount-rules/view/view-cart-rules.php:337
65
- #: woo-discount-rules/view/view-cart-rules.php:339
66
  #: woo-discount-rules/view/view-pricing-rules.php:619
67
  msgid "All selected"
68
  msgstr ""
69
 
 
 
 
 
 
70
  #. Text in echo
71
  #: woo-discount-rules/view/view-pricing-rules.php:495
72
  msgid "Any"
@@ -82,6 +87,12 @@ msgstr ""
82
  msgid "Any one cheapest from selected"
83
  msgstr ""
84
 
 
 
 
 
 
 
85
  #. Text in echo
86
  #: woo-discount-rules/view/view-pricing-rules.php:145
87
  msgid "Apply To"
@@ -121,22 +132,34 @@ msgid "Apply if any one coupon applied"
121
  msgstr ""
122
 
123
  #. Text in echo
124
- #: woo-discount-rules/view/view-cart-rules.php:327
125
- #: woo-discount-rules/view/view-cart-rules.php:329
126
  msgid "Atleast any one"
127
  msgstr ""
128
 
129
  #. Text in echo
130
- #: woo-discount-rules/view/view-cart-rules.php:271
131
- #: woo-discount-rules/view/view-cart-rules.php:273
132
  msgid "Billing city"
133
  msgstr ""
134
 
 
 
 
 
 
 
135
  #. Text in echo
136
  #: woo-discount-rules/view/view-pricing-rules.php:493
137
  msgid "Buy"
138
  msgstr ""
139
 
 
 
 
 
 
 
140
  #. Text in echo
141
  #: woo-discount-rules/view/view-cart-rules.php:130
142
  msgid "Cart Conditions"
@@ -153,7 +176,7 @@ msgid "Cart Item Count"
153
  msgstr ""
154
 
155
  #. Text in echo
156
- #: woo-discount-rules/view/cart-rules.php:22
157
  msgid "Cart Rules"
158
  msgstr ""
159
 
@@ -202,12 +225,6 @@ msgstr ""
202
  msgid "Check this box to count quantities cumulatively across products"
203
  msgstr ""
204
 
205
- #. Text in echo
206
- #: woo-discount-rules/view/view-cart-rules.php:53
207
- #: woo-discount-rules/view/view-pricing-rules.php:37
208
- msgid "Close"
209
- msgstr ""
210
-
211
  #. Text in echo
212
  #: woo-discount-rules/view/view-pricing-rules.php:497
213
  msgid "Combine"
@@ -234,27 +251,27 @@ msgid "Coupon Name to be displayed :"
234
  msgstr ""
235
 
236
  #. Text in echo
237
- #: woo-discount-rules/view/view-cart-rules.php:321
238
  msgid "Coupon applied"
239
  msgstr ""
240
 
241
  #. Text in echo
242
- #: woo-discount-rules/view/view-cart-rules.php:265
243
  msgid "Customer Billing Details"
244
  msgstr ""
245
 
246
  #. Text in echo
247
- #: woo-discount-rules/view/view-cart-rules.php:211
248
  msgid "Customer Details (must be logged in)"
249
  msgstr ""
250
 
251
  #. Text in echo
252
- #: woo-discount-rules/view/view-cart-rules.php:243
253
  msgid "Customer Email"
254
  msgstr ""
255
 
256
  #. Text in echo
257
- #: woo-discount-rules/view/view-cart-rules.php:277
258
  msgid "Customer Shipping Details"
259
  msgstr ""
260
 
@@ -264,11 +281,17 @@ msgid "Customers"
264
  msgstr ""
265
 
266
  #. Text in echo
267
- #: woo-discount-rules/view/cart-rules.php:101
268
- #: woo-discount-rules/view/pricing-rules.php:130
269
  msgid "Delete"
270
  msgstr ""
271
 
 
 
 
 
 
 
272
  #. Text in echo
273
  #: woo-discount-rules/view/view-pricing-rules.php:103
274
  #: woo-discount-rules/view/view-pricing-rules.php:105
@@ -276,13 +299,19 @@ msgid "Dependant product based discount"
276
  msgstr ""
277
 
278
  #. Text in function
279
- #: woo-discount-rules/view/cart-rules.php:69
280
- #: woo-discount-rules/view/pricing-rules.php:98
281
  msgid "Disable"
282
  msgstr ""
283
 
284
  #. Text in echo
285
- #: woo-discount-rules/view/view-cart-rules.php:492
 
 
 
 
 
 
286
  #: woo-discount-rules/view/view-pricing-rules.php:343
287
  msgid "Disable the rules while have coupon(Third party)"
288
  msgstr ""
@@ -301,8 +330,8 @@ msgstr ""
301
  #. Text in echo
302
  #: woo-discount-rules/view/includes/cart-menu.php:13
303
  #: woo-discount-rules/view/includes/sub-menu.php:13
304
- #: woo-discount-rules/view/template/discount-table.php:16
305
- #: woo-discount-rules/view/view-cart-rules.php:517
306
  #: woo-discount-rules/view/view-pricing-rules.php:540
307
  msgid "Discount"
308
  msgstr ""
@@ -323,7 +352,7 @@ msgid "Discount Table :"
323
  msgstr ""
324
 
325
  #. Text in echo
326
- #: woo-discount-rules/view/view-cart-rules.php:533
327
  msgid "Discount Type :"
328
  msgstr ""
329
 
@@ -346,8 +375,8 @@ msgid "Do not use"
346
  msgstr ""
347
 
348
  #. Text in echo
349
- #: woo-discount-rules/view/cart-rules.php:27
350
- #: woo-discount-rules/view/pricing-rules.php:59
351
  msgid "Documentation"
352
  msgstr ""
353
 
@@ -361,6 +390,12 @@ msgstr ""
361
  msgid "Draft"
362
  msgstr ""
363
 
 
 
 
 
 
 
364
  #. Text in echo
365
  #: woo-discount-rules/view/view-pricing-rules.php:642
366
  msgid "Dynamic item count"
@@ -372,8 +407,8 @@ msgid "Each"
372
  msgstr ""
373
 
374
  #. Text in echo
375
- #: woo-discount-rules/view/cart-rules.php:95
376
- #: woo-discount-rules/view/pricing-rules.php:124
377
  msgid "Edit"
378
  msgstr ""
379
 
@@ -388,20 +423,20 @@ msgid "Edit Price Rule"
388
  msgstr ""
389
 
390
  #. Text in echo
391
- #: woo-discount-rules/view/view-cart-rules.php:259
392
- #: woo-discount-rules/view/view-cart-rules.php:261
393
  msgid "Email with Domain (Eg: gmail.com)"
394
  msgstr ""
395
 
396
  #. Text in echo
397
- #: woo-discount-rules/view/view-cart-rules.php:249
398
- #: woo-discount-rules/view/view-cart-rules.php:251
399
  msgid "Email with TLD (Eg: edu)"
400
  msgstr ""
401
 
402
  #. Text in function
403
- #: woo-discount-rules/view/cart-rules.php:69
404
- #: woo-discount-rules/view/pricing-rules.php:98
405
  msgid "Enable"
406
  msgstr ""
407
 
@@ -415,6 +450,12 @@ msgstr ""
415
  msgid "Enable free shipping option"
416
  msgstr ""
417
 
 
 
 
 
 
 
418
  #. Text in echo
419
  #: woo-discount-rules/view/view-pricing-rules.php:442
420
  msgid "Enter the amount"
@@ -446,8 +487,8 @@ msgid "Exclude sale items"
446
  msgstr ""
447
 
448
  #. Text in echo
449
- #: woo-discount-rules/view/cart-rules.php:116
450
- #: woo-discount-rules/view/pricing-rules.php:145
451
  msgid "Expired On"
452
  msgstr ""
453
 
@@ -492,8 +533,8 @@ msgid "Free quantity"
492
  msgstr ""
493
 
494
  #. Text in echo
495
- #: woo-discount-rules/view/view-cart-rules.php:552
496
- #: woo-discount-rules/view/view-cart-rules.php:554
497
  msgid "Free shipping"
498
  msgstr ""
499
 
@@ -523,7 +564,7 @@ msgid "General Settings"
523
  msgstr ""
524
 
525
  #. Text in echo
526
- #: woo-discount-rules/view/view-cart-rules.php:458
527
  #: woo-discount-rules/view/view-pricing-rules.php:456
528
  msgid "Greater than or equal to"
529
  msgstr ""
@@ -533,17 +574,27 @@ msgstr ""
533
  msgid "Guest"
534
  msgstr ""
535
 
 
 
 
 
 
536
  #. Text in echo
537
  #: woo-discount-rules/view/template/sidebar.php:12
538
  msgid "Hide"
539
  msgstr ""
540
 
541
  #. Text in echo
542
- #: woo-discount-rules/view/view-cart-rules.php:461
543
  #: woo-discount-rules/view/view-pricing-rules.php:460
544
  msgid "In Order status"
545
  msgstr ""
546
 
 
 
 
 
 
547
  #. Text in echo
548
  #: woo-discount-rules/view/settings.php:158
549
  msgid "It displays only if any rule matches"
@@ -565,7 +616,7 @@ msgid "Less than"
565
  msgstr ""
566
 
567
  #. Text in echo
568
- #: woo-discount-rules/view/view-cart-rules.php:459
569
  #: woo-discount-rules/view/view-pricing-rules.php:457
570
  msgid "Less than or equal to"
571
  msgstr ""
@@ -631,23 +682,12 @@ msgid "More than one cheapest from selected category"
631
  msgstr ""
632
 
633
  #. Text in echo
634
- #: woo-discount-rules/view/cart-rules.php:52
635
- #: woo-discount-rules/view/pricing-rules.php:81
636
- msgid "NOTE: Order Should not be empty ('-').If it's empty('-'), then it won't be implemented."
637
- msgstr ""
638
-
639
- #. Text in echo
640
- #: woo-discount-rules/view/cart-rules.php:114
641
- #: woo-discount-rules/view/pricing-rules.php:143
642
- #: woo-discount-rules/view/template/discount-table.php:12
643
  msgid "Name"
644
  msgstr ""
645
 
646
- #. Text in echo
647
- #: woo-discount-rules/view/includes/footer.php:5
648
- msgid "Need help in setting up the rules?"
649
- msgstr ""
650
-
651
  #. Text in echo
652
  #: woo-discount-rules/view/view-cart-rules.php:56
653
  msgid "New Cart Rule"
@@ -660,7 +700,7 @@ msgstr ""
660
 
661
  #. Text in echo
662
  #: woo-discount-rules/view/view-cart-rules.php:126
663
- #: woo-discount-rules/view/view-cart-rules.php:512
664
  #: woo-discount-rules/view/view-pricing-rules.php:135
665
  #: woo-discount-rules/view/view-pricing-rules.php:533
666
  msgid "Next"
@@ -671,18 +711,18 @@ msgstr ""
671
  #: woo-discount-rules/view/settings.php:81
672
  #: woo-discount-rules/view/settings.php:206
673
  #: woo-discount-rules/view/settings.php:269
674
- #: woo-discount-rules/view/view-cart-rules.php:492
675
  #: woo-discount-rules/view/view-pricing-rules.php:343
676
  msgid "No"
677
  msgstr ""
678
 
679
  #. Text in echo
680
- #: woo-discount-rules/view/template/discount-table.php:45
681
  msgid "No Active Discounts."
682
  msgstr ""
683
 
684
  #. Text in echo
685
- #: woo-discount-rules/view/view-cart-rules.php:466
686
  #: woo-discount-rules/view/view-pricing-rules.php:187
687
  #: woo-discount-rules/view/view-pricing-rules.php:203
688
  #: woo-discount-rules/view/view-pricing-rules.php:468
@@ -701,14 +741,14 @@ msgid "Number of line items in the cart (not quantity) less than"
701
  msgstr ""
702
 
703
  #. Text in echo
704
- #: woo-discount-rules/view/view-cart-rules.php:305
705
- #: woo-discount-rules/view/view-cart-rules.php:307
706
  msgid "Number of order purchased"
707
  msgstr ""
708
 
709
  #. Text in echo
710
- #: woo-discount-rules/view/view-cart-rules.php:315
711
- #: woo-discount-rules/view/view-cart-rules.php:317
712
  msgid "Number of order purchased in products"
713
  msgstr ""
714
 
@@ -728,9 +768,9 @@ msgstr ""
728
  msgid "Only Given"
729
  msgstr ""
730
 
731
- #. Text in echo
732
- #: woo-discount-rules/view/cart-rules.php:117
733
- #: woo-discount-rules/view/pricing-rules.php:146
734
  msgid "Order"
735
  msgstr ""
736
 
@@ -751,7 +791,7 @@ msgid "Percentage"
751
  msgstr ""
752
 
753
  #. Text in echo
754
- #: woo-discount-rules/view/view-cart-rules.php:537
755
  #: woo-discount-rules/view/view-pricing-rules.php:582
756
  msgid "Percentage Discount"
757
  msgstr ""
@@ -763,21 +803,21 @@ msgid "Period of Rule Active. Format: month/day/Year Hour:Min"
763
  msgstr ""
764
 
765
  #. Text in echo
766
- #: woo-discount-rules/view/includes/footer.php:5
767
  msgid "Please contact our support team"
768
  msgstr ""
769
 
770
  #. Text in echo
771
- #: woo-discount-rules/view/view-cart-rules.php:511
772
- #: woo-discount-rules/view/view-cart-rules.php:571
773
  #: woo-discount-rules/view/view-pricing-rules.php:532
774
  #: woo-discount-rules/view/view-pricing-rules.php:718
775
  msgid "Previous"
776
  msgstr ""
777
 
778
  #. Text in echo
779
- #: woo-discount-rules/view/view-cart-rules.php:543
780
- #: woo-discount-rules/view/view-cart-rules.php:545
781
  #: woo-discount-rules/view/view-pricing-rules.php:590
782
  #: woo-discount-rules/view/view-pricing-rules.php:592
783
  msgid "Price Discount"
@@ -789,7 +829,7 @@ msgid "Price Discount Rules"
789
  msgstr ""
790
 
791
  #. Text in echo
792
- #: woo-discount-rules/view/pricing-rules.php:54
793
  msgid "Price Rules"
794
  msgstr ""
795
 
@@ -810,14 +850,14 @@ msgid "Product(s) from"
810
  msgstr ""
811
 
812
  #. Text in echo
813
- #: woo-discount-rules/view/view-cart-rules.php:289
814
  #: woo-discount-rules/view/view-pricing-rules.php:412
815
  msgid "Purchase History"
816
  msgstr ""
817
 
818
  #. Text in echo
819
- #: woo-discount-rules/view/view-cart-rules.php:295
820
- #: woo-discount-rules/view/view-cart-rules.php:297
821
  #: woo-discount-rules/view/view-pricing-rules.php:420
822
  msgid "Purchased amount"
823
  msgstr ""
@@ -845,12 +885,12 @@ msgid "Quantity based by product/category and BOGO deals"
845
  msgstr ""
846
 
847
  #. Text in echo
848
- #: woo-discount-rules/view/template/discount-table.php:15
849
  msgid "Range"
850
  msgstr ""
851
 
852
  #. Text in echo
853
- #: woo-discount-rules/view/view-cart-rules.php:501
854
  #: woo-discount-rules/view/view-pricing-rules.php:696
855
  msgid "Remove"
856
  msgstr ""
@@ -905,14 +945,14 @@ msgid "Settings"
905
  msgstr ""
906
 
907
  #. Text in echo
908
- #: woo-discount-rules/view/view-cart-rules.php:237
909
- #: woo-discount-rules/view/view-cart-rules.php:239
910
  msgid "Shipping country in list"
911
  msgstr ""
912
 
913
  #. Text in echo
914
- #: woo-discount-rules/view/view-cart-rules.php:283
915
- #: woo-discount-rules/view/view-cart-rules.php:285
916
  msgid "Shipping state"
917
  msgstr ""
918
 
@@ -964,8 +1004,8 @@ msgid "Specific products"
964
  msgstr ""
965
 
966
  #. Text in echo
967
- #: woo-discount-rules/view/cart-rules.php:115
968
- #: woo-discount-rules/view/pricing-rules.php:144
969
  msgid "Start Date"
970
  msgstr ""
971
 
@@ -1018,7 +1058,7 @@ msgid "To - Leave Empty if No Expiry"
1018
  msgstr ""
1019
 
1020
  #. Text in echo
1021
- #: woo-discount-rules/view/view-cart-rules.php:492
1022
  #: woo-discount-rules/view/view-pricing-rules.php:343
1023
  msgid "To get this condition work,"
1024
  msgstr ""
@@ -1049,14 +1089,14 @@ msgid "Use Woocommerce free shipping"
1049
  msgstr ""
1050
 
1051
  #. Text in echo
1052
- #: woo-discount-rules/view/view-cart-rules.php:217
1053
- #: woo-discount-rules/view/view-cart-rules.php:219
1054
  msgid "User in list"
1055
  msgstr ""
1056
 
1057
  #. Text in echo
1058
- #: woo-discount-rules/view/view-cart-rules.php:227
1059
- #: woo-discount-rules/view/view-cart-rules.php:229
1060
  msgid "User role in list"
1061
  msgstr ""
1062
 
@@ -1077,15 +1117,15 @@ msgid "Validity"
1077
  msgstr ""
1078
 
1079
  #. Text in echo
1080
- #: woo-discount-rules/view/view-cart-rules.php:347
1081
  #: woo-discount-rules/view/view-pricing-rules.php:606
1082
  #: woo-discount-rules/view/view-pricing-rules.php:713
1083
  msgid "Value"
1084
  msgstr ""
1085
 
1086
  #. Text in echo
1087
- #: woo-discount-rules/view/cart-rules.php:26
1088
- #: woo-discount-rules/view/pricing-rules.php:58
1089
  msgid "View Examples"
1090
  msgstr ""
1091
 
@@ -1111,8 +1151,8 @@ msgid "Yes"
1111
  msgstr ""
1112
 
1113
  #. Text in echo
1114
- #: woo-discount-rules/view/cart-rules.php:37
1115
- #: woo-discount-rules/view/pricing-rules.php:69
1116
  msgid "You Reach Max. Rule Limit"
1117
  msgstr ""
1118
 
@@ -1162,13 +1202,13 @@ msgid "ex. Standard Rule."
1162
  msgstr ""
1163
 
1164
  #. Text in echo
1165
- #: woo-discount-rules/view/view-cart-rules.php:492
1166
  #: woo-discount-rules/view/view-pricing-rules.php:343
1167
  msgid "in cart to"
1168
  msgstr ""
1169
 
1170
  #. Text in echo
1171
- #: woo-discount-rules/view/view-cart-rules.php:492
1172
  #: woo-discount-rules/view/view-pricing-rules.php:343
1173
  msgid "please change the option"
1174
  msgstr ""
@@ -1179,6 +1219,6 @@ msgid "to"
1179
  msgstr ""
1180
 
1181
  #. Text in echo
1182
- #: woo-discount-rules/view/view-cart-rules.php:563
1183
  msgid "value :"
1184
- msgstr ""
22
  msgstr ""
23
 
24
  #. Text in echo
25
+ #: woo-discount-rules/view/cart-rules.php:178
26
+ #: woo-discount-rules/view/pricing-rules.php:206
27
+ #: woo-discount-rules/view/view-cart-rules.php:505
28
  msgid "Action"
29
  msgstr ""
30
 
39
  msgstr ""
40
 
41
  #. Text in echo
42
+ #: woo-discount-rules/view/cart-rules.php:66
43
+ #: woo-discount-rules/view/pricing-rules.php:97
44
  msgid "Add New Rule"
45
  msgstr ""
46
 
61
  msgstr ""
62
 
63
  #. Text in echo
64
+ #: woo-discount-rules/view/view-cart-rules.php:343
65
+ #: woo-discount-rules/view/view-cart-rules.php:345
66
  #: woo-discount-rules/view/view-pricing-rules.php:619
67
  msgid "All selected"
68
  msgstr ""
69
 
70
+ #. Text in function
71
+ #: woo-discount-rules/view/includes/header.php:13
72
+ msgid "An another discount plugin %s is active. Please disable this plugin, Woo Discount Rules might get conflict."
73
+ msgstr ""
74
+
75
  #. Text in echo
76
  #: woo-discount-rules/view/view-pricing-rules.php:495
77
  msgid "Any"
87
  msgid "Any one cheapest from selected"
88
  msgstr ""
89
 
90
+ #. Text in echo
91
+ #: woo-discount-rules/view/cart-rules.php:84
92
+ #: woo-discount-rules/view/pricing-rules.php:112
93
+ msgid "Apply"
94
+ msgstr ""
95
+
96
  #. Text in echo
97
  #: woo-discount-rules/view/view-pricing-rules.php:145
98
  msgid "Apply To"
132
  msgstr ""
133
 
134
  #. Text in echo
135
+ #: woo-discount-rules/view/view-cart-rules.php:333
136
+ #: woo-discount-rules/view/view-cart-rules.php:335
137
  msgid "Atleast any one"
138
  msgstr ""
139
 
140
  #. Text in echo
141
+ #: woo-discount-rules/view/view-cart-rules.php:277
142
+ #: woo-discount-rules/view/view-cart-rules.php:279
143
  msgid "Billing city"
144
  msgstr ""
145
 
146
+ #. Text in echo
147
+ #: woo-discount-rules/view/cart-rules.php:79
148
+ #: woo-discount-rules/view/pricing-rules.php:107
149
+ msgid "Bulk Actions"
150
+ msgstr ""
151
+
152
  #. Text in echo
153
  #: woo-discount-rules/view/view-pricing-rules.php:493
154
  msgid "Buy"
155
  msgstr ""
156
 
157
+ #. Text in echo
158
+ #: woo-discount-rules/view/view-cart-rules.php:53
159
+ #: woo-discount-rules/view/view-pricing-rules.php:37
160
+ msgid "Cancel and go back to list"
161
+ msgstr ""
162
+
163
  #. Text in echo
164
  #: woo-discount-rules/view/view-cart-rules.php:130
165
  msgid "Cart Conditions"
176
  msgstr ""
177
 
178
  #. Text in echo
179
+ #: woo-discount-rules/view/cart-rules.php:46
180
  msgid "Cart Rules"
181
  msgstr ""
182
 
225
  msgid "Check this box to count quantities cumulatively across products"
226
  msgstr ""
227
 
 
 
 
 
 
 
228
  #. Text in echo
229
  #: woo-discount-rules/view/view-pricing-rules.php:497
230
  msgid "Combine"
251
  msgstr ""
252
 
253
  #. Text in echo
254
+ #: woo-discount-rules/view/view-cart-rules.php:327
255
  msgid "Coupon applied"
256
  msgstr ""
257
 
258
  #. Text in echo
259
+ #: woo-discount-rules/view/view-cart-rules.php:271
260
  msgid "Customer Billing Details"
261
  msgstr ""
262
 
263
  #. Text in echo
264
+ #: woo-discount-rules/view/view-cart-rules.php:217
265
  msgid "Customer Details (must be logged in)"
266
  msgstr ""
267
 
268
  #. Text in echo
269
+ #: woo-discount-rules/view/view-cart-rules.php:249
270
  msgid "Customer Email"
271
  msgstr ""
272
 
273
  #. Text in echo
274
+ #: woo-discount-rules/view/view-cart-rules.php:283
275
  msgid "Customer Shipping Details"
276
  msgstr ""
277
 
281
  msgstr ""
282
 
283
  #. Text in echo
284
+ #: woo-discount-rules/view/cart-rules.php:152
285
+ #: woo-discount-rules/view/pricing-rules.php:180
286
  msgid "Delete"
287
  msgstr ""
288
 
289
+ #. Text in echo
290
+ #: woo-discount-rules/view/cart-rules.php:82
291
+ #: woo-discount-rules/view/pricing-rules.php:110
292
+ msgid "Delete rules"
293
+ msgstr ""
294
+
295
  #. Text in echo
296
  #: woo-discount-rules/view/view-pricing-rules.php:103
297
  #: woo-discount-rules/view/view-pricing-rules.php:105
299
  msgstr ""
300
 
301
  #. Text in function
302
+ #: woo-discount-rules/view/cart-rules.php:112
303
+ #: woo-discount-rules/view/pricing-rules.php:140
304
  msgid "Disable"
305
  msgstr ""
306
 
307
  #. Text in echo
308
+ #: woo-discount-rules/view/cart-rules.php:81
309
+ #: woo-discount-rules/view/pricing-rules.php:109
310
+ msgid "Disable rules"
311
+ msgstr ""
312
+
313
+ #. Text in echo
314
+ #: woo-discount-rules/view/view-cart-rules.php:497
315
  #: woo-discount-rules/view/view-pricing-rules.php:343
316
  msgid "Disable the rules while have coupon(Third party)"
317
  msgstr ""
330
  #. Text in echo
331
  #: woo-discount-rules/view/includes/cart-menu.php:13
332
  #: woo-discount-rules/view/includes/sub-menu.php:13
333
+ #: woo-discount-rules/view/template/discount-table.php:22
334
+ #: woo-discount-rules/view/view-cart-rules.php:522
335
  #: woo-discount-rules/view/view-pricing-rules.php:540
336
  msgid "Discount"
337
  msgstr ""
352
  msgstr ""
353
 
354
  #. Text in echo
355
+ #: woo-discount-rules/view/view-cart-rules.php:538
356
  msgid "Discount Type :"
357
  msgstr ""
358
 
375
  msgstr ""
376
 
377
  #. Text in echo
378
+ #: woo-discount-rules/view/cart-rules.php:51
379
+ #: woo-discount-rules/view/pricing-rules.php:83
380
  msgid "Documentation"
381
  msgstr ""
382
 
390
  msgid "Draft"
391
  msgstr ""
392
 
393
+ #. Text in echo
394
+ #: woo-discount-rules/view/cart-rules.php:145
395
+ #: woo-discount-rules/view/pricing-rules.php:173
396
+ msgid "Duplicate"
397
+ msgstr ""
398
+
399
  #. Text in echo
400
  #: woo-discount-rules/view/view-pricing-rules.php:642
401
  msgid "Dynamic item count"
407
  msgstr ""
408
 
409
  #. Text in echo
410
+ #: woo-discount-rules/view/cart-rules.php:141
411
+ #: woo-discount-rules/view/pricing-rules.php:169
412
  msgid "Edit"
413
  msgstr ""
414
 
423
  msgstr ""
424
 
425
  #. Text in echo
426
+ #: woo-discount-rules/view/view-cart-rules.php:265
427
+ #: woo-discount-rules/view/view-cart-rules.php:267
428
  msgid "Email with Domain (Eg: gmail.com)"
429
  msgstr ""
430
 
431
  #. Text in echo
432
+ #: woo-discount-rules/view/view-cart-rules.php:255
433
+ #: woo-discount-rules/view/view-cart-rules.php:257
434
  msgid "Email with TLD (Eg: edu)"
435
  msgstr ""
436
 
437
  #. Text in function
438
+ #: woo-discount-rules/view/cart-rules.php:112
439
+ #: woo-discount-rules/view/pricing-rules.php:140
440
  msgid "Enable"
441
  msgstr ""
442
 
450
  msgid "Enable free shipping option"
451
  msgstr ""
452
 
453
+ #. Text in echo
454
+ #: woo-discount-rules/view/cart-rules.php:80
455
+ #: woo-discount-rules/view/pricing-rules.php:108
456
+ msgid "Enable rules"
457
+ msgstr ""
458
+
459
  #. Text in echo
460
  #: woo-discount-rules/view/view-pricing-rules.php:442
461
  msgid "Enter the amount"
487
  msgstr ""
488
 
489
  #. Text in echo
490
+ #: woo-discount-rules/view/cart-rules.php:170
491
+ #: woo-discount-rules/view/pricing-rules.php:198
492
  msgid "Expired On"
493
  msgstr ""
494
 
533
  msgstr ""
534
 
535
  #. Text in echo
536
+ #: woo-discount-rules/view/view-cart-rules.php:557
537
+ #: woo-discount-rules/view/view-cart-rules.php:559
538
  msgid "Free shipping"
539
  msgstr ""
540
 
564
  msgstr ""
565
 
566
  #. Text in echo
567
+ #: woo-discount-rules/view/view-cart-rules.php:463
568
  #: woo-discount-rules/view/view-pricing-rules.php:456
569
  msgid "Greater than or equal to"
570
  msgstr ""
574
  msgid "Guest"
575
  msgstr ""
576
 
577
+ #. Text in echo
578
+ #: woo-discount-rules/view/includes/footer.php:7
579
+ msgid "Having trouble in setting up the discount? Let us set up the rules for you (for free)!"
580
+ msgstr ""
581
+
582
  #. Text in echo
583
  #: woo-discount-rules/view/template/sidebar.php:12
584
  msgid "Hide"
585
  msgstr ""
586
 
587
  #. Text in echo
588
+ #: woo-discount-rules/view/view-cart-rules.php:466
589
  #: woo-discount-rules/view/view-pricing-rules.php:460
590
  msgid "In Order status"
591
  msgstr ""
592
 
593
+ #. Text in echo
594
+ #: woo-discount-rules/view/view-cart-rules.php:214
595
+ msgid "In each category"
596
+ msgstr ""
597
+
598
  #. Text in echo
599
  #: woo-discount-rules/view/settings.php:158
600
  msgid "It displays only if any rule matches"
616
  msgstr ""
617
 
618
  #. Text in echo
619
+ #: woo-discount-rules/view/view-cart-rules.php:464
620
  #: woo-discount-rules/view/view-pricing-rules.php:457
621
  msgid "Less than or equal to"
622
  msgstr ""
682
  msgstr ""
683
 
684
  #. Text in echo
685
+ #: woo-discount-rules/view/cart-rules.php:168
686
+ #: woo-discount-rules/view/pricing-rules.php:196
687
+ #: woo-discount-rules/view/template/discount-table.php:18
 
 
 
 
 
 
688
  msgid "Name"
689
  msgstr ""
690
 
 
 
 
 
 
691
  #. Text in echo
692
  #: woo-discount-rules/view/view-cart-rules.php:56
693
  msgid "New Cart Rule"
700
 
701
  #. Text in echo
702
  #: woo-discount-rules/view/view-cart-rules.php:126
703
+ #: woo-discount-rules/view/view-cart-rules.php:517
704
  #: woo-discount-rules/view/view-pricing-rules.php:135
705
  #: woo-discount-rules/view/view-pricing-rules.php:533
706
  msgid "Next"
711
  #: woo-discount-rules/view/settings.php:81
712
  #: woo-discount-rules/view/settings.php:206
713
  #: woo-discount-rules/view/settings.php:269
714
+ #: woo-discount-rules/view/view-cart-rules.php:497
715
  #: woo-discount-rules/view/view-pricing-rules.php:343
716
  msgid "No"
717
  msgstr ""
718
 
719
  #. Text in echo
720
+ #: woo-discount-rules/view/template/discount-table.php:51
721
  msgid "No Active Discounts."
722
  msgstr ""
723
 
724
  #. Text in echo
725
+ #: woo-discount-rules/view/view-cart-rules.php:471
726
  #: woo-discount-rules/view/view-pricing-rules.php:187
727
  #: woo-discount-rules/view/view-pricing-rules.php:203
728
  #: woo-discount-rules/view/view-pricing-rules.php:468
741
  msgstr ""
742
 
743
  #. Text in echo
744
+ #: woo-discount-rules/view/view-cart-rules.php:311
745
+ #: woo-discount-rules/view/view-cart-rules.php:313
746
  msgid "Number of order purchased"
747
  msgstr ""
748
 
749
  #. Text in echo
750
+ #: woo-discount-rules/view/view-cart-rules.php:321
751
+ #: woo-discount-rules/view/view-cart-rules.php:323
752
  msgid "Number of order purchased in products"
753
  msgstr ""
754
 
768
  msgid "Only Given"
769
  msgstr ""
770
 
771
+ #. Text in function
772
+ #: woo-discount-rules/view/cart-rules.php:172
773
+ #: woo-discount-rules/view/pricing-rules.php:200
774
  msgid "Order"
775
  msgstr ""
776
 
791
  msgstr ""
792
 
793
  #. Text in echo
794
+ #: woo-discount-rules/view/view-cart-rules.php:542
795
  #: woo-discount-rules/view/view-pricing-rules.php:582
796
  msgid "Percentage Discount"
797
  msgstr ""
803
  msgstr ""
804
 
805
  #. Text in echo
806
+ #: woo-discount-rules/view/includes/footer.php:7
807
  msgid "Please contact our support team"
808
  msgstr ""
809
 
810
  #. Text in echo
811
+ #: woo-discount-rules/view/view-cart-rules.php:516
812
+ #: woo-discount-rules/view/view-cart-rules.php:576
813
  #: woo-discount-rules/view/view-pricing-rules.php:532
814
  #: woo-discount-rules/view/view-pricing-rules.php:718
815
  msgid "Previous"
816
  msgstr ""
817
 
818
  #. Text in echo
819
+ #: woo-discount-rules/view/view-cart-rules.php:548
820
+ #: woo-discount-rules/view/view-cart-rules.php:550
821
  #: woo-discount-rules/view/view-pricing-rules.php:590
822
  #: woo-discount-rules/view/view-pricing-rules.php:592
823
  msgid "Price Discount"
829
  msgstr ""
830
 
831
  #. Text in echo
832
+ #: woo-discount-rules/view/pricing-rules.php:78
833
  msgid "Price Rules"
834
  msgstr ""
835
 
850
  msgstr ""
851
 
852
  #. Text in echo
853
+ #: woo-discount-rules/view/view-cart-rules.php:295
854
  #: woo-discount-rules/view/view-pricing-rules.php:412
855
  msgid "Purchase History"
856
  msgstr ""
857
 
858
  #. Text in echo
859
+ #: woo-discount-rules/view/view-cart-rules.php:301
860
+ #: woo-discount-rules/view/view-cart-rules.php:303
861
  #: woo-discount-rules/view/view-pricing-rules.php:420
862
  msgid "Purchased amount"
863
  msgstr ""
885
  msgstr ""
886
 
887
  #. Text in echo
888
+ #: woo-discount-rules/view/template/discount-table.php:21
889
  msgid "Range"
890
  msgstr ""
891
 
892
  #. Text in echo
893
+ #: woo-discount-rules/view/view-cart-rules.php:506
894
  #: woo-discount-rules/view/view-pricing-rules.php:696
895
  msgid "Remove"
896
  msgstr ""
945
  msgstr ""
946
 
947
  #. Text in echo
948
+ #: woo-discount-rules/view/view-cart-rules.php:243
949
+ #: woo-discount-rules/view/view-cart-rules.php:245
950
  msgid "Shipping country in list"
951
  msgstr ""
952
 
953
  #. Text in echo
954
+ #: woo-discount-rules/view/view-cart-rules.php:289
955
+ #: woo-discount-rules/view/view-cart-rules.php:291
956
  msgid "Shipping state"
957
  msgstr ""
958
 
1004
  msgstr ""
1005
 
1006
  #. Text in echo
1007
+ #: woo-discount-rules/view/cart-rules.php:169
1008
+ #: woo-discount-rules/view/pricing-rules.php:197
1009
  msgid "Start Date"
1010
  msgstr ""
1011
 
1058
  msgstr ""
1059
 
1060
  #. Text in echo
1061
+ #: woo-discount-rules/view/view-cart-rules.php:497
1062
  #: woo-discount-rules/view/view-pricing-rules.php:343
1063
  msgid "To get this condition work,"
1064
  msgstr ""
1089
  msgstr ""
1090
 
1091
  #. Text in echo
1092
+ #: woo-discount-rules/view/view-cart-rules.php:223
1093
+ #: woo-discount-rules/view/view-cart-rules.php:225
1094
  msgid "User in list"
1095
  msgstr ""
1096
 
1097
  #. Text in echo
1098
+ #: woo-discount-rules/view/view-cart-rules.php:233
1099
+ #: woo-discount-rules/view/view-cart-rules.php:235
1100
  msgid "User role in list"
1101
  msgstr ""
1102
 
1117
  msgstr ""
1118
 
1119
  #. Text in echo
1120
+ #: woo-discount-rules/view/view-cart-rules.php:353
1121
  #: woo-discount-rules/view/view-pricing-rules.php:606
1122
  #: woo-discount-rules/view/view-pricing-rules.php:713
1123
  msgid "Value"
1124
  msgstr ""
1125
 
1126
  #. Text in echo
1127
+ #: woo-discount-rules/view/cart-rules.php:50
1128
+ #: woo-discount-rules/view/pricing-rules.php:82
1129
  msgid "View Examples"
1130
  msgstr ""
1131
 
1151
  msgstr ""
1152
 
1153
  #. Text in echo
1154
+ #: woo-discount-rules/view/cart-rules.php:61
1155
+ #: woo-discount-rules/view/pricing-rules.php:93
1156
  msgid "You Reach Max. Rule Limit"
1157
  msgstr ""
1158
 
1202
  msgstr ""
1203
 
1204
  #. Text in echo
1205
+ #: woo-discount-rules/view/view-cart-rules.php:497
1206
  #: woo-discount-rules/view/view-pricing-rules.php:343
1207
  msgid "in cart to"
1208
  msgstr ""
1209
 
1210
  #. Text in echo
1211
+ #: woo-discount-rules/view/view-cart-rules.php:497
1212
  #: woo-discount-rules/view/view-pricing-rules.php:343
1213
  msgid "please change the option"
1214
  msgstr ""
1219
  msgstr ""
1220
 
1221
  #. Text in echo
1222
+ #: woo-discount-rules/view/view-cart-rules.php:568
1223
  msgid "value :"
1224
+ msgstr ""
includes/cart-rules.php CHANGED
@@ -215,7 +215,19 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
215
  {
216
  if(self::$rules_loaded) return $this->rules = self::$cartRules;
217
 
218
- $posts = get_posts(array('post_type' => $this->post_type, 'numberposts' => '-1'));
 
 
 
 
 
 
 
 
 
 
 
 
219
  if ($onlyCount) return count($posts);
220
  if (isset($posts) && count($posts) > 0) {
221
  foreach ($posts as $index => $item) {
@@ -673,6 +685,10 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
673
  $categories = $rule['categories_in'];
674
  break;
675
  }
 
 
 
 
676
  }
677
  }
678
  }
@@ -710,7 +726,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
710
  */
711
  public function applyRule($index, $rule, $rules)
712
  {
713
- $skipRuleType = array('categories_in');
714
  $availableRuleToSkip = array_intersect($skipRuleType, array_keys($rules));
715
  switch ($index) {
716
 
@@ -932,6 +948,15 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
932
  }
933
  return false;
934
  break;
 
 
 
 
 
 
 
 
 
935
  case 'customer_based_on_purchase_history':
936
  case 'customer_based_on_purchase_history_order_count':
937
  case 'customer_based_on_purchase_history_product_order_count':
@@ -1141,6 +1166,25 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1141
  return $ruleSuccess;
1142
  }
1143
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1144
  /**
1145
  * Get tld from email
1146
  * */
215
  {
216
  if(self::$rules_loaded) return $this->rules = self::$cartRules;
217
 
218
+ $post_args = array('post_type' => $this->post_type, 'numberposts' => '-1');
219
+ $postData = \FlycartInput\FInput::getInstance();
220
+ $request = $postData->getArray();
221
+ if(is_admin() && isset($request['page']) && $request['page'] == 'woo_discount_rules'){
222
+ $post_args['meta_key'] = 'rule_order';
223
+ $post_args['orderby'] = 'meta_value_num';
224
+ $post_args['order'] = 'DESC';
225
+ if(isset($request['order']) && in_array($request['order'], array('asc', 'desc'))){
226
+ if($request['order'] == 'asc') $post_args['order'] = 'ASC';
227
+ }
228
+ }
229
+ $posts = get_posts($post_args);
230
+
231
  if ($onlyCount) return count($posts);
232
  if (isset($posts) && count($posts) > 0) {
233
  foreach ($posts as $index => $item) {
685
  $categories = $rule['categories_in'];
686
  break;
687
  }
688
+ if(array_key_exists('in_each_category', $rule)) {
689
+ $categories = $rule['in_each_category'];
690
+ break;
691
+ }
692
  }
693
  }
694
  }
726
  */
727
  public function applyRule($index, $rule, $rules)
728
  {
729
+ $skipRuleType = array('categories_in', 'in_each_category');
730
  $availableRuleToSkip = array_intersect($skipRuleType, array_keys($rules));
731
  switch ($index) {
732
 
948
  }
949
  return false;
950
  break;
951
+ case 'in_each_category':
952
+ if(count($rule)){
953
+ $ruleSuccess = $this->validateCartItemsInEachSelectedCategory($index, $rule, $rules);
954
+ if($ruleSuccess){
955
+ return true;
956
+ }
957
+ }
958
+ return false;
959
+ break;
960
  case 'customer_based_on_purchase_history':
961
  case 'customer_based_on_purchase_history_order_count':
962
  case 'customer_based_on_purchase_history_product_order_count':
1166
  return $ruleSuccess;
1167
  }
1168
 
1169
+ /**
1170
+ * verify the cart items are from each selected category
1171
+ * */
1172
+ protected function validateCartItemsInEachSelectedCategory($index, $rule, $rules){
1173
+ $ruleSuccess = 0;
1174
+ if(is_array($rule)){
1175
+ foreach ($rule as $category){
1176
+ $category_matched = $this->validateCartItemsInSelectedCategory($index, array($category), $rules);
1177
+ if($category_matched) $ruleSuccess = 1;
1178
+ else {
1179
+ $ruleSuccess = 0;
1180
+ break;
1181
+ }
1182
+ }
1183
+ }
1184
+
1185
+ return $ruleSuccess;
1186
+ }
1187
+
1188
  /**
1189
  * Get tld from email
1190
  * */
includes/discount-base.php CHANGED
@@ -304,6 +304,7 @@ if (!class_exists('FlycartWooDiscountBase')) {
304
  'categories_atleast_one' => 'category_to_apply',
305
  'categories_not_in' => 'category_to_apply',
306
  'categories_in' => 'category_to_apply',
 
307
 
308
  'users_in' => 'users_to_apply',
309
  'roles_in' => 'user_roles_to_apply',
@@ -450,6 +451,111 @@ if (!class_exists('FlycartWooDiscountBase')) {
450
  // Save General Settings of the Plugin.
451
  }
452
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  /**
454
  * @return array
455
  */
@@ -788,6 +894,12 @@ if (!class_exists('FlycartWooDiscountBase')) {
788
  'save_text' => esc_html__('Save', 'woo-discount-rules'),
789
  'saved_successfully' => esc_html__('Saved Successfully!', 'woo-discount-rules'),
790
  'none_selected' => esc_html__('None selected', 'woo-discount-rules'),
 
 
 
 
 
 
791
  );
792
  }
793
  }
304
  'categories_atleast_one' => 'category_to_apply',
305
  'categories_not_in' => 'category_to_apply',
306
  'categories_in' => 'category_to_apply',
307
+ 'in_each_category' => 'category_to_apply',
308
 
309
  'users_in' => 'users_to_apply',
310
  'roles_in' => 'user_roles_to_apply',
451
  // Save General Settings of the Plugin.
452
  }
453
 
454
+ /**
455
+ * Do bulk action
456
+ * */
457
+ public function doBulkAction(){
458
+ $postData = \FlycartInput\FInput::getInstance();
459
+ $request = $postData->getArray();
460
+ if(empty($request['bulk_action'])){
461
+ echo esc_html__('Failed to do action', 'woo-discount-rules');exit;
462
+ }
463
+ $result = array();
464
+ $had_action = 0;
465
+ if(!empty($request['post'])){
466
+ foreach ($request['post'] as $key => $id){
467
+ $had_action = 1;
468
+ $result[$key] = 0;
469
+ if($id){
470
+ switch ($request['bulk_action']){
471
+ case 'unpublish':
472
+ $status = get_post_meta($id, 'status', true);
473
+ if (!empty($status)) {
474
+ $result[$key] = update_post_meta($id, 'status', 'disable');
475
+ }
476
+ break;
477
+ case 'delete':
478
+ try {
479
+ $id = intval($id);
480
+ if ($id) $result[$key] = wp_delete_post($id);
481
+ } catch (Exception $e) {
482
+ }
483
+ break;
484
+ default:
485
+ $status = get_post_meta($id, 'status', true);
486
+
487
+ if (!empty($status)) {
488
+ $result[$key] = update_post_meta($id, 'status', 'publish');
489
+ }
490
+ break;
491
+ }
492
+ }
493
+ }
494
+ }
495
+ if(!$had_action){
496
+ echo esc_html__('Failed to do action', 'woo-discount-rules');
497
+ } else{
498
+ switch ($request['bulk_action']){
499
+ case 'unpublish':
500
+ echo esc_html__('Disabled successfully', 'woo-discount-rules');
501
+ break;
502
+ case 'delete':
503
+ echo esc_html__('Deleted successfully', 'woo-discount-rules');
504
+ break;
505
+ default:
506
+ echo esc_html__('Enabled successfully', 'woo-discount-rules');
507
+ break;
508
+ }
509
+ }
510
+ die();
511
+ }
512
+
513
+ /**
514
+ * Create a duplicate rule
515
+ * */
516
+ public function createDuplicateRule(){
517
+ $purchase = new FlycartWooDiscountRulesPurchase();
518
+ $isPro = $purchase->isPro();
519
+ if(!$isPro) return false;
520
+ $postData = \FlycartInput\FInput::getInstance();
521
+ $request = $postData->getArray();
522
+ if(!empty($request['id']) && (int)$request['id'] && !empty($request['type'])){
523
+ $post = get_post( (int)$request['id'] );
524
+ if(!empty($post)){
525
+ $post_new = array(
526
+ 'post_title' => $post->post_title.' - '.esc_html__('copy', 'woo-discount-rules'),
527
+ 'post_name' => $post->post_title.' - '.esc_html__('copy', 'woo-discount-rules'),
528
+ 'post_content' => 'New Rule',
529
+ 'post_type' => $post->post_type,
530
+ 'post_status' => 'publish'
531
+ );
532
+ $id = wp_insert_post($post_new);
533
+ if($id){
534
+ /*
535
+ * duplicate all post meta just in two SQL queries
536
+ */
537
+ global $wpdb;
538
+ $post_meta_infos = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->postmeta WHERE post_id=$post->ID");
539
+ if (count($post_meta_infos)!=0) {
540
+ $sql_query = "INSERT INTO $wpdb->postmeta (post_id, meta_key, meta_value) ";
541
+ foreach ($post_meta_infos as $meta_info) {
542
+ $meta_key = $meta_info->meta_key;
543
+ if( $meta_key == 'rule_order' ) $meta_info->meta_value = FlycartWooDiscountRulesGeneralHelper::reOrderRuleIfExists($id, 1, $post->post_type);
544
+ if( $meta_key == 'rule_name' ) $meta_info->meta_value = $meta_info->meta_value.' - '.esc_html__('copy', 'woo-discount-rules');
545
+ if( $meta_key == 'status' ) $meta_info->meta_value = 'disable';
546
+ $meta_value = addslashes($meta_info->meta_value);
547
+ $sql_query_sel[]= "SELECT $id, '$meta_key', '$meta_value'";
548
+ }
549
+ $sql_query.= implode(" UNION ALL ", $sql_query_sel);
550
+ $wpdb->query($sql_query);
551
+ }
552
+ echo esc_html__('Duplicate rule created successfully', 'woo-discount-rules'); die();
553
+ }
554
+ }
555
+ }
556
+ echo esc_html__('Failed to create duplicate rule', 'woo-discount-rules'); die();
557
+ }
558
+
559
  /**
560
  * @return array
561
  */
894
  'save_text' => esc_html__('Save', 'woo-discount-rules'),
895
  'saved_successfully' => esc_html__('Saved Successfully!', 'woo-discount-rules'),
896
  'none_selected' => esc_html__('None selected', 'woo-discount-rules'),
897
+ 'in_each_category_cart' => esc_html__('In each category', 'woo-discount-rules'),
898
+ 'show_text' => esc_html__('Show', 'woo-discount-rules'),
899
+ 'hide_text' => esc_html__('Hide', 'woo-discount-rules'),
900
+ 'please_select_at_least_one_checkbox' => esc_html__('Please select at least one rule', 'woo-discount-rules'),
901
+ 'please_select_bulk_action' => esc_html__('Please select an action to apply', 'woo-discount-rules'),
902
+ 'are_you_sure_to_delete' => esc_html__('Are you sure to remove the selected rules', 'woo-discount-rules'),
903
  );
904
  }
905
  }
includes/pricing-rules.php CHANGED
@@ -334,7 +334,19 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
334
  {
335
  if(self::$rules_loaded) return $this->rules = self::$pricingRules;
336
 
337
- $posts = get_posts(array('post_type' => $this->post_type, 'numberposts' => '-1'));
 
 
 
 
 
 
 
 
 
 
 
 
338
  if ($onlyCount) return count($posts);
339
  if (isset($posts) && count($posts) > 0) {
340
  foreach ($posts as $index => $item) {
334
  {
335
  if(self::$rules_loaded) return $this->rules = self::$pricingRules;
336
 
337
+ $post_args = array('post_type' => $this->post_type, 'numberposts' => '-1');
338
+ $postData = \FlycartInput\FInput::getInstance();
339
+ $request = $postData->getArray();
340
+ if(is_admin() && isset($request['page']) && $request['page'] == 'woo_discount_rules'){
341
+ $post_args['meta_key'] = 'rule_order';
342
+ $post_args['orderby'] = 'meta_value_num';
343
+ $post_args['order'] = 'DESC';
344
+ if(isset($request['order']) && in_array($request['order'], array('asc', 'desc'))){
345
+ if($request['order'] == 'asc') $post_args['order'] = 'ASC';
346
+ }
347
+ }
348
+ $posts = get_posts($post_args);
349
+
350
  if ($onlyCount) return count($posts);
351
  if (isset($posts) && count($posts) > 0) {
352
  foreach ($posts as $index => $item) {
loader.php CHANGED
@@ -113,6 +113,8 @@ if(!class_exists('FlycartWooDiscountRules')){
113
 
114
  add_action('wp_ajax_UpdateStatus', array($this->discountBase, 'updateStatus'));
115
  add_action('wp_ajax_RemoveRule', array($this->discountBase, 'removeRule'));
 
 
116
  }
117
 
118
  /**
113
 
114
  add_action('wp_ajax_UpdateStatus', array($this->discountBase, 'updateStatus'));
115
  add_action('wp_ajax_RemoveRule', array($this->discountBase, 'removeRule'));
116
+ add_action('wp_ajax_doBulkAction', array($this->discountBase, 'doBulkAction'));
117
+ add_action('wp_ajax_createDuplicateRule', array($this->discountBase, 'createDuplicateRule'));
118
  }
119
 
120
  /**
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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: 4.9
7
- Stable tag: 1.6.7
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -308,6 +308,12 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
308
 
309
  == Changelog ==
310
 
 
 
 
 
 
 
311
  = 1.6.7 - 29/06/18 =
312
  * Fix - Invalid function wc_products_array_filter_visible_grouped in woocommerce 2.6
313
  * Removed - Disable product discount while have subtotal option
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: 4.9
7
+ Stable tag: 1.6.8
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
308
 
309
  == Changelog ==
310
 
311
+ = 1.6.8 - 03/07/18 =
312
+ * Feature - Bulk action, Ordering by order id
313
+ * Feature - In each category option for cart rule(Pro)
314
+ * Feature - Duplicate a rule (pro)
315
+ * Improvement - UI improvement
316
+
317
  = 1.6.7 - 29/06/18 =
318
  * Fix - Invalid function wc_products_array_filter_visible_grouped in woocommerce 2.6
319
  * Removed - Disable product discount while have subtotal option
view/cart-rules.php CHANGED
@@ -12,8 +12,32 @@ $rule_list = $config;
12
  global $woocommerce;
13
 
14
  $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  ?>
16
- <div class="container-fluid" id="cart_rule">
17
  <div class="row-fluid">
18
  <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
19
  <div class="row">
@@ -28,7 +52,7 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
28
  </div>
29
  <hr>
30
  </div>
31
- <form method="post" action="?page=woo_discount_rules">
32
  <div class="row">
33
  <div class="col-md-4" id="add_new_rule_div">
34
  <?php if (isset($rule_list)) {
@@ -49,7 +73,17 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
49
 
50
  </div>
51
  <div class="col-md-12">
52
- <code><?php esc_html_e("NOTE: Order Should not be empty ('-').If it's empty('-'), then it won't be implemented.", 'woo-discount-rules'); ?></code>
 
 
 
 
 
 
 
 
 
 
53
  </div>
54
  </div>
55
  <br>
@@ -58,11 +92,20 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
58
  <table class="wp-list-table widefat fixed striped posts">
59
  <thead>
60
  <tr>
61
- <td><?php esc_html_e('Name', 'woo-discount-rules'); ?></td>
62
- <td><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></td>
63
- <td><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></td>
64
- <td><?php esc_html_e('Order', 'woo-discount-rules'); ?></td>
65
- <td><?php esc_html_e('Action', 'woo-discount-rules'); ?></td>
 
 
 
 
 
 
 
 
 
66
  </tr>
67
  </thead>
68
  <tbody id="cart_rule">
@@ -77,15 +120,18 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
77
  $class = 'btn btn-success';
78
 
79
  if ($status == 'publish') {
80
- $class = 'btn btn-warning';
81
  $value = esc_html__('Disable', 'woo-discount-rules');
82
  } else {
83
- $class = 'btn btn-success';
84
  $value = esc_html__('Enable', 'woo-discount-rules');
85
  }
86
  ?>
87
 
88
  <tr>
 
 
 
89
  <td><?php echo(isset($meta['rule_name'][0]) ? $meta['rule_name'][0] : '-') ?></td>
90
  <td><?php echo(isset($rule->date_from) ? $rule->date_from : '-') ?></td>
91
  <td><?php echo(isset($rule->date_to) ? $rule->date_to : '-') ?></td>
@@ -94,6 +140,11 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
94
  <a class="btn btn-primary" href="?page=woo_discount_rules&tab=cart-rules&view=<?php echo $rule->ID ?>">
95
  <?php esc_html_e('Edit', 'woo-discount-rules'); ?>
96
  </a>
 
 
 
 
 
97
  <a class="<?php echo $class; ?> cart_manage_status" id="state_<?php echo $rule->ID ?>">
98
  <?php echo $value; ?>
99
  </a>
@@ -111,11 +162,20 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
111
  </tbody>
112
  <tfoot>
113
  <tr>
114
- <td><?php esc_html_e('Name', 'woo-discount-rules'); ?></td>
115
- <td><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></td>
116
- <td><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></td>
117
- <td><?php esc_html_e('Order', 'woo-discount-rules'); ?></td>
118
- <td><?php esc_html_e('Action', 'woo-discount-rules'); ?></td>
 
 
 
 
 
 
 
 
 
119
  </tr>
120
  </tfoot>
121
  </table>
@@ -135,6 +195,9 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
135
  <!-- Sidebar END -->
136
  <?php } ?>
137
  </div>
 
 
 
138
  </div>
139
  <div class="clear"></div>
140
  <?php include_once(WOO_DISCOUNT_DIR . '/view/includes/footer.php'); ?>
12
  global $woocommerce;
13
 
14
  $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
15
+
16
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
17
+ $current_url = remove_query_arg( 'paged', $current_url );
18
+ if ( isset( $_GET['order'] ) && 'asc' === $_GET['order'] ) {
19
+ $current_order = 'asc';
20
+ } else {
21
+ $current_order = 'desc';
22
+ }
23
+ if ( isset( $_GET['orderby'] ) ) {
24
+ $current_orderby = $_GET['orderby'];
25
+ } else {
26
+ $current_orderby = '';
27
+ }
28
+ $orderby = 'ordering';
29
+ $desc_first = 0 ;
30
+ if ( $current_orderby === $orderby ) {
31
+ $order = 'desc' === $current_order ? 'asc' : 'desc';
32
+ $class[] = 'sorted';
33
+ $class[] = $current_order;
34
+ } else {
35
+ $order = $desc_first ? 'desc' : 'asc';
36
+ $class[] = 'sortable';
37
+ $class[] = $desc_first ? 'asc' : 'desc';
38
+ }
39
  ?>
40
+ <div class="container-fluid woo_discount_loader_outer" id="cart_rule">
41
  <div class="row-fluid">
42
  <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
43
  <div class="row">
52
  </div>
53
  <hr>
54
  </div>
55
+ <form id="woo_discount_list_form" method="post" action="?page=woo_discount_rules">
56
  <div class="row">
57
  <div class="col-md-4" id="add_new_rule_div">
58
  <?php if (isset($rule_list)) {
73
 
74
  </div>
75
  <div class="col-md-12">
76
+ <div class="woo_discount_rules_bulk_action_con">
77
+ <div class="alignleft actions bulkactions">
78
+ <select name="bulk_action" id="bulk-action-selector-top">
79
+ <option value=""><?php esc_html_e('Bulk Actions', 'woo-discount-rules'); ?></option>
80
+ <option value="publish"><?php esc_html_e('Enable rules', 'woo-discount-rules'); ?></option>
81
+ <option value="unpublish"><?php esc_html_e('Disable rules', 'woo-discount-rules'); ?></option>
82
+ <option value="delete"><?php esc_html_e('Delete rules', 'woo-discount-rules'); ?></option>
83
+ </select>
84
+ <input id="wdr_do_bulk_action" class="button action" value="<?php esc_html_e('Apply', 'woo-discount-rules'); ?>" type="button">
85
+ </div>
86
+ </div>
87
  </div>
88
  </div>
89
  <br>
92
  <table class="wp-list-table widefat fixed striped posts">
93
  <thead>
94
  <tr>
95
+ <td id="cb" class="manage-column column-cb check-column">
96
+ <input id="cb-select-all-1" type="checkbox" />
97
+ </td>
98
+ <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
99
+ <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
100
+ <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
101
+ <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
102
+ <?php
103
+ $column_display_name = esc_html__('Order', 'woo-discount-rules');
104
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
105
+ echo $column_display_name;
106
+ ?>
107
+ </th>
108
+ <th><?php esc_html_e('Action', 'woo-discount-rules'); ?></th>
109
  </tr>
110
  </thead>
111
  <tbody id="cart_rule">
120
  $class = 'btn btn-success';
121
 
122
  if ($status == 'publish') {
123
+ $class = 'btn btn-success';
124
  $value = esc_html__('Disable', 'woo-discount-rules');
125
  } else {
126
+ $class = 'btn btn-warning';
127
  $value = esc_html__('Enable', 'woo-discount-rules');
128
  }
129
  ?>
130
 
131
  <tr>
132
+ <th class="check-column">
133
+ <input id="cb-select-<?php echo $i; ?>" name="post[]" value="<?php echo $rule->ID; ?>" type="checkbox"/>
134
+ </th>
135
  <td><?php echo(isset($meta['rule_name'][0]) ? $meta['rule_name'][0] : '-') ?></td>
136
  <td><?php echo(isset($rule->date_from) ? $rule->date_from : '-') ?></td>
137
  <td><?php echo(isset($rule->date_to) ? $rule->date_to : '-') ?></td>
140
  <a class="btn btn-primary" href="?page=woo_discount_rules&tab=cart-rules&view=<?php echo $rule->ID ?>">
141
  <?php esc_html_e('Edit', 'woo-discount-rules'); ?>
142
  </a>
143
+ <?php if($pro){ ?>
144
+ <button class="btn btn-primary duplicate_cart_rule_btn" data-id="<?php echo $rule->ID; ?>" type="button">
145
+ <?php esc_html_e('Duplicate', 'woo-discount-rules'); ?>
146
+ </button>
147
+ <?php } ?>
148
  <a class="<?php echo $class; ?> cart_manage_status" id="state_<?php echo $rule->ID ?>">
149
  <?php echo $value; ?>
150
  </a>
162
  </tbody>
163
  <tfoot>
164
  <tr>
165
+ <td id="cb" class="manage-column column-cb check-column">
166
+ <input id="cb-select-all-1" type="checkbox" />
167
+ </td>
168
+ <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
169
+ <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
170
+ <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
171
+ <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
172
+ <?php
173
+ $column_display_name = esc_html__('Order', 'woo-discount-rules');
174
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
175
+ echo $column_display_name;
176
+ ?>
177
+ </th>
178
+ <th><?php esc_html_e('Action', 'woo-discount-rules'); ?></th>
179
  </tr>
180
  </tfoot>
181
  </table>
195
  <!-- Sidebar END -->
196
  <?php } ?>
197
  </div>
198
+ <div class="woo_discount_loader">
199
+ <div class="lds-ripple"><div></div><div></div></div>
200
+ </div>
201
  </div>
202
  <div class="clear"></div>
203
  <?php include_once(WOO_DISCOUNT_DIR . '/view/includes/footer.php'); ?>
view/includes/footer.php CHANGED
@@ -2,9 +2,11 @@
2
  <div class="row-fluid">
3
  <div class="">
4
  <div class="col-md-12">
5
- <?php esc_html_e('Need help in setting up the rules?', 'woo-discount-rules'); ?> <a href="https://www.flycart.org/support" target="_blank" class=""><?php esc_html_e('Please contact our support team', 'woo-discount-rules'); ?></a>
 
 
 
 
6
  </div>
7
  </div>
8
  </div>
9
- </body>
10
- </html>
2
  <div class="row-fluid">
3
  <div class="">
4
  <div class="col-md-12">
5
+ <div class="notice inline notice-success notice-alt">
6
+ <p>
7
+ <?php esc_html_e('Having trouble in setting up the discount? Let us set up the rules for you (for free)!', 'woo-discount-rules'); ?> <a href="https://www.flycart.org/support?utm_source=inline&utm_content=inline_support&utm_campaign=inline_setup" target="_blank" class=""><?php esc_html_e('Please contact our support team', 'woo-discount-rules'); ?></a>
8
+ </p>
9
+ </div>
10
  </div>
11
  </div>
12
  </div>
 
 
view/includes/header.php CHANGED
@@ -1,11 +1,20 @@
1
- <?php if (!defined('ABSPATH')) exit; // Exit if accessed directly ?>
2
- <html>
3
- <head>
4
- <style>
5
- body{
6
- width: 100% !important;
7
- height: 100% !important;
8
- }
9
- </style>
10
- <body style="background-color: rgb(241, 241, 241) !important;">
 
 
 
 
 
 
 
 
 
11
  <span id="woo-admin-message"></span>
1
+ <?php if (!defined('ABSPATH')) exit; // Exit if accessed directly
2
+ $unsupported_plugins = array(
3
+ 'woocommerce-dynamic-pricing/woocommerce-dynamic-pricing.php' => 'WooCommerce Dynamic Pricing',
4
+ 'pricing-deals-for-woocommerce/vt-pricing-deals.php' => 'VarkTech Pricing Deals for WooCommerce',
5
+ 'dynamic-pricing-and-discounts-for-woocommerce-basic-version/dynamic-pricing-and-discounts-for-woocommerce-basic-version.php' => 'Dynamic Pricing and Discounts for WooCommerce Basic Version',
6
+ 'wc-dynamic-pricing-and-discounts/wc-dynamic-pricing-and-discounts.php' => 'WooCommerce Dynamic Pricing & Discounts');
7
+ foreach ($unsupported_plugins as $plugin_path => $unsupported_plugin){
8
+ $is_active = is_plugin_active($plugin_path);
9
+ if($is_active){
10
+ ?>
11
+ <div class="notice inline notice-warning notice-alt">
12
+ <p>
13
+ <?php echo sprintf(esc_html__("An another discount plugin %s is active. Please disable this plugin, Woo Discount Rules might get conflict.", 'woo-discount-rules'), $unsupported_plugin); ?>
14
+ </p>
15
+ </div>
16
+ <?php
17
+ }
18
+ }
19
+ ?>
20
  <span id="woo-admin-message"></span>
view/pricing-rules.php CHANGED
@@ -10,161 +10,223 @@ $config = (isset($config)) ? $config : '{}';
10
  $data = array();
11
  $rule_list = $config;
12
  $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  ?>
14
 
15
- <style>
16
- @media screen and (max-width: 600px) {
17
- table {
18
- width: 100%;
19
- }
20
 
21
- thead {
22
- display: none;
23
- }
24
 
25
- tr:nth-of-type(2n) {
26
- background-color: inherit;
27
- }
28
 
29
- tr td:first-child {
30
- background: #f0f0f0;
31
- font-weight: bold;
32
- font-size: 1.3em;
33
- }
34
 
35
- tbody td {
36
- display: block;
37
- text-align: left;
38
- }
39
 
40
- tbody td:before {
41
- content: attr(data-th);
42
- display: block;
43
- text-align: left;
 
44
  }
45
- }
46
- </style>
47
 
48
- <div class="container-fluid" id="pricing_rule">
49
- <div class="row-fluid">
50
- <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
51
- <div class="">
52
  <div class="row">
53
- <div class="col-md-8">
54
- <h4><?php esc_html_e('Price Rules', 'woo-discount-rules'); ?></h4>
55
- </div>
56
- <div class="col-md-4 text-right">
57
- <br/>
58
- <a href="https://www.flycart.org/woocommerce-discount-rules-examples#pricediscountexample" target="_blank" class="btn btn-info"><?php esc_html_e('View Examples', 'woo-discount-rules'); ?></a>
59
- <a href="http://docs.flycart.org/woocommerce-discount-rules/price-discount-rules" target="_blank" class="btn btn-info"><?php esc_html_e('Documentation', 'woo-discount-rules'); ?></a>
 
 
 
60
  </div>
61
- <hr>
62
- </div>
63
- <div class="">
64
- <form method="post" action="?page=woo_discount_rules">
65
- <div class="row">
66
- <div class="col-md-4">
67
- <?php if (isset($rule_list)) {
68
- if (count($rule_list) >= 3 && !$pro) { ?>
69
- <a href=javascript:void(0) class="btn btn-primary"><?php esc_html_e('You Reach Max. Rule Limit', 'woo-discount-rules'); ?></a>
70
- <?php } else {
71
- ?>
72
- <a href="?page=woo_discount_rules&type=new" id="add_new_rule"
73
- class="btn btn-primary"><?php esc_html_e('Add New Rule', 'woo-discount-rules'); ?></a>
74
- <?php
75
  }
76
- }
77
-
78
- ?>
79
- </div>
80
- <div class="col-md-12">
81
- <code><?php esc_html_e("NOTE: Order Should not be empty ('-').If it's empty('-'), then it won't be implemented.", 'woo-discount-rules'); ?></code>
 
 
 
 
 
 
 
 
 
82
  </div>
83
- </div>
84
- <br>
85
- <div class="row">
86
- <div class="">
87
- <table class="wp-list-table widefat fixed striped posts">
88
- <thead>
89
- <tr>
90
- <td><?php esc_html_e('Name', 'woo-discount-rules'); ?></td>
91
- <td><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></td>
92
- <td><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></td>
93
- <td><?php esc_html_e('Order', 'woo-discount-rules'); ?></td>
94
- <td><?php esc_html_e('Action', 'woo-discount-rules'); ?></td>
95
- </tr>
96
- </thead>
97
- <tbody id="pricing_rule">
98
- <?php
99
- $i = 1;
100
- if (is_array($rule_list)) {
101
- if (count($rule_list) > 0) {
102
- foreach ($rule_list as $index => $rule) {
103
- if (!$pro && $i > 3) continue;
104
- $meta = $rule->meta;
105
- $status = isset($meta['status'][0]) ? $meta['status'][0] : 'disable';
106
- $class = 'btn btn-success';
107
-
108
- if ($status == 'publish') {
109
- $class = 'btn btn-warning';
110
- $value = esc_html__('Disable', 'woo-discount-rules');
111
- } else {
112
- $class = 'btn btn-success';
113
- $value = esc_html__('Enable', 'woo-discount-rules');;
114
- }
115
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
116
 
117
- <tr>
118
- <td><?php echo(isset($rule->rule_name) ? $rule->rule_name : '-') ?></td>
119
- <td><?php echo(isset($rule->date_from) ? $rule->date_from : '-') ?></td>
120
- <td><?php echo(isset($rule->date_to) ? $rule->date_to : '-') ?></td>
121
- <td><?php echo((isset($rule->rule_order) && ($rule->rule_order != '')) ? $rule->rule_order : ' - ') ?></td>
122
- <td>
123
- <a class="btn btn-primary" href="?page=woo_discount_rules&view=<?php echo $rule->ID ?>">
124
- <?php esc_html_e('Edit', 'woo-discount-rules'); ?>
125
- </a>
126
- <a class="<?php echo $class; ?> manage_status"
127
- id="state_<?php echo $rule->ID ?>"><?php echo $value; ?>
128
- </a>
129
- <a class="btn btn-danger delete_rule" id="delete_<?php echo $rule->ID ?>">
130
- <?php esc_html_e('Delete', 'woo-discount-rules'); ?>
131
- </a>
132
- </td>
133
- </tr>
134
- <?php
135
- $i++;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
  }
137
  }
138
- }
139
- ?>
140
- </tbody>
141
- <tfoot>
142
- <tr>
143
- <td><?php esc_html_e('Name', 'woo-discount-rules'); ?></td>
144
- <td><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></td>
145
- <td><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></td>
146
- <td><?php esc_html_e('Order', 'woo-discount-rules'); ?></td>
147
- <td><?php esc_html_e('Action', 'woo-discount-rules'); ?></td>
148
- </tr>
149
- </tfoot>
150
- </table>
 
 
 
 
 
 
 
 
 
151
  </div>
152
- </div>
153
- <hr>
154
 
155
- <input type="hidden" name="form" value="pricing_rules">
156
- <input type="hidden" id="ajax_path" value="<?php echo admin_url('admin-ajax.php') ?>">
157
- </form>
 
158
  </div>
159
  </div>
 
 
 
 
 
 
 
 
 
160
  </div>
161
- <?php if(!$isPro){ ?>
162
- <div class="col-md-1"></div>
163
- <!-- Sidebar -->
164
- <?php include_once(__DIR__ . '/template/sidebar.php'); ?>
165
- <!-- Sidebar END -->
166
- <?php } ?>
167
  </div>
168
- </div>
169
- <div class="clear"></div>
170
  <?php include_once(WOO_DISCOUNT_DIR . '/view/includes/footer.php'); ?>
10
  $data = array();
11
  $rule_list = $config;
12
  $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
13
+
14
+ $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
15
+ $current_url = remove_query_arg( 'paged', $current_url );
16
+ if ( isset( $_GET['order'] ) && 'asc' === $_GET['order'] ) {
17
+ $current_order = 'asc';
18
+ } else {
19
+ $current_order = 'desc';
20
+ }
21
+ if ( isset( $_GET['orderby'] ) ) {
22
+ $current_orderby = $_GET['orderby'];
23
+ } else {
24
+ $current_orderby = '';
25
+ }
26
+ $orderby = 'ordering';
27
+ $desc_first = 0 ;
28
+ if ( $current_orderby === $orderby ) {
29
+ $order = 'desc' === $current_order ? 'asc' : 'desc';
30
+ $class[] = 'sorted';
31
+ $class[] = $current_order;
32
+ } else {
33
+ $order = $desc_first ? 'desc' : 'asc';
34
+ $class[] = 'sortable';
35
+ $class[] = $desc_first ? 'asc' : 'desc';
36
+ }
37
  ?>
38
 
39
+ <style>
40
+ @media screen and (max-width: 600px) {
41
+ table {
42
+ width: 100%;
43
+ }
44
 
45
+ thead {
46
+ display: none;
47
+ }
48
 
49
+ tr:nth-of-type(2n) {
50
+ background-color: inherit;
51
+ }
52
 
53
+ tr td:first-child {
54
+ background: #f0f0f0;
55
+ font-weight: bold;
56
+ font-size: 1.3em;
57
+ }
58
 
59
+ tbody td {
60
+ display: block;
61
+ text-align: left;
62
+ }
63
 
64
+ tbody td:before {
65
+ content: attr(data-th);
66
+ display: block;
67
+ text-align: left;
68
+ }
69
  }
70
+ </style>
 
71
 
72
+ <div class="container-fluid woo_discount_loader_outer" id="pricing_rule">
73
+ <div class="row-fluid">
74
+ <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
 
75
  <div class="row">
76
+ <div class="row">
77
+ <div class="col-md-8">
78
+ <h4><?php esc_html_e('Price Rules', 'woo-discount-rules'); ?></h4>
79
+ </div>
80
+ <div class="col-md-4 text-right">
81
+ <br/>
82
+ <a href="https://www.flycart.org/woocommerce-discount-rules-examples#pricediscountexample" target="_blank" class="btn btn-info"><?php esc_html_e('View Examples', 'woo-discount-rules'); ?></a>
83
+ <a href="http://docs.flycart.org/woocommerce-discount-rules/price-discount-rules" target="_blank" class="btn btn-info"><?php esc_html_e('Documentation', 'woo-discount-rules'); ?></a>
84
+ </div>
85
+ <hr>
86
  </div>
87
+ <div class="">
88
+ <form id="woo_discount_list_form" method="post" action="?page=woo_discount_rules">
89
+ <div class="row">
90
+ <div class="col-md-4">
91
+ <?php if (isset($rule_list)) {
92
+ if (count($rule_list) >= 3 && !$pro) { ?>
93
+ <a href=javascript:void(0) class="btn btn-primary"><?php esc_html_e('You Reach Max. Rule Limit', 'woo-discount-rules'); ?></a>
94
+ <?php } else {
95
+ ?>
96
+ <a href="?page=woo_discount_rules&type=new" id="add_new_rule"
97
+ class="btn btn-primary"><?php esc_html_e('Add New Rule', 'woo-discount-rules'); ?></a>
98
+ <?php
99
+ }
 
100
  }
101
+ ?>
102
+ </div>
103
+ <div class="col-md-12">
104
+ <div class="woo_discount_rules_bulk_action_con">
105
+ <div class="alignleft actions bulkactions">
106
+ <select name="bulk_action" id="bulk-action-selector-top">
107
+ <option value=""><?php esc_html_e('Bulk Actions', 'woo-discount-rules'); ?></option>
108
+ <option value="publish"><?php esc_html_e('Enable rules', 'woo-discount-rules'); ?></option>
109
+ <option value="unpublish"><?php esc_html_e('Disable rules', 'woo-discount-rules'); ?></option>
110
+ <option value="delete"><?php esc_html_e('Delete rules', 'woo-discount-rules'); ?></option>
111
+ </select>
112
+ <input id="wdr_do_bulk_action" class="button action" value="<?php esc_html_e('Apply', 'woo-discount-rules'); ?>" type="button">
113
+ </div>
114
+ </div>
115
+ </div>
116
  </div>
117
+ <br>
118
+ <div class="row">
119
+ <div class="">
120
+ <table class="wp-list-table widefat fixed striped posts">
121
+ <thead>
122
+ <tr>
123
+ <td id="cb" class="manage-column column-cb check-column">
124
+ <input id="cb-select-all-1" type="checkbox" />
125
+ </td>
126
+ <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
127
+ <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
128
+ <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
129
+ <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
130
+ <?php
131
+ $column_display_name = esc_html__('Order', 'woo-discount-rules');
132
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
133
+ echo $column_display_name;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
134
  ?>
135
+ </th>
136
+ <th><?php esc_html_e('Action', 'woo-discount-rules'); ?></th>
137
+ </tr>
138
+ </thead>
139
+ <tbody id="pricing_rule">
140
+ <?php
141
+ $i = 1;
142
+ if (is_array($rule_list)) {
143
+ if (count($rule_list) > 0) {
144
+ foreach ($rule_list as $index => $rule) {
145
+ if (!$pro && $i > 3) continue;
146
+ $meta = $rule->meta;
147
+ $status = isset($meta['status'][0]) ? $meta['status'][0] : 'disable';
148
+ $class = 'btn btn-success';
149
 
150
+ if ($status == 'publish') {
151
+ $class = 'btn btn-success';
152
+ $value = esc_html__('Disable', 'woo-discount-rules');
153
+ } else {
154
+ $class = 'btn btn-warning';
155
+ $value = esc_html__('Enable', 'woo-discount-rules');;
156
+ }
157
+ ?>
158
+
159
+ <tr>
160
+ <th class="check-column">
161
+ <input id="cb-select-<?php echo $i; ?>" name="post[]" value="<?php echo $rule->ID; ?>" type="checkbox"/>
162
+ </th>
163
+ <td><?php echo(isset($rule->rule_name) ? $rule->rule_name : '-') ?></td>
164
+ <td><?php echo(isset($rule->date_from) ? $rule->date_from : '-') ?></td>
165
+ <td><?php echo(isset($rule->date_to) ? $rule->date_to : '-') ?></td>
166
+ <td><?php echo((isset($rule->rule_order) && ($rule->rule_order != '')) ? $rule->rule_order : ' - ') ?></td>
167
+ <td>
168
+ <a class="btn btn-primary" href="?page=woo_discount_rules&view=<?php echo $rule->ID ?>">
169
+ <?php esc_html_e('Edit', 'woo-discount-rules'); ?>
170
+ </a>
171
+ <?php if($pro){ ?>
172
+ <button class="btn btn-primary duplicate_price_rule_btn" data-id="<?php echo $rule->ID; ?>" type="button">
173
+ <?php esc_html_e('Duplicate', 'woo-discount-rules'); ?>
174
+ </button>
175
+ <?php } ?>
176
+ <a class="<?php echo $class; ?> manage_status"
177
+ id="state_<?php echo $rule->ID ?>"><?php echo $value; ?>
178
+ </a>
179
+ <a class="btn btn-danger delete_rule" id="delete_<?php echo $rule->ID ?>">
180
+ <?php esc_html_e('Delete', 'woo-discount-rules'); ?>
181
+ </a>
182
+ </td>
183
+ </tr>
184
+ <?php
185
+ $i++;
186
+ }
187
  }
188
  }
189
+ ?>
190
+ </tbody>
191
+ <tfoot>
192
+ <tr>
193
+ <td id="cb" class="manage-column column-cb check-column">
194
+ <input id="cb-select-all-1" type="checkbox" />
195
+ </td>
196
+ <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
197
+ <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
198
+ <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
199
+ <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
200
+ <?php
201
+ $column_display_name = esc_html__('Order', 'woo-discount-rules');
202
+ $column_display_name = '<a href="' . esc_url( add_query_arg( compact( 'orderby', 'order' ), $current_url ) ) . '"><span>' . $column_display_name . '</span><span class="sorting-indicator"></span></a>';
203
+ echo $column_display_name;
204
+ ?>
205
+ </th>
206
+ <th><?php esc_html_e('Action', 'woo-discount-rules'); ?></th>
207
+ </tr>
208
+ </tfoot>
209
+ </table>
210
+ </div>
211
  </div>
212
+ <hr>
 
213
 
214
+ <input type="hidden" name="form" value="pricing_rules">
215
+ <input type="hidden" id="ajax_path" value="<?php echo admin_url('admin-ajax.php') ?>">
216
+ </form>
217
+ </div>
218
  </div>
219
  </div>
220
+ <?php if(!$isPro){ ?>
221
+ <div class="col-md-1"></div>
222
+ <!-- Sidebar -->
223
+ <?php include_once(__DIR__ . '/template/sidebar.php'); ?>
224
+ <!-- Sidebar END -->
225
+ <?php } ?>
226
+ </div>
227
+ <div class="woo_discount_loader">
228
+ <div class="lds-ripple"><div></div><div></div></div>
229
  </div>
 
 
 
 
 
 
230
  </div>
231
+ <div class="clear"></div>
 
232
  <?php include_once(WOO_DISCOUNT_DIR . '/view/includes/footer.php'); ?>
view/settings.php CHANGED
@@ -16,9 +16,10 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
16
  <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
17
  <form method="post" id="discount_config">
18
  <div class="col-md-12" align="right">
 
19
  <input type="submit" id="saveConfig" value="<?php esc_html_e('Save', 'woo-discount-rules'); ?>" class="btn btn-success">
20
  </div>
21
- <div class="">
22
  <div class="">
23
  <h4><?php esc_html_e('General Settings', 'woo-discount-rules'); ?></h4>
24
  <hr>
16
  <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
17
  <form method="post" id="discount_config">
18
  <div class="col-md-12" align="right">
19
+ <br/>
20
  <input type="submit" id="saveConfig" value="<?php esc_html_e('Save', 'woo-discount-rules'); ?>" class="btn btn-success">
21
  </div>
22
+ <div class="row">
23
  <div class="">
24
  <h4><?php esc_html_e('General Settings', 'woo-discount-rules'); ?></h4>
25
  <hr>
view/template/discount-table.php CHANGED
@@ -1,4 +1,10 @@
1
  <?php
 
 
 
 
 
 
2
  if (!defined('ABSPATH')) exit; // Exit if accessed directly
3
  if (!isset($table_data) || empty($table_data)) return false;
4
  $base_config = (is_string($data)) ? json_decode($data, true) : (is_array($data) ? $data : array());
1
  <?php
2
+ /**
3
+ * List matched Rules in Table format
4
+ *
5
+ * This template can be overridden by copying it to yourtheme/plugin-folder-name/discount-table.php
6
+ */
7
+
8
  if (!defined('ABSPATH')) exit; // Exit if accessed directly
9
  if (!isset($table_data) || empty($table_data)) return false;
10
  $base_config = (is_string($data)) ? json_decode($data, true) : (is_array($data) ? $data : array());
view/view-cart-rules.php CHANGED
@@ -50,7 +50,7 @@ $do_not_run_while_have_third_party_coupon = $woo_settings->getConfigData('do_not
50
  <div class="<?php echo $isPro? 'col-md-12': 'col-md-9'; ?>">
51
  <div class="col-md-12 rule_buttons_con" align="right">
52
  <input type="submit" id="saveCartRule" value="<?php esc_html_e('Save Rule', 'woo-discount-rules'); ?>" class="btn btn-primary">
53
- <a href="?page=woo_discount_rules&tab=cart-rules" class="btn btn-warning"><?php esc_html_e('Close', 'woo-discount-rules'); ?></a>
54
  </div>
55
  <?php if ($rule_id == 0) { ?>
56
  <div class="col-md-12"><h2><?php esc_html_e('New Cart Rule', 'woo-discount-rules'); ?></h2></div>
@@ -207,6 +207,12 @@ $do_not_run_while_have_third_party_coupon = $woo_settings->getConfigData('do_not
207
  <?php if ($type == 'categories_in') { ?> selected="selected"
208
  <?php } ?>><?php esc_html_e('Categories in cart', 'woo-discount-rules'); ?>
209
  </option>
 
 
 
 
 
 
210
  </optgroup>
211
  <optgroup label="<?php esc_attr_e('Customer Details (must be logged in)', 'woo-discount-rules'); ?>">
212
  <option
@@ -363,9 +369,8 @@ $do_not_run_while_have_third_party_coupon = $woo_settings->getConfigData('do_not
363
  <?php
364
  $category_list = array();
365
  $class = 'style="display:none"';
366
- if ($type == 'categories_atleast_one' || $type == 'categories_not_in' || $type == 'categories_in') {
367
- $category_list = $discount_rules[$type];;
368
-
369
  $class = 'style="display:block"';
370
  $hit = true;
371
  }
50
  <div class="<?php echo $isPro? 'col-md-12': 'col-md-9'; ?>">
51
  <div class="col-md-12 rule_buttons_con" align="right">
52
  <input type="submit" id="saveCartRule" value="<?php esc_html_e('Save Rule', 'woo-discount-rules'); ?>" class="btn btn-primary">
53
+ <a href="?page=woo_discount_rules&tab=cart-rules" class="btn btn-warning"><?php esc_html_e('Cancel and go back to list', 'woo-discount-rules'); ?></a>
54
  </div>
55
  <?php if ($rule_id == 0) { ?>
56
  <div class="col-md-12"><h2><?php esc_html_e('New Cart Rule', 'woo-discount-rules'); ?></h2></div>
207
  <?php if ($type == 'categories_in') { ?> selected="selected"
208
  <?php } ?>><?php esc_html_e('Categories in cart', 'woo-discount-rules'); ?>
209
  </option>
210
+ <option
211
+ <?php if (!$pro) { ?> disabled <?php } else { ?> value="in_each_category" <?php
212
+ } ?>
213
+ <?php if ($type == 'in_each_category') { ?> selected="selected"
214
+ <?php } ?>><?php esc_html_e('In each category', 'woo-discount-rules'); ?>
215
+ </option>
216
  </optgroup>
217
  <optgroup label="<?php esc_attr_e('Customer Details (must be logged in)', 'woo-discount-rules'); ?>">
218
  <option
369
  <?php
370
  $category_list = array();
371
  $class = 'style="display:none"';
372
+ if ($type == 'categories_atleast_one' || $type == 'categories_not_in' || $type == 'categories_in' || $type == 'in_each_category') {
373
+ $category_list = $discount_rules[$type];
 
374
  $class = 'style="display:block"';
375
  $hit = true;
376
  }
view/view-pricing-rules.php CHANGED
@@ -34,7 +34,7 @@ $do_not_run_while_have_third_party_coupon = $woo_settings->getConfigData('do_not
34
  <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
35
  <div class="col-md-12 rule_buttons_con" align="right">
36
  <input type="submit" id="savePriceRule" value="<?php esc_html_e('Save Rule', 'woo-discount-rules'); ?>" class="btn btn-primary">
37
- <a href="?page=woo_discount_rules" class="btn btn-warning"><?php esc_html_e('Close', 'woo-discount-rules'); ?></a>
38
  </div>
39
  <?php if ($rule_id == 0) { ?>
40
  <div class="col-md-12"><h2><?php esc_html_e('New Price Rule', 'woo-discount-rules'); ?></h2></div>
34
  <div class="<?php echo $isPro? 'col-md-12': 'col-md-8'; ?>">
35
  <div class="col-md-12 rule_buttons_con" align="right">
36
  <input type="submit" id="savePriceRule" value="<?php esc_html_e('Save Rule', 'woo-discount-rules'); ?>" class="btn btn-primary">
37
+ <a href="?page=woo_discount_rules" class="btn btn-warning"><?php esc_html_e('Cancel and go back to list', 'woo-discount-rules'); ?></a>
38
  </div>
39
  <?php if ($rule_id == 0) { ?>
40
  <div class="col-md-12"><h2><?php esc_html_e('New Price Rule', 'woo-discount-rules'); ?></h2></div>
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.6.7
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.6.8
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/