Discount Rules for WooCommerce - Version 1.6.17

Version Description

  • 10/10/18 =
  • Feature - Option to display message in cart while apply price rules
  • Improvement - Event apply_filters('woo_discount_rules_load_minimum_product_variant_price', false, $product) to handle variant strikeout price
  • Improvement - Option to display Message on apply cart rules in cart
  • Fix - Warning: on coupon applied
Download this release

Release Info

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

Code changes from version 1.6.16 to 1.6.17

assets/css/style.css CHANGED
@@ -159,4 +159,16 @@
159
  color: darkgray;
160
  display: inline-block;
161
  margin-top: 10px;
 
 
 
 
 
 
 
 
 
 
 
 
162
  }
159
  color: darkgray;
160
  display: inline-block;
161
  margin-top: 10px;
162
+ }
163
+ .message_on_apply_discount_textarea{
164
+ min-width: 500px;
165
+ max-width: 100%;
166
+ }
167
+ .wdr_desc_text{
168
+ color: darkgray;
169
+ display: inline-block;
170
+ font-size: 12px;
171
+ }
172
+ div.wdr_hide_important{
173
+ display: none !important;
174
  }
assets/js/app.js CHANGED
@@ -373,6 +373,16 @@ function trigger_woocommerce_tooltip(){
373
  });
374
  $('#message_on_apply_cart_discount').trigger('change');
375
 
 
 
 
 
 
 
 
 
 
 
