Discount Rules for WooCommerce - Version 1.7.0

Version Description

  • 28/11/18 =
  • Fix - Attribute doesn't worked for imported products
  • Fix - Wrong cart discount while having both the rules and cart rules have category based
  • Fix - Split strikeout doesn't work for few cases
  • Fix - BOGO multiple add(product quantity)
  • Fix - Script issue woocommerce_admin is not defined
  • Fix - Display applied matched rule(messages) only
  • Improvement - Option to disable table header
  • Improvement - Displaying table for attribute based rule even the product is excluded
  • Improvement - Event apply_filters('woo_discount_rules_exclude_woocommerce_bundled_item', true, $cartItem);
  • Improvement - Display status text in listing page
  • Improvement - Load coupon from woocommerce for selecting instead of entering manually
  • Improvement - Content improvements
  • Feature - You saved text in cart and order page when rule applied
  • Feature - Advance table format field in price rule
Download this release

Release Info

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

Code changes from version 1.6.19 to 1.7.0

assets/css/style.css CHANGED
@@ -160,7 +160,7 @@
160
  display: inline-block;
161
  margin-top: 10px;
162
  }
163
- .message_on_apply_discount_textarea{
164
  min-width: 500px;
165
  max-width: 100%;
166
  }
@@ -171,4 +171,22 @@
171
  }
172
  div.wdr_hide_important{
173
  display: none !important;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
160
  display: inline-block;
161
  margin-top: 10px;
162
  }
163
+ .message_on_apply_discount_textarea,.display_you_saved_text_value{
164
  min-width: 500px;
165
  max-width: 100%;
166
  }
171
  }
172
  div.wdr_hide_important{
173
  display: none !important;
174
+ }
175
+ .price_rule_display_format{
176
+ width: 100%;
177
+ min-height: 60px;
178
+ }
179
+ .cart_rules_guide_btn{
180
+ margin-bottom: 10px !important;
181
+ }
182
+ span.wdr_block_span{
183
+ display: block;
184
+ }
185
+ .wdr_status_active_text,.wdr_status_disabled_text {
186
+ display: inline-block;
187
+ padding: 5px !important;
188
+ margin-bottom: 0 !important;
189
+ }
190
+ .wdr_invalid{
191
+ border-color: red !important;
192
  }