376
  $(document).on('keyup', '.rule_descr', function () {
377
  var value = $(this).val();
378
  value = '| ' + value;
@@ -533,9 +543,9 @@ function trigger_woocommerce_tooltip(){
533
  $('#cart_rule_discount_type').on('change', function () {
534
  var option = $(this).val();
535
  if (option == 'shipping_price') {
536
- $('#cart_rule_discount_value_con').hide();
537
  } else {
538
- $('#cart_rule_discount_value_con').show();
539
  }
540
  });
541
  $('#cart_rule_discount_type').trigger('change');
373
  });
374
  $('#message_on_apply_cart_discount').trigger('change');
375
 
376
+ $('#message_on_apply_price_discount').on('change', function () {
377
+ var option = $(this).val();
378
+ if (option == 'yes') {
379
+ $('.message_on_apply_price_discount_options').show();
380
+ } else {
381
+ $('.message_on_apply_price_discount_options').hide();
382
+ }
383
+ });
384
+ $('#message_on_apply_price_discount').trigger('change');
385
+
386
  $(document).on('keyup', '.rule_descr', function () {
387
  var value = $(this).val();
388
  value = '| ' + value;
543
  $('#cart_rule_discount_type').on('change', function () {
544
  var option = $(this).val();
545
  if (option == 'shipping_price') {
546
+ $('#cart_rule_discount_value_con').addClass('wdr_hide_important');
547
  } else {
548
+ $('#cart_rule_discount_value_con').removeClass('wdr_hide_important');
549
  }
550
  });
551
  $('#cart_rule_discount_type').trigger('change');
helper/general-helper.php CHANGED
@@ -628,7 +628,7 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
628
  if($has_coupon){
629
  if(!empty($styles)){
630
  $is_ajax = is_ajax();
631
- $wc_ajax = $_REQUEST['wc-ajax'];
632
  if(!$is_ajax || in_array($wc_ajax, array('apply_coupon'))){
633
  echo "<style>".$styles."</style>";
634
  }
628
  if($has_coupon){
629
  if(!empty($styles)){
630
  $is_ajax = is_ajax();
631
+ $wc_ajax = isset($_REQUEST['wc-ajax'])? $_REQUEST['wc-ajax']: false;
632
  if(!$is_ajax || in_array($wc_ajax, array('apply_coupon'))){
633
  echo "<style>".$styles."</style>";
634
  }
i18n/languages/woo-discount-rules.pot CHANGED
@@ -75,7 +75,7 @@ msgstr ""
75
  msgid "License key check : Passed."
76
  msgstr ""
77
 
78
- #: helper/purchase.php:178 view/settings.php:61
79
  msgid "License key seems to be Invalid. Please enter a valid license key"
80
  msgstr ""
81
 
@@ -95,12 +95,13 @@ msgstr ""
95
  msgid "Custom Shipping Method for Woocommerce Discount Rules"
96
  msgstr ""
97
 
98
- #: includes/advanced/free_shipping_method.php:68 view/settings.php:420
99
  msgid "Free Shipping"
100
  msgstr ""
101
 
102
  #: includes/advanced/free_shipping_method.php:73 includes/discount-base.php:874
103
- #: view/cart-rules.php:128 view/pricing-rules.php:156 view/settings.php:440
 
104
  msgid "Enable"
105
  msgstr ""
106
 
@@ -108,7 +109,7 @@ msgstr ""
108
  msgid "Enable this shipping."
109
  msgstr ""
110
 
111
- #: includes/advanced/free_shipping_method.php:80 view/settings.php:455
112
  msgid "Title"
113
  msgstr ""
114
 
@@ -528,9 +529,9 @@ msgstr ""
528
  msgid "In each category"
529
  msgstr ""
530
 
531
- #: includes/discount-base.php:916 view/settings.php:178 view/settings.php:197
532
- #: view/settings.php:216 view/settings.php:252 view/settings.php:270
533
- #: view/settings.php:288
534
  msgid "Show"
535
  msgstr ""
536
 
@@ -550,100 +551,95 @@ msgstr ""
550
  msgid "Are you sure to remove the selected rules"
551
  msgstr ""
552
 
553
- #: includes/pricing-rules.php:2455 view/view-pricing-rules.php:505
554
  msgid "Buy"
555
  msgstr ""
556
 
557
- #: includes/pricing-rules.php:2459
558
  msgid " less than or equal to "
559
  msgstr ""
560
 
561
- #: includes/pricing-rules.php:2459 includes/pricing-rules.php:2465
562
  msgid " Quantity"
563
  msgstr ""
564
 
565
- #: includes/pricing-rules.php:2462
566
  msgid " Quantity "
567
  msgstr ""
568
 
569
- #: includes/pricing-rules.php:2469
570
  msgid " or more Quantity"
571
  msgstr ""
572
 
573
- #: includes/pricing-rules.php:2478
574
  msgid " any "
575
  msgstr ""
576
 
577
- #: includes/pricing-rules.php:2478
578
  msgid " products from "
579
  msgstr ""
580
 
581
- #: includes/pricing-rules.php:2485
582
  msgid " in each products"
583
  msgstr ""
584
 
585
- #: includes/pricing-rules.php:2497
586
  msgid " and get discount in "
587
  msgstr ""
588
 
589
- #: includes/pricing-rules.php:2500
590
  msgid " first "
591
  msgstr ""
592
 
593
- #: includes/pricing-rules.php:2502 includes/pricing-rules.php:2506
594
  msgid " quantity of product(s) - "
595
  msgstr ""
596
 
597
- #: includes/pricing-rules.php:2504
598
  msgid " after first "
599
  msgstr ""
600
 
601
- #: includes/pricing-rules.php:2522
602
  msgid "Category(ies) "
603
  msgstr ""
604
 
605
- #: includes/pricing-rules.php:2588
606
  msgid "Get "
607
  msgstr ""
608
 
609
- #: includes/pricing-rules.php:2590
610
  #, php-format
611
  msgid "% discount in "
612
  msgstr ""
613
 
614
- #: includes/pricing-rules.php:2593
615
  msgid "same product"
616
  msgstr ""
617
 
618
- #: includes/pricing-rules.php:2595
619
  msgid "any cheapest one from cart"
620
  msgstr ""
621
 
622
- #: includes/pricing-rules.php:2598
623
  msgid "any cheapest one of "
624
  msgstr ""
625
 
626
- #: includes/pricing-rules.php:2603
627
  msgid " quantity of any "
628
  msgstr ""
629
 
630
- #: includes/pricing-rules.php:2605
631
  msgid " cheapest item "
632
  msgstr ""
633
 
634
- #: includes/pricing-rules.php:2608
635
  msgid " quantity of cheapest item "
636
  msgstr ""
637
 
638
- #: includes/pricing-rules.php:2612
639
  msgid "from the category "
640
  msgstr ""
641
 
642
- #: loader.php:373
643
- #, php-format
644
- msgid "Discount applied: %s"
645
- msgstr ""
646
-
647
  #: view/cart-rules.php:47
648
  msgid "Cart Rules"
649
  msgstr ""
@@ -837,208 +833,221 @@ msgstr ""
837
  msgid "Performance"
838
  msgstr ""
839
 
840
- #: view/settings.php:36
 
 
 
 
841
  msgid "General Settings"
842
  msgstr ""
843
 
844
- #: view/settings.php:43
845
  msgid "License Key :"
846
  msgstr ""
847
 
848
- #: view/settings.php:49
849
  msgid "Your Unique License Key"
850
  msgstr ""
851
 
852
- #: view/settings.php:50
853
  msgid "Validate Key"
854
  msgstr ""
855
 
856
- #: view/settings.php:77
857
  msgid "Enable Bootstrap"
858
  msgstr ""
859
 
860
- #: view/settings.php:82 view/settings.php:94 view/settings.php:106
861
- #: view/settings.php:119 view/settings.php:304 view/settings.php:316
862
- #: view/settings.php:502
863
  msgid "Yes"
864
  msgstr ""
865
 
866
- #: view/settings.php:83 view/settings.php:95 view/settings.php:107
867
- #: view/settings.php:120 view/settings.php:305 view/settings.php:317
868
- #: view/settings.php:503 view/view-cart-rules.php:526
869
  #: view/view-pricing-rules.php:354
870
  msgid "No"
871
  msgstr ""
872
 
873
- #: view/settings.php:89
874
  msgid "Force refresh the cart widget while add and remove item to cart"
875
  msgstr ""
876
 
877
- #: view/settings.php:101
878
  msgid "Disable the rules while have coupon(Third party) in cart"
879
  msgstr ""
880
 
881
- #: view/settings.php:114
882
  msgid ""
883
  "Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a "
884
  "coupon used with discount rule conditions"
885
  msgstr ""
886
 
887
- #: view/settings.php:131
888
  msgid "Price rules settings"
889
  msgstr ""
890
 
891
- #: view/settings.php:139
892
  msgid "Rule Setup for Price:"
893
  msgstr ""
894
 
895
- #: view/settings.php:145 view/settings.php:353
896
  msgid "Apply first matched rule"
897
  msgstr ""
898
 
899
- #: view/settings.php:151 view/settings.php:153 view/settings.php:359
900
- #: view/settings.php:361
901
  msgid "Apply all matched rules"
902
  msgstr ""
903
 
904
- #: view/settings.php:160 view/settings.php:162 view/settings.php:368
905
- #: view/settings.php:370
906
  msgid "Apply biggest discount"
907
  msgstr ""
908
 
909
- #: view/settings.php:172
910
  msgid "Show Price discount on product page :"
911
  msgstr ""
912
 
913
- #: view/settings.php:181 view/settings.php:200 view/settings.php:219
914
- #: view/settings.php:255 view/settings.php:273 view/settings.php:291
915
  msgid "Don't Show"
916
  msgstr ""
917
 
918
- #: view/settings.php:184 view/settings.php:203
919
  msgid "It displays only if any rule matches"
920
  msgstr ""
921
 
922
- #: view/settings.php:191
923
  msgid "Show Sale tag on product page :"
924
  msgstr ""
925
 
926
- #: view/settings.php:210
927
  msgid "Discount Table :"
928
  msgstr ""
929
 
930
- #: view/settings.php:228
931
  msgid "Table placement:"
932
  msgstr ""
933
 
934
- #: view/settings.php:234
935
  msgid "Before cart form"
936
  msgstr ""
937
 
938
- #: view/settings.php:237
939
  msgid "After cart form"
940
  msgstr ""
941
 
942
- #: view/settings.php:246
943
  msgid "Show column title on table :"
944
  msgstr ""
945
 
946
- #: view/settings.php:264
947
  msgid "Show column discount range on table :"
948
  msgstr ""
949
 
950
- #: view/settings.php:282
951
  msgid "Show column discount on table :"
952
  msgstr ""
953
 
954
- #: view/settings.php:299
955
  msgid "Show strikeout discount in cart item"
956
  msgstr ""
957
 
958
- #: view/settings.php:311
959
  msgid "Auto add free product on coupon applied (For coupon based rules)"
960
  msgstr ""
961
 
962
- #: view/settings.php:327
963
  msgid "Cart rules settings"
964
  msgstr ""
965
 
966
- #: view/settings.php:334
967
  msgid "Coupon Name to be displayed :"
968
  msgstr ""
969
 
970
- #: view/settings.php:340
971
  msgid "Discount Coupon Name"
972
  msgstr ""
973
 
974
- #: view/settings.php:347
975
  msgid "Rule Setup for Cart:"
976
  msgstr ""
977
 
978
- #: view/settings.php:379
979
  msgid "Enable free shipping option"
980
  msgstr ""
981
 
982
- #: view/settings.php:386 view/view-pricing-rules.php:256
983
  #: view/view-pricing-rules.php:313 view/view-pricing-rules.php:366
984
  #: view/view-pricing-rules.php:412 view/view-pricing-rules.php:441
985
  msgid "Supported in PRO version"
986
  msgstr ""
987
 
988
- #: view/settings.php:389 view/settings.php:396 view/settings.php:437
 
989
  msgid "Disabled"
990
  msgstr ""
991
 
992
- #: view/settings.php:399
993
  msgid "Use Woocommerce free shipping"
994
  msgstr ""
995
 
996
- #: view/settings.php:402
997
  msgid "Use Woo-Discount free shipping"
998
  msgstr ""
999
 
1000
- #: view/settings.php:416
1001
  msgid "Free shipping text to be displayed"
1002
  msgstr ""
1003
 
1004
- #: view/settings.php:423
1005
  msgid "Free Shipping title"
1006
  msgstr ""
1007
 
1008
- #: view/settings.php:430
1009
- msgid "Message on apply discount in cart"
1010
  msgstr ""
1011
 
1012
- #: view/settings.php:448
1013
- msgid "Content to display in message"
1014
  msgstr ""
1015
 
1016
- #: view/settings.php:458
1017
- msgid "Description"
1018
  msgstr ""
1019
 
1020
- #: view/settings.php:461
1021
- msgid "Title and description"
1022
  msgstr ""
1023
 
1024
- #: view/settings.php:469
1025
- msgid "Draft"
1026
  msgstr ""
1027
 
1028
- #: view/settings.php:479
1029
- msgid "Exclude Draft products in product select box."
1030
  msgstr ""
1031
 
1032
- #: view/settings.php:489
1033
- msgid "Performance settings"
1034
  msgstr ""
1035
 
1036
- #: view/settings.php:497
1037
- msgid "Enable cache for variable products table content"
1038
  msgstr ""
1039
 
1040
- #: view/settings.php:509 view/settings.php:513
1041
- msgid "Clear cache"
 
 
 
 
 
 
 
 
1042
  msgstr ""
1043
 
1044
  #: view/template/discount-table.php:22
75
  msgid "License key check : Passed."
76
  msgstr ""
77
 
78
+ #: helper/purchase.php:178 view/settings.php:62
79
  msgid "License key seems to be Invalid. Please enter a valid license key"
80
  msgstr ""
81
 
95
  msgid "Custom Shipping Method for Woocommerce Discount Rules"
96
  msgstr ""
97
 
98
+ #: includes/advanced/free_shipping_method.php:68 view/settings.php:421
99
  msgid "Free Shipping"
100
  msgstr ""
101
 
102
  #: includes/advanced/free_shipping_method.php:73 includes/discount-base.php:874
103
+ #: view/cart-rules.php:128 view/pricing-rules.php:156 view/settings.php:502
104
+ #: view/settings.php:537
105
  msgid "Enable"
106
  msgstr ""
107
 
109
  msgid "Enable this shipping."
110
  msgstr ""
111
 
112
+ #: includes/advanced/free_shipping_method.php:80
113
  msgid "Title"
114
  msgstr ""
115
 
529
  msgid "In each category"
530
  msgstr ""
531
 
532
+ #: includes/discount-base.php:916 view/settings.php:179 view/settings.php:198
533
+ #: view/settings.php:217 view/settings.php:253 view/settings.php:271
534
+ #: view/settings.php:289
535
  msgid "Show"
536
  msgstr ""
537
 
551
  msgid "Are you sure to remove the selected rules"
552
  msgstr ""
553
 
554
+ #: includes/pricing-rules.php:2458 view/view-pricing-rules.php:505
555
  msgid "Buy"
556
  msgstr ""
557
 
558
+ #: includes/pricing-rules.php:2462
559
  msgid " less than or equal to "
560
  msgstr ""
561
 
562
+ #: includes/pricing-rules.php:2462 includes/pricing-rules.php:2468
563
  msgid " Quantity"
564
  msgstr ""
565
 
566
+ #: includes/pricing-rules.php:2465
567
  msgid " Quantity "
568
  msgstr ""
569
 
570
+ #: includes/pricing-rules.php:2472
571
  msgid " or more Quantity"
572
  msgstr ""
573
 
574
+ #: includes/pricing-rules.php:2481
575
  msgid " any "
576
  msgstr ""
577
 
578
+ #: includes/pricing-rules.php:2481
579
  msgid " products from "
580
  msgstr ""
581
 
582
+ #: includes/pricing-rules.php:2488
583
  msgid " in each products"
584
  msgstr ""
585
 
586
+ #: includes/pricing-rules.php:2500
587
  msgid " and get discount in "
588
  msgstr ""
589
 
590
+ #: includes/pricing-rules.php:2503
591
  msgid " first "
592
  msgstr ""
593
 
594
+ #: includes/pricing-rules.php:2505 includes/pricing-rules.php:2509
595
  msgid " quantity of product(s) - "
596
  msgstr ""
597
 
598
+ #: includes/pricing-rules.php:2507
599
  msgid " after first "
600
  msgstr ""
601
 
602
+ #: includes/pricing-rules.php:2525
603
  msgid "Category(ies) "
604
  msgstr ""
605
 
606
+ #: includes/pricing-rules.php:2591
607
  msgid "Get "
608
  msgstr ""
609
 
610
+ #: includes/pricing-rules.php:2593
611
  #, php-format
612
  msgid "% discount in "
613
  msgstr ""
614
 
615
+ #: includes/pricing-rules.php:2596
616
  msgid "same product"
617
  msgstr ""
618
 
619
+ #: includes/pricing-rules.php:2598
620
  msgid "any cheapest one from cart"
621
  msgstr ""
622
 
623
+ #: includes/pricing-rules.php:2601
624
  msgid "any cheapest one of "
625
  msgstr ""
626
 
627
+ #: includes/pricing-rules.php:2606
628
  msgid " quantity of any "
629
  msgstr ""
630
 
631
+ #: includes/pricing-rules.php:2608
632
  msgid " cheapest item "
633
  msgstr ""
634
 
635
+ #: includes/pricing-rules.php:2611
636
  msgid " quantity of cheapest item "
637
  msgstr ""
638
 
639
+ #: includes/pricing-rules.php:2615
640
  msgid "from the category "
641
  msgstr ""
642
 
 
 
 
 
 
643
  #: view/cart-rules.php:47
644
  msgid "Cart Rules"
645
  msgstr ""
833
  msgid "Performance"
834
  msgstr ""
835
 
836
+ #: view/settings.php:30
837
+ msgid "Promotion"
838
+ msgstr ""
839
+
840
+ #: view/settings.php:37
841
  msgid "General Settings"
842
  msgstr ""
843
 
844
+ #: view/settings.php:44
845
  msgid "License Key :"
846
  msgstr ""
847
 
848
+ #: view/settings.php:50
849
  msgid "Your Unique License Key"
850
  msgstr ""
851
 
852
+ #: view/settings.php:51
853
  msgid "Validate Key"
854
  msgstr ""
855
 
856
+ #: view/settings.php:78
857
  msgid "Enable Bootstrap"
858
  msgstr ""
859
 
860
+ #: view/settings.php:83 view/settings.php:95 view/settings.php:107
861
+ #: view/settings.php:120 view/settings.php:305 view/settings.php:317
862
+ #: view/settings.php:464
863
  msgid "Yes"
864
  msgstr ""
865
 
866
+ #: view/settings.php:84 view/settings.php:96 view/settings.php:108
867
+ #: view/settings.php:121 view/settings.php:306 view/settings.php:318
868
+ #: view/settings.php:465 view/view-cart-rules.php:526
869
  #: view/view-pricing-rules.php:354
870
  msgid "No"
871
  msgstr ""
872
 
873
+ #: view/settings.php:90
874
  msgid "Force refresh the cart widget while add and remove item to cart"
875
  msgstr ""
876
 
877
+ #: view/settings.php:102
878
  msgid "Disable the rules while have coupon(Third party) in cart"
879
  msgstr ""
880
 
881
+ #: view/settings.php:115
882
  msgid ""
883
  "Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a "
884
  "coupon used with discount rule conditions"
885
  msgstr ""
886
 
887
+ #: view/settings.php:132
888
  msgid "Price rules settings"
889
  msgstr ""
890
 
891
+ #: view/settings.php:140
892
  msgid "Rule Setup for Price:"
893
  msgstr ""
894
 
895
+ #: view/settings.php:146 view/settings.php:354
896
  msgid "Apply first matched rule"
897
  msgstr ""
898
 
899
+ #: view/settings.php:152 view/settings.php:154 view/settings.php:360
900
+ #: view/settings.php:362
901
  msgid "Apply all matched rules"
902
  msgstr ""
903
 
904
+ #: view/settings.php:161 view/settings.php:163 view/settings.php:369
905
+ #: view/settings.php:371
906
  msgid "Apply biggest discount"
907
  msgstr ""
908
 
909
+ #: view/settings.php:173
910
  msgid "Show Price discount on product page :"
911
  msgstr ""
912
 
913
+ #: view/settings.php:182 view/settings.php:201 view/settings.php:220
914
+ #: view/settings.php:256 view/settings.php:274 view/settings.php:292
915
  msgid "Don't Show"
916
  msgstr ""
917
 
918
+ #: view/settings.php:185 view/settings.php:204
919
  msgid "It displays only if any rule matches"
920
  msgstr ""
921
 
922
+ #: view/settings.php:192
923
  msgid "Show Sale tag on product page :"
924
  msgstr ""
925
 
926
+ #: view/settings.php:211
927
  msgid "Discount Table :"
928
  msgstr ""
929
 
930
+ #: view/settings.php:229
931
  msgid "Table placement:"
932
  msgstr ""
933
 
934
+ #: view/settings.php:235
935
  msgid "Before cart form"
936
  msgstr ""
937
 
938
+ #: view/settings.php:238
939
  msgid "After cart form"
940
  msgstr ""
941
 
942
+ #: view/settings.php:247
943
  msgid "Show column title on table :"
944
  msgstr ""
945
 
946
+ #: view/settings.php:265
947
  msgid "Show column discount range on table :"
948
  msgstr ""
949
 
950
+ #: view/settings.php:283
951
  msgid "Show column discount on table :"
952
  msgstr ""
953
 
954
+ #: view/settings.php:300
955
  msgid "Show strikeout discount in cart item"
956
  msgstr ""
957
 
958
+ #: view/settings.php:312
959
  msgid "Auto add free product on coupon applied (For coupon based rules)"
960
  msgstr ""
961
 
962
+ #: view/settings.php:328
963
  msgid "Cart rules settings"
964
  msgstr ""
965
 
966
+ #: view/settings.php:335
967
  msgid "Coupon Name to be displayed :"
968
  msgstr ""
969
 
970
+ #: view/settings.php:341
971
  msgid "Discount Coupon Name"
972
  msgstr ""
973
 
974
+ #: view/settings.php:348
975
  msgid "Rule Setup for Cart:"
976
  msgstr ""
977
 
978
+ #: view/settings.php:380
979
  msgid "Enable free shipping option"
980
  msgstr ""
981
 
982
+ #: view/settings.php:387 view/view-pricing-rules.php:256
983
  #: view/view-pricing-rules.php:313 view/view-pricing-rules.php:366
984
  #: view/view-pricing-rules.php:412 view/view-pricing-rules.php:441
985
  msgid "Supported in PRO version"
986
  msgstr ""
987
 
988
+ #: view/settings.php:390 view/settings.php:397 view/settings.php:499
989
+ #: view/settings.php:534
990
  msgid "Disabled"
991
  msgstr ""
992
 
993
+ #: view/settings.php:400
994
  msgid "Use Woocommerce free shipping"
995
  msgstr ""
996
 
997
+ #: view/settings.php:403
998
  msgid "Use Woo-Discount free shipping"
999
  msgstr ""
1000
 
1001
+ #: view/settings.php:417
1002
  msgid "Free shipping text to be displayed"
1003
  msgstr ""
1004
 
1005
+ #: view/settings.php:424
1006
  msgid "Free Shipping title"
1007
  msgstr ""
1008
 
1009
+ #: view/settings.php:431
1010
+ msgid "Draft"
1011
  msgstr ""
1012
 
1013
+ #: view/settings.php:441
1014
+ msgid "Exclude Draft products in product select box."
1015
  msgstr ""
1016
 
1017
+ #: view/settings.php:451
1018
+ msgid "Performance settings"
1019
  msgstr ""
1020
 
1021
+ #: view/settings.php:459
1022
+ msgid "Enable cache for variable products table content"
1023
  msgstr ""
1024
 
1025
+ #: view/settings.php:471 view/settings.php:475
1026
+ msgid "Clear cache"
1027
  msgstr ""
1028
 
1029
+ #: view/settings.php:485
1030
+ msgid "Promotion settings"
1031
  msgstr ""
1032
 
1033
+ #: view/settings.php:492
1034
+ msgid "Message on apply price rules in cart"
1035
  msgstr ""
1036
 
1037
+ #: view/settings.php:510 view/settings.php:545
1038
+ msgid "Text"
1039
  msgstr ""
1040
 
1041
+ #: view/settings.php:518 view/settings.php:553
1042
+ msgid "{{title}} -> displays title"
1043
+ msgstr ""
1044
+
1045
+ #: view/settings.php:519 view/settings.php:554
1046
+ msgid "{{description}} -> displays description"
1047
+ msgstr ""
1048
+
1049
+ #: view/settings.php:527
1050
+ msgid "Message on apply cart rules in cart"
1051
  msgstr ""
1052
 
1053
  #: view/template/discount-table.php:22
includes/pricing-rules.php CHANGED
@@ -40,6 +40,9 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
40
  public $matched_sets;
41
  public $matched_sets_for_product;
42
 
 
 
 
43
  /**
44
  * @var
45
  */
@@ -2933,6 +2936,18 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2933
  // $woocommerce->cart->cart_contents[$item]['data']->price = $amount;
2934
  FlycartWoocommerceProduct::set_price($product, $amount);
2935
  $product->woo_discount_rules_applied = 1;
 
 
 
 
 
 
 
 
 
 
 
 
2936
  }
2937
 
2938
  protected function hasToSplitTheStrikeOutInCart($cart_item, $additional_details){
@@ -3203,7 +3218,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3203
  }
3204
 
3205
  public function checkForHighestVariantIfExists($product, $price_to_display, &$show_original){
3206
- $display_only_lowest_price = 0;
3207
  $tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
3208
  $child_prices = array();
3209
 
40
  public $matched_sets;
41
  public $matched_sets_for_product;
42
 
43
+ public static $matched_discounts = array();
44
+ public static $applied_discount_rules = array();
45
+
46
  /**
47
  * @var
48
  */
2936
  // $woocommerce->cart->cart_contents[$item]['data']->price = $amount;
2937
  FlycartWoocommerceProduct::set_price($product, $amount);
2938
  $product->woo_discount_rules_applied = 1;
2939
+
2940
+ // To get the applied discount in cart
2941
+ if(isset($this->matched_sets[$item])){
2942
+ self::$matched_discounts[$item] = $this->matched_sets[$item];
2943
+ foreach (self::$matched_discounts[$item] as $matched_discounts){
2944
+ $rule_order_id = $matched_discounts['rule_order'];
2945
+ if(isset($this->rule_sets[$rule_order_id])){
2946
+ self::$applied_discount_rules[$rule_order_id] = $this->rule_sets[$rule_order_id];
2947
+ }
2948
+ }
2949
+
2950
+ }
2951
  }
2952
 
2953
  protected function hasToSplitTheStrikeOutInCart($cart_item, $additional_details){
3218
  }
3219
 
3220
  public function checkForHighestVariantIfExists($product, $price_to_display, &$show_original){
3221
+ $display_only_lowest_price = apply_filters('woo_discount_rules_load_minimum_product_variant_price', false, $product);
3222
  $tax_display_mode = get_option( 'woocommerce_tax_display_shop' );
3223
  $child_prices = array();
3224
 
loader.php CHANGED
@@ -318,7 +318,9 @@ if(!class_exists('FlycartWooDiscountRules')){
318
  add_action('wp_ajax_nopriv_loadWooDiscountedDiscountTable', array($this->pricingRules, 'getWooDiscountedPriceTableForVariant'));
319
  add_action( 'wp_enqueue_scripts', array($this, 'includeScriptAndStyles') );
320
 
 
321
  add_action('woocommerce_before_checkout_form', array($this, 'displayAppliedDiscountMessagesForCartRules'));
 
322
  add_action('woocommerce_before_cart', array($this, 'displayAppliedDiscountMessagesForCartRules'));
323
  }
324
 
@@ -357,27 +359,43 @@ if(!class_exists('FlycartWooDiscountRules')){
357
  if(!empty($matched_discounts['name'])){
358
  foreach ($matched_discounts['name'] as $key => $matched_discount_name){
359
  $rule_sets = $this->cart_rules->rule_sets;
360
- $title = $rule_title = $matched_discount_name;
361
  $rule_description = '';
362
  if(isset($rule_sets[$key])){
363
- $message_on_apply_cart_discount_type = $this->discountBase->getConfigData('message_on_apply_cart_discount_type', 'title');
364
  if(!empty($rule_sets[$key]['descr'])) $rule_description = $rule_sets[$key]['descr'];
365
- if($message_on_apply_cart_discount_type == 'title'){
366
- $title = $matched_discount_name;
367
- } else if($message_on_apply_cart_discount_type == 'description'){
368
- if(!empty($rule_sets[$key]['descr'])) $title = $rule_sets[$key]['descr'];
369
- } else {
370
- if(!empty($rule_sets[$key]['descr'])) $title .= "<p>".$rule_sets[$key]['descr']."</p>";
371
- }
372
  }
373
- $message = sprintf(__('Discount applied: %s', 'woo-discount-rules'), $title);
374
- wc_print_notice( apply_filters('woo_discount_rules_message_on_apply_cart_rules', $message, $rule_title, $rule_description), 'success' );
 
 
 
375
  }
376
  }
377
  }
378
  }
379
  }
380
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
381
  }
382
  }
383
 
318
  add_action('wp_ajax_nopriv_loadWooDiscountedDiscountTable', array($this->pricingRules, 'getWooDiscountedPriceTableForVariant'));
319
  add_action( 'wp_enqueue_scripts', array($this, 'includeScriptAndStyles') );
320
 
321
+ add_action('woocommerce_before_checkout_form', array($this, 'displayAppliedDiscountMessagesForPriceRules'));
322
  add_action('woocommerce_before_checkout_form', array($this, 'displayAppliedDiscountMessagesForCartRules'));
323
+ add_action('woocommerce_before_cart', array($this, 'displayAppliedDiscountMessagesForPriceRules'));
324
  add_action('woocommerce_before_cart', array($this, 'displayAppliedDiscountMessagesForCartRules'));
325
  }
326
 
359
  if(!empty($matched_discounts['name'])){
360
  foreach ($matched_discounts['name'] as $key => $matched_discount_name){
361
  $rule_sets = $this->cart_rules->rule_sets;
362
+ $rule_title = $matched_discount_name;
363
  $rule_description = '';
364
  if(isset($rule_sets[$key])){
 
365
  if(!empty($rule_sets[$key]['descr'])) $rule_description = $rule_sets[$key]['descr'];
 
 
 
 
 
 
 
366
  }
367
+ $message_on_apply_cart_discount_text = $this->discountBase->getConfigData('message_on_apply_cart_discount_text', 'Discount <strong>"{{title}}"</strong> has been applied to your cart.');
368
+ $message_on_apply_cart_discount_text = __($message_on_apply_cart_discount_text, 'woo-discount-rules');
369
+ $message_on_apply_cart_discount_text = str_replace('{{title}}', $rule_title, $message_on_apply_cart_discount_text);
370
+ $message_on_apply_cart_discount_text = str_replace('{{description}}', $rule_description, $message_on_apply_cart_discount_text);
371
+ wc_print_notice( apply_filters('woo_discount_rules_message_on_apply_cart_rules', $message_on_apply_cart_discount_text, $rule_sets), 'success' );
372
  }
373
  }
374
  }
375
  }
376
  }
377
  }
378
+
379
+ /**
380
+ * To display applied discount messages for cart rules
381
+ * */
382
+ public function displayAppliedDiscountMessagesForPriceRules(){
383
+ $message_on_apply_price_discount = $this->discountBase->getConfigData('message_on_apply_price_discount', 'no');
384
+ if($message_on_apply_price_discount == "yes"){
385
+ $applied_discount_rules = FlycartWooDiscountRulesPricingRules::$applied_discount_rules;
386
+ if(!empty($applied_discount_rules)){
387
+ foreach ($applied_discount_rules as $key => $matched_discount_rules){
388
+ $rule_title = $matched_discount_rules['name'];
389
+ $rule_description = $matched_discount_rules['descr'];
390
+ $message_on_apply_cart_discount_text = $this->discountBase->getConfigData('message_on_apply_price_discount_text', 'Discount <strong>"{{title}}"</strong> has been applied to your cart.');
391
+ $message_on_apply_cart_discount_text = __($message_on_apply_cart_discount_text, 'woo-discount-rules');
392
+ $message_on_apply_cart_discount_text = str_replace('{{title}}', $rule_title, $message_on_apply_cart_discount_text);
393
+ $message_on_apply_cart_discount_text = str_replace('{{description}}', $rule_description, $message_on_apply_cart_discount_text);
394
+ wc_print_notice( apply_filters('woo_discount_rules_message_on_apply_price_rules', $message_on_apply_cart_discount_text, $matched_discount_rules), 'success' );
395
+ }
396
+ }
397
+ }
398
+ }
399
  }