assets/css/woo_discount_rules.css ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ .wdr_you_saved_con {
2
+ color: green;
3
+ }
4
+ .wdr_order_discount-total{
5
+ margin: 10px 0;
6
+ }
7
+ .wdr_table_content_advance_item{
8
+ margin: 5px 0;
9
+ }
assets/js/app.js CHANGED
@@ -19,6 +19,107 @@ function validateFields(){
19
  return returnValue;
20
  }
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  function trigger_woocommerce_tooltip(){
23
  jQuery( '.tips, .help_tip, .woocommerce-help-tip' ).tipTip( {
24
  'attribute': 'data-tip',
@@ -37,7 +138,7 @@ function trigger_woocommerce_tooltip(){
37
  var pro_suffix = $('#pro_suffix').val();
38
  var is_pro = $('#is_pro').val();
39
  // $(".datepicker").datepicker();
40
- $(".datepicker").datetimepicker({
41
  //format: "dd MM yyyy - hh:ii",
42
  format: "mm/dd/yyyy hh:ii",
43
  autoclose: true,
@@ -61,7 +162,9 @@ function trigger_woocommerce_tooltip(){
61
  $('#savePriceRule').on('click', function (event) {
62
  var validate = validateFields();
63
 
64
- if(validate == false){
 
 
65
  return false;
66
  }
67
  var form = $('#form_price_rule').serialize();
@@ -149,61 +252,95 @@ function trigger_woocommerce_tooltip(){
149
  });
150
  });
151
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
 
153
  // Adding New Discount Range.
154
  $('#addNewDiscountRange').on('click', function () {
155
  var count = $('.discount_rule_list').length + 1;
156
  if (is_pro) {
157
- var form = '<div class="discount_rule_list"> <div class="form-group"><label>'+woo_discount_localization.min_quantity+' <input type="text" name="discount_range[' + count + '][min_qty]" class="form-control" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'"></label>' +
158
- '<label>'+woo_discount_localization.max_quantity+' <input type="text" name="discount_range[' + count + '][max_qty]" class="form-control" value="" placeholder="'+woo_discount_localization.place_holder_ex_50+'"> </label> <label>'+woo_discount_localization.adjustment_type+'<select class="form-control price_discount_type" name="discount_range[' + count + '][discount_type]"> ' +
159
  '<option value="percentage_discount"> '+woo_discount_localization.percentage_discount+' </option> <option value="price_discount">'+woo_discount_localization.price_discount+' </option> <option value="product_discount">'+woo_discount_localization.product_discount+' </option> </select></label> <label><span class="hide-for-product-discount">'+woo_discount_localization.value_text+'</span>' +
160
  '<input type="text" name="discount_range[' + count + '][to_discount]" class="form-control price_discount_amount" value="" placeholder="'+woo_discount_localization.place_holder_ex_50+'"> ';
161
  form += '<div class="price_discount_product_list_con hide">' +
162
  ' '+woo_discount_localization.apply_for+' <select class="selectpicker discount_product_option" name="discount_range['+count+'][discount_product_option]"><option value="all">'+woo_discount_localization.all_selected+'</option><option value="same_product">'+woo_discount_localization.same_product+'</option><option value="any_cheapest">'+woo_discount_localization.any_one_cheapest_from_selected+'</option><option value="any_cheapest_from_all">'+woo_discount_localization.any_one_cheapest_from_all_products+'</option>' +
163
  '<option value="more_than_one_cheapest_from_cat">'+woo_discount_localization.more_than_one_cheapest_from_selected_category+'</option><option value="more_than_one_cheapest">'+woo_discount_localization.more_than_one_cheapest_from_selected+'</option><option value="more_than_one_cheapest_from_all">'+woo_discount_localization.more_than_one_cheapest_from_all+'</option>' +
164
  '</select>';
 
165
  form += '<div class="discount_product_option_bogo_con">';
166
- form += ' <label> '+woo_discount_localization.free_quantity+' <span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.number_of_quantities_in_each_products+'"></span> <input type="text" name="discount_range['+count+'][discount_bogo_qty]" class="form-control" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'" /></label>';
167
  form += '</div>';
168
  form += '<div class="discount_product_option_more_cheapest_con hide">';
169
- form += '<select class="selectpicker discount_product_item_count_type" name="discount_range['+count+'][discount_product_item_type]">';
170
  form += '<option value="dynamic">'+woo_discount_localization.dynamic_item_count+'</option>';
171
  form += '<option value="static">'+woo_discount_localization.fixed_item_count+'</option>';
172
  form += '</select>';
173
- form += '<span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.fixed_item_count_tooltip+'"></span>';
174
- form += ' <label class="discount_product_items_count_field hide"> '+woo_discount_localization.item_count+' <span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.discount_number_of_item_tooltip+'"></span><input type="text" name="discount_range['+count+'][discount_product_items]" class="form-control discount_product_items_count_field hide" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'" /></label>';
175
- form += ' <label> '+woo_discount_localization.item_quantity+' <span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.discount_number_of_each_item_tooltip+'"></span><input type="text" name="discount_range['+count+'][discount_product_qty]" class="form-control" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'" /></label>';
176
  form += '</div>';
177
  form += '<div class="discount_product_option_list_con">';
 
178
  if($('#flycart_wdr_woocommerce_version').val() == 2){
179
- form += ' <input type="hidden" class="wc-product-search" style="min-width: 250px" data-multiple="true" name="discount_range[' + count + '][discount_product][]" data-placeholder="'+woo_discount_localization.place_holder_search_for_products+'" data-action="woocommerce_json_search_products_and_variations" data-selected=""/>';
180
  } else {
181
- form += ' <select class="wc-product-search" multiple="multiple" style="min-width: 250px" name="discount_range[' + count + '][discount_product][]" data-placeholder="'+woo_discount_localization.place_holder_search_for_products+'" data-action="woocommerce_json_search_products_and_variations"></select>'
182
  }
 
183
  form += '</div>';
184
  form += '<div class="discount_category_option_list_con hide">';
185
- form += ' <select class="category_list selectpicker" multiple title="'+woo_discount_localization.none_selected+'" name="discount_range[' + count + '][discount_category][]">';
 
186
  $("#category_list select.category_list option").each(function()
187
  {
188
  form += '<option value="'+$(this).val()+'">'+$(this).html()+'</option>';
189
  });
190
  form += '</select>';
 
191
  form += '</div>';
192
  form += '<div class="discount_product_percent_con">';
193
- form += ' '+woo_discount_localization.and_text+' <select class="selectpicker discount_product_discount_type" name="discount_range['+ count +'][discount_product_discount_type]"><option value="">'+woo_discount_localization.percent_100+'</option><option value="limited_percent">'+woo_discount_localization.limited_percent+'</option></select>';
194
- form += '<span class="discount_product_percent_field"> <input type="text" name="discount_range['+count+'][discount_product_percent]" class="discount_product_percent_field" value="" placeholder="'+woo_discount_localization.place_holder_ex_10+'" /><span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.percentage_tooltip+'"></span></span> '+woo_discount_localization.as_discount;
195
  form += '</div>';
196
  form += '</div>';
197
- form += '</label> <label><a href=javascript:void(0) class="btn btn-danger form-control remove_discount_range">'+woo_discount_localization.remove_text+'</a></label> </div> </div>';
 
198
  } else {
199
- var form = '<div class="discount_rule_list"> <div class="form-group"><label>'+woo_discount_localization.min_quantity+' <input type="text" name="discount_range[' + count + '][min_qty]" class="form-control" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'"></label>' +
200
- '<label>'+woo_discount_localization.max_quantity+' <input type="text" name="discount_range[' + count + '][max_qty]" class="form-control" value="" placeholder="'+woo_discount_localization.place_holder_ex_50+'"> </label> <label>'+woo_discount_localization.adjustment_type+'<select class="form-control price_discount_type" name="discount_range[' + count + '][discount_type]"> ' +
201
  '<option value="percentage_discount"> '+woo_discount_localization.percentage_discount+' </option> <option disabled>'+woo_discount_localization.price_discount+' <b>' + pro_suffix + '</b> </option> <option disabled>'+woo_discount_localization.product_discount+' <b>' + pro_suffix + '</b> </option> </select></label> <label>'+woo_discount_localization.value_text+' ' +
202
  '<input type="text" name="discount_range[' + count + '][to_discount]" class="form-control price_discount_amount" value="" placeholder="'+woo_discount_localization.place_holder_ex_50+'"> ';
203
  form += '<div class="price_discount_product_list_con hide"><select class="product_list selectpicker price_discount_product_list" multiple title="'+woo_discount_localization.none_selected+'" name="discount_range[' + count + '][discount_product][]">';
204
  form += '<option>'+woo_discount_localization.none_text+'</option>';
205
  form += '</select></div>';
206
- form += '</label> <label><a href=javascript:void(0) class="btn btn-danger form-control remove_discount_range">'+woo_discount_localization.remove_text+'</a> </label></div> </div>';
 
207
  }
208
  $('#discount_rule_list').append(form);
209
  $('.product_list,.selectpicker').selectpicker('refresh');
@@ -230,18 +367,22 @@ function trigger_woocommerce_tooltip(){
230
  $.ajax({
231
  url: ajax_url,
232
  type: 'POST',
 
233
  data: {action: 'UpdateStatus', id: id, from: 'pricing-rules'},
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
  }
246
 
247
  });
@@ -357,6 +498,9 @@ function trigger_woocommerce_tooltip(){
357
  var option = $(this).val();
358
  if (option == 'show') {
359
  $('.discount_table_options').show();
 
 
 
360
  } else {
361
  $('.discount_table_options').hide();
362
  }
@@ -383,6 +527,16 @@ function trigger_woocommerce_tooltip(){
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;
@@ -419,6 +573,7 @@ function trigger_woocommerce_tooltip(){
419
  // Cloning the List.
420
  var user_list = $('#cart_user_list_0 > option').clone();
421
  var category_list = $('#cart_category_list_0 > option').clone();
 
422
  var roles_list = $('#cart_roles_list_0 > option').clone();
423
  var country_list = $('#cart_countries_list_0 > option').clone();
424
  var order_status_list = $('#order_status_list_0 > option').clone();
@@ -442,8 +597,8 @@ function trigger_woocommerce_tooltip(){
442
  '<option value="customer_based_on_purchase_history_order_count">'+woo_discount_localization.number_of_order_purchased+'</option>'+
443
  '<option value="customer_based_on_purchase_history_product_order_count">'+woo_discount_localization.number_of_order_purchased_in_product+'</option>'+
444
  '</optgroup>' +
445
- '<optgroup label="'+woo_discount_localization.coupon_applied+'"><option value="coupon_applied_any_one">'+woo_discount_localization.atleast_any_one+'</option><option value="coupon_applied_all_selected">'+woo_discount_localization.all_selected+'</option></optgroup>' +
446
- '</select></label></div>' +
447
  '<div class="col-md-3 form-group"><label> '+woo_discount_localization.value_text+'<div id="general_' + count + '"><input type="text" name="discount_rule[' + count + '][option_value]"></div>' +
448
  '<div id="user_div_' + count + '">';
449
  if($('#flycart_wdr_woocommerce_version').val() == 2){
@@ -454,6 +609,7 @@ function trigger_woocommerce_tooltip(){
454
  form += '</div>' +
455
  '<div id="product_div_' + count + '"><select id="cart_product_list_' + count + '" class="product_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][product_to_apply][]"></select></div>' +
456
  '<div id="category_div_' + count + '"><select id="cart_category_list_' + count + '" class="category_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][category_to_apply][]"></select></div>' +
 
457
  '<div id="roles_div_' + count + '"><select id="cart_roles_list_' + count + '" class="roles_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][user_roles_to_apply][]"></select></div>' +
458
  '<div id="countries_div_' + count + '"><select id="cart_countries_list_' + count + '" class="country_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][countries_to_apply][]"></select></div>' +
459
  '<div id="purchase_history_div_' + count + '">' +
@@ -486,7 +642,7 @@ function trigger_woocommerce_tooltip(){
486
  '<option disabled>'+woo_discount_localization.number_of_order_purchased_in_product+' <b>' + pro_suffix + '</b></option>' +
487
  '</optgroup>' +
488
  '<optgroup label="'+woo_discount_localization.coupon_applied+'"><option disabled>'+woo_discount_localization.atleast_any_one+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.all_selected+' <b>' + pro_suffix + '</b></option></optgroup>' +
489
- '</select></label></div>' +
490
  '<div class="col-md-3 form-group"><label> '+woo_discount_localization.value_text+'<div id="general_' + count + '"><input type="text" name="discount_rule[' + count + '][option_value]"></div>' +
491
  '<div id="user_div_' + count + '"><select id="cart_user_list_' + count + '" class="user_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][users_to_apply][]"></select></div>' +
492
  '<div id="product_div_' + count + '"><select id="cart_product_list_' + count + '" class="product_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][product_to_apply][]"></select></div>' +
@@ -511,22 +667,19 @@ function trigger_woocommerce_tooltip(){
511
  $('#cart_user_list_' + count).append(user_list);
512
  $('#cart_product_list_' + count).append(product_list);
513
  $('#cart_category_list_' + count).append(category_list);
 
514
  $('#cart_roles_list_' + count).append(roles_list);
515
  $('#cart_countries_list_' + count).append(country_list);
516
  $('#order_status_list_' + count).append(order_status_list);
517
 
518
  // Refresh the SelectPicker.
519
- $('.product_list').selectpicker('refresh');
520
- $('.category_list').selectpicker('refresh');
521
- $('.roles_list').selectpicker('refresh');
522
- $('.country_list').selectpicker('refresh');
523
- $('.order_status_list').selectpicker('refresh');
524
- $('.purchased_history_type').selectpicker('refresh');
525
 
526
  // Default Hide List.
527
  $('#user_div_' + count).css('display', 'none');
528
  $('#product_div_' + count).css('display', 'none');
529
  $('#category_div_' + count).css('display', 'none');
 
530
  $('#roles_div_' + count).css('display', 'none');
531
  $('#countries_div_' + count).css('display', 'none');
532
  $('#purchase_history_div_' + count).css('display', 'none');
@@ -669,6 +822,7 @@ function trigger_woocommerce_tooltip(){
669
  $('#cart_user_list_' + id).selectpicker('val', []);
670
  $('#cart_product_list_' + id).selectpicker('val', []);
671
  $('#cart_category_list_' + id).selectpicker('val', []);
 
672
  $('#cart_roles_list_' + id).selectpicker('val', []);
673
  $('#cart_countries_list_' + id).selectpicker('val', []);
674
  $('#order_status_list_' + id).selectpicker('val', []);
@@ -684,18 +838,22 @@ function trigger_woocommerce_tooltip(){
684
  $.ajax({
685
  url: ajax_url,
686
  type: 'POST',
 
687
  data: {action: 'UpdateStatus', id: id, from: 'cart-rules'},
688
- success: function (status) {
689
  // After Status Changed.
690
- if (status == 'Disable') {
691
  current.addClass('btn-warning');
692
  current.removeClass('btn-success');
693
  current.html(woo_discount_localization.enable_text);
694
- } else if (status == 'Publish') {
695
  current.removeClass('btn-warning');
696
  current.addClass('btn-success');
697
  current.html(woo_discount_localization.disable_text);
698
  }
 
 
 
699
  }
700
 
701
  });
@@ -943,7 +1101,7 @@ function trigger_woocommerce_tooltip(){
943
 
944
  //------------------------------------------------------------------------------------------------------------------
945
  function processShowOnlyTags(id_prefix, id){
946
- var availableTags = ["user_div_", "product_div_", "category_div_", "general_", "roles_div_", "countries_div_", "purchase_history_div_"];
947
  $.each(availableTags, function( index, value ) {
948
  if(value == id_prefix)
949
  $('#'+value+id).css('display', 'block');
@@ -956,6 +1114,8 @@ function trigger_woocommerce_tooltip(){
956
  processShowOnlyTags('product_div_', id);
957
  } else if (option == 'categories_atleast_one' || option == 'categories_not_in' || option == 'categories_in' || option == 'in_each_category' || option == 'atleast_one_including_sub_categories') {
958
  processShowOnlyTags('category_div_', id);
 
 
959
  } else if (option == 'users_in') {
960
  processShowOnlyTags('user_div_', id);
961
  } else if (option == 'roles_in') {
19
  return returnValue;
20
  }
21
 
22
+ function validateWDRBOGOFields(){
23
+ var returnValue = true;
24
+ var discount_rule_range = jQuery('#discount_rule_list .discount_rule_list');
25
+ var wdr_invalid_tags = discount_rule_range.find('.wdr_invalid');
26
+ jQuery.each( wdr_invalid_tags, function( key, container ) {
27
+ jQuery(container).removeClass('wdr_invalid');
28
+ });
29
+ jQuery.each( discount_rule_range, function( key, container ) {
30
+ var price_discount_type = jQuery(container).find('select.price_discount_type');
31
+ if(price_discount_type.val() == 'product_discount'){
32
+ var discount_product_option = jQuery(container).find('select.discount_product_option');
33
+ if(jQuery.inArray(discount_product_option.val(), ['all', 'same_product', 'more_than_one_cheapest', 'more_than_one_cheapest_from_cat']) !== -1){
34
+ var discount_bogo_qty = jQuery(container).find('input.discount_bogo_qty');
35
+ if(discount_bogo_qty.val() == '' || discount_bogo_qty.val() == null){
36
+ discount_bogo_qty.addClass('wdr_invalid');
37
+ returnValue = false;
38
+ } else {
39
+ discount_bogo_qty.removeClass('wdr_invalid');
40
+ }
41
+ }
42
+ if(jQuery.inArray(discount_product_option.val(), ['more_than_one_cheapest_from_all', 'more_than_one_cheapest', 'more_than_one_cheapest_from_cat']) !== -1){
43
+ var discount_product_qty = jQuery(container).find('input.discount_product_qty');
44
+ if(discount_product_qty.val() == '' || discount_product_qty.val() == null){
45
+ discount_product_qty.addClass('wdr_invalid');
46
+ returnValue = false;
47
+ } else {
48
+ discount_product_qty.removeClass('wdr_invalid');
49
+ }
50
+ var discount_product_item_count_type = jQuery(container).find('select.discount_product_item_count_type');
51
+ if(discount_product_item_count_type.val() == 'static'){
52
+ var discount_product_items_count_field = jQuery(container).find('input.discount_product_items_count_field');
53
+ if(discount_product_items_count_field.val() == '' || discount_product_items_count_field.val() == null){
54
+ discount_product_items_count_field.addClass('wdr_invalid');
55
+ returnValue = false;
56
+ } else {
57
+ discount_product_items_count_field.removeClass('wdr_invalid');
58
+ }
59
+ }
60
+ }
61
+ if(jQuery.inArray(discount_product_option.val(), ['more_than_one_cheapest_from_cat']) !== -1){
62
+ var category_list = jQuery(container).find('select.category_list');
63
+ if(category_list.val() == '' || category_list.val() == null){
64
+ jQuery(container).find('.bootstrap-select.category_list > button').addClass('wdr_invalid');
65
+ returnValue = false;
66
+ } else {
67
+ jQuery(container).find('.bootstrap-select.category_list > button').removeClass('wdr_invalid');
68
+ }
69
+ }
70
+ //discount_category_option_list_con
71
+ if(jQuery.inArray(discount_product_option.val(), ['all', 'any_cheapest', 'more_than_one_cheapest']) !== -1){
72
+ var product_field = jQuery(container).find('select.wc-product-search');
73
+ if(product_field.val() == '' || product_field.val() == null){
74
+ jQuery(container).find('.select2-selection').addClass('wdr_invalid');
75
+ returnValue = false;
76
+ } else {
77
+ jQuery(container).find('.select2-selection').removeClass('wdr_invalid');
78
+ }
79
+ }
80
+
81
+ var discount_product_discount_type = jQuery(container).find('select.discount_product_discount_type');
82
+ if(discount_product_discount_type.val() == 'limited_percent'){
83
+ var discount_product_percent_field = jQuery(container).find('input.discount_product_percent_field');
84
+ if(discount_product_percent_field.val() == '' || discount_product_percent_field.val() == null){
85
+ discount_product_percent_field.addClass('wdr_invalid');
86
+ returnValue = false;
87
+ } else {
88
+ discount_product_percent_field.removeClass('wdr_invalid');
89
+ }
90
+ }
91
+ } else if(jQuery.inArray(price_discount_type.val(), ['percentage_discount', 'price_discount']) !== -1){
92
+ var price_discount_amount = jQuery(container).find('input.price_discount_amount');
93
+ if(price_discount_amount.val() == '' || price_discount_amount.val() == null){
94
+ price_discount_amount.addClass('wdr_invalid');
95
+ returnValue = false;
96
+ } else {
97
+ price_discount_amount.removeClass('wdr_invalid');
98
+ }
99
+ }
100
+ var discount_range_min_qty = jQuery(container).find('input.discount_range_min_qty');
101
+ if(discount_range_min_qty.val() == '' || discount_range_min_qty.val() == null){
102
+ discount_range_min_qty.addClass('wdr_invalid');
103
+ returnValue = false;
104
+ } else {
105
+ discount_range_min_qty.removeClass('wdr_invalid');
106
+ }
107
+ var discount_range_max_qty = jQuery(container).find('input.discount_range_max_qty');
108
+ if(discount_range_max_qty.val() == '' || discount_range_max_qty.val() == null){
109
+ discount_range_max_qty.addClass('wdr_invalid');
110
+ returnValue = false;
111
+ } else {
112
+ discount_range_max_qty.removeClass('wdr_invalid');
113
+ }
114
+ });
115
+ if(returnValue == false){
116
+ discount_rule_range.find('.wdr_invalid').first().focus();
117
+ jQuery('a.discount_tab').trigger('click');
118
+ }
119
+
120
+ return returnValue;
121
+ }
122
+
123
  function trigger_woocommerce_tooltip(){
124
  jQuery( '.tips, .help_tip, .woocommerce-help-tip' ).tipTip( {
125
  'attribute': 'data-tip',
138
  var pro_suffix = $('#pro_suffix').val();
139
  var is_pro = $('#is_pro').val();
140
  // $(".datepicker").datepicker();
141
+ $(".wdr_datepicker").datetimepicker({
142
  //format: "dd MM yyyy - hh:ii",
143
  format: "mm/dd/yyyy hh:ii",
144
  autoclose: true,
162
  $('#savePriceRule').on('click', function (event) {
163
  var validate = validateFields();
164
 
165
+ var validate_bogo = validateWDRBOGOFields();
166
+
167
+ if(validate == false || validate_bogo == false){
168
  return false;
169
  }
170
  var form = $('#form_price_rule').serialize();
252
  });
253
  });
254
 
255
+ //To add an duplicate range fields
256
+ $(document).on('click', '.create_duplicate_discount_range', function () {
257
+ //$(".create_duplicate_discount_range").on('click', function () {
258
+ var data_id = $(this).attr('data-id');
259
+ $('#addNewDiscountRange').trigger('click');
260
+ var new_inputs = $("#discount_rule_list .discount_rule_list:last-child").find('input,select');
261
+ $.each( new_inputs, function( key, new_input ) {
262
+ var field_name = $(new_input).attr('name');
263
+ if(field_name != undefined){
264
+ var field_name_second_part = field_name.replace("discount_range[", "");
265
+ var field_name_second_part_split = field_name_second_part.split(']');
266
+ var field_name_id = field_name_second_part_split['0'];
267
+ var field_name_to_duplicate = field_name.replace("discount_range["+field_name_id+"]", "discount_range["+data_id+"]");
268
+ $("input[name='"+field_name+"']").val($("input[name='"+field_name_to_duplicate+"']").val());
269
+ if($("select[name='"+field_name+"']").hasClass('wc-product-search')){
270
+ $("select[name='"+field_name+"']").html($("select[name='"+field_name_to_duplicate+"']").html())
271
+ }
272
+ $("select[name='"+field_name+"']").val($("select[name='"+field_name_to_duplicate+"']").val());
273
+ }
274
+ });
275
+ $("#discount_rule_list .discount_rule_list:last-child select").trigger('change');
276
+ $('.product_list,.selectpicker').selectpicker('refresh');
277
+ $('.wc-product-search').trigger( 'wc-enhanced-select-init' );
278
+ $('select.discount_product_discount_type').trigger('change');
279
+ // Tooltips
280
+ trigger_woocommerce_tooltip();
281
+ });
282
 
283
  // Adding New Discount Range.
284
  $('#addNewDiscountRange').on('click', function () {
285
  var count = $('.discount_rule_list').length + 1;
286
  if (is_pro) {
287
+ var form = '<div class="discount_rule_list"> <div class="form-group"><label>'+woo_discount_localization.min_quantity+' <input type="text" name="discount_range[' + count + '][min_qty]" class="form-control discount_range_min_qty" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'"></label>' +
288
+ '<label>'+woo_discount_localization.max_quantity+' <input type="text" name="discount_range[' + count + '][max_qty]" class="form-control discount_range_max_qty" value="" placeholder="'+woo_discount_localization.place_holder_ex_50+'"> </label> <label>'+woo_discount_localization.adjustment_type+'<select class="form-control price_discount_type" name="discount_range[' + count + '][discount_type]"> ' +
289
  '<option value="percentage_discount"> '+woo_discount_localization.percentage_discount+' </option> <option value="price_discount">'+woo_discount_localization.price_discount+' </option> <option value="product_discount">'+woo_discount_localization.product_discount+' </option> </select></label> <label><span class="hide-for-product-discount">'+woo_discount_localization.value_text+'</span>' +
290
  '<input type="text" name="discount_range[' + count + '][to_discount]" class="form-control price_discount_amount" value="" placeholder="'+woo_discount_localization.place_holder_ex_50+'"> ';
291
  form += '<div class="price_discount_product_list_con hide">' +
292
  ' '+woo_discount_localization.apply_for+' <select class="selectpicker discount_product_option" name="discount_range['+count+'][discount_product_option]"><option value="all">'+woo_discount_localization.all_selected+'</option><option value="same_product">'+woo_discount_localization.same_product+'</option><option value="any_cheapest">'+woo_discount_localization.any_one_cheapest_from_selected+'</option><option value="any_cheapest_from_all">'+woo_discount_localization.any_one_cheapest_from_all_products+'</option>' +
293
  '<option value="more_than_one_cheapest_from_cat">'+woo_discount_localization.more_than_one_cheapest_from_selected_category+'</option><option value="more_than_one_cheapest">'+woo_discount_localization.more_than_one_cheapest_from_selected+'</option><option value="more_than_one_cheapest_from_all">'+woo_discount_localization.more_than_one_cheapest_from_all+'</option>' +
294
  '</select>';
295
+ form += '&nbsp;<span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.discount_product_option_tooltip+'"></span>';
296
  form += '<div class="discount_product_option_bogo_con">';
297
+ form += '&nbsp;<label> '+woo_discount_localization.free_quantity+' <span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.number_of_quantities_in_each_products+'"></span> <input type="text" name="discount_range['+count+'][discount_bogo_qty]" class="form-control discount_bogo_qty" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'" /></label>';
298
  form += '</div>';
299
  form += '<div class="discount_product_option_more_cheapest_con hide">';
300
+ form += '&nbsp;<select class="selectpicker discount_product_item_count_type" name="discount_range['+count+'][discount_product_item_type]">';
301
  form += '<option value="dynamic">'+woo_discount_localization.dynamic_item_count+'</option>';
302
  form += '<option value="static">'+woo_discount_localization.fixed_item_count+'</option>';
303
  form += '</select>';
304
+ form += '&nbsp;<span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.fixed_item_count_tooltip+'"></span>';
305
+ form += '&nbsp;<label class="discount_product_items_count_field hide"> '+woo_discount_localization.item_count+'&nbsp;<span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.discount_number_of_item_tooltip+'"></span><input type="text" name="discount_range['+count+'][discount_product_items]" class="form-control discount_product_items_count_field hide" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'" /></label>';
306
+ form += '&nbsp;<label> '+woo_discount_localization.item_quantity+'&nbsp;<span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.discount_number_of_each_item_tooltip+'"></span><input type="text" name="discount_range['+count+'][discount_product_qty]" class="form-control discount_product_qty" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'" /></label>';
307
  form += '</div>';
308
  form += '<div class="discount_product_option_list_con">';
309
+ form += '<label>&nbsp;<span class="wdr_block_span">'+woo_discount_localization.choose_products+'</span>';
310
  if($('#flycart_wdr_woocommerce_version').val() == 2){
311
+ form += '&nbsp;<input type="hidden" class="wc-product-search" style="min-width: 250px" data-multiple="true" name="discount_range[' + count + '][discount_product][]" data-placeholder="'+woo_discount_localization.place_holder_search_for_products+'" data-action="woocommerce_json_search_products_and_variations" data-selected=""/>';
312
  } else {
313
+ form += '&nbsp;<select class="wc-product-search" multiple="multiple" style="min-width: 250px" name="discount_range[' + count + '][discount_product][]" data-placeholder="'+woo_discount_localization.place_holder_search_for_products+'" data-action="woocommerce_json_search_products_and_variations"></select>'
314
  }
315
+ form += '</label>';
316
  form += '</div>';
317
  form += '<div class="discount_category_option_list_con hide">';
318
+ form += '<label>&nbsp;<span class="wdr_block_span">'+woo_discount_localization.choose_categories+'</span>';
319
+ form += '&nbsp;<select class="category_list selectpicker" multiple title="'+woo_discount_localization.none_selected+'" name="discount_range[' + count + '][discount_category][]">';
320
  $("#category_list select.category_list option").each(function()
321
  {
322
  form += '<option value="'+$(this).val()+'">'+$(this).html()+'</option>';
323
  });
324
  form += '</select>';
325
+ form += '</label>';
326
  form += '</div>';
327
  form += '<div class="discount_product_percent_con">';
328
+ form += '&nbsp;<label>&nbsp;<span class="wdr_block_span">'+woo_discount_localization.percentage_discount+'</span>&nbsp;<select class="selectpicker discount_product_discount_type" name="discount_range['+ count +'][discount_product_discount_type]"><option value="">'+woo_discount_localization.percent_100+'</option><option value="limited_percent">'+woo_discount_localization.limited_percent+'</option></select></label>';
329
+ form += '<span class="discount_product_percent_field">&nbsp;<input type="text" name="discount_range['+count+'][discount_product_percent]" class="discount_product_percent_field" value="" placeholder="'+woo_discount_localization.place_holder_ex_10+'" />&nbsp;<span class="woocommerce-help-tip" data-tip="'+woo_discount_localization.percentage_tooltip+'"></span></span> ';
330
  form += '</div>';
331
  form += '</div>';
332
+ form += '</label>&nbsp;<label><a href=javascript:void(0) class="btn btn-danger form-control remove_discount_range">'+woo_discount_localization.remove_text+'</a></label> ';
333
+ form += '<label><a href="javascript:void(0)" data-id="'+count+'" class="btn btn-primary form-control create_duplicate_discount_range">'+woo_discount_localization.duplicate_text+'</a></label> </div> </div>';
334
  } else {
335
+ var form = '<div class="discount_rule_list"> <div class="form-group"><label>'+woo_discount_localization.min_quantity+' <input type="text" name="discount_range[' + count + '][min_qty]" class="form-control discount_range_min_qty" value="" placeholder="'+woo_discount_localization.place_holder_ex_1+'"></label>' +
336
+ '<label>'+woo_discount_localization.max_quantity+' <input type="text" name="discount_range[' + count + '][max_qty]" class="form-control discount_range_max_qty" value="" placeholder="'+woo_discount_localization.place_holder_ex_50+'"> </label> <label>'+woo_discount_localization.adjustment_type+'<select class="form-control price_discount_type" name="discount_range[' + count + '][discount_type]"> ' +
337
  '<option value="percentage_discount"> '+woo_discount_localization.percentage_discount+' </option> <option disabled>'+woo_discount_localization.price_discount+' <b>' + pro_suffix + '</b> </option> <option disabled>'+woo_discount_localization.product_discount+' <b>' + pro_suffix + '</b> </option> </select></label> <label>'+woo_discount_localization.value_text+' ' +
338
  '<input type="text" name="discount_range[' + count + '][to_discount]" class="form-control price_discount_amount" value="" placeholder="'+woo_discount_localization.place_holder_ex_50+'"> ';
339
  form += '<div class="price_discount_product_list_con hide"><select class="product_list selectpicker price_discount_product_list" multiple title="'+woo_discount_localization.none_selected+'" name="discount_range[' + count + '][discount_product][]">';
340
  form += '<option>'+woo_discount_localization.none_text+'</option>';
341
  form += '</select></div>';
342
+ form += '</label>&nbsp;<label><a href=javascript:void(0) class="btn btn-danger form-control remove_discount_range">'+woo_discount_localization.remove_text+'</a> </label> ';
343
+ form += ' <label><a href=javascript:void(0) data-id="'+count+'" class="btn btn-primary form-control create_duplicate_discount_range">'+woo_discount_localization.duplicate_text+'</a> </label></div> </div>';
344
  }
345
  $('#discount_rule_list').append(form);
346
  $('.product_list,.selectpicker').selectpicker('refresh');
367
  $.ajax({
368
  url: ajax_url,
369
  type: 'POST',
370
+ dataType: "json",
371
  data: {action: 'UpdateStatus', id: id, from: 'pricing-rules'},
372
+ success: function (response) {
373
  // After Status Changed.
374
+ if (response.status == 'Disable') {
375
  current.removeClass('btn-success');
376
  current.addClass('btn-warning');
377
  current.html(woo_discount_localization.enable_text);
378
+ } else if (response.status == 'Publish') {
379
  current.addClass('btn-success');
380
  current.removeClass('btn-warning');
381
  current.html(woo_discount_localization.disable_text);
382
  }
383
+ if (response.status_html != '') {
384
+ $("#status_in_text_"+id).html(response.status_html);
385
+ }
386
  }
387
 
388
  });
498
  var option = $(this).val();
499
  if (option == 'show') {
500
  $('.discount_table_options').show();
501
+ } else if (option == 'advance') {
502
+ $('.discount_table_options').hide();
503
+ $('.discount_table_option_advance').show();
504
  } else {
505
  $('.discount_table_options').hide();
506
  }
527
  });
528
  $('#message_on_apply_price_discount').trigger('change');
529
 
530
+ $('#display_you_saved_text').on('change', function () {
531
+ var option = $(this).val();
532
+ if (option == 'no') {
533
+ $('.display_you_saved_text_options').hide();
534
+ } else {
535
+ $('.display_you_saved_text_options').show();
536
+ }
537
+ });
538
+ $('#display_you_saved_text').trigger('change');
539
+
540
  $(document).on('keyup', '.rule_descr', function () {
541
  var value = $(this).val();
542
  value = '| ' + value;
573
  // Cloning the List.
574
  var user_list = $('#cart_user_list_0 > option').clone();
575
  var category_list = $('#cart_category_list_0 > option').clone();
576
+ var coupon_list = $('#cart_coupon_list_0 > option').clone();
577
  var roles_list = $('#cart_roles_list_0 > option').clone();
578
  var country_list = $('#cart_countries_list_0 > option').clone();
579
  var order_status_list = $('#order_status_list_0 > option').clone();
597
  '<option value="customer_based_on_purchase_history_order_count">'+woo_discount_localization.number_of_order_purchased+'</option>'+
598
  '<option value="customer_based_on_purchase_history_product_order_count">'+woo_discount_localization.number_of_order_purchased_in_product+'</option>'+
599
  '</optgroup>' +
600
+ '<optgroup label="'+woo_discount_localization.coupon_applied+'"><option value="coupon_applied_any_one">'+woo_discount_localization.atleast_any_one+'</option><option value="coupon_applied_all_selected">'+woo_discount_localization.all_selected_coupon+'</option></optgroup>' +
601
+ '</select></label><div class="wdr_cart_rule_doc_con"></div></div>' +
602
  '<div class="col-md-3 form-group"><label> '+woo_discount_localization.value_text+'<div id="general_' + count + '"><input type="text" name="discount_rule[' + count + '][option_value]"></div>' +
603
  '<div id="user_div_' + count + '">';
604
  if($('#flycart_wdr_woocommerce_version').val() == 2){
609
  form += '</div>' +
610
  '<div id="product_div_' + count + '"><select id="cart_product_list_' + count + '" class="product_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][product_to_apply][]"></select></div>' +
611
  '<div id="category_div_' + count + '"><select id="cart_category_list_' + count + '" class="category_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][category_to_apply][]"></select></div>' +
612
+ '<div id="coupon_div_' + count + '"><select id="cart_coupon_list_' + count + '" class="coupon_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][coupon_to_apply][]"></select></div>' +
613
  '<div id="roles_div_' + count + '"><select id="cart_roles_list_' + count + '" class="roles_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][user_roles_to_apply][]"></select></div>' +
614
  '<div id="countries_div_' + count + '"><select id="cart_countries_list_' + count + '" class="country_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][countries_to_apply][]"></select></div>' +
615
  '<div id="purchase_history_div_' + count + '">' +
642
  '<option disabled>'+woo_discount_localization.number_of_order_purchased_in_product+' <b>' + pro_suffix + '</b></option>' +
643
  '</optgroup>' +
644
  '<optgroup label="'+woo_discount_localization.coupon_applied+'"><option disabled>'+woo_discount_localization.atleast_any_one+' <b>' + pro_suffix + '</b></option><option disabled>'+woo_discount_localization.all_selected+' <b>' + pro_suffix + '</b></option></optgroup>' +
645
+ '</select></label><div class="wdr_cart_rule_doc_con"></div></div>' +
646
  '<div class="col-md-3 form-group"><label> '+woo_discount_localization.value_text+'<div id="general_' + count + '"><input type="text" name="discount_rule[' + count + '][option_value]"></div>' +
647
  '<div id="user_div_' + count + '"><select id="cart_user_list_' + count + '" class="user_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][users_to_apply][]"></select></div>' +
648
  '<div id="product_div_' + count + '"><select id="cart_product_list_' + count + '" class="product_list selectpicker" title="'+woo_discount_localization.none_selected+'" data-live-search="true" multiple name="discount_rule[' + count + '][product_to_apply][]"></select></div>' +
667
  $('#cart_user_list_' + count).append(user_list);
668
  $('#cart_product_list_' + count).append(product_list);
669
  $('#cart_category_list_' + count).append(category_list);
670
+ $('#cart_coupon_list_' + count).append(coupon_list);
671
  $('#cart_roles_list_' + count).append(roles_list);
672
  $('#cart_countries_list_' + count).append(country_list);
673
  $('#order_status_list_' + count).append(order_status_list);
674
 
675
  // Refresh the SelectPicker.
676
+ $('.product_list,.category_list,.coupon_list,.roles_list,.country_list,.order_status_list,.purchased_history_type').selectpicker('refresh');
 
 
 
 
 
677
 
678
  // Default Hide List.
679
  $('#user_div_' + count).css('display', 'none');
680
  $('#product_div_' + count).css('display', 'none');
681
  $('#category_div_' + count).css('display', 'none');
682
+ $('#coupon_div_' + count).css('display', 'none');
683
  $('#roles_div_' + count).css('display', 'none');
684
  $('#countries_div_' + count).css('display', 'none');
685
  $('#purchase_history_div_' + count).css('display', 'none');
822
  $('#cart_user_list_' + id).selectpicker('val', []);
823
  $('#cart_product_list_' + id).selectpicker('val', []);
824
  $('#cart_category_list_' + id).selectpicker('val', []);
825
+ $('#cart_coupon_list_' + id).selectpicker('val', []);
826
  $('#cart_roles_list_' + id).selectpicker('val', []);
827
  $('#cart_countries_list_' + id).selectpicker('val', []);
828
  $('#order_status_list_' + id).selectpicker('val', []);
838
  $.ajax({
839
  url: ajax_url,
840
  type: 'POST',
841
+ dataType: "json",
842
  data: {action: 'UpdateStatus', id: id, from: 'cart-rules'},
843
+ success: function (response) {
844
  // After Status Changed.
845
+ if (response.status == 'Disable') {
846
  current.addClass('btn-warning');
847
  current.removeClass('btn-success');
848
  current.html(woo_discount_localization.enable_text);
849
+ } else if (response.status == 'Publish') {
850
  current.removeClass('btn-warning');
851
  current.addClass('btn-success');
852
  current.html(woo_discount_localization.disable_text);
853
  }
854
+ if (response.status_html != '') {
855
+ $("#status_in_text_"+id).html(response.status_html);
856
+ }
857
  }
858
 
859
  });
1101
 
1102
  //------------------------------------------------------------------------------------------------------------------
1103
  function processShowOnlyTags(id_prefix, id){
1104
+ var availableTags = ["user_div_", "product_div_", "category_div_", "coupon_div_", "general_", "roles_div_", "countries_div_", "purchase_history_div_"];
1105
  $.each(availableTags, function( index, value ) {
1106
  if(value == id_prefix)
1107
  $('#'+value+id).css('display', 'block');
1114
  processShowOnlyTags('product_div_', id);
1115
  } else if (option == 'categories_atleast_one' || option == 'categories_not_in' || option == 'categories_in' || option == 'in_each_category' || option == 'atleast_one_including_sub_categories') {
1116
  processShowOnlyTags('category_div_', id);
1117
+ } else if (option == 'coupon_applied_any_one' || option == 'coupon_applied_all_selected') {
1118
+ processShowOnlyTags('coupon_div_', id);
1119
  } else if (option == 'users_in') {
1120
  processShowOnlyTags('user_div_', id);
1121
  } else if (option == 'roles_in') {
helper/general-helper.php CHANGED
@@ -24,7 +24,7 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
24
  * @param $data
25
  * @return bool|string
26
  */
27
- public function processBaseView($path, $data)
28
  {
29
  if (!file_exists($path)) return false;
30
  $this->checkPluginState();
@@ -34,6 +34,11 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
34
  $config = $data;
35
  $pro = $this->isPro;
36
  $category = $this->getCategoryList();
 
 
 
 
 
37
  //$users = $this->getUserList();
38
  FlycartWoocommerceVersion::wcVersion('3.0')? $flycart_wdr_woocommerce_version = 3: $flycart_wdr_woocommerce_version = 2;
39
  $userRoles = $this->getUserRoles();
@@ -69,6 +74,28 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
69
  return $result;
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
72
  /**
73
  * To Retrieve the active tab.
74
  *
@@ -464,6 +491,26 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
464
  return $valid;
465
  }
466
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
467
  /**
468
  * Reorder the rule if order id already exists
469
  *
@@ -607,7 +654,7 @@ if ( ! class_exists( 'FlycartWooDiscountRulesGeneralHelper' ) ) {
607
  * */
608
  public static function removeCouponPriceInCart($coupons = array()){
609
  $config = new FlycartWooDiscountBase();
610
- $remove_zero_coupon_price = $config->getConfigData('remove_zero_coupon_price', 0);
611
  if($remove_zero_coupon_price){
612
  $has_coupon = false;
613
  $styles = '';
24
  * @param $data
25
  * @return bool|string
26
  */
27
+ public function processBaseView($path, $data, $tab)
28
  {
29
  if (!file_exists($path)) return false;
30
  $this->checkPluginState();
34
  $config = $data;
35
  $pro = $this->isPro;
36
  $category = $this->getCategoryList();
37
+ $coupons = array();
38
+ if(in_array($tab, array('pricing-rules-new', 'pricing-rules-view', 'cart-rules-new', 'cart-rules-view'))){
39
+ if($pro) $coupons = $this->getCouponsList();
40
+ }
41
+
42
  //$users = $this->getUserList();
43
  FlycartWoocommerceVersion::wcVersion('3.0')? $flycart_wdr_woocommerce_version = 3: $flycart_wdr_woocommerce_version = 2;
44
  $userRoles = $this->getUserRoles();
74
  return $result;
75
  }
76
 
77
+ /**
78
+ * Get all coupons
79
+ * */
80
+ public function getCouponsList(){
81
+ $args = array(
82
+ 'posts_per_page' => -1,
83
+ 'orderby' => 'title',
84
+ 'order' => 'asc',
85
+ 'post_type' => 'shop_coupon',
86
+ 'post_status' => 'publish',
87
+ );
88
+ $coupon_list = array();
89
+ $coupons = get_posts( $args );
90
+ if(!empty($coupons)){
91
+ foreach ($coupons as $coupon){
92
+ $coupon_list[$coupon->post_name] = $coupon->post_title;
93
+ }
94
+ }
95
+
96
+ return $coupon_list;
97
+ }
98
+
99
  /**
100
  * To Retrieve the active tab.
101
  *
491
  return $valid;
492
  }
493
 
494
+ /**
495
+ * Validate the start and end date
496
+ *
497
+ * @param string $date_from
498
+ * @param string $date_to
499
+ * @return boolean
500
+ * */
501
+ public static function validateDateAndTimeWarningText($date_from, $date_to){
502
+ $string = '';
503
+ $current_date = self::getCurrentDateAndTimeBasedOnTimeZone();
504
+ if($date_from != ''){
505
+ if(!(strtotime($date_from) <= strtotime($current_date))) $string = esc_html__('Start date and time is set as future date', 'woo-discount-rules');
506
+ }
507
+ if($date_to != ''){
508
+ if(!(strtotime($date_to) >= strtotime($current_date))) $string = esc_html__('End date is expired', 'woo-discount-rules');;
509
+ }
510
+
511
+ return $string;
512
+ }
513
+
514
  /**
515
  * Reorder the rule if order id already exists
516
  *
654
  * */
655
  public static function removeCouponPriceInCart($coupons = array()){
656
  $config = new FlycartWooDiscountBase();
657
+ $remove_zero_coupon_price = $config->getConfigData('remove_zero_coupon_price', 1);
658
  if($remove_zero_coupon_price){
659
  $has_coupon = false;
660
  $styles = '';
helper/woo-function.php CHANGED
@@ -94,10 +94,11 @@ if(!class_exists('FlycartWoocommerceProduct')){
94
  *
95
  * @access public
96
  * @param float $amount
 
97
  * @return int/float
98
  */
99
- public static function wc_price($amount){
100
- return FlycartWoocommerceVersion::wcVersion('2.1') ? wc_price($amount) : woocommerce_price($amount);
101
  }
102
 
103
  /**
@@ -582,6 +583,18 @@ if(!class_exists('FlycartWoocommerceOrder')){
582
  return FlycartWoocommerceVersion::wcVersion('3.0') ? $order->get_shipping_city() : $order->shipping_city;
583
  }
584
 
 
 
 
 
 
 
 
 
 
 
 
 
585
  /**
586
  * Get order product ids
587
  *
@@ -637,4 +650,20 @@ if(!class_exists('FlycartWoocommerceCoupon')){
637
  return FlycartWoocommerceVersion::wcVersion('3.0') ? $coupon->get_individual_use() : $coupon->individual_use;
638
  }
639
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
640
  }
94
  *
95
  * @access public
96
  * @param float $amount
97
+ * @param array $args
98
  * @return int/float
99
  */
100
+ public static function wc_price($amount, $args = array()){
101
+ return FlycartWoocommerceVersion::wcVersion('2.1') ? wc_price($amount, $args) : woocommerce_price($amount, $args);
102
  }
103
 
104
  /**
583
  return FlycartWoocommerceVersion::wcVersion('3.0') ? $order->get_shipping_city() : $order->shipping_city;
584
  }
585
 
586
+ /**
587
+ * Get order currency
588
+ *
589
+ * @access public
590
+ * @param object $order
591
+ * @return float
592
+ */
593
+ public static function get_currency($order)
594
+ {
595
+ return FlycartWoocommerceVersion::wcVersion('3.0') ? $order->get_currency() : $order->currency;
596
+ }
597
+
598
  /**
599
  * Get order product ids
600
  *
650
  return FlycartWoocommerceVersion::wcVersion('3.0') ? $coupon->get_individual_use() : $coupon->individual_use;
651
  }
652
  }
653
+ }
654
+
655
+ if(!class_exists('FlycartWoocommerceOrderItem')){
656
+ class FlycartWoocommerceOrderItem{
657
+ /**
658
+ * Get order id
659
+ *
660
+ * @access public
661
+ * @param object $order_item
662
+ * @return integer
663
+ */
664
+ public static function get_order_id($order_item)
665
+ {
666
+ return FlycartWoocommerceVersion::wcVersion('3.0') ? $order_item->get_order_id() : $order_item->order_id;
667
+ }
668
+ }
669
  }
i18n/languages/woo-discount-rules.pot CHANGED
@@ -11,11 +11,19 @@ msgstr ""
11
  "Language: en\n"
12
  "X-Generator: Poedit 1.8.7.1\n"
13
 
14
- #: helper/general-helper.php:39
15
  msgid "Guest"
16
  msgstr ""
17
 
18
- #: helper/general-helper.php:576
 
 
 
 
 
 
 
 
19
  msgid "Read Docs"
20
  msgstr ""
21
 
@@ -79,11 +87,11 @@ msgstr ""
79
  msgid "License key seems to be Invalid. Please enter a valid license key"
80
  msgstr ""
81
 
82
- #: helper/woo-function.php:354 helper/woo-function.php:364
83
  msgid "Search for a product&hellip;"
84
  msgstr ""
85
 
86
- #: helper/woo-function.php:397 helper/woo-function.php:409
87
  msgid "Search for a user&hellip;"
88
  msgstr ""
89
 
@@ -95,13 +103,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: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
 
@@ -117,526 +125,577 @@ msgstr ""
117
  msgid "Title to be display on site"
118
  msgstr ""
119
 
120
- #: includes/discount-base.php:365
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
121
  msgid "Cache cleared successfully"
122
  msgstr ""
123
 
124
- #: includes/discount-base.php:367
125
  msgid "Failed to clear cache"
126
  msgstr ""
127
 
128
- #: includes/discount-base.php:473 includes/discount-base.php:508
129
  msgid "Failed to do action"
130
  msgstr ""
131
 
132
- #: includes/discount-base.php:512
133
  msgid "Disabled successfully"
134
  msgstr ""
135
 
136
- #: includes/discount-base.php:515
137
  msgid "Deleted successfully"
138
  msgstr ""
139
 
140
- #: includes/discount-base.php:518
141
  msgid "Enabled successfully"
142
  msgstr ""
143
 
144
- #: includes/discount-base.php:538 includes/discount-base.php:539
145
- #: includes/discount-base.php:556
146
  msgid "copy"
147
  msgstr ""
148
 
149
- #: includes/discount-base.php:564
150
  msgid "Duplicate rule created successfully"
151
  msgstr ""
152
 
153
- #: includes/discount-base.php:568
154
  msgid "Failed to create duplicate rule"
155
  msgstr ""
156
 
157
- #: includes/discount-base.php:831
158
  msgid "Please fill this field"
159
  msgstr ""
160
 
161
- #: includes/discount-base.php:832
162
  msgid "Please Enter the Rule Name to Create / Save."
163
  msgstr ""
164
 
165
- #: includes/discount-base.php:833
166
  msgid "Saving..."
167
  msgstr ""
168
 
169
- #: includes/discount-base.php:834 view/view-cart-rules.php:54
170
  #: view/view-pricing-rules.php:38
171
  msgid "Save Rule"
172
  msgstr ""
173
 
174
- #: includes/discount-base.php:835
175
  msgid "Please enter a Key"
176
  msgstr ""
177
 
178
- #: includes/discount-base.php:836 view/view-pricing-rules.php:594
179
  msgid "Min Quantity"
180
  msgstr ""
181
 
182
- #: includes/discount-base.php:837 view/view-pricing-rules.php:601
183
  msgid "Max Quantity"
184
  msgstr ""
185
 
186
- #: includes/discount-base.php:838 view/view-cart-rules.php:76
187
- #: view/view-pricing-rules.php:61 view/view-pricing-rules.php:599
188
- #: view/view-pricing-rules.php:664 view/view-pricing-rules.php:681
189
- #: view/view-pricing-rules.php:688
190
  msgid "ex. 1"
191
  msgstr ""
192
 
193
- #: includes/discount-base.php:839 view/view-pricing-rules.php:720
194
  msgid "ex. 10"
195
  msgstr ""
196
 
197
- #: includes/discount-base.php:840 view/view-pricing-rules.php:606
198
- #: view/view-pricing-rules.php:642
199
  msgid "ex. 50"
200
  msgstr ""
201
 
202
- #: includes/discount-base.php:841
203
  msgid "Search for a user"
204
  msgstr ""
205
 
206
- #: includes/discount-base.php:842 view/view-pricing-rules.php:607
207
  msgid "Adjustment Type"
208
  msgstr ""
209
 
210
- #: includes/discount-base.php:843 view/view-cart-rules.php:571
211
- #: view/view-pricing-rules.php:613
212
- msgid "Percentage Discount"
213
  msgstr ""
214
 
215
- #: includes/discount-base.php:844 view/view-cart-rules.php:577
216
- #: view/view-cart-rules.php:579 view/view-pricing-rules.php:621
217
- #: view/view-pricing-rules.php:623
218
  msgid "Price Discount"
219
  msgstr ""
220
 
221
- #: includes/discount-base.php:845 view/view-pricing-rules.php:631
222
- #: view/view-pricing-rules.php:633
223
- msgid "Product Discount"
224
  msgstr ""
225
 
226
- #: includes/discount-base.php:846
227
  msgid "Product Discount - Not support for subtotal based rule"
228
  msgstr ""
229
 
230
- #: includes/discount-base.php:847 view/view-cart-rules.php:382
231
- #: view/view-pricing-rules.php:637 view/view-pricing-rules.php:745
232
  msgid "Value"
233
  msgstr ""
234
 
235
- #: includes/discount-base.php:848 view/view-pricing-rules.php:648
236
- msgid "Apply for"
237
  msgstr ""
238
 
239
- #: includes/discount-base.php:849 view/view-cart-rules.php:372
240
- #: view/view-cart-rules.php:374 view/view-pricing-rules.php:650
241
- msgid "All selected"
242
  msgstr ""
243
 
244
- #: includes/discount-base.php:850 view/view-pricing-rules.php:651
245
  msgid "Same product"
246
  msgstr ""
247
 
248
- #: includes/discount-base.php:851 view/view-pricing-rules.php:652
249
  msgid "Any one cheapest from selected"
250
  msgstr ""
251
 
252
- #: includes/discount-base.php:852 view/view-pricing-rules.php:653
253
  msgid "Any one cheapest from all products"
254
  msgstr ""
255
 
256
- #: includes/discount-base.php:853 view/view-pricing-rules.php:654
257
- msgid "More than one cheapest from selected category"
258
  msgstr ""
259
 
260
- #: includes/discount-base.php:854 view/view-pricing-rules.php:655
261
- msgid "More than one cheapest from selected"
 
262
  msgstr ""
263
 
264
- #: includes/discount-base.php:855 view/view-pricing-rules.php:656
265
- msgid "More than one cheapest from all"
266
  msgstr ""
267
 
268
- #: includes/discount-base.php:856 view/view-pricing-rules.php:659
269
  msgid "Free quantity"
270
  msgstr ""
271
 
272
- #: includes/discount-base.php:857 view/view-pricing-rules.php:659
273
  msgid "Number of quantity(ies) in each selected product(s)"
274
  msgstr ""
275
 
276
- #: includes/discount-base.php:858 view/view-pricing-rules.php:673
277
- msgid "Fixed item count"
278
  msgstr ""
279
 
280
- #: includes/discount-base.php:859 view/view-pricing-rules.php:672
281
  msgid "Dynamic item count"
282
  msgstr ""
283
 
284
- #: includes/discount-base.php:860 view/view-pricing-rules.php:675
285
  msgid ""
286
  "Fixed item count - You need to provide item count manually. Dynamic item "
287
  "count - System will choose dynamically based on cart"
288
  msgstr ""
289
 
290
- #: includes/discount-base.php:861 view/view-pricing-rules.php:676
291
  msgid "Item count"
292
  msgstr ""
293
 
294
- #: includes/discount-base.php:862 view/view-pricing-rules.php:676
295
  msgid "Discount for number of item(s) in cart"
296
  msgstr ""
297
 
298
- #: includes/discount-base.php:863 view/view-pricing-rules.php:683
299
  msgid "Discount for number of quantity(ies) in each item"
300
  msgstr ""
301
 
302
- #: includes/discount-base.php:864 view/view-pricing-rules.php:683
303
  msgid "Item quantity"
304
  msgstr ""
305
 
306
- #: includes/discount-base.php:865
307
  msgid "Search for a products"
308
  msgstr ""
309
 
310
- #: includes/discount-base.php:866 view/view-pricing-rules.php:710
311
  msgid "and"
312
  msgstr ""
313
 
314
- #: includes/discount-base.php:867 view/view-pricing-rules.php:712
315
  msgid "100% percent"
316
  msgstr ""
317
 
318
- #: includes/discount-base.php:868 view/view-pricing-rules.php:713
319
  msgid "Limited percent"
320
  msgstr ""
321
 
322
- #: includes/discount-base.php:869 view/view-pricing-rules.php:720
323
  msgid "Percentage"
324
  msgstr ""
325
 
326
- #: includes/discount-base.php:870 view/view-pricing-rules.php:722
327
  msgid "as discount"
328
  msgstr ""
329
 
330
- #: includes/discount-base.php:871 view/view-cart-rules.php:535
331
- #: view/view-pricing-rules.php:727
332
  msgid "Remove"
333
  msgstr ""
334
 
335
- #: includes/discount-base.php:872
 
 
 
 
 
336
  msgid "none"
337
  msgstr ""
338
 
339
- #: includes/discount-base.php:873
340
  msgid "Are you sure to remove this ?"
341
  msgstr ""
342
 
343
- #: includes/discount-base.php:875 view/cart-rules.php:125
344
- #: view/pricing-rules.php:153
345
  msgid "Disable"
346
  msgstr ""
347
 
348
- #: includes/discount-base.php:876
349
  msgid "Are you sure to remove ?"
350
  msgstr ""
351
 
352
- #: includes/discount-base.php:877 view/view-cart-rules.php:157
353
  msgid "Type"
354
  msgstr ""
355
 
356
- #: includes/discount-base.php:878 view/view-cart-rules.php:161
357
  msgid "Cart Subtotal"
358
  msgstr ""
359
 
360
- #: includes/discount-base.php:879 view/view-cart-rules.php:164
361
  msgid "Subtotal at least"
362
  msgstr ""
363
 
364
- #: includes/discount-base.php:880 view/view-cart-rules.php:168
365
  msgid "Subtotal less than"
366
  msgstr ""
367
 
368
- #: includes/discount-base.php:881 view/view-cart-rules.php:171
369
  msgid "Cart Item Count"
370
  msgstr ""
371
 
372
- #: includes/discount-base.php:882 view/view-cart-rules.php:174
373
  msgid "Number of line items in the cart (not quantity) at least"
374
  msgstr ""
375
 
376
- #: includes/discount-base.php:883 view/view-cart-rules.php:178
377
  msgid "Number of line items in the cart (not quantity) less than"
378
  msgstr ""
379
 
380
- #: includes/discount-base.php:884 view/view-cart-rules.php:181
381
  msgid "Quantity Sum"
382
  msgstr ""
383
 
384
- #: includes/discount-base.php:885 view/view-cart-rules.php:187
385
- #: view/view-cart-rules.php:190
386
  msgid "Total number of quantities in the cart at least"
387
  msgstr ""
388
 
389
- #: includes/discount-base.php:886 view/view-cart-rules.php:199
390
- #: view/view-cart-rules.php:202
391
  msgid "Total number of quantities in the cart less than"
392
  msgstr ""
393
 
394
- #: includes/discount-base.php:887 view/view-cart-rules.php:211
395
  msgid "Categories in cart"
396
  msgstr ""
397
 
398
- #: includes/discount-base.php:888 view/view-cart-rules.php:217
399
  msgid "Including sub-categories in cart"
400
  msgstr ""
401
 
402
- #: includes/discount-base.php:889 view/view-cart-rules.php:226
403
  msgid "Customer Details (must be logged in)"
404
  msgstr ""
405
 
406
- #: includes/discount-base.php:890 view/view-cart-rules.php:232
407
- #: view/view-cart-rules.php:234
408
  msgid "User in list"
409
  msgstr ""
410
 
411
- #: includes/discount-base.php:891 view/view-cart-rules.php:242
412
- #: view/view-cart-rules.php:244
413
  msgid "User role in list"
414
  msgstr ""
415
 
416
- #: includes/discount-base.php:892 view/view-cart-rules.php:252
417
- #: view/view-cart-rules.php:254
418
  msgid "Shipping country in list"
419
  msgstr ""
420
 
421
- #: includes/discount-base.php:893 view/view-cart-rules.php:258
422
  msgid "Customer Email"
423
  msgstr ""
424
 
425
- #: includes/discount-base.php:894
426
  msgid "Email with TLD (Ege: edu)"
427
  msgstr ""
428
 
429
- #: includes/discount-base.php:895 view/view-cart-rules.php:274
430
- #: view/view-cart-rules.php:276
431
  msgid "Email with Domain (Eg: gmail.com)"
432
  msgstr ""
433
 
434
- #: includes/discount-base.php:896 view/view-cart-rules.php:280
435
  msgid "Customer Billing Details"
436
  msgstr ""
437
 
438
- #: includes/discount-base.php:897 view/view-cart-rules.php:286
439
- #: view/view-cart-rules.php:288
440
  msgid "Billing city"
441
  msgstr ""
442
 
443
- #: includes/discount-base.php:898 view/view-cart-rules.php:292
444
  msgid "Customer Shipping Details"
445
  msgstr ""
446
 
447
- #: includes/discount-base.php:899 view/view-cart-rules.php:298
448
- #: view/view-cart-rules.php:300
449
  msgid "Shipping state"
450
  msgstr ""
451
 
452
- #: includes/discount-base.php:900 view/view-cart-rules.php:308
453
- #: view/view-cart-rules.php:310
454
  msgid "Shipping city"
455
  msgstr ""
456
 
457
- #: includes/discount-base.php:901 view/view-cart-rules.php:318
458
- #: view/view-cart-rules.php:320
459
  msgid "Shipping zip code"
460
  msgstr ""
461
 
462
- #: includes/discount-base.php:902 view/view-cart-rules.php:324
463
- #: view/view-pricing-rules.php:423
464
  msgid "Purchase History"
465
  msgstr ""
466
 
467
- #: includes/discount-base.php:903 view/view-cart-rules.php:330
468
- #: view/view-cart-rules.php:332 view/view-pricing-rules.php:431
469
  msgid "Purchased amount"
470
  msgstr ""
471
 
472
- #: includes/discount-base.php:904 view/view-cart-rules.php:340
473
- #: view/view-cart-rules.php:342
474
  msgid "Number of order purchased"
475
  msgstr ""
476
 
477
- #: includes/discount-base.php:905 view/view-cart-rules.php:350
478
- #: view/view-cart-rules.php:352
479
  msgid "Number of order purchased in products"
480
  msgstr ""
481
 
482
- #: includes/discount-base.php:906 view/view-cart-rules.php:356
483
  msgid "Coupon applied"
484
  msgstr ""
485
 
486
- #: includes/discount-base.php:907 view/view-cart-rules.php:362
487
- #: view/view-cart-rules.php:364
488
  msgid "Atleast any one"
489
  msgstr ""
490
 
491
- #: includes/discount-base.php:908 view/view-cart-rules.php:492
492
- #: view/view-pricing-rules.php:468
 
 
 
 
 
493
  msgid "Greater than or equal to"
494
  msgstr ""
495
 
496
- #: includes/discount-base.php:909 view/view-cart-rules.php:493
497
- #: view/view-pricing-rules.php:469
498
  msgid "Less than or equal to"
499
  msgstr ""
500
 
501
- #: includes/discount-base.php:910 view/view-cart-rules.php:495
502
- #: view/view-pricing-rules.php:472
503
  msgid "In Order status"
504
  msgstr ""
505
 
506
- #: includes/discount-base.php:911 view/cart-rules.php:109
507
- #: view/cart-rules.php:179 view/pricing-rules.php:137
508
- #: view/pricing-rules.php:207 view/view-cart-rules.php:534
509
  msgid "Action"
510
  msgstr ""
511
 
512
- #: includes/discount-base.php:912 view/settings.php:21
513
  msgid "Save"
514
  msgstr ""
515
 
516
- #: includes/discount-base.php:913
517
  msgid "Saved Successfully!"
518
  msgstr ""
519
 
520
- #: includes/discount-base.php:914 view/view-cart-rules.php:411
521
- #: view/view-cart-rules.php:430 view/view-cart-rules.php:451
522
- #: view/view-cart-rules.php:500 view/view-pricing-rules.php:191
523
- #: view/view-pricing-rules.php:207 view/view-pricing-rules.php:480
524
- #: view/view-pricing-rules.php:549 view/view-pricing-rules.php:700
 
525
  msgid "None selected"
526
  msgstr ""
527
 
528
- #: includes/discount-base.php:915 view/view-cart-rules.php:223
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
 
538
- #: includes/discount-base.php:917 view/template/sidebar.php:12
539
  msgid "Hide"
540
  msgstr ""
541
 
542
- #: includes/discount-base.php:918
543
  msgid "Please select at least one rule"
544
  msgstr ""
545
 
546
- #: includes/discount-base.php:919
547
  msgid "Please select an action to apply"
548
  msgstr ""
549
 
550
- #: includes/discount-base.php:920
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
 
@@ -648,8 +707,7 @@ msgstr ""
648
  msgid "View Examples"
649
  msgstr ""
650
 
651
- #: view/cart-rules.php:52 view/documentation.php:21 view/includes/menu.php:17
652
- #: view/pricing-rules.php:84
653
  msgid "Documentation"
654
  msgstr ""
655
 
@@ -661,55 +719,56 @@ msgstr ""
661
  msgid "Add New Rule"
662
  msgstr ""
663
 
664
- #: view/cart-rules.php:80 view/pricing-rules.php:108
665
  msgid "Bulk Actions"
666
  msgstr ""
667
 
668
- #: view/cart-rules.php:81 view/pricing-rules.php:109
669
  msgid "Enable rules"
670
  msgstr ""
671
 
672
- #: view/cart-rules.php:82 view/pricing-rules.php:110
673
  msgid "Disable rules"
674
  msgstr ""
675
 
676
- #: view/cart-rules.php:83 view/pricing-rules.php:111
677
  msgid "Delete rules"
678
  msgstr ""
679
 
680
- #: view/cart-rules.php:85 view/pricing-rules.php:113
681
  msgid "Apply"
682
  msgstr ""
683
 
684
- #: view/cart-rules.php:99 view/cart-rules.php:169 view/pricing-rules.php:127
685
- #: view/pricing-rules.php:197 view/template/discount-table.php:19
686
  msgid "Name"
687
  msgstr ""
688
 
689
- #: view/cart-rules.php:100 view/cart-rules.php:170 view/pricing-rules.php:128
690
- #: view/pricing-rules.php:198
691
  msgid "Start Date"
692
  msgstr ""
693
 
694
- #: view/cart-rules.php:101 view/cart-rules.php:171 view/pricing-rules.php:129
695
- #: view/pricing-rules.php:199
696
  msgid "Expired On"
697
  msgstr ""
698
 
699
- #: view/cart-rules.php:104 view/cart-rules.php:174 view/pricing-rules.php:132
700
- #: view/pricing-rules.php:202
701
- msgid "Order"
702
  msgstr ""
703
 
704
- #: view/cart-rules.php:142 view/pricing-rules.php:170
705
- msgid "Edit"
 
706
  msgstr ""
707
 
708
- #: view/cart-rules.php:146 view/pricing-rules.php:174
709
- msgid "Duplicate"
710
  msgstr ""
711
 
712
- #: view/cart-rules.php:153 view/pricing-rules.php:181
713
  msgid "Delete"
714
  msgstr ""
715
 
@@ -721,57 +780,73 @@ msgstr ""
721
  msgid "Welcome onboard"
722
  msgstr ""
723
 
724
- #: view/documentation.php:30 view/includes/menu.php:9
725
- msgid "Price Discount Rules"
726
  msgstr ""
727
 
728
  #: view/documentation.php:30
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
729
  msgid "Learn all about creating a price discount rules"
730
  msgstr ""
731
 
732
- #: view/documentation.php:33 view/includes/menu.php:11
733
  msgid "Cart Discount Rules"
734
  msgstr ""
735
 
736
- #: view/documentation.php:33
737
  msgid "Cart based discount rules with examples."
738
  msgstr ""
739
 
740
- #: view/documentation.php:36
741
  msgid "How to create a perfect BOGO discount rule in WooCommerce"
742
  msgstr ""
743
 
744
- #: view/documentation.php:36
745
  msgid ""
746
  "Buy One Get One deals can be simple to complex. Learn how to get them "
747
  "working correct in your online store"
748
  msgstr ""
749
 
750
- #: view/documentation.php:39
751
  msgid "User Role based discount rules"
752
  msgstr ""
753
 
754
- #: view/documentation.php:39
755
  msgid ""
756
  "Learn how to create user role based / customer group based discount in "
757
  "WooCommerce"
758
  msgstr ""
759
 
760
- #: view/documentation.php:42
761
  msgid "Activate discount rule using a coupon code in WooCommerce"
762
  msgstr ""
763
 
764
- #: view/documentation.php:42
765
  msgid ""
766
  "Apply the dynamic discount rules after the customer enters a valid coupon "
767
  "code"
768
  msgstr ""
769
 
770
- #: view/documentation.php:45
771
  msgid "Purchase History Based Discount"
772
  msgstr ""
773
 
774
- #: view/documentation.php:45
775
  msgid ""
776
  "Price Rule and Cart Rule which gives discount based on the purchase history"
777
  msgstr ""
@@ -787,8 +862,8 @@ msgid "Conditions"
787
  msgstr ""
788
 
789
  #: view/includes/cart-menu.php:13 view/includes/sub-menu.php:13
790
- #: view/template/discount-table.php:25 view/view-cart-rules.php:551
791
- #: view/view-pricing-rules.php:571
792
  msgid "Discount"
793
  msgstr ""
794
 
@@ -813,6 +888,10 @@ msgstr ""
813
  msgid "Settings"
814
  msgstr ""
815
 
 
 
 
 
816
  #: view/includes/sub-menu.php:11
817
  msgid "Condition"
818
  msgstr ""
@@ -853,208 +932,249 @@ msgstr ""
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
1054
  msgid "Range"
1055
  msgstr ""
1056
 
1057
- #: view/template/discount-table.php:56
1058
  msgid "No Active Discounts."
1059
  msgstr ""
1060
 
@@ -1074,110 +1194,118 @@ msgstr ""
1074
  msgid "Edit Cart Rule"
1075
  msgstr ""
1076
 
1077
- #: view/view-cart-rules.php:68 view/view-pricing-rules.php:52
1078
- msgid "Order :"
1079
  msgstr ""
1080
 
1081
- #: view/view-cart-rules.php:70 view/view-pricing-rules.php:54
1082
  msgid ""
1083
  "The Simple Ranking concept to said, which one is going to execute first and "
1084
  "so on."
1085
  msgstr ""
1086
 
1087
- #: view/view-cart-rules.php:77 view/view-pricing-rules.php:62
1088
- msgid "WARNING: More than one rule should not have same priority."
1089
- msgstr ""
1090
-
1091
- #: view/view-cart-rules.php:83 view/view-pricing-rules.php:68
1092
  msgid "Rule Name"
1093
  msgstr ""
1094
 
1095
- #: view/view-cart-rules.php:85 view/view-cart-rules.php:97
1096
- #: view/view-pricing-rules.php:70 view/view-pricing-rules.php:82
1097
  msgid "Rule Descriptions."
1098
  msgstr ""
1099
 
1100
- #: view/view-cart-rules.php:90 view/view-pricing-rules.php:75
1101
  msgid "ex. Standard Rule."
1102
  msgstr ""
1103
 
1104
- #: view/view-cart-rules.php:95 view/view-pricing-rules.php:80
1105
  msgid "Rule Description"
1106
  msgstr ""
1107
 
1108
- #: view/view-cart-rules.php:106 view/view-pricing-rules.php:116
1109
  msgid "Validity"
1110
  msgstr ""
1111
 
1112
- #: view/view-cart-rules.php:107 view/view-pricing-rules.php:117
1113
  msgid "Period of Rule Active. Format: month/day/Year Hour:Min"
1114
  msgstr ""
1115
 
1116
- #: view/view-cart-rules.php:120 view/view-pricing-rules.php:130
1117
- #: view/view-pricing-rules.php:515
1118
  msgid "From"
1119
  msgstr ""
1120
 
1121
- #: view/view-cart-rules.php:124
1122
  msgid "To"
1123
  msgstr ""
1124
 
1125
- #: view/view-cart-rules.php:125 view/view-pricing-rules.php:135
1126
  #, php-format
1127
  msgid "Current date and time: %s"
1128
  msgstr ""
1129
 
1130
- #: view/view-cart-rules.php:130 view/view-cart-rules.php:546
1131
- #: view/view-pricing-rules.php:139 view/view-pricing-rules.php:564
 
 
 
 
1132
  msgid "Next"
1133
  msgstr ""
1134
 
1135
- #: view/view-cart-rules.php:134
1136
  msgid "Cart Conditions"
1137
  msgstr ""
1138
 
1139
- #: view/view-cart-rules.php:137
1140
  msgid "Add Condition"
1141
  msgstr ""
1142
 
1143
- #: view/view-cart-rules.php:206
1144
  msgid "Categories In Cart"
1145
  msgstr ""
1146
 
1147
- #: view/view-cart-rules.php:264 view/view-cart-rules.php:266
1148
  msgid "Email with TLD (Eg: edu)"
1149
  msgstr ""
1150
 
1151
- #: view/view-cart-rules.php:526 view/view-pricing-rules.php:354
1152
  msgid "To get this condition work,"
1153
  msgstr ""
1154
 
1155
- #: view/view-cart-rules.php:526 view/view-pricing-rules.php:354
1156
  msgid "please change the option"
1157
  msgstr ""
1158
 
1159
- #: view/view-cart-rules.php:526 view/view-pricing-rules.php:354
1160
  msgid "Disable the rules while have coupon(Third party)"
1161
  msgstr ""
1162
 
1163
- #: view/view-cart-rules.php:526 view/view-pricing-rules.php:354
1164
  msgid "in cart to"
1165
  msgstr ""
1166
 
1167
- #: view/view-cart-rules.php:545 view/view-cart-rules.php:605
1168
- #: view/view-pricing-rules.php:563 view/view-pricing-rules.php:750
1169
  msgid "Previous"
1170
  msgstr ""
1171
 
1172
- #: view/view-cart-rules.php:567
 
 
 
 
1173
  msgid "Discount Type :"
1174
  msgstr ""
1175
 
1176
- #: view/view-cart-rules.php:586 view/view-cart-rules.php:588
 
 
 
 
1177
  msgid "Free shipping"
1178
  msgstr ""
1179
 
1180
- #: view/view-cart-rules.php:597
1181
  msgid "value :"
1182
  msgstr ""
1183
 
@@ -1189,224 +1317,262 @@ msgstr ""
1189
  msgid "Edit Price Rule"
1190
  msgstr ""
1191
 
1192
- #: view/view-pricing-rules.php:91
1193
  msgid "Method"
1194
  msgstr ""
1195
 
1196
- #: view/view-pricing-rules.php:93
1197
  msgid "Method to Apply."
1198
  msgstr ""
1199
 
1200
- #: view/view-pricing-rules.php:99
1201
- msgid "Quantity based by product/category and BOGO deals"
 
1202
  msgstr ""
1203
 
1204
- #: view/view-pricing-rules.php:106 view/view-pricing-rules.php:108
1205
- msgid "Dependant product based discount"
1206
  msgstr ""
1207
 
1208
- #: view/view-pricing-rules.php:134
1209
  msgid "To - Leave Empty if No Expiry"
1210
  msgstr ""
1211
 
1212
- #: view/view-pricing-rules.php:144
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1213
  msgid "Discount Conditions"
1214
  msgstr ""
1215
 
1216
- #: view/view-pricing-rules.php:149
1217
  msgid "Apply To"
1218
  msgstr ""
1219
 
1220
- #: view/view-pricing-rules.php:155
1221
  msgid "All products"
1222
  msgstr ""
1223
 
1224
- #: view/view-pricing-rules.php:159
1225
  msgid "Specific products"
1226
  msgstr ""
1227
 
1228
- #: view/view-pricing-rules.php:165 view/view-pricing-rules.php:167
1229
  msgid "Specific categories"
1230
  msgstr ""
1231
 
1232
- #: view/view-pricing-rules.php:174 view/view-pricing-rules.php:176
1233
  msgid "Specific attributes"
1234
  msgstr ""
1235
 
1236
- #: view/view-pricing-rules.php:187
1237
- msgid "Check this box to count quantities cumulatively across products"
 
1238
  msgstr ""
1239
 
1240
- #: view/view-pricing-rules.php:199
1241
  msgid "Check this box to count quantities cumulatively across category(ies)"
1242
  msgstr ""
1243
 
1244
- #: view/view-pricing-rules.php:202
1245
  msgid "Check this box to apply child category(ies)"
1246
  msgstr ""
1247
 
1248
- #: view/view-pricing-rules.php:216
1249
  msgid "Check this box to count quantities cumulatively across attribute"
1250
  msgstr ""
1251
 
1252
- #: view/view-pricing-rules.php:226
1253
  msgid "Exclude products"
1254
  msgstr ""
1255
 
1256
- #: view/view-pricing-rules.php:245
1257
  msgid "Exclude sale items"
1258
  msgstr ""
1259
 
1260
- #: view/view-pricing-rules.php:250
1261
  msgid "Check this box if the rule should not apply to items on sale."
1262
  msgstr ""
1263
 
1264
- #: view/view-pricing-rules.php:269
1265
  msgid "Customers"
1266
  msgstr ""
1267
 
1268
- #: view/view-pricing-rules.php:274 view/view-pricing-rules.php:536
1269
  msgid "All"
1270
  msgstr ""
1271
 
1272
- #: view/view-pricing-rules.php:281 view/view-pricing-rules.php:283
1273
  msgid "Only Given"
1274
  msgstr ""
1275
 
1276
- #: view/view-pricing-rules.php:297
1277
  msgid "User roles"
1278
  msgstr ""
1279
 
1280
- #: view/view-pricing-rules.php:302 view/view-pricing-rules.php:332
1281
- #: view/view-pricing-rules.php:387 view/view-pricing-rules.php:430
1282
  msgid "Do not use"
1283
  msgstr ""
1284
 
1285
- #: view/view-pricing-rules.php:324
1286
  msgid "Coupon"
1287
  msgstr ""
1288
 
1289
- #: view/view-pricing-rules.php:333
1290
  msgid "Apply if any one coupon applied"
1291
  msgstr ""
1292
 
1293
- #: view/view-pricing-rules.php:334
1294
  msgid "Apply if all coupon applied"
1295
  msgstr ""
1296
 
1297
- #: view/view-pricing-rules.php:340
1298
- msgid "Enter the coupon code separated by comma(,)"
1299
- msgstr ""
1300
-
1301
- #: view/view-pricing-rules.php:344
1302
  msgid "Make sure you have created the coupon already"
1303
  msgstr ""
1304
 
1305
- #: view/view-pricing-rules.php:377
1306
  msgid "Subtotal"
1307
  msgstr ""
1308
 
1309
- #: view/view-pricing-rules.php:388
1310
  msgid "Subtotal atleast"
1311
  msgstr ""
1312
 
1313
- #: view/view-pricing-rules.php:393
1314
  msgid "Enter the amount"
1315
  msgstr ""
1316
 
1317
- #: view/view-pricing-rules.php:403
1318
  msgid "Supported in WooCommerce 3.x"
1319
  msgstr ""
1320
 
1321
- #: view/view-pricing-rules.php:432
1322
  msgid "Number of orders"
1323
  msgstr ""
1324
 
1325
- #: view/view-pricing-rules.php:433
1326
  msgid "Purchased product"
1327
  msgstr ""
1328
 
1329
- #: view/view-pricing-rules.php:507
1330
  msgid "Any"
1331
  msgstr ""
1332
 
1333
- #: view/view-pricing-rules.php:508
1334
  msgid "Each"
1335
  msgstr ""
1336
 
1337
- #: view/view-pricing-rules.php:509
1338
  msgid "Combine"
1339
  msgstr ""
1340
 
1341
- #: view/view-pricing-rules.php:512
1342
  msgid "More than"
1343
  msgstr ""
1344
 
1345
- #: view/view-pricing-rules.php:513
1346
  msgid "Less than"
1347
  msgstr ""
1348
 
1349
- #: view/view-pricing-rules.php:514
1350
  msgid "Equal"
1351
  msgstr ""
1352
 
1353
- #: view/view-pricing-rules.php:517 view/view-pricing-rules.php:520
1354
- #: view/view-pricing-rules.php:540
1355
  msgid "Quantity"
1356
  msgstr ""
1357
 
1358
- #: view/view-pricing-rules.php:519
1359
  msgid "to"
1360
  msgstr ""
1361
 
1362
- #: view/view-pricing-rules.php:523
1363
  msgid "Product(s) from"
1364
  msgstr ""
1365
 
1366
- #: view/view-pricing-rules.php:529
1367
  msgid "Apply discount in product(s)"
1368
  msgstr ""
1369
 
1370
- #: view/view-pricing-rules.php:530
1371
  msgid "Apply discount in category(ies)"
1372
  msgstr ""
1373
 
1374
- #: view/view-pricing-rules.php:534
1375
  msgid "and get discount in "
1376
  msgstr ""
1377
 
1378
- #: view/view-pricing-rules.php:537
1379
  msgid "First quantity(s)"
1380
  msgstr ""
1381
 
1382
- #: view/view-pricing-rules.php:538
1383
  msgid "Skip first quantity(s)"
1384
  msgstr ""
1385
 
1386
- #: view/view-pricing-rules.php:543
1387
  msgid " Product(s) "
1388
  msgstr ""
1389
 
1390
- #: view/view-pricing-rules.php:547
1391
  msgid "Category(ies)"
1392
  msgstr ""
1393
 
1394
- #: view/view-pricing-rules.php:558
1395
- msgid "Document for product dependent rules"
1396
  msgstr ""
1397
 
1398
- #: view/view-pricing-rules.php:574
1399
  msgid "Add New Range"
1400
  msgstr ""
1401
 
1402
- #: view/view-pricing-rules.php:733
1403
- msgid "Document to create perfect BOGO rules"
1404
  msgstr ""
1405
 
1406
- #: view/view-pricing-rules.php:743
1407
  msgid "Percent"
1408
  msgstr ""
1409
 
1410
- #: view/view-pricing-rules.php:744
1411
  msgid "Fixed"
1412
  msgstr ""
11
  "Language: en\n"
12
  "X-Generator: Poedit 1.8.7.1\n"
13
 
14
+ #: helper/general-helper.php:45
15
  msgid "Guest"
16
  msgstr ""
17
 
18
+ #: helper/general-helper.php:505
19
+ msgid "Start date and time is set as future date"
20
+ msgstr ""
21
+
22
+ #: helper/general-helper.php:508
23
+ msgid "End date is expired"
24
+ msgstr ""
25
+
26
+ #: helper/general-helper.php:624
27
  msgid "Read Docs"
28
  msgstr ""
29
 
87
  msgid "License key seems to be Invalid. Please enter a valid license key"
88
  msgstr ""
89
 
90
+ #: helper/woo-function.php:355 helper/woo-function.php:365
91
  msgid "Search for a product&hellip;"
92
  msgstr ""
93
 
94
+ #: helper/woo-function.php:398 helper/woo-function.php:410
95
  msgid "Search for a user&hellip;"
96
  msgstr ""
97
 
103
  msgid "Custom Shipping Method for Woocommerce Discount Rules"
104
  msgstr ""
105
 
106
+ #: includes/advanced/free_shipping_method.php:68 view/settings.php:492
107
  msgid "Free Shipping"
108
  msgstr ""
109
 
110
+ #: includes/advanced/free_shipping_method.php:73 includes/discount-base.php:900
111
+ #: view/cart-rules.php:127 view/pricing-rules.php:157 view/settings.php:573
112
+ #: view/settings.php:608
113
  msgid "Enable"
114
  msgstr ""
115
 
125
  msgid "Title to be display on site"
126
  msgstr ""
127
 
128
+ #: includes/discount-base.php:178 view/cart-rules.php:141
129
+ #: view/pricing-rules.php:171
130
+ msgid "Active"
131
+ msgstr ""
132
+
133
+ #: includes/discount-base.php:180 view/cart-rules.php:143
134
+ #: view/pricing-rules.php:173 view/settings.php:227 view/settings.php:362
135
+ #: view/settings.php:461 view/settings.php:468 view/settings.php:570
136
+ #: view/settings.php:605
137
+ msgid "Disabled"
138
+ msgstr ""
139
+
140
+ #: includes/discount-base.php:187 view/cart-rules.php:150
141
+ #: view/pricing-rules.php:180
142
+ msgid "Running"
143
+ msgstr ""
144
+
145
+ #: includes/discount-base.php:189 view/cart-rules.php:152
146
+ #: view/pricing-rules.php:182
147
+ msgid "Not running"
148
+ msgstr ""
149
+
150
+ #: includes/discount-base.php:390
151
  msgid "Cache cleared successfully"
152
  msgstr ""
153
 
154
+ #: includes/discount-base.php:392
155
  msgid "Failed to clear cache"
156
  msgstr ""
157
 
158
+ #: includes/discount-base.php:498 includes/discount-base.php:533
159
  msgid "Failed to do action"
160
  msgstr ""
161
 
162
+ #: includes/discount-base.php:537
163
  msgid "Disabled successfully"
164
  msgstr ""
165
 
166
+ #: includes/discount-base.php:540
167
  msgid "Deleted successfully"
168
  msgstr ""
169
 
170
+ #: includes/discount-base.php:543
171
  msgid "Enabled successfully"
172
  msgstr ""
173
 
174
+ #: includes/discount-base.php:563 includes/discount-base.php:564
175
+ #: includes/discount-base.php:581
176
  msgid "copy"
177
  msgstr ""
178
 
179
+ #: includes/discount-base.php:589
180
  msgid "Duplicate rule created successfully"
181
  msgstr ""
182
 
183
+ #: includes/discount-base.php:593
184
  msgid "Failed to create duplicate rule"
185
  msgstr ""
186
 
187
+ #: includes/discount-base.php:856
188
  msgid "Please fill this field"
189
  msgstr ""
190
 
191
+ #: includes/discount-base.php:857
192
  msgid "Please Enter the Rule Name to Create / Save."
193
  msgstr ""
194
 
195
+ #: includes/discount-base.php:858
196
  msgid "Saving..."
197
  msgstr ""
198
 
199
+ #: includes/discount-base.php:859 view/view-cart-rules.php:54
200
  #: view/view-pricing-rules.php:38
201
  msgid "Save Rule"
202
  msgstr ""
203
 
204
+ #: includes/discount-base.php:860
205
  msgid "Please enter a Key"
206
  msgstr ""
207
 
208
+ #: includes/discount-base.php:861 view/view-pricing-rules.php:650
209
  msgid "Min Quantity"
210
  msgstr ""
211
 
212
+ #: includes/discount-base.php:862 view/view-pricing-rules.php:657
213
  msgid "Max Quantity"
214
  msgstr ""
215
 
216
+ #: includes/discount-base.php:863 view/view-cart-rules.php:76
217
+ #: view/view-pricing-rules.php:76 view/view-pricing-rules.php:655
218
+ #: view/view-pricing-rules.php:721 view/view-pricing-rules.php:738
219
+ #: view/view-pricing-rules.php:745
220
  msgid "ex. 1"
221
  msgstr ""
222
 
223
+ #: includes/discount-base.php:864 view/view-pricing-rules.php:783
224
  msgid "ex. 10"
225
  msgstr ""
226
 
227
+ #: includes/discount-base.php:865 view/view-pricing-rules.php:662
228
+ #: view/view-pricing-rules.php:698
229
  msgid "ex. 50"
230
  msgstr ""
231
 
232
+ #: includes/discount-base.php:866
233
  msgid "Search for a user"
234
  msgstr ""
235
 
236
+ #: includes/discount-base.php:867 view/view-pricing-rules.php:663
237
  msgid "Adjustment Type"
238
  msgstr ""
239
 
240
+ #: includes/discount-base.php:868 view/view-pricing-rules.php:772
241
+ msgid "Discount percentage"
 
242
  msgstr ""
243
 
244
+ #: includes/discount-base.php:869 view/view-cart-rules.php:619
245
+ #: view/view-cart-rules.php:621 view/view-pricing-rules.php:677
246
+ #: view/view-pricing-rules.php:679
247
  msgid "Price Discount"
248
  msgstr ""
249
 
250
+ #: includes/discount-base.php:870 view/view-pricing-rules.php:687
251
+ #: view/view-pricing-rules.php:689
252
+ msgid "BOGO Product Discount"
253
  msgstr ""
254
 
255
+ #: includes/discount-base.php:871
256
  msgid "Product Discount - Not support for subtotal based rule"
257
  msgstr ""
258
 
259
+ #: includes/discount-base.php:872 view/view-cart-rules.php:397
260
+ #: view/view-pricing-rules.php:693 view/view-pricing-rules.php:812
261
  msgid "Value"
262
  msgstr ""
263
 
264
+ #: includes/discount-base.php:873 view/view-pricing-rules.php:704
265
+ msgid "receive discount for"
266
  msgstr ""
267
 
268
+ #: includes/discount-base.php:874 view/view-pricing-rules.php:706
269
+ msgid "Auto add all selected products"
 
270
  msgstr ""
271
 
272
+ #: includes/discount-base.php:875 view/view-pricing-rules.php:707
273
  msgid "Same product"
274
  msgstr ""
275
 
276
+ #: includes/discount-base.php:876 view/view-pricing-rules.php:708
277
  msgid "Any one cheapest from selected"
278
  msgstr ""
279
 
280
+ #: includes/discount-base.php:877 view/view-pricing-rules.php:709
281
  msgid "Any one cheapest from all products"
282
  msgstr ""
283
 
284
+ #: includes/discount-base.php:878 view/view-pricing-rules.php:710
285
+ msgid "Cheapest in cart - selected category(ies)"
286
  msgstr ""
287
 
288
+ #: includes/discount-base.php:879 view/view-pricing-rules.php:711
289
+ #: view/view-pricing-rules.php:712
290
+ msgid "Cheapest in cart - selected item(s)"
291
  msgstr ""
292
 
293
+ #: includes/discount-base.php:880
294
+ msgid "Cheapest among all items in cart"
295
  msgstr ""
296
 
297
+ #: includes/discount-base.php:881 view/view-pricing-rules.php:716
298
  msgid "Free quantity"
299
  msgstr ""
300
 
301
+ #: includes/discount-base.php:882 view/view-pricing-rules.php:716
302
  msgid "Number of quantity(ies) in each selected product(s)"
303
  msgstr ""
304
 
305
+ #: includes/discount-base.php:883 view/view-pricing-rules.php:730
306
+ msgid "Fixed item count (not recommended)"
307
  msgstr ""
308
 
309
+ #: includes/discount-base.php:884 view/view-pricing-rules.php:729
310
  msgid "Dynamic item count"
311
  msgstr ""
312
 
313
+ #: includes/discount-base.php:885 view/view-pricing-rules.php:732
314
  msgid ""
315
  "Fixed item count - You need to provide item count manually. Dynamic item "
316
  "count - System will choose dynamically based on cart"
317
  msgstr ""
318
 
319
+ #: includes/discount-base.php:886 view/view-pricing-rules.php:733
320
  msgid "Item count"
321
  msgstr ""
322
 
323
+ #: includes/discount-base.php:887 view/view-pricing-rules.php:733
324
  msgid "Discount for number of item(s) in cart"
325
  msgstr ""
326
 
327
+ #: includes/discount-base.php:888 view/view-pricing-rules.php:740
328
  msgid "Discount for number of quantity(ies) in each item"
329
  msgstr ""
330
 
331
+ #: includes/discount-base.php:889 view/view-pricing-rules.php:740
332
  msgid "Item quantity"
333
  msgstr ""
334
 
335
+ #: includes/discount-base.php:890
336
  msgid "Search for a products"
337
  msgstr ""
338
 
339
+ #: includes/discount-base.php:891
340
  msgid "and"
341
  msgstr ""
342
 
343
+ #: includes/discount-base.php:892 view/view-pricing-rules.php:774
344
  msgid "100% percent"
345
  msgstr ""
346
 
347
+ #: includes/discount-base.php:893 view/view-pricing-rules.php:775
348
  msgid "Limited percent"
349
  msgstr ""
350
 
351
+ #: includes/discount-base.php:894 view/view-pricing-rules.php:783
352
  msgid "Percentage"
353
  msgstr ""
354
 
355
+ #: includes/discount-base.php:895
356
  msgid "as discount"
357
  msgstr ""
358
 
359
+ #: includes/discount-base.php:896 view/view-cart-rules.php:576
360
+ #: view/view-pricing-rules.php:789
361
  msgid "Remove"
362
  msgstr ""
363
 
364
+ #: includes/discount-base.php:897 view/cart-rules.php:163
365
+ #: view/pricing-rules.php:193 view/view-pricing-rules.php:792
366
+ msgid "Duplicate"
367
+ msgstr ""
368
+
369
+ #: includes/discount-base.php:898
370
  msgid "none"
371
  msgstr ""
372
 
373
+ #: includes/discount-base.php:899
374
  msgid "Are you sure to remove this ?"
375
  msgstr ""
376
 
377
+ #: includes/discount-base.php:901 view/cart-rules.php:124
378
+ #: view/pricing-rules.php:154
379
  msgid "Disable"
380
  msgstr ""
381
 
382
+ #: includes/discount-base.php:902
383
  msgid "Are you sure to remove ?"
384
  msgstr ""
385
 
386
+ #: includes/discount-base.php:903 view/view-cart-rules.php:170
387
  msgid "Type"
388
  msgstr ""
389
 
390
+ #: includes/discount-base.php:904 view/view-cart-rules.php:174
391
  msgid "Cart Subtotal"
392
  msgstr ""
393
 
394
+ #: includes/discount-base.php:905 view/view-cart-rules.php:177
395
  msgid "Subtotal at least"
396
  msgstr ""
397
 
398
+ #: includes/discount-base.php:906 view/view-cart-rules.php:181
399
  msgid "Subtotal less than"
400
  msgstr ""
401
 
402
+ #: includes/discount-base.php:907 view/view-cart-rules.php:184
403
  msgid "Cart Item Count"
404
  msgstr ""
405
 
406
+ #: includes/discount-base.php:908 view/view-cart-rules.php:187
407
  msgid "Number of line items in the cart (not quantity) at least"
408
  msgstr ""
409
 
410
+ #: includes/discount-base.php:909 view/view-cart-rules.php:191
411
  msgid "Number of line items in the cart (not quantity) less than"
412
  msgstr ""
413
 
414
+ #: includes/discount-base.php:910 view/view-cart-rules.php:194
415
  msgid "Quantity Sum"
416
  msgstr ""
417
 
418
+ #: includes/discount-base.php:911 view/view-cart-rules.php:200
419
+ #: view/view-cart-rules.php:203
420
  msgid "Total number of quantities in the cart at least"
421
  msgstr ""
422
 
423
+ #: includes/discount-base.php:912 view/view-cart-rules.php:212
424
+ #: view/view-cart-rules.php:215
425
  msgid "Total number of quantities in the cart less than"
426
  msgstr ""
427
 
428
+ #: includes/discount-base.php:913 view/view-cart-rules.php:224
429
  msgid "Categories in cart"
430
  msgstr ""
431
 
432
+ #: includes/discount-base.php:914 view/view-cart-rules.php:230
433
  msgid "Including sub-categories in cart"
434
  msgstr ""
435
 
436
+ #: includes/discount-base.php:915 view/view-cart-rules.php:239
437
  msgid "Customer Details (must be logged in)"
438
  msgstr ""
439
 
440
+ #: includes/discount-base.php:916 view/view-cart-rules.php:245
441
+ #: view/view-cart-rules.php:247
442
  msgid "User in list"
443
  msgstr ""
444
 
445
+ #: includes/discount-base.php:917 view/view-cart-rules.php:255
446
+ #: view/view-cart-rules.php:257
447
  msgid "User role in list"
448
  msgstr ""
449
 
450
+ #: includes/discount-base.php:918 view/view-cart-rules.php:265
451
+ #: view/view-cart-rules.php:267
452
  msgid "Shipping country in list"
453
  msgstr ""
454
 
455
+ #: includes/discount-base.php:919 view/view-cart-rules.php:271
456
  msgid "Customer Email"
457
  msgstr ""
458
 
459
+ #: includes/discount-base.php:920
460
  msgid "Email with TLD (Ege: edu)"
461
  msgstr ""
462
 
463
+ #: includes/discount-base.php:921 view/view-cart-rules.php:287
464
+ #: view/view-cart-rules.php:289
465
  msgid "Email with Domain (Eg: gmail.com)"
466
  msgstr ""
467
 
468
+ #: includes/discount-base.php:922 view/view-cart-rules.php:293
469
  msgid "Customer Billing Details"
470
  msgstr ""
471
 
472
+ #: includes/discount-base.php:923 view/view-cart-rules.php:299
473
+ #: view/view-cart-rules.php:301
474
  msgid "Billing city"
475
  msgstr ""
476
 
477
+ #: includes/discount-base.php:924 view/view-cart-rules.php:305
478
  msgid "Customer Shipping Details"
479
  msgstr ""
480
 
481
+ #: includes/discount-base.php:925 view/view-cart-rules.php:311
482
+ #: view/view-cart-rules.php:313
483
  msgid "Shipping state"
484
  msgstr ""
485
 
486
+ #: includes/discount-base.php:926 view/view-cart-rules.php:321
487
+ #: view/view-cart-rules.php:323
488
  msgid "Shipping city"
489
  msgstr ""
490
 
491
+ #: includes/discount-base.php:927 view/view-cart-rules.php:331
492
+ #: view/view-cart-rules.php:333
493
  msgid "Shipping zip code"
494
  msgstr ""
495
 
496
+ #: includes/discount-base.php:928 view/view-cart-rules.php:337
497
+ #: view/view-pricing-rules.php:479
498
  msgid "Purchase History"
499
  msgstr ""
500
 
501
+ #: includes/discount-base.php:929 view/view-cart-rules.php:343
502
+ #: view/view-cart-rules.php:345 view/view-pricing-rules.php:487
503
  msgid "Purchased amount"
504
  msgstr ""
505
 
506
+ #: includes/discount-base.php:930 view/view-cart-rules.php:353
507
+ #: view/view-cart-rules.php:355
508
  msgid "Number of order purchased"
509
  msgstr ""
510
 
511
+ #: includes/discount-base.php:931 view/view-cart-rules.php:363
512
+ #: view/view-cart-rules.php:365
513
  msgid "Number of order purchased in products"
514
  msgstr ""
515
 
516
+ #: includes/discount-base.php:932 view/view-cart-rules.php:369
517
  msgid "Coupon applied"
518
  msgstr ""
519
 
520
+ #: includes/discount-base.php:933 view/view-cart-rules.php:375
521
+ #: view/view-cart-rules.php:377
522
  msgid "Atleast any one"
523
  msgstr ""
524
 
525
+ #: includes/discount-base.php:934 view/view-cart-rules.php:385
526
+ #: view/view-cart-rules.php:387
527
+ msgid "All selected"
528
+ msgstr ""
529
+
530
+ #: includes/discount-base.php:935 view/view-cart-rules.php:533
531
+ #: view/view-pricing-rules.php:524
532
  msgid "Greater than or equal to"
533
  msgstr ""
534
 
535
+ #: includes/discount-base.php:936 view/view-cart-rules.php:534
536
+ #: view/view-pricing-rules.php:525
537
  msgid "Less than or equal to"
538
  msgstr ""
539
 
540
+ #: includes/discount-base.php:937 view/view-cart-rules.php:536
541
+ #: view/view-pricing-rules.php:528
542
  msgid "In Order status"
543
  msgstr ""
544
 
545
+ #: includes/discount-base.php:938 view/cart-rules.php:108
546
+ #: view/cart-rules.php:197 view/pricing-rules.php:138
547
+ #: view/pricing-rules.php:227 view/view-cart-rules.php:575
548
  msgid "Action"
549
  msgstr ""
550
 
551
+ #: includes/discount-base.php:939 view/settings.php:21
552
  msgid "Save"
553
  msgstr ""
554
 
555
+ #: includes/discount-base.php:940
556
  msgid "Saved Successfully!"
557
  msgstr ""
558
 
559
+ #: includes/discount-base.php:941 view/view-cart-rules.php:426
560
+ #: view/view-cart-rules.php:452 view/view-cart-rules.php:471
561
+ #: view/view-cart-rules.php:492 view/view-cart-rules.php:541
562
+ #: view/view-pricing-rules.php:235 view/view-pricing-rules.php:251
563
+ #: view/view-pricing-rules.php:536 view/view-pricing-rules.php:605
564
+ #: view/view-pricing-rules.php:760
565
  msgid "None selected"
566
  msgstr ""
567
 
568
+ #: includes/discount-base.php:942 view/view-cart-rules.php:236
569
  msgid "In each category"
570
  msgstr ""
571
 
572
+ #: includes/discount-base.php:943 view/settings.php:189 view/settings.php:208
573
+ #: view/settings.php:266 view/settings.php:284 view/settings.php:302
574
+ #: view/settings.php:320
575
  msgid "Show"
576
  msgstr ""
577
 
578
+ #: includes/discount-base.php:944 view/template/sidebar.php:12
579
  msgid "Hide"
580
  msgstr ""
581
 
582
+ #: includes/discount-base.php:945
583
  msgid "Please select at least one rule"
584
  msgstr ""
585
 
586
+ #: includes/discount-base.php:946
587
  msgid "Please select an action to apply"
588
  msgstr ""
589
 
590
+ #: includes/discount-base.php:947
591
  msgid "Are you sure to remove the selected rules"
592
  msgstr ""
593
 
594
+ #: includes/discount-base.php:948 view/view-pricing-rules.php:749
595
+ msgid "Choose product(s)"
596
+ msgstr ""
597
+
598
+ #: includes/discount-base.php:949 view/view-pricing-rules.php:759
599
+ msgid "Choose category(ies)"
600
+ msgstr ""
601
+
602
+ #: includes/discount-base.php:950 view/view-pricing-rules.php:714
603
+ msgid ""
604
+ "Auto add all selected products - Automatically added to the cart <br> Same "
605
+ "product - get discount in same product <br> Any one cheapest from selected - "
606
+ "Get discount in one selected product <br> Any one cheapest from all products "
607
+ "- Get discount in one cheapest product in cart <br> Cheapest in cart - "
608
+ "selected category(ies) - cheapest product from the selected category will be "
609
+ "discounted <br> Cheapest in cart - selected item(s) - get discount in chosen "
610
+ "no.of quantities"
611
+ msgstr ""
612
+
613
+ #: includes/pricing-rules.php:2542 view/view-pricing-rules.php:561
614
  msgid "Buy"
615
  msgstr ""
616
 
617
+ #: includes/pricing-rules.php:2546
618
  msgid " less than or equal to "
619
  msgstr ""
620
 
621
+ #: includes/pricing-rules.php:2546 includes/pricing-rules.php:2552
622
  msgid " Quantity"
623
  msgstr ""
624
 
625
+ #: includes/pricing-rules.php:2549
626
  msgid " Quantity "
627
  msgstr ""
628
 
629
+ #: includes/pricing-rules.php:2556
630
  msgid " or more Quantity"
631
  msgstr ""
632
 
633
+ #: includes/pricing-rules.php:2565
634
  msgid " any "
635
  msgstr ""
636
 
637
+ #: includes/pricing-rules.php:2565
638
  msgid " products from "
639
  msgstr ""
640
 
641
+ #: includes/pricing-rules.php:2572
642
  msgid " in each products"
643
  msgstr ""
644
 
645
+ #: includes/pricing-rules.php:2584
646
  msgid " and get discount in "
647
  msgstr ""
648
 
649
+ #: includes/pricing-rules.php:2587
650
  msgid " first "
651
  msgstr ""
652
 
653
+ #: includes/pricing-rules.php:2589 includes/pricing-rules.php:2593
654
  msgid " quantity of product(s) - "
655
  msgstr ""
656
 
657
+ #: includes/pricing-rules.php:2591
658
  msgid " after first "
659
  msgstr ""
660
 
661
+ #: includes/pricing-rules.php:2609
662
  msgid "Category(ies) "
663
  msgstr ""
664
 
665
+ #: includes/pricing-rules.php:2675
666
  msgid "Get "
667
  msgstr ""
668
 
669
+ #: includes/pricing-rules.php:2677
670
  #, php-format
671
  msgid "% discount in "
672
  msgstr ""
673
 
674
+ #: includes/pricing-rules.php:2680
675
  msgid "same product"
676
  msgstr ""
677
 
678
+ #: includes/pricing-rules.php:2682
679
  msgid "any cheapest one from cart"
680
  msgstr ""
681
 
682
+ #: includes/pricing-rules.php:2685
683
  msgid "any cheapest one of "
684
  msgstr ""
685
 
686
+ #: includes/pricing-rules.php:2690
687
  msgid " quantity of any "
688
  msgstr ""
689
 
690
+ #: includes/pricing-rules.php:2692
691
  msgid " cheapest item "
692
  msgstr ""
693
 
694
+ #: includes/pricing-rules.php:2695
695
  msgid " quantity of cheapest item "
696
  msgstr ""
697
 
698
+ #: includes/pricing-rules.php:2699
699
  msgid "from the category "
700
  msgstr ""
701
 
707
  msgid "View Examples"
708
  msgstr ""
709
 
710
+ #: view/cart-rules.php:52 view/documentation.php:21 view/pricing-rules.php:84
 
711
  msgid "Documentation"
712
  msgstr ""
713
 
719
  msgid "Add New Rule"
720
  msgstr ""
721
 
722
+ #: view/cart-rules.php:78 view/pricing-rules.php:108
723
  msgid "Bulk Actions"
724
  msgstr ""
725
 
726
+ #: view/cart-rules.php:79 view/pricing-rules.php:109
727
  msgid "Enable rules"
728
  msgstr ""
729
 
730
+ #: view/cart-rules.php:80 view/pricing-rules.php:110
731
  msgid "Disable rules"
732
  msgstr ""
733
 
734
+ #: view/cart-rules.php:81 view/pricing-rules.php:111
735
  msgid "Delete rules"
736
  msgstr ""
737
 
738
+ #: view/cart-rules.php:83 view/pricing-rules.php:113
739
  msgid "Apply"
740
  msgstr ""
741
 
742
+ #: view/cart-rules.php:97 view/cart-rules.php:186 view/pricing-rules.php:127
743
+ #: view/pricing-rules.php:216 view/template/discount-table.php:21
744
  msgid "Name"
745
  msgstr ""
746
 
747
+ #: view/cart-rules.php:98 view/cart-rules.php:187 view/pricing-rules.php:128
748
+ #: view/pricing-rules.php:217
749
  msgid "Start Date"
750
  msgstr ""
751
 
752
+ #: view/cart-rules.php:99 view/cart-rules.php:188 view/pricing-rules.php:129
753
+ #: view/pricing-rules.php:218
754
  msgid "Expired On"
755
  msgstr ""
756
 
757
+ #: view/cart-rules.php:100 view/cart-rules.php:189 view/pricing-rules.php:130
758
+ #: view/pricing-rules.php:219
759
+ msgid "Status"
760
  msgstr ""
761
 
762
+ #: view/cart-rules.php:103 view/cart-rules.php:192 view/pricing-rules.php:133
763
+ #: view/pricing-rules.php:222
764
+ msgid "Order"
765
  msgstr ""
766
 
767
+ #: view/cart-rules.php:159 view/pricing-rules.php:189
768
+ msgid "Edit"
769
  msgstr ""
770
 
771
+ #: view/cart-rules.php:170 view/pricing-rules.php:200
772
  msgid "Delete"
773
  msgstr ""
774
 
780
  msgid "Welcome onboard"
781
  msgstr ""
782
 
783
+ #: view/documentation.php:30
784
+ msgid "License Key activation"
785
  msgstr ""
786
 
787
  #: view/documentation.php:30
788
+ msgid "Learn how to obtain the license key and activate it"
789
+ msgstr ""
790
+
791
+ #: view/documentation.php:33
792
+ msgid "Version Updates!"
793
+ msgstr ""
794
+
795
+ #: view/documentation.php:33
796
+ msgid "Learn how to update to latest versions"
797
+ msgstr ""
798
+
799
+ #: view/documentation.php:36 view/includes/menu.php:9
800
+ msgid "Price Discount Rules"
801
+ msgstr ""
802
+
803
+ #: view/documentation.php:36
804
  msgid "Learn all about creating a price discount rules"
805
  msgstr ""
806
 
807
+ #: view/documentation.php:39 view/includes/menu.php:11
808
  msgid "Cart Discount Rules"
809
  msgstr ""
810
 
811
+ #: view/documentation.php:39
812
  msgid "Cart based discount rules with examples."
813
  msgstr ""
814
 
815
+ #: view/documentation.php:42
816
  msgid "How to create a perfect BOGO discount rule in WooCommerce"
817
  msgstr ""
818
 
819
+ #: view/documentation.php:42
820
  msgid ""
821
  "Buy One Get One deals can be simple to complex. Learn how to get them "
822
  "working correct in your online store"
823
  msgstr ""
824
 
825
+ #: view/documentation.php:45
826
  msgid "User Role based discount rules"
827
  msgstr ""
828
 
829
+ #: view/documentation.php:45
830
  msgid ""
831
  "Learn how to create user role based / customer group based discount in "
832
  "WooCommerce"
833
  msgstr ""
834
 
835
+ #: view/documentation.php:48
836
  msgid "Activate discount rule using a coupon code in WooCommerce"
837
  msgstr ""
838
 
839
+ #: view/documentation.php:48
840
  msgid ""
841
  "Apply the dynamic discount rules after the customer enters a valid coupon "
842
  "code"
843
  msgstr ""
844
 
845
+ #: view/documentation.php:51
846
  msgid "Purchase History Based Discount"
847
  msgstr ""
848
 
849
+ #: view/documentation.php:51
850
  msgid ""
851
  "Price Rule and Cart Rule which gives discount based on the purchase history"
852
  msgstr ""
862
  msgstr ""
863
 
864
  #: view/includes/cart-menu.php:13 view/includes/sub-menu.php:13
865
+ #: view/template/discount-table.php:27 view/view-cart-rules.php:593
866
+ #: view/view-pricing-rules.php:627
867
  msgid "Discount"
868
  msgstr ""
869
 
888
  msgid "Settings"
889
  msgstr ""
890
 
891
+ #: view/includes/menu.php:17
892
+ msgid "Read documentation"
893
+ msgstr ""
894
+
895
  #: view/includes/sub-menu.php:11
896
  msgid "Condition"
897
  msgstr ""
932
  msgid "Validate Key"
933
  msgstr ""
934
 
935
+ #: view/settings.php:75
936
+ msgid "Tip: Install pro package before validating the licence"
937
+ msgstr ""
938
+
939
+ #: view/settings.php:83
940
+ msgid "Enable Bootstrap (applies only for the rule engine in the backend.)"
941
  msgstr ""
942
 
943
+ #: view/settings.php:88 view/settings.php:105 view/settings.php:117
944
+ #: view/settings.php:130 view/settings.php:336 view/settings.php:348
945
+ #: view/settings.php:535
946
  msgid "Yes"
947
  msgstr ""
948
 
949
+ #: view/settings.php:89 view/settings.php:106 view/settings.php:118
950
+ #: view/settings.php:131 view/settings.php:337 view/settings.php:349
951
+ #: view/settings.php:536 view/view-cart-rules.php:567
952
+ #: view/view-pricing-rules.php:410
953
  msgid "No"
954
  msgstr ""
955
 
956
+ #: view/settings.php:92
957
+ msgid ""
958
+ "Disabling this setting may affect dropdowns in rule engine (Disabling this "
959
+ "setting is not recommended). Change this only if you know what you are doing."
960
+ msgstr ""
961
+
962
+ #: view/settings.php:100
963
  msgid "Force refresh the cart widget while add and remove item to cart"
964
  msgstr ""
965
 
966
+ #: view/settings.php:112
967
+ msgid "Disable the rules while having a coupon (Third party) in cart"
968
  msgstr ""
969
 
970
+ #: view/settings.php:125
971
  msgid ""
972
  "Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a "
973
  "coupon used with discount rule conditions"
974
  msgstr ""
975
 
976
+ #: view/settings.php:142
977
  msgid "Price rules settings"
978
  msgstr ""
979
 
980
+ #: view/settings.php:150
981
  msgid "Rule Setup for Price:"
982
  msgstr ""
983
 
984
+ #: view/settings.php:156 view/settings.php:425
985
  msgid "Apply first matched rule"
986
  msgstr ""
987
 
988
+ #: view/settings.php:162 view/settings.php:164 view/settings.php:431
989
+ #: view/settings.php:433
990
  msgid "Apply all matched rules"
991
  msgstr ""
992
 
993
+ #: view/settings.php:171 view/settings.php:173 view/settings.php:440
994
+ #: view/settings.php:442
995
  msgid "Apply biggest discount"
996
  msgstr ""
997
 
998
+ #: view/settings.php:183
999
  msgid "Show Price discount on product page :"
1000
  msgstr ""
1001
 
1002
+ #: view/settings.php:192 view/settings.php:211 view/settings.php:269
1003
+ #: view/settings.php:287 view/settings.php:305 view/settings.php:323
1004
  msgid "Don't Show"
1005
  msgstr ""
1006
 
1007
+ #: view/settings.php:195 view/settings.php:214
1008
  msgid "It displays only if any rule matches"
1009
  msgstr ""
1010
 
1011
+ #: view/settings.php:202
1012
+ msgid "Show Sale badge on product page :"
1013
  msgstr ""
1014
 
1015
+ #: view/settings.php:221
1016
  msgid "Discount Table :"
1017
  msgstr ""
1018
 
1019
+ #: view/settings.php:230
1020
+ msgid "Default layout"
1021
+ msgstr ""
1022
+
1023
+ #: view/settings.php:233
1024
+ msgid "Advance layout"
1025
+ msgstr ""
1026
+
1027
+ #: view/settings.php:242
1028
  msgid "Table placement:"
1029
  msgstr ""
1030
 
1031
+ #: view/settings.php:248
1032
  msgid "Before cart form"
1033
  msgstr ""
1034
 
1035
+ #: view/settings.php:251
1036
  msgid "After cart form"
1037
  msgstr ""
1038
 
1039
+ #: view/settings.php:260
1040
+ msgid "Table header :"
1041
+ msgstr ""
1042
+
1043
+ #: view/settings.php:278
1044
+ msgid "Title column on table :"
1045
  msgstr ""
1046
 
1047
+ #: view/settings.php:296
1048
+ msgid "Range column on table :"
1049
  msgstr ""
1050
 
1051
+ #: view/settings.php:314
1052
+ msgid "Discount column on table :"
1053
  msgstr ""
1054
 
1055
+ #: view/settings.php:331
1056
+ msgid "Strikeout discount in cart item"
1057
  msgstr ""
1058
 
1059
+ #: view/settings.php:343
1060
  msgid "Auto add free product on coupon applied (For coupon based rules)"
1061
  msgstr ""
1062
 
1063
+ #: view/settings.php:356
1064
+ msgid "Display savings text"
1065
+ msgstr ""
1066
+
1067
+ #: view/settings.php:365
1068
+ msgid "On each line item"
1069
+ msgstr ""
1070
+
1071
+ #: view/settings.php:368
1072
+ msgid "On after total"
1073
+ msgstr ""
1074
+
1075
+ #: view/settings.php:371
1076
+ msgid "Both in line item and after total"
1077
+ msgstr ""
1078
+
1079
+ #: view/settings.php:379
1080
+ msgid "Savings text to show"
1081
+ msgstr ""
1082
+
1083
+ #: view/settings.php:387
1084
+ msgid "{{total_discount_price}} -> Total discount applied"
1085
+ msgstr ""
1086
+
1087
+ #: view/settings.php:399
1088
  msgid "Cart rules settings"
1089
  msgstr ""
1090
 
1091
+ #: view/settings.php:406
1092
  msgid "Coupon Name to be displayed :"
1093
  msgstr ""
1094
 
1095
+ #: view/settings.php:412
1096
  msgid "Discount Coupon Name"
1097
  msgstr ""
1098
 
1099
+ #: view/settings.php:419
1100
  msgid "Rule Setup for Cart:"
1101
  msgstr ""
1102
 
1103
+ #: view/settings.php:451
1104
  msgid "Enable free shipping option"
1105
  msgstr ""
1106
 
1107
+ #: view/settings.php:458 view/view-pricing-rules.php:300
1108
+ #: view/view-pricing-rules.php:357 view/view-pricing-rules.php:422
1109
+ #: view/view-pricing-rules.php:468 view/view-pricing-rules.php:497
1110
  msgid "Supported in PRO version"
1111
  msgstr ""
1112
 
1113
+ #: view/settings.php:471
 
 
 
 
 
1114
  msgid "Use Woocommerce free shipping"
1115
  msgstr ""
1116
 
1117
+ #: view/settings.php:474
1118
  msgid "Use Woo-Discount free shipping"
1119
  msgstr ""
1120
 
1121
+ #: view/settings.php:488
1122
  msgid "Free shipping text to be displayed"
1123
  msgstr ""
1124
 
1125
+ #: view/settings.php:495
1126
  msgid "Free Shipping title"
1127
  msgstr ""
1128
 
1129
+ #: view/settings.php:502
1130
  msgid "Draft"
1131
  msgstr ""
1132
 
1133
+ #: view/settings.php:512
1134
  msgid "Exclude Draft products in product select box."
1135
  msgstr ""
1136
 
1137
+ #: view/settings.php:522
1138
  msgid "Performance settings"
1139
  msgstr ""
1140
 
1141
+ #: view/settings.php:530
1142
  msgid "Enable cache for variable products table content"
1143
  msgstr ""
1144
 
1145
+ #: view/settings.php:542 view/settings.php:546
1146
  msgid "Clear cache"
1147
  msgstr ""
1148
 
1149
+ #: view/settings.php:556
1150
  msgid "Promotion settings"
1151
  msgstr ""
1152
 
1153
+ #: view/settings.php:563
1154
+ msgid "Show a message on applying price rules in cart"
1155
  msgstr ""
1156
 
1157
+ #: view/settings.php:581 view/settings.php:616
1158
+ msgid "Message"
1159
  msgstr ""
1160
 
1161
+ #: view/settings.php:589 view/settings.php:624
1162
+ msgid "{{title}} -> Rule title"
1163
  msgstr ""
1164
 
1165
+ #: view/settings.php:590 view/settings.php:625
1166
+ msgid "{{description}} -> Rule description"
1167
  msgstr ""
1168
 
1169
+ #: view/settings.php:598
1170
+ msgid "Show a message on applying cart rules in cart"
1171
  msgstr ""
1172
 
1173
+ #: view/template/discount-table.php:24
1174
  msgid "Range"
1175
  msgstr ""
1176
 
1177
+ #: view/template/discount-table.php:59
1178
  msgid "No Active Discounts."
1179
  msgstr ""
1180
 
1194
  msgid "Edit Cart Rule"
1195
  msgstr ""
1196
 
1197
+ #: view/view-cart-rules.php:68 view/view-pricing-rules.php:67
1198
+ msgid "Priority :"
1199
  msgstr ""
1200
 
1201
+ #: view/view-cart-rules.php:70 view/view-pricing-rules.php:69
1202
  msgid ""
1203
  "The Simple Ranking concept to said, which one is going to execute first and "
1204
  "so on."
1205
  msgstr ""
1206
 
1207
+ #: view/view-cart-rules.php:82 view/view-pricing-rules.php:82
 
 
 
 
1208
  msgid "Rule Name"
1209
  msgstr ""
1210
 
1211
+ #: view/view-cart-rules.php:84 view/view-cart-rules.php:96
1212
+ #: view/view-pricing-rules.php:84 view/view-pricing-rules.php:96
1213
  msgid "Rule Descriptions."
1214
  msgstr ""
1215
 
1216
+ #: view/view-cart-rules.php:89 view/view-pricing-rules.php:89
1217
  msgid "ex. Standard Rule."
1218
  msgstr ""
1219
 
1220
+ #: view/view-cart-rules.php:94 view/view-pricing-rules.php:94
1221
  msgid "Rule Description"
1222
  msgstr ""
1223
 
1224
+ #: view/view-cart-rules.php:105 view/view-pricing-rules.php:130
1225
  msgid "Validity"
1226
  msgstr ""
1227
 
1228
+ #: view/view-cart-rules.php:106 view/view-pricing-rules.php:131
1229
  msgid "Period of Rule Active. Format: month/day/Year Hour:Min"
1230
  msgstr ""
1231
 
1232
+ #: view/view-cart-rules.php:119 view/view-pricing-rules.php:144
1233
+ #: view/view-pricing-rules.php:571
1234
  msgid "From"
1235
  msgstr ""
1236
 
1237
+ #: view/view-cart-rules.php:123
1238
  msgid "To"
1239
  msgstr ""
1240
 
1241
+ #: view/view-cart-rules.php:124 view/view-pricing-rules.php:149
1242
  #, php-format
1243
  msgid "Current date and time: %s"
1244
  msgstr ""
1245
 
1246
+ #: view/view-cart-rules.php:133 view/view-pricing-rules.php:58
1247
+ msgid "This rule is not running currently: "
1248
+ msgstr ""
1249
+
1250
+ #: view/view-cart-rules.php:143 view/view-cart-rules.php:587
1251
+ #: view/view-pricing-rules.php:183 view/view-pricing-rules.php:620
1252
  msgid "Next"
1253
  msgstr ""
1254
 
1255
+ #: view/view-cart-rules.php:147
1256
  msgid "Cart Conditions"
1257
  msgstr ""
1258
 
1259
+ #: view/view-cart-rules.php:150
1260
  msgid "Add Condition"
1261
  msgstr ""
1262
 
1263
+ #: view/view-cart-rules.php:219
1264
  msgid "Categories In Cart"
1265
  msgstr ""
1266
 
1267
+ #: view/view-cart-rules.php:277 view/view-cart-rules.php:279
1268
  msgid "Email with TLD (Eg: edu)"
1269
  msgstr ""
1270
 
1271
+ #: view/view-cart-rules.php:567 view/view-pricing-rules.php:410
1272
  msgid "To get this condition work,"
1273
  msgstr ""
1274
 
1275
+ #: view/view-cart-rules.php:567 view/view-pricing-rules.php:410
1276
  msgid "please change the option"
1277
  msgstr ""
1278
 
1279
+ #: view/view-cart-rules.php:567 view/view-pricing-rules.php:410
1280
  msgid "Disable the rules while have coupon(Third party)"
1281
  msgstr ""
1282
 
1283
+ #: view/view-cart-rules.php:567 view/view-pricing-rules.php:410
1284
  msgid "in cart to"
1285
  msgstr ""
1286
 
1287
+ #: view/view-cart-rules.php:586 view/view-cart-rules.php:647
1288
+ #: view/view-pricing-rules.php:619 view/view-pricing-rules.php:817
1289
  msgid "Previous"
1290
  msgstr ""
1291
 
1292
+ #: view/view-cart-rules.php:589
1293
+ msgid "Guide to create cart rules"
1294
+ msgstr ""
1295
+
1296
+ #: view/view-cart-rules.php:609
1297
  msgid "Discount Type :"
1298
  msgstr ""
1299
 
1300
+ #: view/view-cart-rules.php:613 view/view-pricing-rules.php:669
1301
+ msgid "Percentage Discount"
1302
+ msgstr ""
1303
+
1304
+ #: view/view-cart-rules.php:628 view/view-cart-rules.php:630
1305
  msgid "Free shipping"
1306
  msgstr ""
1307
 
1308
+ #: view/view-cart-rules.php:639
1309
  msgid "value :"
1310
  msgstr ""
1311
 
1317
  msgid "Edit Price Rule"
1318
  msgstr ""
1319
 
1320
+ #: view/view-pricing-rules.php:105
1321
  msgid "Method"
1322
  msgstr ""
1323
 
1324
+ #: view/view-pricing-rules.php:107
1325
  msgid "Method to Apply."
1326
  msgstr ""
1327
 
1328
+ #: view/view-pricing-rules.php:113
1329
+ msgid ""
1330
+ "Quantity / category / product / user role based discounts and BOGO deals "
1331
  msgstr ""
1332
 
1333
+ #: view/view-pricing-rules.php:120 view/view-pricing-rules.php:122
1334
+ msgid "Dependent / conditional based discount (by individual product)"
1335
  msgstr ""
1336
 
1337
+ #: view/view-pricing-rules.php:148
1338
  msgid "To - Leave Empty if No Expiry"
1339
  msgstr ""
1340
 
1341
+ #: view/view-pricing-rules.php:159
1342
+ msgid "Format for advanced table display option (see plugin settings)"
1343
+ msgstr ""
1344
+
1345
+ #: view/view-pricing-rules.php:161
1346
+ msgid "Used when advanced table display option is set in the plugin settings"
1347
+ msgstr ""
1348
+
1349
+ #: view/view-pricing-rules.php:164
1350
+ msgid "Buy {{min_quantity}} or more quantity and get {{discount}} as discount"
1351
+ msgstr ""
1352
+
1353
+ #: view/view-pricing-rules.php:167
1354
+ msgid "{{title}} -> Title"
1355
+ msgstr ""
1356
+
1357
+ #: view/view-pricing-rules.php:168
1358
+ msgid "{{description}} -> Description"
1359
+ msgstr ""
1360
+
1361
+ #: view/view-pricing-rules.php:169
1362
+ msgid "{{min_quantity}} -> Minimum quantity"
1363
+ msgstr ""
1364
+
1365
+ #: view/view-pricing-rules.php:170
1366
+ msgid "{{max_quantity}} -> Maximum quantity"
1367
+ msgstr ""
1368
+
1369
+ #: view/view-pricing-rules.php:171
1370
+ msgid "{{discount}} -> Discount"
1371
+ msgstr ""
1372
+
1373
+ #: view/view-pricing-rules.php:172
1374
+ msgid "{{discounted_price}} -> Discounted price"
1375
+ msgstr ""
1376
+
1377
+ #: view/view-pricing-rules.php:173
1378
+ msgid "{{condition}} -> Rule condition text"
1379
+ msgstr ""
1380
+
1381
+ #: view/view-pricing-rules.php:188
1382
  msgid "Discount Conditions"
1383
  msgstr ""
1384
 
1385
+ #: view/view-pricing-rules.php:193
1386
  msgid "Apply To"
1387
  msgstr ""
1388
 
1389
+ #: view/view-pricing-rules.php:199
1390
  msgid "All products"
1391
  msgstr ""
1392
 
1393
+ #: view/view-pricing-rules.php:203
1394
  msgid "Specific products"
1395
  msgstr ""
1396
 
1397
+ #: view/view-pricing-rules.php:209 view/view-pricing-rules.php:211
1398
  msgid "Specific categories"
1399
  msgstr ""
1400
 
1401
+ #: view/view-pricing-rules.php:218 view/view-pricing-rules.php:220
1402
  msgid "Specific attributes"
1403
  msgstr ""
1404
 
1405
+ #: view/view-pricing-rules.php:231
1406
+ msgid ""
1407
+ "Check this box to count item quantities in cart cumulatively across products"
1408
  msgstr ""
1409
 
1410
+ #: view/view-pricing-rules.php:243
1411
  msgid "Check this box to count quantities cumulatively across category(ies)"
1412
  msgstr ""
1413
 
1414
+ #: view/view-pricing-rules.php:246
1415
  msgid "Check this box to apply child category(ies)"
1416
  msgstr ""
1417
 
1418
+ #: view/view-pricing-rules.php:260
1419
  msgid "Check this box to count quantities cumulatively across attribute"
1420
  msgstr ""
1421
 
1422
+ #: view/view-pricing-rules.php:270
1423
  msgid "Exclude products"
1424
  msgstr ""
1425
 
1426
+ #: view/view-pricing-rules.php:289
1427
  msgid "Exclude sale items"
1428
  msgstr ""
1429
 
1430
+ #: view/view-pricing-rules.php:294
1431
  msgid "Check this box if the rule should not apply to items on sale."
1432
  msgstr ""
1433
 
1434
+ #: view/view-pricing-rules.php:313
1435
  msgid "Customers"
1436
  msgstr ""
1437
 
1438
+ #: view/view-pricing-rules.php:318 view/view-pricing-rules.php:592
1439
  msgid "All"
1440
  msgstr ""
1441
 
1442
+ #: view/view-pricing-rules.php:325 view/view-pricing-rules.php:327
1443
  msgid "Only Given"
1444
  msgstr ""
1445
 
1446
+ #: view/view-pricing-rules.php:341
1447
  msgid "User roles"
1448
  msgstr ""
1449
 
1450
+ #: view/view-pricing-rules.php:346 view/view-pricing-rules.php:376
1451
+ #: view/view-pricing-rules.php:443 view/view-pricing-rules.php:486
1452
  msgid "Do not use"
1453
  msgstr ""
1454
 
1455
+ #: view/view-pricing-rules.php:368
1456
  msgid "Coupon"
1457
  msgstr ""
1458
 
1459
+ #: view/view-pricing-rules.php:377
1460
  msgid "Apply if any one coupon applied"
1461
  msgstr ""
1462
 
1463
+ #: view/view-pricing-rules.php:378
1464
  msgid "Apply if all coupon applied"
1465
  msgstr ""
1466
 
1467
+ #: view/view-pricing-rules.php:401
 
 
 
 
1468
  msgid "Make sure you have created the coupon already"
1469
  msgstr ""
1470
 
1471
+ #: view/view-pricing-rules.php:433
1472
  msgid "Subtotal"
1473
  msgstr ""
1474
 
1475
+ #: view/view-pricing-rules.php:444
1476
  msgid "Subtotal atleast"
1477
  msgstr ""
1478
 
1479
+ #: view/view-pricing-rules.php:449
1480
  msgid "Enter the amount"
1481
  msgstr ""
1482
 
1483
+ #: view/view-pricing-rules.php:459
1484
  msgid "Supported in WooCommerce 3.x"
1485
  msgstr ""
1486
 
1487
+ #: view/view-pricing-rules.php:488
1488
  msgid "Number of orders"
1489
  msgstr ""
1490
 
1491
+ #: view/view-pricing-rules.php:489
1492
  msgid "Purchased product"
1493
  msgstr ""
1494
 
1495
+ #: view/view-pricing-rules.php:563
1496
  msgid "Any"
1497
  msgstr ""
1498
 
1499
+ #: view/view-pricing-rules.php:564
1500
  msgid "Each"
1501
  msgstr ""
1502
 
1503
+ #: view/view-pricing-rules.php:565
1504
  msgid "Combine"
1505
  msgstr ""
1506
 
1507
+ #: view/view-pricing-rules.php:568
1508
  msgid "More than"
1509
  msgstr ""
1510
 
1511
+ #: view/view-pricing-rules.php:569
1512
  msgid "Less than"
1513
  msgstr ""
1514
 
1515
+ #: view/view-pricing-rules.php:570
1516
  msgid "Equal"
1517
  msgstr ""
1518
 
1519
+ #: view/view-pricing-rules.php:573 view/view-pricing-rules.php:576
1520
+ #: view/view-pricing-rules.php:596
1521
  msgid "Quantity"
1522
  msgstr ""
1523
 
1524
+ #: view/view-pricing-rules.php:575
1525
  msgid "to"
1526
  msgstr ""
1527
 
1528
+ #: view/view-pricing-rules.php:579
1529
  msgid "Product(s) from"
1530
  msgstr ""
1531
 
1532
+ #: view/view-pricing-rules.php:585
1533
  msgid "Apply discount in product(s)"
1534
  msgstr ""
1535
 
1536
+ #: view/view-pricing-rules.php:586
1537
  msgid "Apply discount in category(ies)"
1538
  msgstr ""
1539
 
1540
+ #: view/view-pricing-rules.php:590
1541
  msgid "and get discount in "
1542
  msgstr ""
1543
 
1544
+ #: view/view-pricing-rules.php:593
1545
  msgid "First quantity(s)"
1546
  msgstr ""
1547
 
1548
+ #: view/view-pricing-rules.php:594
1549
  msgid "Skip first quantity(s)"
1550
  msgstr ""
1551
 
1552
+ #: view/view-pricing-rules.php:599
1553
  msgid " Product(s) "
1554
  msgstr ""
1555
 
1556
+ #: view/view-pricing-rules.php:603
1557
  msgid "Category(ies)"
1558
  msgstr ""
1559
 
1560
+ #: view/view-pricing-rules.php:614
1561
+ msgid "Guide for product dependent rules"
1562
  msgstr ""
1563
 
1564
+ #: view/view-pricing-rules.php:630
1565
  msgid "Add New Range"
1566
  msgstr ""
1567
 
1568
+ #: view/view-pricing-rules.php:800
1569
+ msgid "Guide to create perfect BOGO rules"
1570
  msgstr ""
1571
 
1572
+ #: view/view-pricing-rules.php:810
1573
  msgid "Percent"
1574
  msgstr ""
1575
 
1576
+ #: view/view-pricing-rules.php:811
1577
  msgid "Fixed"
1578
  msgstr ""
includes/cart-rules.php CHANGED
@@ -394,7 +394,9 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
394
 
395
  // Add coupon
396
  $woocommerce->cart->applied_coupons[] = $coupon_code;
 
397
  do_action('woocommerce_applied_coupon', $coupon_code);
 
398
 
399
  return true;
400
  }
@@ -571,10 +573,11 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
571
  } else {
572
  //we will have to re-calculate the sub-total if it has category selected
573
  if($this->is_category_specific($rule)) {
 
574
  $this->has_category_in_rule = 1;
575
  //re-calculate the sub-total
576
  $subtotal = $this->calculate_conditional_subtotal($this->get_discounted_categories_from_json($rule));
577
- }else {
578
  $subtotal = $this->sub_total;
579
  }
580
  // Getting the Percentage level of Discount.
@@ -1076,7 +1079,14 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1076
  if(!empty($rule)){
1077
  $ruleSuccess = $this->validateCartCouponAppliedAnyOne($index, $rule, $rules);
1078
  if($ruleSuccess){
1079
- $coupons = explode(',', $rule);
 
 
 
 
 
 
 
1080
  FlycartWooDiscountRulesGeneralHelper::removeCouponPriceInCart($coupons);
1081
  return true;
1082
  }
@@ -1087,7 +1097,13 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1087
  if(!empty($rule)){
1088
  $ruleSuccess = $this->validateCartCouponAppliedAllSelected($index, $rule, $rules);
1089
  if($ruleSuccess){
1090
- $coupons = explode(',', $rule);
 
 
 
 
 
 
1091
  FlycartWooDiscountRulesGeneralHelper::removeCouponPriceInCart($coupons);
1092
  return true;
1093
  }
@@ -1104,7 +1120,13 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1104
  protected function validateCartCouponAppliedAnyOne($index, $rule, $rules){
1105
  global $woocommerce;
1106
  $allowed = 0;
1107
- $coupons = explode(',', $rule);
 
 
 
 
 
 
1108
  foreach ($coupons as $coupon){
1109
  if($woocommerce->cart->has_discount($coupon)){
1110
  $allowed = 1;
@@ -1121,7 +1143,13 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1121
  protected function validateCartCouponAppliedAllSelected($index, $rule, $rules){
1122
  global $woocommerce;
1123
  $allowed = 0;
1124
- $coupons = explode(',', $rule);
 
 
 
 
 
 
1125
  foreach ($coupons as $coupon){
1126
  if(!$woocommerce->cart->has_discount($coupon)){
1127
  $allowed = 0;
394
 
395
  // Add coupon
396
  $woocommerce->cart->applied_coupons[] = $coupon_code;
397
+ remove_action('woocommerce_after_calculate_totals', array($this, 'applyFakeCoupons'));
398
  do_action('woocommerce_applied_coupon', $coupon_code);
399
+ add_action('woocommerce_after_calculate_totals', array($this, 'applyFakeCoupons'));
400
 
401
  return true;
402
  }
573
  } else {
574
  //we will have to re-calculate the sub-total if it has category selected
575
  if($this->is_category_specific($rule)) {
576
+ do_action('woocommerce_before_calculate_totals');
577
  $this->has_category_in_rule = 1;
578
  //re-calculate the sub-total
579
  $subtotal = $this->calculate_conditional_subtotal($this->get_discounted_categories_from_json($rule));
580
+ } else {
581
  $subtotal = $this->sub_total;
582
  }
583
  // Getting the Percentage level of Discount.
1079
  if(!empty($rule)){
1080
  $ruleSuccess = $this->validateCartCouponAppliedAnyOne($index, $rule, $rules);
1081
  if($ruleSuccess){
1082
+ if(is_string($rule)){
1083
+ $coupons = explode(',', $rule);
1084
+ } elseif (is_array($rule)){
1085
+ $coupons = $rule;
1086
+ } else {
1087
+ return false;
1088
+ }
1089
+
1090
  FlycartWooDiscountRulesGeneralHelper::removeCouponPriceInCart($coupons);
1091
  return true;
1092
  }
1097
  if(!empty($rule)){
1098
  $ruleSuccess = $this->validateCartCouponAppliedAllSelected($index, $rule, $rules);
1099
  if($ruleSuccess){
1100
+ if(is_string($rule)){
1101
+ $coupons = explode(',', $rule);
1102
+ } elseif (is_array($rule)){
1103
+ $coupons = $rule;
1104
+ } else {
1105
+ return false;
1106
+ }
1107
  FlycartWooDiscountRulesGeneralHelper::removeCouponPriceInCart($coupons);
1108
  return true;
1109
  }
1120
  protected function validateCartCouponAppliedAnyOne($index, $rule, $rules){
1121
  global $woocommerce;
1122
  $allowed = 0;
1123
+ if(is_string($rule)){
1124
+ $coupons = explode(',', $rule);
1125
+ } elseif (is_array($rule)){
1126
+ $coupons = $rule;
1127
+ } else {
1128
+ return 0;
1129
+ }
1130
  foreach ($coupons as $coupon){
1131
  if($woocommerce->cart->has_discount($coupon)){
1132
  $allowed = 1;
1143
  protected function validateCartCouponAppliedAllSelected($index, $rule, $rules){
1144
  global $woocommerce;
1145
  $allowed = 0;
1146
+ if(is_string($rule)){
1147
+ $coupons = explode(',', $rule);
1148
+ } elseif (is_array($rule)){
1149
+ $coupons = $rule;
1150
+ } else {
1151
+ return 0;
1152
+ }
1153
  foreach ($coupons as $coupon){
1154
  if(!$woocommerce->cart->has_discount($coupon)){
1155
  $allowed = 0;
includes/discount-base.php CHANGED
@@ -170,7 +170,29 @@ if (!class_exists('FlycartWooDiscountBase')) {
170
  add_post_meta($id, 'status', 'disable');
171
  $state = 'disable';
172
  }
173
- echo ucfirst($state);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
174
  }
175
  die();
176
  }
@@ -307,6 +329,9 @@ if (!class_exists('FlycartWooDiscountBase')) {
307
  'in_each_category' => 'category_to_apply',
308
  'atleast_one_including_sub_categories' => 'category_to_apply',
309
 
 
 
 
310
  'users_in' => 'users_to_apply',
311
  'roles_in' => 'user_roles_to_apply',
312
  'shipping_countries_in' => 'countries_to_apply',
@@ -609,7 +634,7 @@ if (!class_exists('FlycartWooDiscountBase')) {
609
  $data = array();
610
  $this->fetchData($tab, $data);
611
  // Processing View.
612
- $html = $generalHelper->processBaseView($path, $data);
613
  }
614
  echo $html;
615
  }
@@ -840,22 +865,22 @@ if (!class_exists('FlycartWooDiscountBase')) {
840
  'place_holder_ex_50' => esc_html__('ex. 50', 'woo-discount-rules'),
841
  'place_holder_search_for_a_user' => esc_html__('Search for a user', 'woo-discount-rules'),
842
  'adjustment_type' => esc_html__('Adjustment Type', 'woo-discount-rules'),
843
- 'percentage_discount' => esc_html__('Percentage Discount', 'woo-discount-rules'),
844
  'price_discount' => esc_html__('Price Discount', 'woo-discount-rules'),
845
- 'product_discount' => esc_html__('Product Discount', 'woo-discount-rules'),
846
  'product_discount_not_work_on_subtotal_based' => esc_html__('Product Discount - Not support for subtotal based rule', 'woo-discount-rules'),
847
  'value_text' => esc_html__('Value', 'woo-discount-rules'),
848
- 'apply_for' => esc_html__('Apply for', 'woo-discount-rules'),
849
- 'all_selected' => esc_html__('All selected', 'woo-discount-rules'),
850
  'same_product' => esc_html__('Same product', 'woo-discount-rules'),
851
  'any_one_cheapest_from_selected' => esc_html__('Any one cheapest from selected', 'woo-discount-rules'),
852
  'any_one_cheapest_from_all_products' => esc_html__('Any one cheapest from all products', 'woo-discount-rules'),
853
- 'more_than_one_cheapest_from_selected_category' => esc_html__('More than one cheapest from selected category', 'woo-discount-rules'),
854
- 'more_than_one_cheapest_from_selected' => esc_html__('More than one cheapest from selected', 'woo-discount-rules'),
855
- 'more_than_one_cheapest_from_all' => esc_html__('More than one cheapest from all', 'woo-discount-rules'),
856
  'free_quantity' => esc_html__('Free quantity', 'woo-discount-rules'),
857
  'number_of_quantities_in_each_products' => esc_html__('Number of quantity(ies) in each selected product(s)', 'woo-discount-rules'),
858
- 'fixed_item_count' => esc_html__('Fixed item count', 'woo-discount-rules'),
859
  'dynamic_item_count' => esc_html__('Dynamic item count', 'woo-discount-rules'),
860
  'fixed_item_count_tooltip' => esc_html__('Fixed item count - You need to provide item count manually. Dynamic item count - System will choose dynamically based on cart', 'woo-discount-rules'),
861
  'item_count' => esc_html__('Item count', 'woo-discount-rules'),
@@ -869,6 +894,7 @@ if (!class_exists('FlycartWooDiscountBase')) {
869
  'percentage_tooltip' => esc_html__('Percentage', 'woo-discount-rules'),
870
  'as_discount' => esc_html__('as discount', 'woo-discount-rules'),
871
  'remove_text' => esc_html__('Remove', 'woo-discount-rules'),
 
872
  'none_text' => esc_html__('none', 'woo-discount-rules'),
873
  'are_you_sure_to_remove_this' => esc_html__('Are you sure to remove this ?', 'woo-discount-rules'),
874
  'enable_text' => esc_html__('Enable', 'woo-discount-rules'),
@@ -905,6 +931,7 @@ if (!class_exists('FlycartWooDiscountBase')) {
905
  'number_of_order_purchased_in_product' => esc_html__('Number of order purchased in products', 'woo-discount-rules'),
906
  'coupon_applied' => esc_html__('Coupon applied', 'woo-discount-rules'),
907
  'atleast_any_one' => esc_html__('Atleast any one', 'woo-discount-rules'),
 
908
  'greater_than_or_equal_to' => esc_html__('Greater than or equal to', 'woo-discount-rules'),
909
  'less_than_or_equal_to' => esc_html__('Less than or equal to', 'woo-discount-rules'),
910
  'in_order_status' => esc_html__('In Order status', 'woo-discount-rules'),
@@ -918,6 +945,9 @@ if (!class_exists('FlycartWooDiscountBase')) {
918
  'please_select_at_least_one_checkbox' => esc_html__('Please select at least one rule', 'woo-discount-rules'),
919
  'please_select_bulk_action' => esc_html__('Please select an action to apply', 'woo-discount-rules'),
920
  'are_you_sure_to_delete' => esc_html__('Are you sure to remove the selected rules', 'woo-discount-rules'),
 
 
 
921
  );
922
  }
923
  }
170
  add_post_meta($id, 'status', 'disable');
171
  $state = 'disable';
172
  }
173
+ $meta = get_post_meta($id, '', true);
174
+ $status_string = '';
175
+ if(!empty($meta)){
176
+ if(!isset($meta['status'][0])) $meta['status'][0] = 'disable';
177
+ if($meta['status'][0] == 'publish'){
178
+ $status_string .= "<span class='wdr_status_active_text alert alert-success'>".esc_html__('Active', 'woo-discount-rules')."</span>";
179
+ } else {
180
+ $status_string .= "<span class='wdr_status_disabled_text alert alert-danger'>".esc_html__('Disabled', 'woo-discount-rules')."</span>";
181
+ }
182
+ if($meta['status'][0] == 'publish'){
183
+ $date_from = (isset($meta['date_from'][0]) ? $meta['date_from'][0] : false);
184
+ $date_to = (isset($meta['date_to'][0]) ? $meta['date_to'][0] : false);
185
+ $validateDate = FlycartWooDiscountRulesGeneralHelper::validateDateAndTime($date_from, $date_to);
186
+ if($validateDate){
187
+ $status_string .= " - <span class='wdr_status_active_text text-success'>(".esc_html__('Running', 'woo-discount-rules').")</span>";
188
+ } else {
189
+ $status_string .= " - <span class='wdr_status_active_text text-danger'>(".esc_html__('Not running', 'woo-discount-rules').")</span>";
190
+ }
191
+ }
192
+ }
193
+ $return_value = array('status' => ucfirst($state), 'status_html' => $status_string);
194
+
195
+ echo json_encode($return_value);
196
  }
197
  die();
198
  }
329
  'in_each_category' => 'category_to_apply',
330
  'atleast_one_including_sub_categories' => 'category_to_apply',
331
 
332
+ 'coupon_applied_any_one' => 'coupon_to_apply',
333
+ 'coupon_applied_all_selected' => 'coupon_to_apply',
334
+
335
  'users_in' => 'users_to_apply',
336
  'roles_in' => 'user_roles_to_apply',
337
  'shipping_countries_in' => 'countries_to_apply',
634
  $data = array();
635
  $this->fetchData($tab, $data);
636
  // Processing View.
637
+ $html = $generalHelper->processBaseView($path, $data, $tab);
638
  }
639
  echo $html;
640
  }
865
  'place_holder_ex_50' => esc_html__('ex. 50', 'woo-discount-rules'),
866
  'place_holder_search_for_a_user' => esc_html__('Search for a user', 'woo-discount-rules'),
867
  'adjustment_type' => esc_html__('Adjustment Type', 'woo-discount-rules'),
868
+ 'percentage_discount' => esc_html__('Discount percentage', 'woo-discount-rules'),
869
  'price_discount' => esc_html__('Price Discount', 'woo-discount-rules'),
870
+ 'product_discount' => esc_html__('BOGO Product Discount', 'woo-discount-rules'),
871
  'product_discount_not_work_on_subtotal_based' => esc_html__('Product Discount - Not support for subtotal based rule', 'woo-discount-rules'),
872
  'value_text' => esc_html__('Value', 'woo-discount-rules'),
873
+ 'apply_for' => esc_html__('receive discount for', 'woo-discount-rules'),
874
+ 'all_selected' => esc_html__('Auto add all selected products', 'woo-discount-rules'),
875
  'same_product' => esc_html__('Same product', 'woo-discount-rules'),
876
  'any_one_cheapest_from_selected' => esc_html__('Any one cheapest from selected', 'woo-discount-rules'),
877
  'any_one_cheapest_from_all_products' => esc_html__('Any one cheapest from all products', 'woo-discount-rules'),
878
+ 'more_than_one_cheapest_from_selected_category' => esc_html__('Cheapest in cart - selected category(ies)', 'woo-discount-rules'),
879
+ 'more_than_one_cheapest_from_selected' => esc_html__('Cheapest in cart - selected item(s)', 'woo-discount-rules'),
880
+ 'more_than_one_cheapest_from_all' => esc_html__('Cheapest among all items in cart', 'woo-discount-rules'),
881
  'free_quantity' => esc_html__('Free quantity', 'woo-discount-rules'),
882
  'number_of_quantities_in_each_products' => esc_html__('Number of quantity(ies) in each selected product(s)', 'woo-discount-rules'),
883
+ 'fixed_item_count' => esc_html__('Fixed item count (not recommended)', 'woo-discount-rules'),
884
  'dynamic_item_count' => esc_html__('Dynamic item count', 'woo-discount-rules'),
885
  'fixed_item_count_tooltip' => esc_html__('Fixed item count - You need to provide item count manually. Dynamic item count - System will choose dynamically based on cart', 'woo-discount-rules'),
886
  'item_count' => esc_html__('Item count', 'woo-discount-rules'),
894
  'percentage_tooltip' => esc_html__('Percentage', 'woo-discount-rules'),
895
  'as_discount' => esc_html__('as discount', 'woo-discount-rules'),
896
  'remove_text' => esc_html__('Remove', 'woo-discount-rules'),
897
+ 'duplicate_text' => esc_html__('Duplicate', 'woo-discount-rules'),
898
  'none_text' => esc_html__('none', 'woo-discount-rules'),
899
  'are_you_sure_to_remove_this' => esc_html__('Are you sure to remove this ?', 'woo-discount-rules'),
900
  'enable_text' => esc_html__('Enable', 'woo-discount-rules'),
931
  'number_of_order_purchased_in_product' => esc_html__('Number of order purchased in products', 'woo-discount-rules'),
932
  'coupon_applied' => esc_html__('Coupon applied', 'woo-discount-rules'),
933
  'atleast_any_one' => esc_html__('Atleast any one', 'woo-discount-rules'),
934
+ 'all_selected_coupon' => esc_html__('All selected', 'woo-discount-rules'),
935
  'greater_than_or_equal_to' => esc_html__('Greater than or equal to', 'woo-discount-rules'),
936
  'less_than_or_equal_to' => esc_html__('Less than or equal to', 'woo-discount-rules'),
937
  'in_order_status' => esc_html__('In Order status', 'woo-discount-rules'),
945
  'please_select_at_least_one_checkbox' => esc_html__('Please select at least one rule', 'woo-discount-rules'),
946
  'please_select_bulk_action' => esc_html__('Please select an action to apply', 'woo-discount-rules'),
947
  'are_you_sure_to_delete' => esc_html__('Are you sure to remove the selected rules', 'woo-discount-rules'),
948
+ 'choose_products' => esc_html__('Choose product(s)', 'woo-discount-rules'),
949
+ 'choose_categories' => esc_html__('Choose category(ies)', 'woo-discount-rules'),
950
+ 'discount_product_option_tooltip' => esc_html__("Auto add all selected products - Automatically added to the cart <br> Same product - get discount in same product <br> Any one cheapest from selected - Get discount in one selected product <br> Any one cheapest from all products - Get discount in one cheapest product in cart <br> Cheapest in cart - selected category(ies) - cheapest product from the selected category will be discounted <br> Cheapest in cart - selected item(s) - get discount in chosen no.of quantities", 'woo-discount-rules'),
951
  );
952
  }
953
  }
includes/pricing-rules.php CHANGED
@@ -146,6 +146,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
146
  $form = array(
147
  'rule_name',
148
  'rule_descr',
 
149
  'rule_method',
150
  'qty_based_on',
151
  'date_from',
@@ -277,6 +278,10 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
277
  }
278
 
279
  if(!isset($request['product_to_exclude'])) $request['product_to_exclude'] = array();
 
 
 
 
280
 
281
  $request['status'] = 'publish';
282
 
@@ -666,6 +671,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
666
  if(count($this->bogo_matches) > 0){
667
  foreach ($this->bogo_matches as $free_product_id => $bogo_match){
668
  $found = false;
 
669
  foreach ($carts as $key => $cart_item) {
670
  if(empty($cart_item['data'])){
671
  continue;
@@ -1113,6 +1119,15 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
1113
  if(!empty($this->rule_sets))
1114
  foreach ($this->rule_sets as $id => $rule) {
1115
  $quantity = (isset($item['quantity']) ? $item['quantity'] : 0);
 
 
 
 
 
 
 
 
 
1116
  if(isset($rule['method']) && $rule['method'] == 'qty_based'){
1117
  if (isset($rule['type']) && isset($rule['apply_to'])) {
1118
  if($product_page && !$bogo){
@@ -1399,10 +1414,15 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
1399
  if(empty($cartItem['data'])){
1400
  continue;
1401
  }
 
1402
  //Exclude the bundled products items
1403
- if(isset($cartItem['bundled_item_id']) && !empty($cartItem['bundled_item_id'])){
1404
- continue;
 
 
 
1405
  }
 
1406
  // if(isset($cartItem['variation']) && !empty($cartItem['variation'])){
1407
  // if(isset($cartItem['variation']['Type']) && !empty($cartItem['variation']['Type'])){
1408
  // if($cartItem['variation']['Type'] == "Free Item") continue;
@@ -1599,12 +1619,12 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
1599
  } else if($discount_product_option == 'any_cheapest_from_all'){
1600
  $productCheapest = $this->getCheapestProductFromCart($productIds, 1, 1, $range, $product_to_exclude);
1601
  if(!empty($productCheapest)){
1602
- $adjustment = array ( 'price_discount' => $productCheapest['percent'], 'product_ids' => array($productCheapest['product']), 'product_cart_item_keys' => array($productCheapest['product_cart_item_key']) ) ;
1603
  }
1604
  } else if($discount_product_option == 'any_cheapest'){
1605
  $productCheapest = $this->getCheapestProductFromCart($productIds,0, 1, $range, $product_to_exclude);
1606
  if(!empty($productCheapest)){
1607
- $adjustment = array ( 'price_discount' => $productCheapest['percent'], 'product_ids' => array($productCheapest['product']), 'product_cart_item_keys' => array($productCheapest['product_cart_item_key']) ) ;
1608
  }
1609
  } else if($discount_product_option == 'more_than_one_cheapest' || $discount_product_option == 'more_than_one_cheapest_from_all'|| $discount_product_option == 'more_than_one_cheapest_from_cat'){
1610
  $discount_product_items = (isset($range->discount_product_items) ? $range->discount_product_items : 1);
@@ -1969,6 +1989,13 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
1969
  if(!(int)$variation){
1970
  $options = $attributes->get_options();
1971
 
 
 
 
 
 
 
 
1972
  if(!empty($options) && is_array($options)){
1973
  $available_attributes = array_merge($available_attributes, $options);
1974
  }
@@ -2203,7 +2230,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2203
  $show_discount = true;
2204
  // Base Config to Check whether display table or not.
2205
  if (isset($config['show_discount_table'])) {
2206
- if ($config['show_discount_table'] == 'show') {
2207
  $show_discount = true;
2208
  } else {
2209
  $show_discount = false;
@@ -2212,8 +2239,10 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2212
  // If Only allowed to display, then only its display the table.
2213
  if ($show_discount) {
2214
  $table_data = $this->generateDiscountTableData($product);
2215
- $path_from_template = $this->getTemplateOverride('discount-table.php');
2216
- $path = WOO_DISCOUNT_DIR . '/view/template/discount-table.php';
 
 
2217
  if($path_from_template){
2218
  $path = $path_from_template;
2219
  }
@@ -2319,7 +2348,14 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2319
  } elseif ($rule->apply_to == 'specific_attribute') {
2320
  $status = false;
2321
  if(!empty($rule->attribute_to_apply)){
2322
- $status = $this->checkProductMatchedForSpecificAttributes($rule->attribute_to_apply, $product, $index);
 
 
 
 
 
 
 
2323
  }
2324
 
2325
  //false;
@@ -2363,6 +2399,8 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2363
  if(!empty($discount_range_data)){
2364
  foreach ($discount_range_data as $discount_range_each){
2365
  if(isset($discount_range_each->title)) $discount_range_each->title = $rule->rule_name;
 
 
2366
  }
2367
  }
2368
  $discount_range[] = $discount_range_data;//(isset($rule->discount_range) ? json_decode($rule->discount_range) : array());
@@ -2382,6 +2420,8 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2382
  $newTableContent->discount_type = $product_based_discount_type;
2383
  $newTableContent->to_discount = $product_based_discount_value;
2384
  $newTableContent->title = $rule->rule_name;
 
 
2385
  $condition = $this->getTextForProductDiscountCondition($rule);
2386
  $newTableContent->condition = $condition;
2387
  $discount_range[][] = $newTableContent;
@@ -2737,6 +2777,10 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2737
  // All Sets are Collected properly, just process with that.
2738
  if (!isset($cart_item)) return false;
2739
 
 
 
 
 
2740
  // If Product having the rule sets then,
2741
  if (!isset($this->matched_sets[$cart_item_key])) return false;
2742
  if (empty($this->matched_sets[$cart_item_key])) return false;
@@ -2756,41 +2800,44 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2756
 
2757
  //To reset the adjustment set if the Product discount adjustment exists
2758
  $adjustment_set = $this->resetTheDiscountIfProductDiscountAdjustmentExists($adjustment_set, $product_id, $cart_item_key);
2759
- $additionalDetails = array();
2760
  $product_page = 0;
2761
  if ($type == 'first') {
2762
  // For Apply the First Rule.
2763
  $discount = $this->getAmount($adjustment_set, $price, 'first');
2764
  if(is_array($discount)){
2765
  $additionalDetails = $discount['details'];
 
2766
  $discount = $discount['amount'];
2767
  }
2768
  $amount = apply_filters('woo_discount_rules_price_rule_final_amount_applied', $price - $discount, $price, $discount, $additionalDetails, $product, $product_page);//$price - $discount;
2769
  if($amount < 0) $amount = 0;
2770
  $log = 'Discount | ' . $discount;
2771
- $this->applyDiscount($cart_item_key, $amount, $log, $additionalDetails);
2772
  } else if ($type == 'biggest') {
2773
  // For Apply the Biggest Discount.
2774
  $discount = $this->getAmount($adjustment_set, $price, 'biggest');
2775
  if(is_array($discount)){
2776
  $additionalDetails = $discount['details'];
 
2777
  $discount = $discount['amount'];
2778
  }
2779
  $amount = apply_filters('woo_discount_rules_price_rule_final_amount_applied', $price - $discount, $price, $discount, $additionalDetails, $product, $product_page);//$price - $discount;
2780
  if($amount < 0) $amount = 0;
2781
  $log = 'Discount | ' . $discount;
2782
- $this->applyDiscount($cart_item_key, $amount, $log, $additionalDetails);
2783
  } else {
2784
  // For Apply All Rules.
2785
  $discount = $this->getAmount($adjustment_set, $price);
2786
  if(is_array($discount)){
2787
  $additionalDetails = $discount['details'];
 
2788
  $discount = $discount['amount'];
2789
  }
2790
  $amount = apply_filters('woo_discount_rules_price_rule_final_amount_applied', $price - $discount, $price, $discount, $additionalDetails, $product, $product_page);//$price - $discount;
2791
  if($amount < 0) $amount = 0;
2792
  $log = 'Discount | ' . $discount;
2793
- $this->applyDiscount($cart_item_key, $amount, $log, $additionalDetails);
2794
  }
2795
  }
2796
 
@@ -2843,7 +2890,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2843
  $discount = $this->getBiggestDiscount($sets, $price, $product_page, $product);
2844
  return $discount;
2845
  }
2846
- $details = array();
2847
  foreach ($sets as $id => $set) {
2848
  // For the First price, it will return the amount after get hit.
2849
  if ($by == 'first') {
@@ -2862,14 +2909,21 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2862
  }
2863
  }
2864
  }
 
 
 
 
 
2865
  $details[] = isset($set['amount']['product_discount_details'])? $set['amount']['product_discount_details'] : array();
2866
- return array('amount' => $discount, 'details' => $details);
2867
  } else {
 
2868
  // For All, All rules going to apply.
2869
  if (isset($set['amount']['percentage_discount'])) {
2870
  $discount = ($price / 100) * $set['amount']['percentage_discount'];
2871
  // Append all Discounts.
2872
  $overall_discount = $overall_discount + $discount;
 
2873
  } else if (isset($set['amount']['price_discount'])) {
2874
  $discount = $set['amount']['price_discount'];
2875
  if($product_page){
@@ -2881,12 +2935,16 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2881
  }
2882
  // Append all Discounts.
2883
  $overall_discount = $overall_discount + $discount;
 
 
 
 
2884
  }
2885
  $details[] = isset($set['amount']['product_discount_details'])? $set['amount']['product_discount_details'] : array();
2886
  }
2887
  }
2888
 
2889
- return array('amount' => $overall_discount, 'details' => $details);
2890
  }
2891
 
2892
  /**
@@ -2899,7 +2957,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2899
  public function getBiggestDiscount($discount_list, $price, $product_page = 0, $product = array())
2900
  {
2901
  $big = $amount = 0;
2902
- $details = array();
2903
  foreach ($discount_list as $id => $discount_item) {
2904
  $amount_type = (isset($discount_item['amount']['percentage_discount']) ? 'percentage_discount' : 'price_discount');
2905
  if ($amount_type == 'percentage_discount') {
@@ -2921,12 +2979,17 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2921
 
2922
  if ($big < $amount) {
2923
  $big = $amount;
 
 
 
 
 
2924
  $details = isset($discount_item['amount']['product_discount_details'])? $discount_item['amount']['product_discount_details'] : array();
2925
  }
2926
  }
2927
  if(!empty($details)) $details = array($details);
2928
 
2929
- return array('amount' => $big,'details' => $details);
2930
  }
2931
 
2932
  /**
@@ -2936,7 +2999,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2936
  * @param $amount
2937
  * @param $log
2938
  */
2939
- public function applyDiscount($item, $amount, $log, $additionalDetails = array())
2940
  {
2941
  global $woocommerce;
2942
  // Make sure item exists in cart
@@ -2945,8 +3008,11 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2945
  }
2946
 
2947
  //Exclude the bundled products items
2948
- if(isset($woocommerce->cart->cart_contents[$item]['bundled_item_id']) && !empty($woocommerce->cart->cart_contents[$item]['bundled_item_id'])){
2949
- return;
 
 
 
2950
  }
2951
 
2952
  $product = $woocommerce->cart->cart_contents[$item]['data'];
@@ -2962,9 +3028,11 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2962
  if(isset($product->woo_discount_rules_applied) && $product->woo_discount_rules_applied) return ;
2963
  }
2964
 
 
 
2965
  // Log changes
2966
  $woocommerce->cart->cart_contents[$item]['woo_discount'] = array(
2967
- 'original_price' => get_option('woocommerce_tax_display_cart') == 'excl' ? FlycartWoocommerceProduct::get_price_excluding_tax($original_product) : FlycartWoocommerceProduct::get_price_including_tax($original_product),
2968
  'log' => $log,
2969
  'additional_details' => $additionalDetails,
2970
  );
@@ -2981,6 +3049,12 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2981
  }
2982
  }
2983
  }
 
 
 
 
 
 
2984
 
2985
  // Actually adjust price in cart
2986
  // $woocommerce->cart->cart_contents[$item]['data']->price = $amount;
@@ -2994,7 +3068,13 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
2994
  foreach (self::$matched_discounts[$item] as $matched_discounts){
2995
  $rule_order_id = $matched_discounts['rule_order'];
2996
  if(isset($this->rule_sets[$rule_order_id])){
2997
- self::$applied_discount_rules[$rule_order_id] = $this->rule_sets[$rule_order_id];
 
 
 
 
 
 
2998
  }
2999
  }
3000
 
@@ -3031,7 +3111,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3031
 
3032
  $config = new FlycartWooDiscountBase();
3033
  $show_strikeout_in_cart = $config->getConfigData('show_strikeout_in_cart', 1);
3034
- if (!isset($cart_item['woo_discount']) || !$show_strikeout_in_cart) {
3035
  return $item_price;
3036
  }
3037
 
@@ -3116,7 +3196,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3116
  if(FlycartWoocommerceVersion::wcVersion('3.0')) return $data;
3117
  $item_price = $data['price_html'];
3118
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3119
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'dont';
3120
  if($show_price_discount_on_product_page == 'show' && $notAdmin){
3121
  $discountPrice = $this->getDiscountPriceForTheProduct($product, FlycartWoocommerceProduct::get_price($variations));
3122
  $product_id = FlycartWoocommerceProduct::get_id($variations);
@@ -3151,7 +3231,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3151
  }
3152
 
3153
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3154
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'dont';
3155
  if($show_price_discount_on_product_page == 'show' && $notAdmin){
3156
  $discountPrice = $this->getDiscountPriceForTheProduct($product);
3157
  $product_id = FlycartWoocommerceProduct::get_id($product);
@@ -3203,7 +3283,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3203
  }
3204
 
3205
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3206
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'dont';
3207
  if($show_price_discount_on_product_page == 'show' && ($notAdmin || $runTheRulesEvenInAjax)){
3208
  $product_id = FlycartWoocommerceProduct::get_id($product);
3209
  if(isset(self::$product_strike_out_price[$product_id]) && !empty(self::$product_strike_out_price[$product_id])){
@@ -3231,7 +3311,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3231
  public function displayProductIsOnSaleTagOptimized($on_sale, $product){
3232
  $runTheRulesEvenInAjax = apply_filters('woo_discount_rules_run_sale_tag_for_ajax', false, $product);
3233
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3234
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'dont';
3235
  if($show_price_discount_on_product_page == 'show' && ($notAdmin || $runTheRulesEvenInAjax)){
3236
  $product_id = FlycartWoocommerceProduct::get_id($product);
3237
  if(isset(self::$product_on_sale[$product_id])){
@@ -3239,7 +3319,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3239
  $on_sale = true;
3240
  }
3241
  } else {
3242
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'dont';
3243
  $optimize_sale_and_price_strikeout = apply_filters('woo_discount_rules_do_sale_tag_through_strikeout_price', true, $product);
3244
  if($show_price_discount_on_product_page == 'show' && $optimize_sale_and_price_strikeout){
3245
  $this->replaceVisiblePrices('', $product);
@@ -3356,7 +3436,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3356
  public function displayProductIsOnSaleTag($on_sale, $product){
3357
  $runTheRulesEvenInAjax = apply_filters('woo_discount_rules_run_sale_tag_for_ajax', false, $product);
3358
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3359
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'dont';
3360
  if($show_price_discount_on_product_page == 'show' && ($notAdmin || $runTheRulesEvenInAjax)){
3361
  $product_id = FlycartWoocommerceProduct::get_id($product);
3362
  self::$product_on_sale[$product_id] = 0;
@@ -3436,7 +3516,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3436
  * */
3437
  public function displayProductIsOnSaleTagNew($on_sale, $product){
3438
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3439
- $show_price_discount_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'dont';
3440
  if($show_price_discount_on_product_page == 'show' && $notAdmin){
3441
  global $product;
3442
  $rules = $this->generateDiscountTableData($product);
@@ -3622,5 +3702,146 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
3622
 
3623
  return $amount;
3624
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3625
  }
3626
  }
146
  $form = array(
147
  'rule_name',
148
  'rule_descr',
149
+ 'advance_table_format',
150
  'rule_method',
151
  'qty_based_on',
152
  'date_from',
278
  }
279
 
280
  if(!isset($request['product_to_exclude'])) $request['product_to_exclude'] = array();
281
+ if(!isset($request['coupons_to_apply'])) $request['coupons_to_apply'] = '';
282
+ if(!empty($request['coupons_to_apply'])){
283
+ $request['coupons_to_apply'] = implode(',', $request['coupons_to_apply']);
284
+ }
285
 
286
  $request['status'] = 'publish';
287
 
671
  if(count($this->bogo_matches) > 0){
672
  foreach ($this->bogo_matches as $free_product_id => $bogo_match){
673
  $found = false;
674
+ $carts = FlycartWoocommerceCart::get_cart();
675
  foreach ($carts as $key => $cart_item) {
676
  if(empty($cart_item['data'])){
677
  continue;
1119
  if(!empty($this->rule_sets))
1120
  foreach ($this->rule_sets as $id => $rule) {
1121
  $quantity = (isset($item['quantity']) ? $item['quantity'] : 0);
1122
+
1123
+ //Exclude the bundled products items
1124
+ $exclude_bundle_product_item = apply_filters('woo_discount_rules_exclude_woocommerce_bundled_item', true, $item);
1125
+ if($exclude_bundle_product_item){
1126
+ if(isset($item['bundled_item_id']) && !empty($item['bundled_item_id'])){
1127
+ continue;
1128
+ }
1129
+ }
1130
+
1131
  if(isset($rule['method']) && $rule['method'] == 'qty_based'){
1132
  if (isset($rule['type']) && isset($rule['apply_to'])) {
1133
  if($product_page && !$bogo){
1414
  if(empty($cartItem['data'])){
1415
  continue;
1416
  }
1417
+
1418
  //Exclude the bundled products items
1419
+ $exclude_bundle_product_item = apply_filters('woo_discount_rules_exclude_woocommerce_bundled_item', true, $cartItem);
1420
+ if($exclude_bundle_product_item){
1421
+ if(isset($cartItem['bundled_item_id']) && !empty($cartItem['bundled_item_id'])){
1422
+ continue;
1423
+ }
1424
  }
1425
+
1426
  // if(isset($cartItem['variation']) && !empty($cartItem['variation'])){
1427
  // if(isset($cartItem['variation']['Type']) && !empty($cartItem['variation']['Type'])){
1428
  // if($cartItem['variation']['Type'] == "Free Item") continue;
1619
  } else if($discount_product_option == 'any_cheapest_from_all'){
1620
  $productCheapest = $this->getCheapestProductFromCart($productIds, 1, 1, $range, $product_to_exclude);
1621
  if(!empty($productCheapest)){
1622
+ $adjustment = array ( 'price_discount' => $productCheapest['percent'], 'product_ids' => array($productCheapest['product']), 'product_cart_item_keys' => array($productCheapest['product_cart_item_key']), 'product_discount_details' => $productCheapest['discount_details']) ;
1623
  }
1624
  } else if($discount_product_option == 'any_cheapest'){
1625
  $productCheapest = $this->getCheapestProductFromCart($productIds,0, 1, $range, $product_to_exclude);
1626
  if(!empty($productCheapest)){
1627
+ $adjustment = array ( 'price_discount' => $productCheapest['percent'], 'product_ids' => array($productCheapest['product']), 'product_cart_item_keys' => array($productCheapest['product_cart_item_key']), 'product_discount_details' => $productCheapest['discount_details']) ;
1628
  }
1629
  } else if($discount_product_option == 'more_than_one_cheapest' || $discount_product_option == 'more_than_one_cheapest_from_all'|| $discount_product_option == 'more_than_one_cheapest_from_cat'){
1630
  $discount_product_items = (isset($range->discount_product_items) ? $range->discount_product_items : 1);
1989
  if(!(int)$variation){
1990
  $options = $attributes->get_options();
1991
 
1992
+ if(!empty($options) && is_array($options)){
1993
+ $available_attributes = array_merge($available_attributes, $options);
1994
+ }
1995
+ }
1996
+ } else {
1997
+ if(method_exists($attributes, 'get_options')){
1998
+ $options = $attributes->get_options();
1999
  if(!empty($options) && is_array($options)){
2000
  $available_attributes = array_merge($available_attributes, $options);
2001
  }
2230
  $show_discount = true;
2231
  // Base Config to Check whether display table or not.
2232
  if (isset($config['show_discount_table'])) {
2233
+ if ($config['show_discount_table'] == 'show' || $config['show_discount_table'] == 'advance') {
2234
  $show_discount = true;
2235
  } else {
2236
  $show_discount = false;
2239
  // If Only allowed to display, then only its display the table.
2240
  if ($show_discount) {
2241
  $table_data = $this->generateDiscountTableData($product);
2242
+ $file_name = 'discount-table';
2243
+ if($config['show_discount_table'] == 'advance') $file_name .= '-advance';
2244
+ $path_from_template = $this->getTemplateOverride($file_name.'.php');
2245
+ $path = WOO_DISCOUNT_DIR . '/view/template/'.$file_name.'.php';
2246
  if($path_from_template){
2247
  $path = $path_from_template;
2248
  }
2348
  } elseif ($rule->apply_to == 'specific_attribute') {
2349
  $status = false;
2350
  if(!empty($rule->attribute_to_apply)){
2351
+ $productToExclude = $this->getExcludeProductsFromRule($rule);
2352
+ $excluded_product = false;
2353
+ if(!empty($productToExclude)){
2354
+ if(in_array($id, $productToExclude)){
2355
+ $excluded_product = true;
2356
+ }
2357
+ }
2358
+ if(!$excluded_product) $status = $this->checkProductMatchedForSpecificAttributes($rule->attribute_to_apply, $product, $index);
2359
  }
2360
 
2361
  //false;
2399
  if(!empty($discount_range_data)){
2400
  foreach ($discount_range_data as $discount_range_each){
2401
  if(isset($discount_range_each->title)) $discount_range_each->title = $rule->rule_name;
2402
+ $discount_range_each->description = $rule->rule_descr;
2403
+ $discount_range_each->advance_table_format = empty($rule->advance_table_format)? '': $rule->advance_table_format;
2404
  }
2405
  }
2406
  $discount_range[] = $discount_range_data;//(isset($rule->discount_range) ? json_decode($rule->discount_range) : array());
2420
  $newTableContent->discount_type = $product_based_discount_type;
2421
  $newTableContent->to_discount = $product_based_discount_value;
2422
  $newTableContent->title = $rule->rule_name;
2423
+ $newTableContent->description = $rule->rule_descr;
2424
+ $newTableContent->advance_table_format = empty($rule->advance_table_format)? '': $rule->advance_table_format;
2425
  $condition = $this->getTextForProductDiscountCondition($rule);
2426
  $newTableContent->condition = $condition;
2427
  $discount_range[][] = $newTableContent;
2777
  // All Sets are Collected properly, just process with that.
2778
  if (!isset($cart_item)) return false;
2779
 
2780
+ if(!empty($cart_item_key) && !empty($woocommerce->cart->cart_contents[$cart_item_key])){
2781
+ $woocommerce->cart->cart_contents[$cart_item_key]['woo_discount'] = array();
2782
+ }
2783
+
2784
  // If Product having the rule sets then,
2785
  if (!isset($this->matched_sets[$cart_item_key])) return false;
2786
  if (empty($this->matched_sets[$cart_item_key])) return false;
2800
 
2801
  //To reset the adjustment set if the Product discount adjustment exists
2802
  $adjustment_set = $this->resetTheDiscountIfProductDiscountAdjustmentExists($adjustment_set, $product_id, $cart_item_key);
2803
+ $additionalDetails = $rules_info = $additionalInfo = array();
2804
  $product_page = 0;
2805
  if ($type == 'first') {
2806
  // For Apply the First Rule.
2807
  $discount = $this->getAmount($adjustment_set, $price, 'first');
2808
  if(is_array($discount)){
2809
  $additionalDetails = $discount['details'];
2810
+ $additionalInfo['rules_applied'] = $discount['rule'];
2811
  $discount = $discount['amount'];
2812
  }
2813
  $amount = apply_filters('woo_discount_rules_price_rule_final_amount_applied', $price - $discount, $price, $discount, $additionalDetails, $product, $product_page);//$price - $discount;
2814
  if($amount < 0) $amount = 0;
2815
  $log = 'Discount | ' . $discount;
2816
+ if($discount > 0) $this->applyDiscount($cart_item_key, $amount, $log, $additionalDetails, $additionalInfo);
2817
  } else if ($type == 'biggest') {
2818
  // For Apply the Biggest Discount.
2819
  $discount = $this->getAmount($adjustment_set, $price, 'biggest');
2820
  if(is_array($discount)){
2821
  $additionalDetails = $discount['details'];
2822
+ $additionalInfo['rules_applied'] = $discount['rule'];
2823
  $discount = $discount['amount'];
2824
  }
2825
  $amount = apply_filters('woo_discount_rules_price_rule_final_amount_applied', $price - $discount, $price, $discount, $additionalDetails, $product, $product_page);//$price - $discount;
2826
  if($amount < 0) $amount = 0;
2827
  $log = 'Discount | ' . $discount;
2828
+ if($discount > 0) $this->applyDiscount($cart_item_key, $amount, $log, $additionalDetails, $additionalInfo);
2829
  } else {
2830
  // For Apply All Rules.
2831
  $discount = $this->getAmount($adjustment_set, $price);
2832
  if(is_array($discount)){
2833
  $additionalDetails = $discount['details'];
2834
+ $additionalInfo['rules_applied'] = $discount['rule'];
2835
  $discount = $discount['amount'];
2836
  }
2837
  $amount = apply_filters('woo_discount_rules_price_rule_final_amount_applied', $price - $discount, $price, $discount, $additionalDetails, $product, $product_page);//$price - $discount;
2838
  if($amount < 0) $amount = 0;
2839
  $log = 'Discount | ' . $discount;
2840
+ if($discount > 0) $this->applyDiscount($cart_item_key, $amount, $log, $additionalDetails, $additionalInfo);
2841
  }
2842
  }
2843
 
2890
  $discount = $this->getBiggestDiscount($sets, $price, $product_page, $product);
2891
  return $discount;
2892
  }
2893
+ $details = $rule_data = array();
2894
  foreach ($sets as $id => $set) {
2895
  // For the First price, it will return the amount after get hit.
2896
  if ($by == 'first') {
2909
  }
2910
  }
2911
  }
2912
+ if(isset($set['rule_order'])){
2913
+ $rule_data = array($set['rule_order'] => $set['item']);
2914
+ } else {
2915
+ $rule_data = array();
2916
+ }
2917
  $details[] = isset($set['amount']['product_discount_details'])? $set['amount']['product_discount_details'] : array();
2918
+ return array('amount' => $discount, 'details' => $details, 'rule' => $rule_data);
2919
  } else {
2920
+ $has_discount = 0;
2921
  // For All, All rules going to apply.
2922
  if (isset($set['amount']['percentage_discount'])) {
2923
  $discount = ($price / 100) * $set['amount']['percentage_discount'];
2924
  // Append all Discounts.
2925
  $overall_discount = $overall_discount + $discount;
2926
+ $has_discount = 1;
2927
  } else if (isset($set['amount']['price_discount'])) {
2928
  $discount = $set['amount']['price_discount'];
2929
  if($product_page){
2935
  }
2936
  // Append all Discounts.
2937
  $overall_discount = $overall_discount + $discount;
2938
+ $has_discount = 1;
2939
+ }
2940
+ if(isset($set['rule_order']) && $has_discount){
2941
+ $rule_data[$set['rule_order']] = $set['item'];
2942
  }
2943
  $details[] = isset($set['amount']['product_discount_details'])? $set['amount']['product_discount_details'] : array();
2944
  }
2945
  }
2946
 
2947
+ return array('amount' => $overall_discount, 'details' => $details, 'rule' => $rule_data);
2948
  }
2949
 
2950
  /**
2957
  public function getBiggestDiscount($discount_list, $price, $product_page = 0, $product = array())
2958
  {
2959
  $big = $amount = 0;
2960
+ $details = $rule_data = array();
2961
  foreach ($discount_list as $id => $discount_item) {
2962
  $amount_type = (isset($discount_item['amount']['percentage_discount']) ? 'percentage_discount' : 'price_discount');
2963
  if ($amount_type == 'percentage_discount') {
2979
 
2980
  if ($big < $amount) {
2981
  $big = $amount;
2982
+ if(isset($discount_item['rule_order'])){
2983
+ $rule_data = array($discount_item['rule_order'] => $discount_item['item']);
2984
+ } else {
2985
+ $rule_data = array();
2986
+ }
2987
  $details = isset($discount_item['amount']['product_discount_details'])? $discount_item['amount']['product_discount_details'] : array();
2988
  }
2989
  }
2990
  if(!empty($details)) $details = array($details);
2991
 
2992
+ return array('amount' => $big, 'details' => $details, 'rule' => $rule_data);
2993
  }
2994
 
2995
  /**
2999
  * @param $amount
3000
  * @param $log
3001
  */
3002
+ public function applyDiscount($item, $amount, $log, $additionalDetails = array(), $additionalInfo = array())
3003
  {
3004
  global $woocommerce;
3005
  // Make sure item exists in cart
3008
  }
3009
 
3010
  //Exclude the bundled products items
3011
+ $exclude_bundle_product_item = apply_filters('woo_discount_rules_exclude_woocommerce_bundled_item', true, $woocommerce->cart->cart_contents[$item]);
3012
+ if($exclude_bundle_product_item){
3013
+ if(isset($woocommerce->cart->cart_contents[$item]['bundled_item_id']) && !empty($woocommerce->cart->cart_contents[$item]['bundled_item_id'])){
3014
+ return;
3015
+ }
3016
  }
3017
 
3018
  $product = $woocommerce->cart->cart_contents[$item]['data'];
3028
  if(isset($product->woo_discount_rules_applied) && $product->woo_discount_rules_applied) return ;
3029
  }
3030
 
3031
+ $original_price_to_display = get_option('woocommerce_tax_display_cart') == 'excl' ? FlycartWoocommerceProduct::get_price_excluding_tax($original_product) : FlycartWoocommerceProduct::get_price_including_tax($original_product);
3032
+ $original_price = FlycartWoocommerceProduct::get_price($original_product);
3033
  // Log changes
3034
  $woocommerce->cart->cart_contents[$item]['woo_discount'] = array(
3035
+ 'original_price' => $original_price_to_display,
3036
  'log' => $log,
3037
  'additional_details' => $additionalDetails,
3038
  );
3049
  }
3050
  }
3051
  }
3052
+ //for future reference
3053
+ $discount_amount = $original_price - $amount;
3054
+ $woocommerce->cart->cart_contents[$item]['woo_discount']['discounted_price_per_product'] = $amount;
3055
+ $woocommerce->cart->cart_contents[$item]['woo_discount']['discounted_price_total'] = $amount * $woocommerce->cart->cart_contents[$item]['quantity'];
3056
+ $woocommerce->cart->cart_contents[$item]['woo_discount']['discount_amount'] = $discount_amount;
3057
+ $woocommerce->cart->cart_contents[$item]['woo_discount']['discount_amount_total'] = $discount_amount * $woocommerce->cart->cart_contents[$item]['quantity'];
3058
 
3059
  // Actually adjust price in cart
3060
  // $woocommerce->cart->cart_contents[$item]['data']->price = $amount;
3068
  foreach (self::$matched_discounts[$item] as $matched_discounts){
3069
  $rule_order_id = $matched_discounts['rule_order'];
3070
  if(isset($this->rule_sets[$rule_order_id])){
3071
+ if(!empty($additionalInfo['rules_applied'])){
3072
+ if(isset($additionalInfo['rules_applied'][$rule_order_id])){
3073
+ if($additionalInfo['rules_applied'][$rule_order_id] == $item){
3074
+ self::$applied_discount_rules[$rule_order_id] = $this->rule_sets[$rule_order_id];
3075
+ }
3076
+ }
3077
+ }
3078
  }
3079
  }
3080
 
3111
 
3112
  $config = new FlycartWooDiscountBase();
3113
  $show_strikeout_in_cart = $config->getConfigData('show_strikeout_in_cart', 1);
3114
+ if (!isset($cart_item['woo_discount']) || !$show_strikeout_in_cart || !isset($cart_item['woo_discount']['original_price'])) {
3115
  return $item_price;
3116
  }
3117
 
3196
  if(FlycartWoocommerceVersion::wcVersion('3.0')) return $data;
3197
  $item_price = $data['price_html'];
3198
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3199
+ $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'show';
3200
  if($show_price_discount_on_product_page == 'show' && $notAdmin){
3201
  $discountPrice = $this->getDiscountPriceForTheProduct($product, FlycartWoocommerceProduct::get_price($variations));
3202
  $product_id = FlycartWoocommerceProduct::get_id($variations);
3231
  }
3232
 
3233
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3234
+ $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'show';
3235
  if($show_price_discount_on_product_page == 'show' && $notAdmin){
3236
  $discountPrice = $this->getDiscountPriceForTheProduct($product);
3237
  $product_id = FlycartWoocommerceProduct::get_id($product);
3283
  }
3284
 
3285
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3286
+ $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'show';
3287
  if($show_price_discount_on_product_page == 'show' && ($notAdmin || $runTheRulesEvenInAjax)){
3288
  $product_id = FlycartWoocommerceProduct::get_id($product);
3289
  if(isset(self::$product_strike_out_price[$product_id]) && !empty(self::$product_strike_out_price[$product_id])){
3311
  public function displayProductIsOnSaleTagOptimized($on_sale, $product){
3312
  $runTheRulesEvenInAjax = apply_filters('woo_discount_rules_run_sale_tag_for_ajax', false, $product);
3313
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3314
+ $show_price_discount_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'show';
3315
  if($show_price_discount_on_product_page == 'show' && ($notAdmin || $runTheRulesEvenInAjax)){
3316
  $product_id = FlycartWoocommerceProduct::get_id($product);
3317
  if(isset(self::$product_on_sale[$product_id])){
3319
  $on_sale = true;
3320
  }
3321
  } else {
3322
+ $show_price_discount_on_product_page = (isset($this->baseConfig['show_price_discount_on_product_page']))? $this->baseConfig['show_price_discount_on_product_page']: 'show';
3323
  $optimize_sale_and_price_strikeout = apply_filters('woo_discount_rules_do_sale_tag_through_strikeout_price', true, $product);
3324
  if($show_price_discount_on_product_page == 'show' && $optimize_sale_and_price_strikeout){
3325
  $this->replaceVisiblePrices('', $product);
3436
  public function displayProductIsOnSaleTag($on_sale, $product){
3437
  $runTheRulesEvenInAjax = apply_filters('woo_discount_rules_run_sale_tag_for_ajax', false, $product);
3438
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3439
+ $show_price_discount_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'show';
3440
  if($show_price_discount_on_product_page == 'show' && ($notAdmin || $runTheRulesEvenInAjax)){
3441
  $product_id = FlycartWoocommerceProduct::get_id($product);
3442
  self::$product_on_sale[$product_id] = 0;
3516
  * */
3517
  public function displayProductIsOnSaleTagNew($on_sale, $product){
3518
  $notAdmin = FlycartWooDiscountRulesGeneralHelper::doIHaveToRun();
3519
+ $show_price_discount_on_product_page = (isset($this->baseConfig['show_sale_tag_on_product_page']))? $this->baseConfig['show_sale_tag_on_product_page']: 'show';
3520
  if($show_price_discount_on_product_page == 'show' && $notAdmin){
3521
  global $product;
3522
  $rules = $this->generateDiscountTableData($product);
3702
 
3703
  return $amount;
3704
  }
3705
+
3706
+ /**
3707
+ * Add woo discount data for each order item
3708
+ * */
3709
+ public function onCreateWoocommerceOrderLineItem($item, $cart_item_key, $values, $order){
3710
+ $woo_discount_data = array();
3711
+ if(!empty($values['woo_discount'])){
3712
+ $woo_discount_data = $values['woo_discount'];
3713
+ }
3714
+ $item->add_meta_data( '_fly_woo_discount_price_rules', $woo_discount_data, true );
3715
+ }
3716
+
3717
+ /**
3718
+ * Add you saved content in each cart item
3719
+ * */
3720
+ public function addAdditionalContentInCartItemSubTotal($subtotal, $cart_item, $cart_item_key)
3721
+ {
3722
+ if (!empty($cart_item['woo_discount'])) {
3723
+ $woo_discount = $cart_item['woo_discount'];
3724
+ if (!empty($woo_discount['discount_amount_total'])) {
3725
+ $total_discounted_price = FlycartWoocommerceProduct::wc_price($woo_discount['discount_amount_total']);
3726
+ $subtotal_additional_text = $this->getYouSavedContent($total_discounted_price);
3727
+ $subtotal .= apply_filters('woo_discount_rules_on_display_discount_priced_in_cart_item_subtotal', $subtotal_additional_text, $woo_discount, $cart_item, $subtotal);
3728
+ }
3729
+ }
3730
+
3731
+ return $subtotal;
3732
+ }
3733
+
3734
+ /**
3735
+ * Add you saved content in each order item
3736
+ * */
3737
+ public function addAdditionalContentInOrderItemSubTotal($subtotal, $item, $order)
3738
+ {
3739
+ $woo_discount_details = $item->get_meta('_fly_woo_discount_price_rules');
3740
+ if(!empty($woo_discount_details)){
3741
+ if (!empty($woo_discount_details['discount_amount_total'])) {
3742
+ $total_discounted_price = FlycartWoocommerceProduct::wc_price($woo_discount_details['discount_amount_total'], array('currency' => FlycartWoocommerceOrder::get_currency($order)));
3743
+ $subtotal_additional_text = $this->getYouSavedContent($total_discounted_price);
3744
+ $subtotal .= apply_filters('woo_discount_rules_on_display_discount_priced_in_order_item_subtotal', $subtotal_additional_text, $woo_discount_details, $item, $subtotal);
3745
+ }
3746
+ }
3747
+
3748
+ return $subtotal;
3749
+ }
3750
+
3751
+ /**
3752
+ * Add you saved content in each order item
3753
+ * */
3754
+ public function addAdditionalContentInAfterOrderItemMeta($item_id, $item, $product)
3755
+ {
3756
+ $order = FlycartWoocommerceOrder::wc_get_order(FlycartWoocommerceOrderItem::get_order_id($item));
3757
+ $woo_discount_details = $item->get_meta('_fly_woo_discount_price_rules');
3758
+ if(!empty($woo_discount_details)){
3759
+ if (!empty($woo_discount_details['discount_amount_total'])) {
3760
+ $total_discounted_price = FlycartWoocommerceProduct::wc_price($woo_discount_details['discount_amount_total'], array('currency' => FlycartWoocommerceOrder::get_currency($order)));
3761
+ $subtotal_additional_text = '<div class="wdr_you_saved_discount_con" style="color: green;">';
3762
+ $subtotal_additional_text .= $this->getYouSavedContent($total_discounted_price);
3763
+ $subtotal_additional_text .= '</div>';
3764
+
3765
+ echo $subtotal_additional_text;
3766
+ }
3767
+ }
3768
+ }
3769
+
3770
+ /**
3771
+ * Get you saved HTML content
3772
+ * @param string $total_discounted_price
3773
+ * @return string
3774
+ * */
3775
+ protected function getYouSavedContent($total_discounted_price){
3776
+ $subtotal_additional_text = '<span class="wdr_you_saved_con">';
3777
+ $config = new FlycartWooDiscountBase();
3778
+ $display_you_saved_string = $config->getConfigData('display_you_saved_text_value', " You saved: {{total_discount_price}}");
3779
+ $display_you_saved_string = esc_html__($display_you_saved_string, 'woo-discount-rules');
3780
+ $subtotal_additional_text .= str_replace('{{total_discount_price}}', $total_discounted_price, $display_you_saved_string);
3781
+ $subtotal_additional_text .= '</span>';
3782
+
3783
+ return $subtotal_additional_text;
3784
+ }
3785
+
3786
+ /**
3787
+ * Display total savings in cart
3788
+ * */
3789
+ public function displayTotalSavingsThroughDiscountInCart(){
3790
+ $cart = FlycartWoocommerceCart::get_cart();
3791
+ if(!empty($cart)){
3792
+ $total_discount = 0;
3793
+ foreach ($cart as $key => $cart_item){
3794
+ if (!empty($cart_item['woo_discount'])) {
3795
+ $woo_discount = $cart_item['woo_discount'];
3796
+ if (!empty($woo_discount['discount_amount_total'])) {
3797
+ $total_discount += $woo_discount['discount_amount_total'];
3798
+ }
3799
+ }
3800
+ }
3801
+ if($total_discount > 0){
3802
+ $total_discounted_price = FlycartWoocommerceProduct::wc_price($total_discount);
3803
+ $subtotal_additional_text = $this->getYouSavedContent($total_discounted_price);
3804
+ $path_from_template = $this->getTemplateOverride('total-savings-cart.php');
3805
+ $path = WOO_DISCOUNT_DIR . '/view/template/total-savings-cart.php';
3806
+ if($path_from_template){
3807
+ $path = $path_from_template;
3808
+ }
3809
+ include($path);
3810
+ }
3811
+ }
3812
+ }
3813
+
3814
+ /**
3815
+ * Display total savings in order
3816
+ * */
3817
+ public function displayTotalSavingsThroughDiscountInOrder($order){
3818
+ if(!is_object($order)){
3819
+ if(!empty($order) && is_int($order)){
3820
+ $order = FlycartWoocommerceOrder::wc_get_order($order);
3821
+ }
3822
+ }
3823
+ $items = $order->get_items();
3824
+ if(!empty($items)){
3825
+ $total_discount = 0;
3826
+ foreach ($items as $key => $item){
3827
+ $woo_discount_details = $item->get_meta('_fly_woo_discount_price_rules');
3828
+ if(!empty($woo_discount_details)){
3829
+ if (!empty($woo_discount_details['discount_amount_total'])) {
3830
+ $total_discount += $woo_discount_details['discount_amount_total'];
3831
+ }
3832
+ }
3833
+ }
3834
+ if($total_discount > 0){
3835
+ $total_discounted_price = FlycartWoocommerceProduct::wc_price($total_discount, array('currency' => FlycartWoocommerceOrder::get_currency($order)));
3836
+ $subtotal_additional_text = $this->getYouSavedContent($total_discounted_price);
3837
+ $path_from_template = $this->getTemplateOverride('total-savings-order.php');
3838
+ $path = WOO_DISCOUNT_DIR . '/view/template/total-savings-order.php';
3839
+ if($path_from_template){
3840
+ $path = $path_from_template;
3841
+ }
3842
+ include($path);
3843
+ }
3844
+ }
3845
+ }
3846
  }
3847
  }
loader.php CHANGED
@@ -58,6 +58,7 @@ if(!class_exists('FlycartWooDiscountRules')){
58
  if(FlycartWooDiscountRulesGeneralHelper::doIHaveToRun()){
59
  $this->loadSiteScripts();
60
  }
 
61
  }
62
 
63
  /**
@@ -117,6 +118,13 @@ if(!class_exists('FlycartWooDiscountRules')){
117
  add_action('wp_ajax_doBulkAction', array($this->discountBase, 'doBulkAction'));
118
  add_action('wp_ajax_createDuplicateRule', array($this->discountBase, 'createDuplicateRule'));
119
  add_action('admin_enqueue_scripts', array($this->discountBase, 'woo_discount_adminPageScript'), 100 );
 
 
 
 
 
 
 
120
  }
121
 
122
  /**
@@ -134,8 +142,8 @@ if(!class_exists('FlycartWooDiscountRules')){
134
  * Apply discount rules
135
  * */
136
  public function applyCartDiscountRules(){
137
- $this->discountBase->handleCartDiscount();
138
  remove_action('woocommerce_cart_loaded_from_session', array($this, 'applyCartDiscountRules'), 97);
 
139
  }
140
 
141
  /**
@@ -145,7 +153,7 @@ if(!class_exists('FlycartWooDiscountRules')){
145
  $runVariationStrikeoutAjax = apply_filters('woo_discount_rules_run_variation_strikeout_through_ajax', true);
146
  $script = '<script>';
147
  $script .= 'jQuery( document ).ready( function() {';
148
- $do_product_page_strikeout = $this->discountBase->getConfigData('show_price_discount_on_product_page', 'dont');
149
  $enable_variable_product_cache = $this->discountBase->getConfigData('enable_variable_product_cache', 0);
150
  if($do_product_page_strikeout == 'show' && $runVariationStrikeoutAjax) {
151
  $script .= 'jQuery( ".single_variation_wrap" ).on( "show_variation", function ( event, variation, purchasable ) {';
@@ -243,6 +251,31 @@ if(!class_exists('FlycartWooDiscountRules')){
243
  echo $script;
244
  }
245
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  /**
247
  * Load Admin scripts
248
  * */
@@ -270,6 +303,17 @@ if(!class_exists('FlycartWooDiscountRules')){
270
  add_action('woocommerce_applied_coupon', array($this->pricingRules, 'handleBOGODiscountAfterApplyCoupon'), 10, 1);
271
  }
272
 
 
 
 
 
 
 
 
 
 
 
 
273
  // Manually Update Line Item Name.
274
  add_filter('woocommerce_cart_item_name', array($this->discountBase, 'modifyName'));
275
 
@@ -328,6 +372,8 @@ if(!class_exists('FlycartWooDiscountRules')){
328
  * To include the styles
329
  * */
330
  public function includeScriptAndStyles(){
 
 
331
  // Enqueued script with localized data.
332
  wp_register_script( 'woo_discount_rules_site', WOO_DISCOUNT_URI . '/assets/js/woo_discount_rules.js', array('jquery'), WOO_DISCOUNT_VERSION, true );
333
  wp_localize_script('woo_discount_rules_site', 'woo_discount_rules', array(
@@ -399,6 +445,11 @@ if(!class_exists('FlycartWooDiscountRules')){
399
  }
400
  }
401
 
 
 
 
 
 
402
  /**
403
  * init Woo Discount Rules
404
  */
@@ -413,4 +464,3 @@ if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
413
  include_once('includes/advanced/advanced-helper.php');
414
  }
415
  }
416
-
58
  if(FlycartWooDiscountRulesGeneralHelper::doIHaveToRun()){
59
  $this->loadSiteScripts();
60
  }
61
+ $this->loadCommonScripts();
62
  }
63
 
64
  /**
118
  add_action('wp_ajax_doBulkAction', array($this->discountBase, 'doBulkAction'));
119
  add_action('wp_ajax_createDuplicateRule', array($this->discountBase, 'createDuplicateRule'));
120
  add_action('admin_enqueue_scripts', array($this->discountBase, 'woo_discount_adminPageScript'), 100 );
121
+ $display_you_saved_text = $this->discountBase->getConfigData('display_you_saved_text', 'no');
122
+ if(in_array($display_you_saved_text, array('on_each_line_item', 'both_line_item_and_after_total'))){
123
+ add_action( 'woocommerce_after_order_itemmeta', array( $this->pricingRules, 'addAdditionalContentInAfterOrderItemMeta'), 1000, 3);
124
+ }
125
+ if(in_array($display_you_saved_text, array('after_total', 'both_line_item_and_after_total'))){
126
+ add_action( 'woocommerce_admin_order_totals_after_total', array( $this->pricingRules, 'displayTotalSavingsThroughDiscountInOrder'), 10);
127
+ }
128
  }
129
 
130
  /**
142
  * Apply discount rules
143
  * */
144
  public function applyCartDiscountRules(){
 
145
  remove_action('woocommerce_cart_loaded_from_session', array($this, 'applyCartDiscountRules'), 97);
146
+ $this->discountBase->handleCartDiscount();
147
  }
148
 
149
  /**
153
  $runVariationStrikeoutAjax = apply_filters('woo_discount_rules_run_variation_strikeout_through_ajax', true);
154
  $script = '<script>';
155
  $script .= 'jQuery( document ).ready( function() {';
156
+ $do_product_page_strikeout = $this->discountBase->getConfigData('show_price_discount_on_product_page', 'show');
157
  $enable_variable_product_cache = $this->discountBase->getConfigData('enable_variable_product_cache', 0);
158
  if($do_product_page_strikeout == 'show' && $runVariationStrikeoutAjax) {
159
  $script .= 'jQuery( ".single_variation_wrap" ).on( "show_variation", function ( event, variation, purchasable ) {';
251
  echo $script;
252
  }
253
 
254
+ /**
255
+ * Load common scripts
256
+ * */
257
+ protected function loadCommonScripts(){
258
+ add_filter( 'woocommerce_email_styles', array($this, 'add_additional_woocommerce_email_styles'), 100);
259
+ $display_you_saved_text = $this->discountBase->getConfigData('display_you_saved_text', 'no');
260
+ if(in_array($display_you_saved_text, array('on_each_line_item', 'both_line_item_and_after_total'))){
261
+ add_filter( 'woocommerce_order_formatted_line_subtotal', array( $this->pricingRules, 'addAdditionalContentInOrderItemSubTotal'), 1000, 3);
262
+ }
263
+ if(in_array($display_you_saved_text, array('after_total', 'both_line_item_and_after_total'))){
264
+ add_action( 'woocommerce_email_after_order_table', array( $this->pricingRules, 'displayTotalSavingsThroughDiscountInOrder'), 10);
265
+ }
266
+ add_action( 'woo_discount_rules_get_total_savings_through_discount_in_cart', array( $this->pricingRules, 'displayTotalSavingsThroughDiscountInCart'), 10);
267
+ add_action( 'woo_discount_rules_get_total_savings_through_discount_from_order', array( $this->pricingRules, 'displayTotalSavingsThroughDiscountInOrder'), 10);
268
+ }
269
+
270
+ /**
271
+ * Add additional css in emails
272
+ * */
273
+ public function add_additional_woocommerce_email_styles($css){
274
+ return $css.'.wdr_you_saved_con {
275
+ color: green;
276
+ }';
277
+ }
278
+
279
  /**
280
  * Load Admin scripts
281
  * */
303
  add_action('woocommerce_applied_coupon', array($this->pricingRules, 'handleBOGODiscountAfterApplyCoupon'), 10, 1);
304
  }
305
 
306
+ add_action( 'woocommerce_checkout_create_order_line_item', array( $this->pricingRules, 'onCreateWoocommerceOrderLineItem'), 10, 4);
307
+ $display_you_saved_text = $this->discountBase->getConfigData('display_you_saved_text', 'no');
308
+ if(in_array($display_you_saved_text, array('on_each_line_item', 'both_line_item_and_after_total'))){
309
+ add_filter( 'woocommerce_cart_item_subtotal', array( $this->pricingRules, 'addAdditionalContentInCartItemSubTotal'), 1000, 3);
310
+ }
311
+ if(in_array($display_you_saved_text, array('after_total', 'both_line_item_and_after_total'))){
312
+ add_action( 'woocommerce_cart_totals_after_order_total', array( $this->pricingRules, 'displayTotalSavingsThroughDiscountInCart'), 10);
313
+ add_action( 'woocommerce_review_order_after_order_total', array( $this->pricingRules, 'displayTotalSavingsThroughDiscountInCart'), 10);
314
+ add_action( 'woocommerce_order_details_after_order_table', array( $this->pricingRules, 'displayTotalSavingsThroughDiscountInOrder'), 10);
315
+ }
316
+
317
  // Manually Update Line Item Name.
318
  add_filter('woocommerce_cart_item_name', array($this->discountBase, 'modifyName'));
319
 
372
  * To include the styles
373
  * */
374
  public function includeScriptAndStyles(){
375
+ wp_register_style('woo_discount_rules_front_end', WOO_DISCOUNT_URI . '/assets/css/woo_discount_rules.css', array(), WOO_DISCOUNT_VERSION);
376
+ wp_enqueue_style('woo_discount_rules_front_end');
377
  // Enqueued script with localized data.
378
  wp_register_script( 'woo_discount_rules_site', WOO_DISCOUNT_URI . '/assets/js/woo_discount_rules.js', array('jquery'), WOO_DISCOUNT_VERSION, true );
379
  wp_localize_script('woo_discount_rules_site', 'woo_discount_rules', array(
445
  }
446
  }
447
 
448
+ add_filter('woocommerce_screen_ids', function($screen_ids){
449
+ $screen_ids[] = 'woocommerce_page_woo_discount_rules';
450
+ return $screen_ids;
451
+ });
452
+
453
  /**
454
  * init Woo Discount Rules
455
  */
464
  include_once('includes/advanced/advanced-helper.php');
465
  }
466
  }
 
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === WooCommerce Discount Rules ===
2
  Contributors: flycart
3
  Donate link: https://flycart.org/
4
  Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts, pricing deals
5
  Requires at least: 4.4.1
6
  Tested up to: 4.9
7
- Stable tag: 1.6.19
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -308,11 +308,27 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
308
 
309
  == Changelog ==
310
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  = 1.6.19 - 29/10/18 =
312
- * Fix: coupon doesn't works for few language
313
- * Fix: displaying promotion text even if the rule doesn't matches
314
- * Fix: Buy x and get y and z each 1 quantity
315
- * Improvement: Exclude the bundled products items from applying discount
316
 
317
  = 1.6.18 - 23/10/18 =
318
  * Fix - Adding additional quantity when BOGO rule applied
1
+ === Discount Rules For WooCommerce ===
2
  Contributors: flycart
3
  Donate link: https://flycart.org/
4
  Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts, pricing deals
5
  Requires at least: 4.4.1
6
  Tested up to: 4.9
7
+ Stable tag: 1.7.0
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
308
 
309
  == Changelog ==
310
 
311
+ = 1.7.0 - 28/11/18 =
312
+ * Fix - Attribute doesn't worked for imported products
313
+ * Fix - Wrong cart discount while having both the rules and cart rules have category based
314
+ * Fix - Split strikeout doesn't work for few cases
315
+ * Fix - BOGO multiple add(product quantity)
316
+ * Fix - Script issue woocommerce_admin is not defined
317
+ * Fix - Display applied matched rule(messages) only
318
+ * Improvement - Option to disable table header
319
+ * Improvement - Displaying table for attribute based rule even the product is excluded
320
+ * Improvement - Event apply_filters('woo_discount_rules_exclude_woocommerce_bundled_item', true, $cartItem);
321
+ * Improvement - Display status text in listing page
322
+ * Improvement - Load coupon from woocommerce for selecting instead of entering manually
323
+ * Improvement - Content improvements
324
+ * Feature - You saved text in cart and order page when rule applied
325
+ * Feature - Advance table format field in price rule
326
+
327
  = 1.6.19 - 29/10/18 =
328
+ * Fix - coupon doesn't works for few language
329
+ * Fix - displaying promotion text even if the rule doesn't matches
330
+ * Fix - Buy x and get y and z each 1 quantity
331
+ * Improvement - Exclude the bundled products items from applying discount
332
 
333
  = 1.6.18 - 23/10/18 =
334
  * Fix - Adding additional quantity when BOGO rule applied
view/cart-rules.php CHANGED
@@ -69,9 +69,7 @@ if ( $current_orderby === $orderby ) {
69
  <?php
70
  }
71
  }
72
-
73
  ?>
74
-
75
  </div>
76
  <div class="col-md-12">
77
  <div class="woo_discount_rules_bulk_action_con">
@@ -99,6 +97,7 @@ if ( $current_orderby === $orderby ) {
99
  <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
100
  <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
101
  <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
 
102
  <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
103
  <?php
104
  $column_display_name = esc_html__('Order', 'woo-discount-rules');
@@ -136,6 +135,24 @@ if ( $current_orderby === $orderby ) {
136
  <td><?php echo(isset($meta['rule_name'][0]) ? $meta['rule_name'][0] : '-') ?></td>
137
  <td><?php echo(isset($rule->date_from) ? $rule->date_from : '-') ?></td>
138
  <td><?php echo(isset($rule->date_to) ? $rule->date_to : '-') ?></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  <td><?php echo((isset($rule->rule_order) && ($rule->rule_order != '')) ? $rule->rule_order : ' - ') ?></td>
140
  <td>
141
  <a class="btn btn-primary" href="?page=woo_discount_rules&tab=cart-rules&view=<?php echo $rule->ID ?>">
@@ -169,6 +186,7 @@ if ( $current_orderby === $orderby ) {
169
  <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
170
  <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
171
  <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
 
172
  <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
173
  <?php
174
  $column_display_name = esc_html__('Order', 'woo-discount-rules');
69
  <?php
70
  }
71
  }
 
72
  ?>
 
73
  </div>
74
  <div class="col-md-12">
75
  <div class="woo_discount_rules_bulk_action_con">
97
  <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
98
  <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
99
  <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
100
+ <th><?php esc_html_e('Status', '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');
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>
138
+ <td class="status_in_text" id="status_in_text_<?php echo $rule->ID ?>"><?php
139
+ if(!isset($rule->status)) $rule->status = 'disable';
140
+ if($rule->status == 'publish'){
141
+ echo "<span class='wdr_status_active_text alert alert-success'>".esc_html__('Active', 'woo-discount-rules')."</span>";
142
+ } else {
143
+ echo "<span class='wdr_status_disabled_text alert alert-danger'>".esc_html__('Disabled', 'woo-discount-rules')."</span>";
144
+ }
145
+ if($rule->status == 'publish'){
146
+ $date_from = (isset($rule->date_from) ? $rule->date_from : false);
147
+ $date_to = (isset($rule->date_to) ? $rule->date_to : false);
148
+ $validateDate = FlycartWooDiscountRulesGeneralHelper::validateDateAndTime($date_from, $date_to);
149
+ if($validateDate){
150
+ echo " - <span class='wdr_status_active_text text-success'>(".esc_html__('Running', 'woo-discount-rules').")</span>";
151
+ } else {
152
+ echo " - <span class='wdr_status_active_text text-danger'>(".esc_html__('Not running', 'woo-discount-rules').")</span>";
153
+ }
154
+ }
155
+ ?></td>
156
  <td><?php echo((isset($rule->rule_order) && ($rule->rule_order != '')) ? $rule->rule_order : ' - ') ?></td>
157
  <td>
158
  <a class="btn btn-primary" href="?page=woo_discount_rules&tab=cart-rules&view=<?php echo $rule->ID ?>">
186
  <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
187
  <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
188
  <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
189
+ <th><?php esc_html_e('Status', 'woo-discount-rules'); ?></th>
190
  <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
191
  <?php
192
  $column_display_name = esc_html__('Order', 'woo-discount-rules');
view/documentation.php CHANGED
@@ -26,6 +26,12 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
26
  <div class="col-md-12">
27
  <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTMLForDocumentation('introduction/getting-started', 'getting_started', esc_html__('Getting started', 'woo-discount-rules'), esc_html__('Welcome onboard', 'woo-discount-rules')); ?>
28
  </div>
 
 
 
 
 
 
29
  <div class="col-md-12">
30
  <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTMLForDocumentation('introduction/price-discount-rules', 'price_rules', esc_html__('Price Discount Rules', 'woo-discount-rules'), esc_html__('Learn all about creating a price discount rules', 'woo-discount-rules')); ?>
31
  </div>
26
  <div class="col-md-12">
27
  <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTMLForDocumentation('introduction/getting-started', 'getting_started', esc_html__('Getting started', 'woo-discount-rules'), esc_html__('Welcome onboard', 'woo-discount-rules')); ?>
28
  </div>
29
+ <div class="col-md-12">
30
+ <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTMLForDocumentation('introduction/license-key-activation', 'license_key_activation', esc_html__('License Key activation', 'woo-discount-rules'), esc_html__('Learn how to obtain the license key and activate it', 'woo-discount-rules')); ?>
31
+ </div>
32
+ <div class="col-md-12">
33
+ <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTMLForDocumentation('introduction/version-updates', 'version_updates', esc_html__('Version Updates!', 'woo-discount-rules'), esc_html__('Learn how to update to latest versions', 'woo-discount-rules')); ?>
34
+ </div>
35
  <div class="col-md-12">
36
  <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTMLForDocumentation('introduction/price-discount-rules', 'price_rules', esc_html__('Price Discount Rules', 'woo-discount-rules'), esc_html__('Learn all about creating a price discount rules', 'woo-discount-rules')); ?>
37
  </div>
view/includes/menu.php CHANGED
@@ -14,7 +14,7 @@ $isPro = $purchase->isPro();
14
  <?php if($isPro){
15
  ?>
16
  <a class="nav-tab <?php if ($active == 'settings') { echo 'nav-tab-active'; } ?> btn-success" href="?page=woo_discount_rules&amp;tab=documentation">
17
- &nbsp;<?php esc_html_e('Documentation', 'woo-discount-rules'); ?> </a>
18
  <?php
19
  } ?>
20
  </h3>
14
  <?php if($isPro){
15
  ?>
16
  <a class="nav-tab <?php if ($active == 'settings') { echo 'nav-tab-active'; } ?> btn-success" href="?page=woo_discount_rules&amp;tab=documentation">
17
+ &nbsp;<?php esc_html_e('Read documentation', 'woo-discount-rules'); ?> </a>
18
  <?php
19
  } ?>
20
  </h3>
view/pricing-rules.php CHANGED
@@ -127,6 +127,7 @@ if ( $current_orderby === $orderby ) {
127
  <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
128
  <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
129
  <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
 
130
  <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
131
  <?php
132
  $column_display_name = esc_html__('Order', 'woo-discount-rules');
@@ -164,6 +165,24 @@ if ( $current_orderby === $orderby ) {
164
  <td><?php echo(isset($rule->rule_name) ? $rule->rule_name : '-') ?></td>
165
  <td><?php echo(isset($rule->date_from) ? $rule->date_from : '-') ?></td>
166
  <td><?php echo(isset($rule->date_to) ? $rule->date_to : '-') ?></td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  <td><?php echo((isset($rule->rule_order) && ($rule->rule_order != '')) ? $rule->rule_order : ' - ') ?></td>
168
  <td>
169
  <a class="btn btn-primary" href="?page=woo_discount_rules&view=<?php echo $rule->ID ?>">
@@ -197,6 +216,7 @@ if ( $current_orderby === $orderby ) {
197
  <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
198
  <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
199
  <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
 
200
  <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
201
  <?php
202
  $column_display_name = esc_html__('Order', 'woo-discount-rules');
127
  <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
128
  <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
129
  <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
130
+ <th><?php esc_html_e('Status', 'woo-discount-rules'); ?></th>
131
  <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
132
  <?php
133
  $column_display_name = esc_html__('Order', 'woo-discount-rules');
165
  <td><?php echo(isset($rule->rule_name) ? $rule->rule_name : '-') ?></td>
166
  <td><?php echo(isset($rule->date_from) ? $rule->date_from : '-') ?></td>
167
  <td><?php echo(isset($rule->date_to) ? $rule->date_to : '-') ?></td>
168
+ <td class="status_in_text" id="status_in_text_<?php echo $rule->ID ?>"><?php
169
+ if(!isset($rule->status)) $rule->status = 'disable';
170
+ if($rule->status == 'publish'){
171
+ echo "<span class='wdr_status_active_text alert alert-success'>".esc_html__('Active', 'woo-discount-rules')."</span>";
172
+ } else {
173
+ echo "<span class='wdr_status_disabled_text alert alert-danger'>".esc_html__('Disabled', 'woo-discount-rules')."</span>";
174
+ }
175
+ if($rule->status == 'publish'){
176
+ $date_from = (isset($rule->date_from) ? $rule->date_from : false);
177
+ $date_to = (isset($rule->date_to) ? $rule->date_to : false);
178
+ $validateDate = FlycartWooDiscountRulesGeneralHelper::validateDateAndTime($date_from, $date_to);
179
+ if($validateDate){
180
+ echo " - <span class='wdr_status_active_text text-success'>(".esc_html__('Running', 'woo-discount-rules').")</span>";
181
+ } else {
182
+ echo " - <span class='wdr_status_active_text text-danger'>(".esc_html__('Not running', 'woo-discount-rules').")</span>";
183
+ }
184
+ }
185
+ ?></td>
186
  <td><?php echo((isset($rule->rule_order) && ($rule->rule_order != '')) ? $rule->rule_order : ' - ') ?></td>
187
  <td>
188
  <a class="btn btn-primary" href="?page=woo_discount_rules&view=<?php echo $rule->ID ?>">
216
  <th><?php esc_html_e('Name', 'woo-discount-rules'); ?></th>
217
  <th><?php esc_html_e('Start Date', 'woo-discount-rules'); ?></th>
218
  <th><?php esc_html_e('Expired On', 'woo-discount-rules'); ?></th>
219
+ <th><?php esc_html_e('Status', 'woo-discount-rules'); ?></th>
220
  <th class="manage-column column-title column-primary sorted <?php echo $current_order; ?>" scope="col">
221
  <?php
222
  $column_display_name = esc_html__('Order', 'woo-discount-rules');
view/settings.php CHANGED
@@ -70,18 +70,28 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
70
  <div id="woo-disc-license-check-msg">
71
 
72
  </div>
 
 
 
 
 
73
  </div>
74
  </div>
75
  <div class="row form-group">
76
  <div class="col-md-2">
77
  <label>
78
- <?php esc_html_e('Enable Bootstrap', 'woo-discount-rules'); ?>
79
  </label>
80
  </div>
81
  <?php $data['enable_bootstrap'] = (isset($data['enable_bootstrap']) ? $data['enable_bootstrap'] : 1); ?>
82
  <div class="col-md-6">
83
  <label><input type="radio" name="enable_bootstrap" value="1" <?php echo ($data['enable_bootstrap'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
84
  <label><input type="radio" name="enable_bootstrap" value="0" <?php echo ($data['enable_bootstrap'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
 
 
 
 
 
85
  </div>
86
  </div>
87
  <div class="row form-group">
@@ -99,7 +109,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
99
  <div class="row form-group">
100
  <div class="col-md-2">
101
  <label>
102
- <?php esc_html_e('Disable the rules while have coupon(Third party) in cart', 'woo-discount-rules'); ?>
103
  </label>
104
  </div>
105
  <?php $data['do_not_run_while_have_third_party_coupon'] = (isset($data['do_not_run_while_have_third_party_coupon']) ? $data['do_not_run_while_have_third_party_coupon'] : 0); ?>
@@ -115,7 +125,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
115
  <?php esc_html_e('Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a coupon used with discount rule conditions', 'woo-discount-rules'); ?>
116
  </label>
117
  </div>
118
- <?php $data['remove_zero_coupon_price'] = (isset($data['remove_zero_coupon_price']) ? $data['remove_zero_coupon_price'] : 0); ?>
119
  <div class="col-md-6">
120
  <label><input type="radio" name="remove_zero_coupon_price" value="1" <?php echo ($data['remove_zero_coupon_price'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
121
  <label><input type="radio" name="remove_zero_coupon_price" value="0" <?php echo ($data['remove_zero_coupon_price'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
@@ -167,7 +177,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
167
  </div>
168
  </div>
169
  <div class="row form-group">
170
- <?php $data['show_price_discount_on_product_page'] = (isset($data['show_price_discount_on_product_page']) ? $data['show_price_discount_on_product_page'] : 'dont'); ?>
171
  <div class="col-md-2">
172
  <label>
173
  <?php esc_html_e('Show Price discount on product page :', 'woo-discount-rules'); ?>
@@ -186,10 +196,10 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
186
  </div>
187
  </div>
188
  <div class="row form-group">
189
- <?php $data['show_sale_tag_on_product_page'] = (isset($data['show_sale_tag_on_product_page']) ? $data['show_sale_tag_on_product_page'] : 'dont'); ?>
190
  <div class="col-md-2">
191
  <label>
192
- <?php esc_html_e('Show Sale tag on product page :', 'woo-discount-rules'); ?>
193
  </label>
194
  </div>
195
  <div class="col-md-6">
@@ -213,16 +223,19 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
213
  </div>
214
  <div class="col-md-6">
215
  <select class="selectpicker" name="show_discount_table" id="show_discount_table">
 
 
 
216
  <option <?php if ($data['show_discount_table'] == 'show') { ?> selected=selected <?php } ?>
217
- value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
218
  </option>
219
- <option <?php if ($data['show_discount_table'] == 'dont') { ?> selected=selected <?php } ?>
220
- value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
221
  </option>
222
  </select>
223
  </div>
224
  </div>
225
- <div class="row form-group discount_table_options">
226
  <?php $data['discount_table_placement'] = (isset($data['discount_table_placement']) ? $data['discount_table_placement'] : 'before_cart_form'); ?>
227
  <div class="col-md-2">
228
  <label>
@@ -240,11 +253,29 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
240
  </select>
241
  </div>
242
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
243
  <div class="row form-group discount_table_options">
244
  <?php $data['show_discount_title_table'] = (isset($data['show_discount_title_table']) ? $data['show_discount_title_table'] : 'show'); ?>
245
  <div class="col-md-2">
246
  <label>
247
- <?php esc_html_e('Show column title on table :', 'woo-discount-rules'); ?>
248
  </label>
249
  </div>
250
  <div class="col-md-6">
@@ -262,7 +293,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
262
  <?php $data['show_column_range_table'] = (isset($data['show_column_range_table']) ? $data['show_column_range_table'] : 'show'); ?>
263
  <div class="col-md-2">
264
  <label>
265
- <?php esc_html_e('Show column discount range on table :', 'woo-discount-rules'); ?>
266
  </label>
267
  </div>
268
  <div class="col-md-6">
@@ -280,7 +311,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
280
  <?php $data['show_column_discount_table'] = (isset($data['show_column_discount_table']) ? $data['show_column_discount_table'] : 'show'); ?>
281
  <div class="col-md-2">
282
  <label>
283
- <?php esc_html_e('Show column discount on table :', 'woo-discount-rules'); ?>
284
  </label>
285
  </div>
286
  <div class="col-md-6">
@@ -297,7 +328,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
297
  <div class="row form-group">
298
  <div class="col-md-2">
299
  <label>
300
- <?php esc_html_e('Show strikeout discount in cart item', 'woo-discount-rules'); ?>
301
  </label>
302
  </div>
303
  <?php $data['show_strikeout_in_cart'] = (isset($data['show_strikeout_in_cart']) ? $data['show_strikeout_in_cart'] : 1); ?>
@@ -318,6 +349,46 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
318
  <label><input type="radio" name="add_free_product_on_coupon_applied" value="0" <?php echo ($data['add_free_product_on_coupon_applied'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
319
  </div>
320
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
321
  </div>
322
  </div>
323
  <div id="wdr_s_cart_rules" class="tab-pane fade">
@@ -489,7 +560,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
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"); ?>
@@ -507,7 +578,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
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."); ?>
@@ -515,8 +586,8 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
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>
@@ -524,7 +595,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
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"); ?>
@@ -542,7 +613,7 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
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."); ?>
@@ -550,8 +621,8 @@ $isPro = $flycartWooDiscountRulesPurchase->isPro();
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>
70
  <div id="woo-disc-license-check-msg">
71
 
72
  </div>
73
+ <div class="wdr_desc_text_con">
74
+ <span class="wdr_desc_text">
75
+ <?php esc_html_e('Tip: Install pro package before validating the licence', 'woo-discount-rules'); ?>
76
+ </span>
77
+ </div>
78
  </div>
79
  </div>
80
  <div class="row form-group">
81
  <div class="col-md-2">
82
  <label>
83
+ <?php esc_html_e('Enable Bootstrap (applies only for the rule engine in the backend.)', 'woo-discount-rules'); ?>
84
  </label>
85
  </div>
86
  <?php $data['enable_bootstrap'] = (isset($data['enable_bootstrap']) ? $data['enable_bootstrap'] : 1); ?>
87
  <div class="col-md-6">
88
  <label><input type="radio" name="enable_bootstrap" value="1" <?php echo ($data['enable_bootstrap'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
89
  <label><input type="radio" name="enable_bootstrap" value="0" <?php echo ($data['enable_bootstrap'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
90
+ <div class="wdr_desc_text_con">
91
+ <span class="wdr_desc_text">
92
+ <?php esc_html_e('Disabling this setting may affect dropdowns in rule engine (Disabling this setting is not recommended). Change this only if you know what you are doing.', 'woo-discount-rules'); ?>
93
+ </span>
94
+ </div>
95
  </div>
96
  </div>
97
  <div class="row form-group">
109
  <div class="row form-group">
110
  <div class="col-md-2">
111
  <label>
112
+ <?php esc_html_e('Disable the rules while having a coupon (Third party) in cart', 'woo-discount-rules'); ?>
113
  </label>
114
  </div>
115
  <?php $data['do_not_run_while_have_third_party_coupon'] = (isset($data['do_not_run_while_have_third_party_coupon']) ? $data['do_not_run_while_have_third_party_coupon'] : 0); ?>
125
  <?php esc_html_e('Hide $0.00 (zero value) of coupon codes in the totals column. Useful when a coupon used with discount rule conditions', 'woo-discount-rules'); ?>
126
  </label>
127
  </div>
128
+ <?php $data['remove_zero_coupon_price'] = (isset($data['remove_zero_coupon_price']) ? $data['remove_zero_coupon_price'] : 1); ?>
129
  <div class="col-md-6">
130
  <label><input type="radio" name="remove_zero_coupon_price" value="1" <?php echo ($data['remove_zero_coupon_price'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
131
  <label><input type="radio" name="remove_zero_coupon_price" value="0" <?php echo ($data['remove_zero_coupon_price'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
177
  </div>
178
  </div>
179
  <div class="row form-group">
180
+ <?php $data['show_price_discount_on_product_page'] = (isset($data['show_price_discount_on_product_page']) ? $data['show_price_discount_on_product_page'] : 'show'); ?>
181
  <div class="col-md-2">
182
  <label>
183
  <?php esc_html_e('Show Price discount on product page :', 'woo-discount-rules'); ?>
196
  </div>
197
  </div>
198
  <div class="row form-group">
199
+ <?php $data['show_sale_tag_on_product_page'] = (isset($data['show_sale_tag_on_product_page']) ? $data['show_sale_tag_on_product_page'] : 'show'); ?>
200
  <div class="col-md-2">
201
  <label>
202
+ <?php esc_html_e('Show Sale badge on product page :', 'woo-discount-rules'); ?>
203
  </label>
204
  </div>
205
  <div class="col-md-6">
223
  </div>
224
  <div class="col-md-6">
225
  <select class="selectpicker" name="show_discount_table" id="show_discount_table">
226
+ <option <?php if ($data['show_discount_table'] == 'dont') { ?> selected=selected <?php } ?>
227
+ value="dont"><?php esc_html_e("Disabled", 'woo-discount-rules'); ?>
228
+ </option>
229
  <option <?php if ($data['show_discount_table'] == 'show') { ?> selected=selected <?php } ?>
230
+ value="show"><?php esc_html_e('Default layout', 'woo-discount-rules'); ?>
231
  </option>
232
+ <option <?php if ($data['show_discount_table'] == 'advance') { ?> selected=selected <?php } ?>
233
+ value="advance"><?php esc_html_e('Advance layout', 'woo-discount-rules'); ?>
234
  </option>
235
  </select>
236
  </div>
237
  </div>
238
+ <div class="row form-group discount_table_options discount_table_option_advance">
239
  <?php $data['discount_table_placement'] = (isset($data['discount_table_placement']) ? $data['discount_table_placement'] : 'before_cart_form'); ?>
240
  <div class="col-md-2">
241
  <label>
253
  </select>
254
  </div>
255
  </div>
256
+ <div class="row form-group discount_table_options">
257
+ <?php $data['show_discount_table_header'] = (isset($data['show_discount_table_header']) ? $data['show_discount_table_header'] : 'show'); ?>
258
+ <div class="col-md-2">
259
+ <label>
260
+ <?php esc_html_e('Table header :', 'woo-discount-rules'); ?>
261
+ </label>
262
+ </div>
263
+ <div class="col-md-6">
264
+ <select class="selectpicker" name="show_discount_table_header">
265
+ <option <?php if ($data['show_discount_table_header'] == 'show') { ?> selected=selected <?php } ?>
266
+ value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
267
+ </option>
268
+ <option <?php if ($data['show_discount_table_header'] == 'dont') { ?> selected=selected <?php } ?>
269
+ value="dont"><?php esc_html_e("Don't Show", 'woo-discount-rules'); ?>
270
+ </option>
271
+ </select>
272
+ </div>
273
+ </div>
274
  <div class="row form-group discount_table_options">
275
  <?php $data['show_discount_title_table'] = (isset($data['show_discount_title_table']) ? $data['show_discount_title_table'] : 'show'); ?>
276
  <div class="col-md-2">
277
  <label>
278
+ <?php esc_html_e('Title column on table :', 'woo-discount-rules'); ?>
279
  </label>
280
  </div>
281
  <div class="col-md-6">
293
  <?php $data['show_column_range_table'] = (isset($data['show_column_range_table']) ? $data['show_column_range_table'] : 'show'); ?>
294
  <div class="col-md-2">
295
  <label>
296
+ <?php esc_html_e('Range column on table :', 'woo-discount-rules'); ?>
297
  </label>
298
  </div>
299
  <div class="col-md-6">
311
  <?php $data['show_column_discount_table'] = (isset($data['show_column_discount_table']) ? $data['show_column_discount_table'] : 'show'); ?>
312
  <div class="col-md-2">
313
  <label>
314
+ <?php esc_html_e('Discount column on table :', 'woo-discount-rules'); ?>
315
  </label>
316
  </div>
317
  <div class="col-md-6">
328
  <div class="row form-group">
329
  <div class="col-md-2">
330
  <label>
331
+ <?php esc_html_e('Strikeout discount in cart item', 'woo-discount-rules'); ?>
332
  </label>
333
  </div>
334
  <?php $data['show_strikeout_in_cart'] = (isset($data['show_strikeout_in_cart']) ? $data['show_strikeout_in_cart'] : 1); ?>
349
  <label><input type="radio" name="add_free_product_on_coupon_applied" value="0" <?php echo ($data['add_free_product_on_coupon_applied'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
350
  </div>
351
  </div>
352
+ <div class="row form-group">
353
+ <?php $data['display_you_saved_text'] = (isset($data['display_you_saved_text']) ? $data['display_you_saved_text'] : 'no'); ?>
354
+ <div class="col-md-2">
355
+ <label>
356
+ <?php esc_html_e('Display savings text', 'woo-discount-rules'); ?>
357
+ </label>
358
+ </div>
359
+ <div class="col-md-6">
360
+ <select class="selectpicker" id="display_you_saved_text" name="display_you_saved_text">
361
+ <option <?php if ($data['display_you_saved_text'] == 'no') { ?> selected=selected <?php } ?>
362
+ value="no"><?php esc_html_e('Disabled', 'woo-discount-rules'); ?>
363
+ </option>
364
+ <option <?php if ($data['display_you_saved_text'] == 'on_each_line_item') { ?> selected=selected <?php } ?>
365
+ value="on_each_line_item"><?php esc_html_e('On each line item', 'woo-discount-rules'); ?>
366
+ </option>
367
+ <option <?php if ($data['display_you_saved_text'] == 'after_total') { ?> selected=selected <?php } ?>
368
+ value="after_total"><?php esc_html_e('On after total', 'woo-discount-rules'); ?>
369
+ </option>
370
+ <option <?php if ($data['display_you_saved_text'] == 'both_line_item_and_after_total') { ?> selected=selected <?php } ?>
371
+ value="both_line_item_and_after_total"><?php esc_html_e('Both in line item and after total', 'woo-discount-rules'); ?>
372
+ </option>
373
+ </select>
374
+ </div>
375
+ </div>
376
+ <div class="row form-group display_you_saved_text_options">
377
+ <div class="col-md-2">
378
+ <label>
379
+ <?php esc_html_e('Savings text to show', 'woo-discount-rules'); ?>
380
+ </label>
381
+ </div>
382
+ <?php $data['display_you_saved_text_value'] = (isset($data['display_you_saved_text_value']) ? $data['display_you_saved_text_value'] : " You saved: {{total_discount_price}}"); ?>
383
+ <div class="col-md-6">
384
+ <textarea name="display_you_saved_text_value" class="display_you_saved_text_value" value="<?php echo esc_attr($data['display_you_saved_text_value']); ?>"><?php echo $data['display_you_saved_text_value']; ?></textarea>
385
+ <div class="wdr_desc_text_con">
386
+ <span class="wdr_desc_text">
387
+ <?php esc_html_e('{{total_discount_price}} -> Total discount applied', 'woo-discount-rules'); ?>
388
+ </span>
389
+ </div>
390
+ </div>
391
+ </div>
392
  </div>
393
  </div>
394
  <div id="wdr_s_cart_rules" class="tab-pane fade">
560
  <div class="row form-group">
561
  <div class="col-md-2">
562
  <label>
563
+ <?php esc_html_e('Show a message on applying price rules in cart', 'woo-discount-rules'); ?>
564
  </label>
565
  </div>
566
  <?php $data['message_on_apply_price_discount'] = (isset($data['message_on_apply_price_discount']) ? $data['message_on_apply_price_discount'] : "no"); ?>
578
  <div class="row form-group message_on_apply_price_discount_options">
579
  <div class="col-md-2">
580
  <label>
581
+ <?php esc_html_e('Message', 'woo-discount-rules'); ?>
582
  </label>
583
  </div>
584
  <?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."); ?>
586
  <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>
587
  <div class="wdr_desc_text_con">
588
  <span class="wdr_desc_text">
589
+ <?php esc_html_e('{{title}} -> Rule title', 'woo-discount-rules'); ?><br>
590
+ <?php esc_html_e('{{description}} -> Rule description', 'woo-discount-rules'); ?>
591
  </span>
592
  </div>
593
  </div>
595
  <div class="row form-group">
596
  <div class="col-md-2">
597
  <label>
598
+ <?php esc_html_e('Show a message on applying cart rules in cart', 'woo-discount-rules'); ?>
599
  </label>
600
  </div>
601
  <?php $data['message_on_apply_cart_discount'] = (isset($data['message_on_apply_cart_discount']) ? $data['message_on_apply_cart_discount'] : "no"); ?>
613
  <div class="row form-group message_on_apply_cart_discount_options">
614
  <div class="col-md-2">
615
  <label>
616
+ <?php esc_html_e('Message', 'woo-discount-rules'); ?>
617
  </label>
618
  </div>
619
  <?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."); ?>
621
  <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>
622
  <div class="wdr_desc_text_con">
623
  <span class="wdr_desc_text">
624
+ <?php esc_html_e('{{title}} -> Rule title', 'woo-discount-rules'); ?><br>
625
+ <?php esc_html_e('{{description}} -> Rule description', 'woo-discount-rules'); ?>
626
  </span>
627
  </div>
628
  </div>
view/template/discount-table-advance.php ADDED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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-advance.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());
11
+ $discount_rules = $table_data;
12
+ $discount_rules_displayed = array();
13
+ $product_price = $product->get_price();
14
+ $searchForReplace = array('{{title}}', '{{description}}', '{{min_quantity}}', '{{max_quantity}}', '{{discount}}', '{{discounted_price}}', '{{condition}}');
15
+ $i = 1;
16
+ ?>
17
+ <div class="wdr_table_content_advance_con">
18
+ <?php foreach ($discount_rules as $index => $item) {
19
+ if ($item) {
20
+ foreach ($item as $id => $value) {
21
+ if (!empty($value->advance_table_format)) {
22
+ $html_content = $value->advance_table_format;
23
+ $discounted_price_text = '';
24
+ $min_qty = empty($value->min_qty) ? '' : $value->min_qty;
25
+ $max_qty = empty($value->max_qty) ? '' : $value->max_qty;
26
+ $condition = $table_data_content[$index . $id]['condition'];
27
+ $discount_text = $table_data_content[$index . $id]['discount'];
28
+ $discounted_title_text = $table_data_content[$index . $id]['title'];
29
+ $discounted_description_text = $value->description;
30
+ if($value->discount_type == 'product_discount'){
31
+ if($value->discount_product_discount_type == 'limited_percent'){
32
+ if ($value->discount_product_percent > 0) {
33
+ $discount = ($product_price / 100) * $value->discount_product_percent;
34
+ $discounted_price = $product_price - $discount;
35
+ $discounted_price_text = wc_price($discounted_price);
36
+ }
37
+ } else {
38
+ $discounted_price_text = wc_price($product_price);
39
+ }
40
+ } else {
41
+ if ($value->discount_type == "percentage_discount") {
42
+ if ($value->to_discount > 0) {
43
+ $discount = ($product_price / 100) * $value->to_discount;
44
+ $discounted_price = $product_price - $discount;
45
+ $discounted_price_text = wc_price($discounted_price);
46
+ }
47
+ } else {
48
+ if ($value->to_discount > 0) {
49
+ $discounted_price = $product_price - $value->to_discount;
50
+ $discounted_price_text = wc_price($discounted_price);
51
+ }
52
+ }
53
+ }
54
+ $string_to_replace = array($discounted_title_text, $discounted_description_text, $min_qty, $max_qty, $discount_text, $discounted_price_text, $condition);
55
+ $html_content = str_replace($searchForReplace, $string_to_replace, $html_content);
56
+ if(!in_array($html_content, $discount_rules_displayed)){
57
+ $discount_rules_displayed[] = $html_content;
58
+ $i++;
59
+ $row = $i%2;
60
+ ?>
61
+ <div class="wdr_table_content_advance_item wdr_row<?php echo $row;?>">
62
+ <?php echo $html_content; ?>
63
+ </div>
64
+ <?php
65
+ }
66
+ }
67
+ }
68
+ }
69
+ }
70
+ ?>
71
+ </div>
view/template/discount-table.php CHANGED
@@ -8,24 +8,27 @@
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());
 
11
  $show_discount_title_table = isset($base_config['show_discount_title_table'])? $base_config['show_discount_title_table']: 'show';
12
  $show_column_range_table = isset($base_config['show_column_range_table'])? $base_config['show_column_range_table']: 'show';
13
  $show_column_discount_table = isset($base_config['show_column_discount_table'])? $base_config['show_column_discount_table']: 'show';
14
  ?>
15
  <table class="woo_discount_rules_table">
16
- <thead>
17
- <tr class="wdr_tr_head">
18
- <?php if ($show_discount_title_table == 'show') { ?>
19
- <td class="wdr_td_head_title"><?php esc_html_e('Name', 'woo-discount-rules'); ?></td>
20
- <?php } ?>
21
- <?php if ($show_column_range_table == 'show') { ?>
22
- <td class="wdr_td_head_range"><?php esc_html_e('Range', 'woo-discount-rules'); ?></td>
23
- <?php } ?>
24
- <?php if ($show_column_discount_table == 'show') { ?>
25
- <td class="wdr_td_head_discount"><?php esc_html_e('Discount', 'woo-discount-rules'); ?></td>
26
- <?php } ?>
27
- </tr>
28
- </thead>
 
 
29
  <tbody>
30
  <?php
31
  $have_discount = false;
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());
11
+ $show_discount_table_header = isset($base_config['show_discount_table_header'])? $base_config['show_discount_table_header']: 'show';
12
  $show_discount_title_table = isset($base_config['show_discount_title_table'])? $base_config['show_discount_title_table']: 'show';
13
  $show_column_range_table = isset($base_config['show_column_range_table'])? $base_config['show_column_range_table']: 'show';
14
  $show_column_discount_table = isset($base_config['show_column_discount_table'])? $base_config['show_column_discount_table']: 'show';
15
  ?>
16
  <table class="woo_discount_rules_table">
17
+ <?php if($show_discount_table_header == 'show'){ ?>
18
+ <thead>
19
+ <tr class="wdr_tr_head">
20
+ <?php if ($show_discount_title_table == 'show') { ?>
21
+ <td class="wdr_td_head_title"><?php esc_html_e('Name', 'woo-discount-rules'); ?></td>
22
+ <?php } ?>
23
+ <?php if ($show_column_range_table == 'show') { ?>
24
+ <td class="wdr_td_head_range"><?php esc_html_e('Range', 'woo-discount-rules'); ?></td>
25
+ <?php } ?>
26
+ <?php if ($show_column_discount_table == 'show') { ?>
27
+ <td class="wdr_td_head_discount"><?php esc_html_e('Discount', 'woo-discount-rules'); ?></td>
28
+ <?php } ?>
29
+ </tr>
30
+ </thead>
31
+ <?php } ?>
32
  <tbody>
33
  <?php
34
  $have_discount = false;
view/template/total-savings-cart.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/total-savings-cart.php
6
+ *
7
+ * @param int/float $total_discount
8
+ * @param string $total_discounted_price
9
+ * @param string $subtotal_additional_text
10
+ */
11
+
12
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
13
+ ?>
14
+ <tr class="wdr_cart_discount-total">
15
+ <th></th>
16
+ <td ><?php echo $subtotal_additional_text; ?></td>
17
+ </tr>
view/template/total-savings-order.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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/total-savings-cart.php
6
+ *
7
+ * @param int/float $total_discount
8
+ * @param string $total_discounted_price
9
+ * @param string $subtotal_additional_text
10
+ * @param object $order
11
+ */
12
+
13
+ if (!defined('ABSPATH')) exit; // Exit if accessed directly
14
+ ?>
15
+ <style>
16
+ .wdr_order_discount-total{
17
+ color: green;
18
+ margin: 10px 0;
19
+ }
20
+ </style>
21
+ <div class="wdr_order_discount-total">
22
+ <?php echo $subtotal_additional_text; ?>
23
+ </div>
view/view-cart-rules.php CHANGED
@@ -65,24 +65,23 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
65
  <hr>
66
  <div class="form-group">
67
  <div class="row">
68
- <div class="col-md-3"><label><?php esc_html_e('Order :', 'woo-discount-rules') ?> <i
69
- class="text-muted glyphicon glyphicon-exclamation-sign"
70
- title="<?php esc_attr_e('The Simple Ranking concept to said, which one is going to execute first and so on.', 'woo-discount-rules'); ?>"></i></label>
71
  </div>
72
  <div class="col-md-6"><input type="number" class="rule_order"
73
  id="rule_order"
74
  name="rule_order"
75
- value="<?php echo(isset($data->rule_order) ? $data->rule_order : ''); ?>"
76
  placeholder="<?php esc_attr_e('ex. 1', 'woo-discount-rules'); ?>">
77
- <code><?php esc_html_e('WARNING: More than one rule should not have same priority.', 'woo-discount-rules'); ?> </code>
78
  </div>
79
  </div>
80
  </div>
81
  <div class="form-group">
82
  <div class="row">
83
  <div class="col-md-3"><label> <?php esc_html_e('Rule Name', 'woo-discount-rules'); ?> <i
84
- class="text-muted glyphicon glyphicon-exclamation-sign"
85
- title="<?php esc_attr_e('Rule Descriptions.', 'woo-discount-rules'); ?>"></i></label></div>
86
  <div class="col-md-6"><input type="text" class="form-control rule_descr"
87
  id="rule_name"
88
  name="rule_name"
@@ -93,8 +92,8 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
93
  <div class="form-group">
94
  <div class="row">
95
  <div class="col-md-3"><label> <?php esc_html_e('Rule Description', 'woo-discount-rules'); ?> <i
96
- class="text-muted glyphicon glyphicon-exclamation-sign"
97
- title="<?php esc_attr_e('Rule Descriptions.', 'woo-discount-rules'); ?>"></i></label></div>
98
  <div class="col-md-6"><input type="text" class="form-control rule_descr"
99
  name="rule_descr"
100
  value="<?php echo(isset($data->rule_descr) ? $data->rule_descr : ''); ?>"
@@ -114,15 +113,29 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
114
  ?>
115
  <div class="form-inline">
116
  <input type="text"
117
- name="date_from"
118
- class="form-control datepicker"
119
- value="<?php echo $date_from; ?>"
120
- placeholder="<?php esc_attr_e('From', 'woo-discount-rules'); ?>">
121
  <input type="text" name="date_to"
122
- class="form-control datepicker"
123
  value="<?php echo $date_to; ?>"
124
  placeholder="<?php esc_attr_e('To', 'woo-discount-rules'); ?>"></div>
125
  <span class="wdr_current_date_and_time_string"><?php echo sprintf(esc_html__('Current date and time: %s', 'woo-discount-rules'), date('m/d/Y h:i', strtotime($current_date_and_time))); ?></span>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  </div>
127
  </div>
128
  </div>
@@ -133,7 +146,7 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
133
 
134
  <div class="col-md-12 wdr_hide" id="restriction_block"><h4 class="text text-muted"> <?php esc_html_e('Cart Conditions', 'woo-discount-rules'); ?> </h4>
135
  <a href=javascript:void(0) id="add_cart_rule" class="button button-primary"><i
136
- class="glyphicon glyphicon-plus"></i>
137
  <?php esc_html_e('Add Condition', 'woo-discount-rules'); ?></a>
138
  <hr>
139
  <div class="form-group">
@@ -160,21 +173,21 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
160
  name="discount_rule[<?php echo $i; ?>][type]">
161
  <optgroup label="<?php esc_attr_e('Cart Subtotal', 'woo-discount-rules'); ?>">
162
  <option
163
- value="subtotal_least"<?php if ($type == 'subtotal_least') { ?> selected=selected <?php } ?>>
164
  <?php esc_html_e('Subtotal at least', 'woo-discount-rules'); ?>
165
  </option>
166
  <option
167
- value="subtotal_less"<?php if ($type == 'subtotal_less') { ?> selected=selected <?php } ?>>
168
  <?php esc_html_e('Subtotal less than', 'woo-discount-rules'); ?>
169
  </option>
170
  </optgroup>
171
  <optgroup label="<?php esc_attr_e('Cart Item Count', 'woo-discount-rules'); ?>">
172
  <option
173
- value="item_count_least"<?php if ($type == 'item_count_least') { ?> selected=selected <?php } ?>>
174
  <?php esc_html_e('Number of line items in the cart (not quantity) at least', 'woo-discount-rules'); ?>
175
  </option>
176
  <option
177
- value="item_count_less"<?php if ($type == 'item_count_less') { ?> selected=selected <?php } ?>>
178
  <?php esc_html_e('Number of line items in the cart (not quantity) less than', 'woo-discount-rules'); ?>
179
  </option>
180
  </optgroup>
@@ -377,6 +390,8 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
377
  </optgroup>
378
  </select>
379
  </label>
 
 
380
  </div>
381
  <div class="col-md-3 form-group">
382
  <label> <?php esc_html_e('Value', 'woo-discount-rules'); ?>
@@ -412,7 +427,33 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
412
  name="discount_rule[<?php echo $i; ?>][category_to_apply][]">
413
  <?php foreach ($category as $index => $cat) { ?>
414
  <option
415
- value="<?php echo $index; ?>"<?php if (in_array($index, $category_list)) { ?> selected=selected <?php } ?>><?php echo $cat; ?></option>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
416
  <?php } ?>
417
  </select>
418
  </div>
@@ -431,7 +472,7 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
431
  name="discount_rule[<?php echo $i; ?>][user_roles_to_apply][]">
432
  <?php foreach ($userRoles as $index => $user) { ?>
433
  <option
434
- value="<?php echo $index; ?>"<?php if (in_array($index, $roles_list)) { ?> selected=selected <?php } ?>><?php echo $user; ?></option>
435
  <?php } ?>
436
  </select>
437
  </div>
@@ -452,7 +493,7 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
452
  name="discount_rule[<?php echo $i; ?>][countries_to_apply][]">
453
  <?php foreach ($countries as $index => $country) { ?>
454
  <option
455
- value="<?php echo $index; ?>"<?php if (in_array($index, $countries_list)) { ?> selected=selected <?php } ?>><?php echo $country; ?></option>
456
  <?php } ?>
457
  </select>
458
  </div>
@@ -545,6 +586,7 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
545
  <input type="button" class="btn btn-warning general_tab" value="<?php esc_attr_e('Previous', 'woo-discount-rules'); ?>">
546
  <input type="button" class="btn btn-success discount_tab" value="<?php esc_attr_e('Next', 'woo-discount-rules'); ?>">
547
  </div>
 
548
  </div>
549
 
550
  <!-- TODO: Implement ForEach Concept -->
@@ -567,7 +609,7 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
567
  <label> <?php esc_html_e('Discount Type :', 'woo-discount-rules'); ?>
568
  <select class="form-control" id="cart_rule_discount_type" name="discount_type">
569
  <option
570
- value="percentage_discount" <?php if ($discount_type == 'percentage_discount') { ?> selected=selected <?php } ?>>
571
  <?php esc_html_e('Percentage Discount', 'woo-discount-rules'); ?>
572
  </option>
573
  <option
65
  <hr>
66
  <div class="form-group">
67
  <div class="row">
68
+ <div class="col-md-3"><label><?php esc_html_e('Priority :', 'woo-discount-rules') ?> <i
69
+ class="text-muted glyphicon glyphicon-exclamation-sign"
70
+ title="<?php esc_attr_e('The Simple Ranking concept to said, which one is going to execute first and so on.', 'woo-discount-rules'); ?>"></i></label>
71
  </div>
72
  <div class="col-md-6"><input type="number" class="rule_order"
73
  id="rule_order"
74
  name="rule_order"
75
+ value="<?php echo(isset($data->rule_order) ? $data->rule_order : 1); ?>"
76
  placeholder="<?php esc_attr_e('ex. 1', 'woo-discount-rules'); ?>">
 
77
  </div>
78
  </div>
79
  </div>
80
  <div class="form-group">
81
  <div class="row">
82
  <div class="col-md-3"><label> <?php esc_html_e('Rule Name', 'woo-discount-rules'); ?> <i
83
+ class="text-muted glyphicon glyphicon-exclamation-sign"
84
+ title="<?php esc_attr_e('Rule Descriptions.', 'woo-discount-rules'); ?>"></i></label></div>
85
  <div class="col-md-6"><input type="text" class="form-control rule_descr"
86
  id="rule_name"
87
  name="rule_name"
92
  <div class="form-group">
93
  <div class="row">
94
  <div class="col-md-3"><label> <?php esc_html_e('Rule Description', 'woo-discount-rules'); ?> <i
95
+ class="text-muted glyphicon glyphicon-exclamation-sign"
96
+ title="<?php esc_attr_e('Rule Descriptions.', 'woo-discount-rules'); ?>"></i></label></div>
97
  <div class="col-md-6"><input type="text" class="form-control rule_descr"
98
  name="rule_descr"
99
  value="<?php echo(isset($data->rule_descr) ? $data->rule_descr : ''); ?>"
113
  ?>
114
  <div class="form-inline">
115
  <input type="text"
116
+ name="date_from"
117
+ class="form-control wdr_datepicker"
118
+ value="<?php echo $date_from; ?>"
119
+ placeholder="<?php esc_attr_e('From', 'woo-discount-rules'); ?>">
120
  <input type="text" name="date_to"
121
+ class="form-control wdr_datepicker"
122
  value="<?php echo $date_to; ?>"
123
  placeholder="<?php esc_attr_e('To', 'woo-discount-rules'); ?>"></div>
124
  <span class="wdr_current_date_and_time_string"><?php echo sprintf(esc_html__('Current date and time: %s', 'woo-discount-rules'), date('m/d/Y h:i', strtotime($current_date_and_time))); ?></span>
125
+ <?php
126
+ $date_from = (isset($data->date_from) ? $data->date_from : false);
127
+ $date_to = (isset($data->date_to) ? $data->date_to : false);
128
+ $validateDateString = FlycartWooDiscountRulesGeneralHelper::validateDateAndTimeWarningText($date_from, $date_to);
129
+ if(!empty($validateDateString)){
130
+ ?>
131
+ <div class="notice inline notice notice-warning notice-alt">
132
+ <p>
133
+ <b><?php esc_html_e("This rule is not running currently: "); ?></b><?php echo $validateDateString; ?>
134
+ </p>
135
+ </div>
136
+ <?php
137
+ }
138
+ ?>
139
  </div>
140
  </div>
141
  </div>
146
 
147
  <div class="col-md-12 wdr_hide" id="restriction_block"><h4 class="text text-muted"> <?php esc_html_e('Cart Conditions', 'woo-discount-rules'); ?> </h4>
148
  <a href=javascript:void(0) id="add_cart_rule" class="button button-primary"><i
149
+ class="glyphicon glyphicon-plus"></i>
150
  <?php esc_html_e('Add Condition', 'woo-discount-rules'); ?></a>
151
  <hr>
152
  <div class="form-group">
173
  name="discount_rule[<?php echo $i; ?>][type]">
174
  <optgroup label="<?php esc_attr_e('Cart Subtotal', 'woo-discount-rules'); ?>">
175
  <option
176
+ value="subtotal_least"<?php if ($type == 'subtotal_least') { ?> selected=selected <?php } ?>>
177
  <?php esc_html_e('Subtotal at least', 'woo-discount-rules'); ?>
178
  </option>
179
  <option
180
+ value="subtotal_less"<?php if ($type == 'subtotal_less') { ?> selected=selected <?php } ?>>
181
  <?php esc_html_e('Subtotal less than', 'woo-discount-rules'); ?>
182
  </option>
183
  </optgroup>
184
  <optgroup label="<?php esc_attr_e('Cart Item Count', 'woo-discount-rules'); ?>">
185
  <option
186
+ value="item_count_least"<?php if ($type == 'item_count_least') { ?> selected=selected <?php } ?>>
187
  <?php esc_html_e('Number of line items in the cart (not quantity) at least', 'woo-discount-rules'); ?>
188
  </option>
189
  <option
190
+ value="item_count_less"<?php if ($type == 'item_count_less') { ?> selected=selected <?php } ?>>
191
  <?php esc_html_e('Number of line items in the cart (not quantity) less than', 'woo-discount-rules'); ?>
192
  </option>
193
  </optgroup>
390
  </optgroup>
391
  </select>
392
  </label>
393
+ <div class="wdr_cart_rule_doc_con">
394
+ </div>
395
  </div>
396
  <div class="col-md-3 form-group">
397
  <label> <?php esc_html_e('Value', 'woo-discount-rules'); ?>
427
  name="discount_rule[<?php echo $i; ?>][category_to_apply][]">
428
  <?php foreach ($category as $index => $cat) { ?>
429
  <option
430
+ value="<?php echo $index; ?>"<?php if (in_array($index, $category_list)) { ?> selected=selected <?php } ?>><?php echo $cat; ?></option>
431
+ <?php } ?>
432
+ </select>
433
+ </div>
434
+ <?php
435
+ $coupon_list = array();
436
+ $class = 'style="display:none"';
437
+ if (in_array($type, array('coupon_applied_any_one', 'coupon_applied_all_selected'))) {
438
+ $coupon_list = $discount_rules[$type];
439
+ if(!empty($coupon_list)){
440
+ if(is_string($coupon_list)) $coupon_list = explode(',', $coupon_list);
441
+ } else {
442
+ $coupon_list = array();
443
+ }
444
+ $class = 'style="display:block"';
445
+ $hit = true;
446
+ }
447
+ ?>
448
+ <div id="coupon_div_<?php echo $i; ?>" <?php echo $class; ?>>
449
+ <select class="coupon_list selectpicker"
450
+ id="cart_coupon_list_<?php echo $i; ?>"
451
+ multiple
452
+ title="<?php esc_html_e('None selected', 'woo-discount-rules'); ?>"
453
+ name="discount_rule[<?php echo $i; ?>][coupon_to_apply][]">
454
+ <?php foreach ($coupons as $coupon_code => $coupon_name) { ?>
455
+ <option
456
+ value="<?php echo $coupon_code; ?>"<?php if (in_array($coupon_code, $coupon_list)) { ?> selected=selected <?php } ?>><?php echo $coupon_name; ?></option>
457
  <?php } ?>
458
  </select>
459
  </div>
472
  name="discount_rule[<?php echo $i; ?>][user_roles_to_apply][]">
473
  <?php foreach ($userRoles as $index => $user) { ?>
474
  <option
475
+ value="<?php echo $index; ?>"<?php if (in_array($index, $roles_list)) { ?> selected=selected <?php } ?>><?php echo $user; ?></option>
476
  <?php } ?>
477
  </select>
478
  </div>
493
  name="discount_rule[<?php echo $i; ?>][countries_to_apply][]">
494
  <?php foreach ($countries as $index => $country) { ?>
495
  <option
496
+ value="<?php echo $index; ?>"<?php if (in_array($index, $countries_list)) { ?> selected=selected <?php } ?>><?php echo $country; ?></option>
497
  <?php } ?>
498
  </select>
499
  </div>
586
  <input type="button" class="btn btn-warning general_tab" value="<?php esc_attr_e('Previous', 'woo-discount-rules'); ?>">
587
  <input type="button" class="btn btn-success discount_tab" value="<?php esc_attr_e('Next', 'woo-discount-rules'); ?>">
588
  </div>
589
+ <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('introduction/cart-discount-rules', 'cart_rules', 'btn btn-info cart_rules_guide_btn', esc_html__('Guide to create cart rules', 'woo-discount-rules')); ?>
590
  </div>
591
 
592
  <!-- TODO: Implement ForEach Concept -->
609
  <label> <?php esc_html_e('Discount Type :', 'woo-discount-rules'); ?>
610
  <select class="form-control" id="cart_rule_discount_type" name="discount_type">
611
  <option
612
+ value="percentage_discount" <?php if ($discount_type == 'percentage_discount') { ?> selected=selected <?php } ?>>
613
  <?php esc_html_e('Percentage Discount', 'woo-discount-rules'); ?>
614
  </option>
615
  <option
view/view-pricing-rules.php CHANGED
@@ -47,9 +47,24 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
47
  <?php } ?>
48
  <div class="col-md-12" id="general_block"><h4 class="text text-muted"> <?php esc_html_e('General', 'woo-discount-rules'); ?></h4>
49
  <hr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  <div class="form-group">
51
  <div class="row">
52
- <div class="col-md-3"><label> <?php esc_html_e('Order :', 'woo-discount-rules'); ?> <i
53
  class="text-muted glyphicon glyphicon-exclamation-sign"
54
  title="<?php esc_html_e('The Simple Ranking concept to said, which one is going to execute first and so on.', 'woo-discount-rules'); ?>"></i></label>
55
  </div>
@@ -57,9 +72,8 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
57
  id="rule_order"
58
  name="rule_order"
59
  min=1
60
- value="<?php echo(isset($data->rule_order) ? $data->rule_order : '-'); ?>"
61
  placeholder="<?php esc_html_e('ex. 1', 'woo-discount-rules'); ?>">
62
- <code><?php esc_html_e('WARNING: More than one rule should not have same priority.', 'woo-discount-rules'); ?> </code>
63
  </div>
64
  </div>
65
  </div>
@@ -96,16 +110,16 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
96
  name="rule_method" id="price_rule_method">
97
  <option
98
  value="qty_based" <?php if ($opt == 'qty_based') { ?> selected=selected <?php } ?>>
99
- <?php esc_html_e('Quantity based by product/category and BOGO deals', 'woo-discount-rules'); ?>
100
  </option>
101
  <option
102
  <?php if (!$pro) { ?> disabled <?php } else { ?> value="product_based" <?php
103
  }
104
  if ($opt == 'product_based') { ?> selected=selected <?php } ?>>
105
  <?php if (!$pro) { ?>
106
- <?php esc_html_e('Dependant product based discount', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
107
  <?php } else { ?>
108
- <?php esc_html_e('Dependant product based discount', 'woo-discount-rules'); ?>
109
  <?php } ?>
110
  </option>
111
  </select></div>
@@ -125,16 +139,46 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
125
  <div class="form-inline">
126
  <input type="text"
127
  name="date_from"
128
- class="form-control datepicker"
129
  value="<?php echo $date_from; ?>"
130
  placeholder="<?php esc_attr_e('From', 'woo-discount-rules'); ?>">
131
  <input type="text" name="date_to"
132
- class="form-control datepicker"
133
  value="<?php echo $date_to; ?>"
134
  placeholder="<?php esc_attr_e('To - Leave Empty if No Expiry', 'woo-discount-rules'); ?>"></div>
135
  <span class="wdr_current_date_and_time_string"><?php echo sprintf(esc_html__('Current date and time: %s', 'woo-discount-rules'), date('m/d/Y h:i', strtotime($current_date_and_time))); ?></span>
136
  </div>
137
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  <div align="right">
139
  <input type="button" class="btn btn-success restriction_tab" value="<?php esc_attr_e('Next', 'woo-discount-rules'); ?>">
140
  </div>
@@ -184,7 +228,7 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
184
  </div>
185
  <?php $is_cumulative_for_products = (isset($data->is_cumulative_for_products))? $data->is_cumulative_for_products : 0 ?>
186
  <div class="form-group" id="cumulative_for_products_cont">
187
- <input type="checkbox" name="is_cumulative_for_products" id="is_cumulative_for_products" value="1" <?php if($is_cumulative_for_products) { echo "checked"; } ?>> <label class="checkbox_label" for="is_cumulative_for_products"><?php esc_html_e('Check this box to count quantities cumulatively across products', 'woo-discount-rules'); ?></label>
188
  </div>
189
  <div class="form-group" id="category_list">
190
  <?php $category_list = json_decode((isset($data->category_to_apply) ? $data->category_to_apply : '{}'), true); ?>
@@ -335,26 +379,38 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
335
  </select>
336
  <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('coupon-based-discounts/activate-discount-rule-using-a-coupon-code-in-woocommerce', 'coupon'); ?>
337
  <div class="coupons_to_apply_price_rule_con">
338
- <span class="woo-discount-hint">
339
  <?php
340
- esc_html_e('Enter the coupon code separated by comma(,)', 'woo-discount-rules');
 
 
 
 
 
 
 
 
 
 
 
341
  ?>
 
 
342
  <a target="_blank" href="https://docs.flycart.org/woocommerce-discount-rules/coupon-based-discounts/activate-discount-rule-using-a-coupon-code-in-woocommerce">
343
  <?php
344
  esc_html_e('Make sure you have created the coupon already', 'woo-discount-rules');
345
  ?>
346
  </a>
347
  </span>
348
- <input class="form-control coupons_to_apply" id="coupons_to_apply" name="coupons_to_apply" value="<?php echo $coupons_to_apply; ?>"/>
349
  <?php
350
  if($do_not_run_while_have_third_party_coupon){
351
  ?>
352
- <div class="notice notice-warning">
353
- <p>
354
- <?php esc_html_e('To get this condition work,', 'woo-discount-rules'); ?> <a target="_blank" href="?page=woo_discount_rules&tab=settings"><?php esc_html_e('please change the option', 'woo-discount-rules'); ?> <b><?php esc_html_e('Disable the rules while have coupon(Third party)', 'woo-discount-rules'); ?></b> <?php esc_html_e('in cart to', 'woo-discount-rules'); ?> <b><?php esc_html_e('No', 'woo-discount-rules'); ?></b></a>.
355
- </p>
356
- </div>
357
- <?php
358
  }
359
  ?>
360
  </div>
@@ -550,12 +606,12 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
550
  name="product_based_condition[category_to_apply][]">
551
  <?php foreach ($category as $index => $value) { ?>
552
  <option
553
- value="<?php echo $index; ?>"<?php if (in_array($index, $product_based_condition_category_to_apply)) { ?> selected=selected <?php } ?>><?php echo $value; ?></option>
554
  <?php } ?>
555
  </select>
556
  </div>
557
  </div>
558
- <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('', 'product_dependent#dependant-product-based-rules', 'btn btn-info', esc_html__('Document for product dependent rules', 'woo-discount-rules')); ?>
559
  </div>
560
  <div class="form-group">
561
  <div class="row">
@@ -594,14 +650,14 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
594
  <label><?php esc_html_e('Min Quantity', 'woo-discount-rules'); ?>
595
  <input type="text"
596
  name="discount_range[<?php echo $fieldIndex; ?>][min_qty]"
597
- class="form-control"
598
  value="<?php echo(isset($discount->min_qty) ? $discount->min_qty : ''); ?>"
599
  placeholder="<?php esc_html_e('ex. 1', 'woo-discount-rules'); ?>">
600
  </label>
601
  <label><?php esc_html_e('Max Quantity', 'woo-discount-rules'); ?>
602
  <input type="text"
603
  name="discount_range[<?php echo $fieldIndex; ?>][max_qty]"
604
- class="form-control"
605
  value="<?php echo(isset($discount->max_qty) ? $discount->max_qty : ''); ?>"
606
  placeholder="<?php esc_html_e('ex. 50', 'woo-discount-rules'); ?>"> </label>
607
  <label><?php esc_html_e('Adjustment Type', 'woo-discount-rules'); ?>
@@ -628,9 +684,9 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
628
  }
629
  if ($opt == 'product_discount') { ?> selected=selected <?php } ?>>
630
  <?php if (!$pro) { ?>
631
- <?php esc_html_e('Product Discount', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
632
  <?php } else { ?>
633
- <?php esc_html_e('Product Discount', 'woo-discount-rules'); ?>
634
  <?php } ?>
635
  </option>
636
  </select></label>
@@ -645,21 +701,22 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
645
  $discount_product_option = (isset($discount->discount_product_option) ? $discount->discount_product_option : 'all');
646
  ?>
647
  <div class="price_discount_product_list_con">
648
- <?php esc_html_e('Apply for', 'woo-discount-rules') ?>
649
  <select class="selectpicker discount_product_option" name="discount_range[<?php echo $fieldIndex; ?>][discount_product_option]">
650
- <option value="all"<?php echo ($discount_product_option == 'all')? ' selected="selected"': '' ?>><?php esc_html_e('All selected', 'woo-discount-rules') ?></option>
651
  <option value="same_product"<?php echo ($discount_product_option == 'same_product')? ' selected="selected"': '' ?>><?php esc_html_e('Same product', 'woo-discount-rules') ?></option>
652
  <option value="any_cheapest"<?php echo ($discount_product_option == 'any_cheapest')? ' selected="selected"': '' ?>><?php esc_html_e('Any one cheapest from selected', 'woo-discount-rules') ?></option>
653
  <option value="any_cheapest_from_all"<?php echo ($discount_product_option == 'any_cheapest_from_all')? ' selected="selected"': '' ?>><?php esc_html_e('Any one cheapest from all products', 'woo-discount-rules') ?></option>
654
- <option value="more_than_one_cheapest_from_cat"<?php echo ($discount_product_option == 'more_than_one_cheapest_from_cat')? ' selected="selected"': '' ?>><?php esc_html_e('More than one cheapest from selected category', 'woo-discount-rules') ?></option>
655
- <option value="more_than_one_cheapest"<?php echo ($discount_product_option == 'more_than_one_cheapest')? ' selected="selected"': '' ?>><?php esc_html_e('More than one cheapest from selected', 'woo-discount-rules') ?></option>
656
- <option value="more_than_one_cheapest_from_all"<?php echo ($discount_product_option == 'more_than_one_cheapest_from_all')? ' selected="selected"': '' ?>><?php esc_html_e('More than one cheapest from all', 'woo-discount-rules') ?></option>
657
  </select>
 
658
  <div class="discount_product_option_bogo_con hide">
659
  <label><?php esc_html_e('Free quantity', 'woo-discount-rules'); ?> <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Number of quantity(ies) in each selected product(s)', 'woo-discount-rules'); ?>"></span>
660
  <input type="text"
661
  name="discount_range[<?php echo $fieldIndex; ?>][discount_bogo_qty]"
662
- class="form-control"
663
  value="<?php echo(isset($discount->discount_bogo_qty) ? $discount->discount_bogo_qty : 1); ?>"
664
  placeholder="<?php esc_attr_e('ex. 1', 'woo-discount-rules'); ?>" />
665
  </label>
@@ -670,7 +727,7 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
670
  ?>
671
  <select class="selectpicker discount_product_item_count_type" name="discount_range[<?php echo $fieldIndex; ?>][discount_product_item_type]">
672
  <option value="dynamic"<?php echo ($discount_product_item_type == 'dynamic')? ' selected="selected"': '' ?>><?php esc_html_e('Dynamic item count', 'woo-discount-rules') ?></option>
673
- <option value="static"<?php echo ($discount_product_item_type == 'static')? ' selected="selected"': '' ?>><?php esc_html_e('Fixed item count', 'woo-discount-rules') ?></option>
674
  </select>
675
  <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Fixed item count - You need to provide item count manually. Dynamic item count - System will choose dynamically based on cart', 'woo-discount-rules'); ?>"></span>
676
  <label class="discount_product_items_count_field"><?php esc_html_e('Item count', 'woo-discount-rules'); ?> <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Discount for number of item(s) in cart', 'woo-discount-rules'); ?>"></span>
@@ -683,54 +740,64 @@ $current_date_and_time = FlycartWooDiscountRulesGeneralHelper::getCurrentDateAnd
683
  <label><?php esc_html_e('Item quantity', 'woo-discount-rules'); ?> <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Discount for number of quantity(ies) in each item', 'woo-discount-rules'); ?>"></span>
684
  <input type="text"
685
  name="discount_range[<?php echo $fieldIndex; ?>][discount_product_qty]"
686
- class="form-control"
687
  value="<?php echo(isset($discount->discount_product_qty) ? $discount->discount_product_qty : ''); ?>"
688
  placeholder="<?php esc_attr_e('ex. 1', 'woo-discount-rules'); ?>" />
689
  </label>
690
  </div>
691
  <div class="discount_product_option_list_con hide">
692
- <?php
693
- echo FlycartWoocommerceProduct::getProductAjaxSelectBox($products_list, "discount_range[".$fieldIndex."][discount_product]");
694
- ?>
 
 
695
  </div>
696
  <div class="discount_category_option_list_con hide">
697
  <?php
698
  $discount_category_selected = (isset($discount->discount_category) ? $discount->discount_category : array());
699
  ?>
700
- <select class="category_list selectpicker" multiple title="<?php esc_html_e('None selected', 'woo-discount-rules'); ?>"
701
- name="<?php echo "discount_range[".$fieldIndex."][discount_category][]"; ?>">
702
- <?php foreach ($category as $index => $value) { ?>
703
- <option value="<?php echo $index; ?>"<?php if (in_array($index, $discount_category_selected)) { ?> selected=selected <?php } ?>><?php echo $value; ?></option>
704
- <?php } ?>
705
- </select>
 
 
706
  </div>
707
  <div class="discount_product_percent_con hide">
708
  <?php
709
  $discount_product_discount_type = (isset($discount->discount_product_discount_type) ? $discount->discount_product_discount_type : '');
710
- ?> <?php esc_html_e('and', 'woo-discount-rules'); ?>
711
- <select class="selectpicker discount_product_discount_type" name="discount_range[<?php echo $fieldIndex; ?>][discount_product_discount_type]">
712
- <option value=""<?php echo ($discount_product_discount_type == '')? ' selected="selected"': '' ?>><?php esc_html_e('100% percent', 'woo-discount-rules') ?></option>
713
- <option value="limited_percent"<?php echo ($discount_product_discount_type == 'limited_percent')? ' selected="selected"': '' ?>><?php esc_html_e('Limited percent', 'woo-discount-rules') ?></option>
714
- </select>
 
 
715
  <span class="discount_product_percent_field">
716
  <input type="text"
717
  name="discount_range[<?php echo $fieldIndex; ?>][discount_product_percent]"
718
  class="discount_product_percent_field"
719
  value="<?php echo(isset($discount->discount_product_percent) ? $discount->discount_product_percent : ''); ?>"
720
  placeholder="<?php esc_attr_e('ex. 10', 'woo-discount-rules'); ?>" /><span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Percentage', 'woo-discount-rules'); ?>"></span>
721
- </span>
722
- <?php esc_html_e('as discount', 'woo-discount-rules'); ?>
723
  </div>
724
  </div>
725
  </label>
726
  <label><a href=javascript:void(0)
727
- class="btn btn-danger form-control remove_discount_range"><?php esc_html_e('Remove', 'woo-discount-rules'); ?></a></label>
 
 
 
 
 
728
 
729
  </div>
730
  </div>
731
  <?php $fieldIndex++; } ?>
732
  </div>
733
- <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('buy-one-get-one-deals/how-to-create-a-perfect-bogo-discount-rule-in-woocommerce', 'bogo_rules', 'btn btn-info', esc_html__('Document to create perfect BOGO rules', 'woo-discount-rules')); ?>
734
  </div>
735
  <div class="product_based_discount_cont price_discounts_con">
736
  <div class="price_discount_product_list_con">
47
  <?php } ?>
48
  <div class="col-md-12" id="general_block"><h4 class="text text-muted"> <?php esc_html_e('General', 'woo-discount-rules'); ?></h4>
49
  <hr>
50
+ <?php
51
+ $date_from = (isset($data->date_from) ? $data->date_from : false);
52
+ $date_to = (isset($data->date_to) ? $data->date_to : false);
53
+ $validateDateString = FlycartWooDiscountRulesGeneralHelper::validateDateAndTimeWarningText($date_from, $date_to);
54
+ if(!empty($validateDateString)){
55
+ ?>
56
+ <div class="notice inline notice notice-warning notice-alt">
57
+ <p>
58
+ <b><?php esc_html_e("This rule is not running currently: "); ?></b><?php echo $validateDateString; ?>
59
+ </p>
60
+ </div>
61
+ <br>
62
+ <?php
63
+ }
64
+ ?>
65
  <div class="form-group">
66
  <div class="row">
67
+ <div class="col-md-3"><label> <?php esc_html_e('Priority :', 'woo-discount-rules'); ?> <i
68
  class="text-muted glyphicon glyphicon-exclamation-sign"
69
  title="<?php esc_html_e('The Simple Ranking concept to said, which one is going to execute first and so on.', 'woo-discount-rules'); ?>"></i></label>
70
  </div>
72
  id="rule_order"
73
  name="rule_order"
74
  min=1
75
+ value="<?php echo(isset($data->rule_order) ? $data->rule_order : 1); ?>"
76
  placeholder="<?php esc_html_e('ex. 1', 'woo-discount-rules'); ?>">
 
77
  </div>
78
  </div>
79
  </div>
110
  name="rule_method" id="price_rule_method">
111
  <option
112
  value="qty_based" <?php if ($opt == 'qty_based') { ?> selected=selected <?php } ?>>
113
+ <?php esc_html_e('Quantity / category / product / user role based discounts and BOGO deals ', 'woo-discount-rules'); ?>
114
  </option>
115
  <option
116
  <?php if (!$pro) { ?> disabled <?php } else { ?> value="product_based" <?php
117
  }
118
  if ($opt == 'product_based') { ?> selected=selected <?php } ?>>
119
  <?php if (!$pro) { ?>
120
+ <?php esc_html_e('Dependent / conditional based discount (by individual product)', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
121
  <?php } else { ?>
122
+ <?php esc_html_e('Dependent / conditional based discount (by individual product)', 'woo-discount-rules'); ?>
123
  <?php } ?>
124
  </option>
125
  </select></div>
139
  <div class="form-inline">
140
  <input type="text"
141
  name="date_from"
142
+ class="form-control wdr_datepicker"
143
  value="<?php echo $date_from; ?>"
144
  placeholder="<?php esc_attr_e('From', 'woo-discount-rules'); ?>">
145
  <input type="text" name="date_to"
146
+ class="form-control wdr_datepicker"
147
  value="<?php echo $date_to; ?>"
148
  placeholder="<?php esc_attr_e('To - Leave Empty if No Expiry', 'woo-discount-rules'); ?>"></div>
149
  <span class="wdr_current_date_and_time_string"><?php echo sprintf(esc_html__('Current date and time: %s', 'woo-discount-rules'), date('m/d/Y h:i', strtotime($current_date_and_time))); ?></span>
150
  </div>
151
  </div>
152
+ <?php
153
+ $show_discount_table = $woo_settings->getConfigData('show_discount_table', 'show');
154
+ if($show_discount_table == 'advance'){
155
+ ?>
156
+ <br>
157
+ <div class="form-group">
158
+ <div class="row">
159
+ <div class="col-md-3"><label> <?php esc_html_e('Format for advanced table display option (see plugin settings)', 'woo-discount-rules'); ?> <i
160
+ class="text-muted glyphicon glyphicon-exclamation-sign"
161
+ title="<?php esc_attr_e('Used when advanced table display option is set in the plugin settings', 'woo-discount-rules'); ?>"></i></label></div>
162
+ <?php $opt = (isset($data->advance_table_format) ? $data->advance_table_format : ''); ?>
163
+ <div class="col-md-6">
164
+ <textarea name="advance_table_format" class="price_rule_display_format" placeholder="<?php esc_attr_e('Buy {{min_quantity}} or more quantity and get {{discount}} as discount', 'woo-discount-rules'); ?>" value="<?php echo esc_attr($opt); ?>"><?php echo $opt; ?></textarea>
165
+ <div class="wdr_desc_text_con">
166
+ <span class="wdr_desc_text">
167
+ <?php esc_html_e('{{title}} -> Title', 'woo-discount-rules'); ?><br>
168
+ <?php esc_html_e('{{description}} -> Description', 'woo-discount-rules'); ?><br>
169
+ <?php esc_html_e('{{min_quantity}} -> Minimum quantity', 'woo-discount-rules'); ?><br>
170
+ <?php esc_html_e('{{max_quantity}} -> Maximum quantity', 'woo-discount-rules'); ?><br>
171
+ <?php esc_html_e('{{discount}} -> Discount', 'woo-discount-rules'); ?><br>
172
+ <?php esc_html_e('{{discounted_price}} -> Discounted price', 'woo-discount-rules'); ?><br>
173
+ <?php esc_html_e('{{condition}} -> Rule condition text', 'woo-discount-rules'); ?>
174
+ </span>
175
+ </div>
176
+ </div>
177
+ </div>
178
+ </div>
179
+ <?php
180
+ }
181
+ ?>
182
  <div align="right">
183
  <input type="button" class="btn btn-success restriction_tab" value="<?php esc_attr_e('Next', 'woo-discount-rules'); ?>">
184
  </div>
228
  </div>
229
  <?php $is_cumulative_for_products = (isset($data->is_cumulative_for_products))? $data->is_cumulative_for_products : 0 ?>
230
  <div class="form-group" id="cumulative_for_products_cont">
231
+ <input type="checkbox" name="is_cumulative_for_products" id="is_cumulative_for_products" value="1" <?php if($is_cumulative_for_products) { echo "checked"; } ?>> <label class="checkbox_label" for="is_cumulative_for_products"><?php esc_html_e('Check this box to count item quantities in cart cumulatively across products', 'woo-discount-rules'); ?></label>
232
  </div>
233
  <div class="form-group" id="category_list">
234
  <?php $category_list = json_decode((isset($data->category_to_apply) ? $data->category_to_apply : '{}'), true); ?>
379
  </select>
380
  <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('coupon-based-discounts/activate-discount-rule-using-a-coupon-code-in-woocommerce', 'coupon'); ?>
381
  <div class="coupons_to_apply_price_rule_con">
382
+ <select class="form-control coupons_to_apply selectpicker" multiple id="coupons_to_apply" name="coupons_to_apply[]">
383
  <?php
384
+ if(!empty($coupons)){
385
+ if(!empty($coupons_to_apply)){
386
+ if(is_string($coupons_to_apply)) $coupons_to_apply = explode(',', $coupons_to_apply);
387
+ } else {
388
+ $coupons_to_apply = array();
389
+ }
390
+ foreach ($coupons as $coupon_code => $coupon_title){
391
+ ?>
392
+ <option value="<?php echo $coupon_code; ?>"<?php if(in_array($coupon_code, $coupons_to_apply)) { ?> selected=selected <?php } ?>><?php echo $coupon_title ?></option>
393
+ <?php
394
+ }
395
+ }
396
  ?>
397
+ </select>
398
+ <span class="woo-discount-hint">
399
  <a target="_blank" href="https://docs.flycart.org/woocommerce-discount-rules/coupon-based-discounts/activate-discount-rule-using-a-coupon-code-in-woocommerce">
400
  <?php
401
  esc_html_e('Make sure you have created the coupon already', 'woo-discount-rules');
402
  ?>
403
  </a>
404
  </span>
 
405
  <?php
406
  if($do_not_run_while_have_third_party_coupon){
407
  ?>
408
+ <div class="notice notice-warning">
409
+ <p>
410
+ <?php esc_html_e('To get this condition work,', 'woo-discount-rules'); ?> <a target="_blank" href="?page=woo_discount_rules&tab=settings"><?php esc_html_e('please change the option', 'woo-discount-rules'); ?> <b><?php esc_html_e('Disable the rules while have coupon(Third party)', 'woo-discount-rules'); ?></b> <?php esc_html_e('in cart to', 'woo-discount-rules'); ?> <b><?php esc_html_e('No', 'woo-discount-rules'); ?></b></a>.
411
+ </p>
412
+ </div>
413
+ <?php
414
  }
415
  ?>
416
  </div>
606
  name="product_based_condition[category_to_apply][]">
607
  <?php foreach ($category as $index => $value) { ?>
608
  <option
609
+ value="<?php echo $index; ?>"<?php if (in_array($index, $product_based_condition_category_to_apply)) { ?> selected=selected <?php } ?>><?php echo $value; ?></option>
610
  <?php } ?>
611
  </select>
612
  </div>
613
  </div>
614
+ <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('', 'product_dependent#dependant-product-based-rules', 'btn btn-info', esc_html__('Guide for product dependent rules', 'woo-discount-rules')); ?>
615
  </div>
616
  <div class="form-group">
617
  <div class="row">
650
  <label><?php esc_html_e('Min Quantity', 'woo-discount-rules'); ?>
651
  <input type="text"
652
  name="discount_range[<?php echo $fieldIndex; ?>][min_qty]"
653
+ class="form-control discount_range_min_qty"
654
  value="<?php echo(isset($discount->min_qty) ? $discount->min_qty : ''); ?>"
655
  placeholder="<?php esc_html_e('ex. 1', 'woo-discount-rules'); ?>">
656
  </label>
657
  <label><?php esc_html_e('Max Quantity', 'woo-discount-rules'); ?>
658
  <input type="text"
659
  name="discount_range[<?php echo $fieldIndex; ?>][max_qty]"
660
+ class="form-control discount_range_max_qty"
661
  value="<?php echo(isset($discount->max_qty) ? $discount->max_qty : ''); ?>"
662
  placeholder="<?php esc_html_e('ex. 50', 'woo-discount-rules'); ?>"> </label>
663
  <label><?php esc_html_e('Adjustment Type', 'woo-discount-rules'); ?>
684
  }
685
  if ($opt == 'product_discount') { ?> selected=selected <?php } ?>>
686
  <?php if (!$pro) { ?>
687
+ <?php esc_html_e('BOGO Product Discount', 'woo-discount-rules'); ?> <b><?php echo $suffix; ?></b>
688
  <?php } else { ?>
689
+ <?php esc_html_e('BOGO Product Discount', 'woo-discount-rules'); ?>
690
  <?php } ?>
691
  </option>
692
  </select></label>
701
  $discount_product_option = (isset($discount->discount_product_option) ? $discount->discount_product_option : 'all');
702
  ?>
703
  <div class="price_discount_product_list_con">
704
+ <?php esc_html_e('receive discount for', 'woo-discount-rules') ?>
705
  <select class="selectpicker discount_product_option" name="discount_range[<?php echo $fieldIndex; ?>][discount_product_option]">
706
+ <option value="all"<?php echo ($discount_product_option == 'all')? ' selected="selected"': '' ?>><?php esc_html_e('Auto add all selected products', 'woo-discount-rules') ?></option>
707
  <option value="same_product"<?php echo ($discount_product_option == 'same_product')? ' selected="selected"': '' ?>><?php esc_html_e('Same product', 'woo-discount-rules') ?></option>
708
  <option value="any_cheapest"<?php echo ($discount_product_option == 'any_cheapest')? ' selected="selected"': '' ?>><?php esc_html_e('Any one cheapest from selected', 'woo-discount-rules') ?></option>
709
  <option value="any_cheapest_from_all"<?php echo ($discount_product_option == 'any_cheapest_from_all')? ' selected="selected"': '' ?>><?php esc_html_e('Any one cheapest from all products', 'woo-discount-rules') ?></option>
710
+ <option value="more_than_one_cheapest_from_cat"<?php echo ($discount_product_option == 'more_than_one_cheapest_from_cat')? ' selected="selected"': '' ?>><?php esc_html_e('Cheapest in cart - selected category(ies)', 'woo-discount-rules') ?></option>
711
+ <option value="more_than_one_cheapest"<?php echo ($discount_product_option == 'more_than_one_cheapest')? ' selected="selected"': '' ?>><?php esc_html_e('Cheapest in cart - selected item(s)', 'woo-discount-rules') ?></option>
712
+ <option value="more_than_one_cheapest_from_all"<?php echo ($discount_product_option == 'more_than_one_cheapest_from_all')? ' selected="selected"': '' ?>><?php esc_html_e('Cheapest in cart - selected item(s)', 'woo-discount-rules') ?></option>
713
  </select>
714
+ <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Auto add all selected products - Automatically added to the cart <br> Same product - get discount in same product <br> Any one cheapest from selected - Get discount in one selected product <br> Any one cheapest from all products - Get discount in one cheapest product in cart <br> Cheapest in cart - selected category(ies) - cheapest product from the selected category will be discounted <br> Cheapest in cart - selected item(s) - get discount in chosen no.of quantities', 'woo-discount-rules'); ?>"></span>
715
  <div class="discount_product_option_bogo_con hide">
716
  <label><?php esc_html_e('Free quantity', 'woo-discount-rules'); ?> <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Number of quantity(ies) in each selected product(s)', 'woo-discount-rules'); ?>"></span>
717
  <input type="text"
718
  name="discount_range[<?php echo $fieldIndex; ?>][discount_bogo_qty]"
719
+ class="form-control discount_bogo_qty"
720
  value="<?php echo(isset($discount->discount_bogo_qty) ? $discount->discount_bogo_qty : 1); ?>"
721
  placeholder="<?php esc_attr_e('ex. 1', 'woo-discount-rules'); ?>" />
722
  </label>
727
  ?>
728
  <select class="selectpicker discount_product_item_count_type" name="discount_range[<?php echo $fieldIndex; ?>][discount_product_item_type]">
729
  <option value="dynamic"<?php echo ($discount_product_item_type == 'dynamic')? ' selected="selected"': '' ?>><?php esc_html_e('Dynamic item count', 'woo-discount-rules') ?></option>
730
+ <option value="static"<?php echo ($discount_product_item_type == 'static')? ' selected="selected"': '' ?>><?php esc_html_e('Fixed item count (not recommended)', 'woo-discount-rules') ?></option>
731
  </select>
732
  <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Fixed item count - You need to provide item count manually. Dynamic item count - System will choose dynamically based on cart', 'woo-discount-rules'); ?>"></span>
733
  <label class="discount_product_items_count_field"><?php esc_html_e('Item count', 'woo-discount-rules'); ?> <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Discount for number of item(s) in cart', 'woo-discount-rules'); ?>"></span>
740
  <label><?php esc_html_e('Item quantity', 'woo-discount-rules'); ?> <span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Discount for number of quantity(ies) in each item', 'woo-discount-rules'); ?>"></span>
741
  <input type="text"
742
  name="discount_range[<?php echo $fieldIndex; ?>][discount_product_qty]"
743
+ class="form-control discount_product_qty"
744
  value="<?php echo(isset($discount->discount_product_qty) ? $discount->discount_product_qty : ''); ?>"
745
  placeholder="<?php esc_attr_e('ex. 1', 'woo-discount-rules'); ?>" />
746
  </label>
747
  </div>
748
  <div class="discount_product_option_list_con hide">
749
+ <label><span class="wdr_block_span"><?php esc_html_e('Choose product(s)', 'woo-discount-rules'); ?></span>
750
+ <?php
751
+ echo FlycartWoocommerceProduct::getProductAjaxSelectBox($products_list, "discount_range[".$fieldIndex."][discount_product]");
752
+ ?>
753
+ </label>
754
  </div>
755
  <div class="discount_category_option_list_con hide">
756
  <?php
757
  $discount_category_selected = (isset($discount->discount_category) ? $discount->discount_category : array());
758
  ?>
759
+ <label><span class="wdr_block_span"><?php esc_html_e('Choose category(ies)', 'woo-discount-rules'); ?></span>
760
+ <select class="category_list selectpicker" multiple title="<?php esc_html_e('None selected', 'woo-discount-rules'); ?>"
761
+ name="<?php echo "discount_range[".$fieldIndex."][discount_category][]"; ?>">
762
+ <?php foreach ($category as $index => $value) { ?>
763
+ <option value="<?php echo $index; ?>"<?php if (in_array($index, $discount_category_selected)) { ?> selected=selected <?php } ?>><?php echo $value; ?></option>
764
+ <?php } ?>
765
+ </select>
766
+ </label>
767
  </div>
768
  <div class="discount_product_percent_con hide">
769
  <?php
770
  $discount_product_discount_type = (isset($discount->discount_product_discount_type) ? $discount->discount_product_discount_type : '');
771
+ ?>
772
+ <label><span class="wdr_block_span"><?php esc_html_e('Discount percentage', 'woo-discount-rules'); ?></span>
773
+ <select class="selectpicker discount_product_discount_type" name="discount_range[<?php echo $fieldIndex; ?>][discount_product_discount_type]">
774
+ <option value=""<?php echo ($discount_product_discount_type == '')? ' selected="selected"': '' ?>><?php esc_html_e('100% percent', 'woo-discount-rules') ?></option>
775
+ <option value="limited_percent"<?php echo ($discount_product_discount_type == 'limited_percent')? ' selected="selected"': '' ?>><?php esc_html_e('Limited percent', 'woo-discount-rules') ?></option>
776
+ </select>
777
+ </label>
778
  <span class="discount_product_percent_field">
779
  <input type="text"
780
  name="discount_range[<?php echo $fieldIndex; ?>][discount_product_percent]"
781
  class="discount_product_percent_field"
782
  value="<?php echo(isset($discount->discount_product_percent) ? $discount->discount_product_percent : ''); ?>"
783
  placeholder="<?php esc_attr_e('ex. 10', 'woo-discount-rules'); ?>" /><span class="woocommerce-help-tip" data-tip="<?php esc_attr_e('Percentage', 'woo-discount-rules'); ?>"></span>
784
+ </span>
 
785
  </div>
786
  </div>
787
  </label>
788
  <label><a href=javascript:void(0)
789
+ class="btn btn-danger form-control remove_discount_range"><?php esc_html_e('Remove', 'woo-discount-rules'); ?></a>
790
+ </label>
791
+ <label><a href="javascript:void(0)" data-id="<?php echo $fieldIndex; ?>"
792
+ class="btn btn-primary form-control create_duplicate_discount_range"><?php esc_html_e('Duplicate', 'woo-discount-rules'); ?></a>
793
+ </label>
794
+
795
 
796
  </div>
797
  </div>
798
  <?php $fieldIndex++; } ?>
799
  </div>
800
+ <?php echo FlycartWooDiscountRulesGeneralHelper::docsURLHTML('buy-one-get-one-deals/how-to-create-a-perfect-bogo-discount-rule-in-woocommerce', 'bogo_rules', 'btn btn-info', esc_html__('Guide to create perfect BOGO rules', 'woo-discount-rules')); ?>
801
  </div>
802
  <div class="product_based_discount_cont price_discounts_con">
803
  <div class="price_discount_product_list_con">
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.19
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
+ * Version: 1.7.0
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Domain Path: /i18n/languages/