400
  }
401
 
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.16
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.16 - 08/10/18 =
312
  * Feature - Option to display message in cart while apply discount
313
  * Feature - Option to change the placement of discount table before / after add to cart button
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.17
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.17 - 10/10/18 =
312
+ * Feature - Option to display message in cart while apply price rules
313
+ * Improvement - Event apply_filters('woo_discount_rules_load_minimum_product_variant_price', false, $product) to handle variant strikeout price
314
+ * Improvement - Option to display Message on apply cart rules in cart
315
+ * Fix - Warning: on coupon applied
316
+
317
  = 1.6.16 - 08/10/18 =
318
  * Feature - Option to display message in cart while apply discount
319
  * Feature - Option to change the placement of discount table before / after add to cart button
view/settings.php CHANGED
@@ -27,6 +27,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
27
  <li><a data-toggle="tab" href="#wdr_s_price_rules"><?php esc_html_e('Price rules', 'woo-discount-rules'); ?></a></li>
28
  <li><a data-toggle="tab" href="#wdr_s_cart_rules"><?php esc_html_e('Cart rules', 'woo-discount-rules'); ?></a></li>
29
  <li><a data-toggle="tab" href="#wdr_s_performance"><?php esc_html_e('Performance', 'woo-discount-rules'); ?></a></li>
 
30
  </ul>
31
 
32
  <div class="tab-content">
@@ -424,45 +425,6 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
424
  </div>
425
  </div>
426
  <?php } ?>
427
- <div class="row form-group">
428
- <div class="col-md-2">
429
- <label>
430
- <?php esc_html_e('Message on apply discount in cart', 'woo-discount-rules'); ?>
431
- </label>
432
- </div>
433
- <?php $data['message_on_apply_cart_discount'] = (isset($data['message_on_apply_cart_discount']) ? $data['message_on_apply_cart_discount'] : "no"); ?>
434
- <div class="col-md-6">
435
- <select class="selectpicker" name="message_on_apply_cart_discount" id="message_on_apply_cart_discount">
436
- <option <?php if ($data['message_on_apply_cart_discount'] == "no") { ?> selected=selected <?php } ?>
437
- value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
438
- </option>
439
- <option <?php if ($data['message_on_apply_cart_discount'] == "yes") { ?> selected=selected <?php } ?>
440
- value="yes"><?php esc_html_e('Enable', 'woo-discount-rules'); ?>
441
- </option>
442
- </select>
443
- </div>
444
- </div>
445
- <div class="row form-group message_on_apply_cart_discount_options">
446
- <div class="col-md-2">
447
- <label>
448
- <?php esc_html_e('Content to display in message', 'woo-discount-rules'); ?>
449
- </label>
450
- </div>
451
- <?php $data['message_on_apply_cart_discount_type'] = (isset($data['message_on_apply_cart_discount_type']) ? $data['message_on_apply_cart_discount_type'] : "title"); ?>
452
- <div class="col-md-6">
453
- <select class="selectpicker" name="message_on_apply_cart_discount_type" id="message_on_apply_cart_discount_type">
454
- <option <?php if ($data['message_on_apply_cart_discount_type'] == "title") { ?> selected=selected <?php } ?>
455
- value="title"><?php esc_html_e('Title', 'woo-discount-rules'); ?>
456
- </option>
457
- <option <?php if ($data['message_on_apply_cart_discount_type'] == "description") { ?> selected=selected <?php } ?>
458
- value="description"><?php esc_html_e('Description', 'woo-discount-rules'); ?>
459
- </option>
460
- <option <?php if ($data['message_on_apply_cart_discount_type'] == "title_and_description") { ?> selected=selected <?php } ?>
461
- value="title_and_description"><?php esc_html_e('Title and description', 'woo-discount-rules'); ?>
462
- </option>
463
- </select>
464
- </div>
465
- </div>
466
  <div class="row form-group" style="display: none"><!-- Hide this because it is not required after v1.4.36 -->
467
  <div class="col-md-2">
468
  <label>
@@ -515,6 +477,87 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
515
  </div>
516
  </div>
517
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  </div>
519
  </div>
520
  <input type="hidden" id="ajax_path" value="<?php echo admin_url('admin-ajax.php') ?>">
27
  <li><a data-toggle="tab" href="#wdr_s_price_rules"><?php esc_html_e('Price rules', 'woo-discount-rules'); ?></a></li>
28
  <li><a data-toggle="tab" href="#wdr_s_cart_rules"><?php esc_html_e('Cart rules', 'woo-discount-rules'); ?></a></li>
29
  <li><a data-toggle="tab" href="#wdr_s_performance"><?php esc_html_e('Performance', 'woo-discount-rules'); ?></a></li>
30
+ <li><a data-toggle="tab" href="#wdr_s_promotion"><?php esc_html_e('Promotion', 'woo-discount-rules'); ?></a></li>
31
  </ul>
32
 
33
  <div class="tab-content">
425
  </div>
426
  </div>
427
  <?php } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
428
  <div class="row form-group" style="display: none"><!-- Hide this because it is not required after v1.4.36 -->
429
  <div class="col-md-2">
430
  <label>
477
  </div>
478
  </div>
479
  </div>
480
+ <div id="wdr_s_promotion" class="tab-pane fade">
481
+ <div class="">
482
+ <div class="row form-group">
483
+ <div class="col-md-12">
484
+ <br/>
485
+ <h4><?php esc_html_e('Promotion settings', 'woo-discount-rules'); ?></h4>
486
+ <hr>
487
+ </div>
488
+ </div>
489
+ <div class="row form-group">
490
+ <div class="col-md-2">
491
+ <label>
492
+ <?php esc_html_e('Message on apply price rules in cart', 'woo-discount-rules'); ?>
493
+ </label>
494
+ </div>
495
+ <?php $data['message_on_apply_price_discount'] = (isset($data['message_on_apply_price_discount']) ? $data['message_on_apply_price_discount'] : "no"); ?>
496
+ <div class="col-md-6">
497
+ <select class="selectpicker" name="message_on_apply_price_discount" id="message_on_apply_price_discount">
498
+ <option <?php if ($data['message_on_apply_price_discount'] == "no") { ?> selected=selected <?php } ?>
499
+ value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
500
+ </option>
501
+ <option <?php if ($data['message_on_apply_price_discount'] == "yes") { ?> selected=selected <?php } ?>
502
+ value="yes"><?php esc_html_e('Enable', 'woo-discount-rules'); ?>
503
+ </option>
504
+ </select>
505
+ </div>
506
+ </div>
507
+ <div class="row form-group message_on_apply_price_discount_options">
508
+ <div class="col-md-2">
509
+ <label>
510
+ <?php esc_html_e('Text', 'woo-discount-rules'); ?>
511
+ </label>
512
+ </div>
513
+ <?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."); ?>
514
+ <div class="col-md-6">
515
+ <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>
516
+ <div class="wdr_desc_text_con">
517
+ <span class="wdr_desc_text">
518
+ <?php esc_html_e('{{title}} -> displays title', 'woo-discount-rules'); ?><br>
519
+ <?php esc_html_e('{{description}} -> displays description', 'woo-discount-rules'); ?>
520
+ </span>
521
+ </div>
522
+ </div>
523
+ </div>
524
+ <div class="row form-group">
525
+ <div class="col-md-2">
526
+ <label>
527
+ <?php esc_html_e('Message on apply cart rules in cart', 'woo-discount-rules'); ?>
528
+ </label>
529
+ </div>
530
+ <?php $data['message_on_apply_cart_discount'] = (isset($data['message_on_apply_cart_discount']) ? $data['message_on_apply_cart_discount'] : "no"); ?>
531
+ <div class="col-md-6">
532
+ <select class="selectpicker" name="message_on_apply_cart_discount" id="message_on_apply_cart_discount">
533
+ <option <?php if ($data['message_on_apply_cart_discount'] == "no") { ?> selected=selected <?php } ?>
534
+ value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
535
+ </option>
536
+ <option <?php if ($data['message_on_apply_cart_discount'] == "yes") { ?> selected=selected <?php } ?>
537
+ value="yes"><?php esc_html_e('Enable', 'woo-discount-rules'); ?>
538
+ </option>
539
+ </select>
540
+ </div>
541
+ </div>
542
+ <div class="row form-group message_on_apply_cart_discount_options">
543
+ <div class="col-md-2">
544
+ <label>
545
+ <?php esc_html_e('Text', 'woo-discount-rules'); ?>
546
+ </label>
547
+ </div>
548
+ <?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."); ?>
549
+ <div class="col-md-6">
550
+ <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>
551
+ <div class="wdr_desc_text_con">
552
+ <span class="wdr_desc_text">
553
+ <?php esc_html_e('{{title}} -> displays title', 'woo-discount-rules'); ?><br>
554
+ <?php esc_html_e('{{description}} -> displays description', 'woo-discount-rules'); ?>
555
+ </span>
556
+ </div>
557
+ </div>
558
+ </div>
559
+ </div>
560
+ </div>
561
  </div>
562
  </div>
563
  <input type="hidden" id="ajax_path" value="<?php echo admin_url('admin-ajax.php') ?>">
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.16
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.17
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/