Discount Rules for WooCommerce - Version 1.5.8

Version Description

  • 11/04/18 =
  • Feature - Option to add rule based on email domain in cart rules(Pro)
  • Improvement - Content improvement
Download this release

Release Info

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

Code changes from version 1.5.7 to 1.5.8

assets/js/app.js CHANGED
@@ -337,7 +337,7 @@ function validateFields(){
337
  '<option value="categories_in">Categories in cart</option>' +
338
  '</optgroup>' +
339
  '<optgroup label="Customer Details (must be logged in)"><option value="users_in">User in list</option><option value="roles_in">User role in list</option><option value="shipping_countries_in">Shipping country in list</option></optgroup>' +
340
- '<optgroup label="Customer Email Domain (Eg: edu)"><option value="customer_email_tld">Email ends with</option></optgroup>' +
341
  '<optgroup label="Customer Billing Details"><option value="customer_billing_city">Billing city</option></optgroup>' +
342
  '<optgroup label="Customer Shipping Details"><option value="customer_shipping_state">Shipping state</option></optgroup>' +
343
  '<optgroup label="Purchase History"><option value="customer_based_on_purchase_history">Based on Purchase history</option></optgroup>' +
@@ -366,7 +366,7 @@ function validateFields(){
366
  '<option disabled>Categories in cart <b>' + pro_suffix + '</b></option>' +
367
  '</optgroup>' +
368
  '<optgroup label="Customer Details (must be logged in)"><option disabled>User in list <b>' + pro_suffix + '</b></option><option disabled>User role in list <b>' + pro_suffix + '</b></option><option disabled>Shipping country in list <b>' + pro_suffix + '</b></option></optgroup>' +
369
- '<optgroup label="Customer Email Domain (Eg: edu)"><option disabled>Email ends with <b>' + pro_suffix + '</b></option></optgroup>' +
370
  '<optgroup label="Customer Billing Details"><option disabled>Billing city <b>' + pro_suffix + '</b></option></optgroup>' +
371
  '<optgroup label="Customer Shipping Details"><option disabled>Shipping state <b>' + pro_suffix + '</b></option></optgroup>' +
372
  '<optgroup label="Purchase History"><option disabled>Based on Purchase history <b>' + pro_suffix + '</b></option></optgroup>' +
337
  '<option value="categories_in">Categories in cart</option>' +
338
  '</optgroup>' +
339
  '<optgroup label="Customer Details (must be logged in)"><option value="users_in">User in list</option><option value="roles_in">User role in list</option><option value="shipping_countries_in">Shipping country in list</option></optgroup>' +
340
+ '<optgroup label="Customer Email"><option value="customer_email_tld">Email with TLD (Eg: edu)</option><option value="customer_email_domain">Email with Domain (Eg: gmail.com)</option></optgroup>' +
341
  '<optgroup label="Customer Billing Details"><option value="customer_billing_city">Billing city</option></optgroup>' +
342
  '<optgroup label="Customer Shipping Details"><option value="customer_shipping_state">Shipping state</option></optgroup>' +
343
  '<optgroup label="Purchase History"><option value="customer_based_on_purchase_history">Based on Purchase history</option></optgroup>' +
366
  '<option disabled>Categories in cart <b>' + pro_suffix + '</b></option>' +
367
  '</optgroup>' +
368
  '<optgroup label="Customer Details (must be logged in)"><option disabled>User in list <b>' + pro_suffix + '</b></option><option disabled>User role in list <b>' + pro_suffix + '</b></option><option disabled>Shipping country in list <b>' + pro_suffix + '</b></option></optgroup>' +
369
+ '<optgroup label="Customer Email"><option disabled>Email with TLD (Eg: edu)<b>' + pro_suffix + '</b></option><option disabled>Email with Domain (Eg: gmail.com)<b>' + pro_suffix + '</b></option></optgroup>' +
370
  '<optgroup label="Customer Billing Details"><option disabled>Billing city <b>' + pro_suffix + '</b></option></optgroup>' +
371
  '<optgroup label="Customer Shipping Details"><option disabled>Shipping state <b>' + pro_suffix + '</b></option></optgroup>' +
372
  '<optgroup label="Purchase History"><option disabled>Based on Purchase history <b>' + pro_suffix + '</b></option></optgroup>' +
includes/cart-rules.php CHANGED
@@ -108,8 +108,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
108
 
109
  $id = intval($id);
110
  if (!$id && $id != 0) return false;
111
-
112
- $title = (isset($request['rule_name']) ? $request['rule_name'] : 'New');
113
  $slug = str_replace(' ', '-', strtolower($title));
114
 
115
  // To Lowercase.
@@ -118,6 +117,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
118
  // Encoding String with Space.
119
  $slug = str_replace(' ', '-', $slug);
120
 
 
121
  $form = array(
122
  'rule_name',
123
  'rule_descr',
@@ -769,7 +769,7 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
769
  }
770
  return true;
771
  break;
772
- case 'customer_email_tld':
773
  $rule = explode(',', $rule);
774
  foreach($rule as $key => $r){
775
  $rule[$key] = trim($r);
@@ -796,14 +796,20 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
796
  if(get_current_user_id()){
797
  update_user_meta(get_current_user_id(), 'billing_email', $user_email);
798
  }
799
- $tld = $this->getTLDFromEmail($user_email);
 
 
 
800
  if(in_array($tld, $rule)){
801
  return true;
802
  }
803
  } else if(get_current_user_id()){
804
  $user_email = get_user_meta( get_current_user_id(), 'billing_email', true );
805
  if($user_email != '' && !empty($user_email)){
806
- $tld = $this->getTLDFromEmail($user_email);
 
 
 
807
  if(in_array($tld, $rule)){
808
  return true;
809
  }
@@ -811,7 +817,10 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
811
  $user_details = get_userdata( get_current_user_id() );
812
  if(isset($user_details->data->user_email) && $user_details->data->user_email != ''){
813
  $user_email = $user_details->data->user_email;
814
- $tld = $this->getTLDFromEmail($user_email);
 
 
 
815
  if(in_array($tld, $rule)){
816
  return true;
817
  }
@@ -1115,6 +1124,17 @@ if (!class_exists('FlycartWooDiscountRulesCartRules')) {
1115
  return $emailArray[0];
1116
  }
1117
 
 
 
 
 
 
 
 
 
 
 
 
1118
  /**
1119
  * Get cart total amount
1120
  *
108
 
109
  $id = intval($id);
110
  if (!$id && $id != 0) return false;
111
+ $title = $request['rule_name'] = (isset($request['rule_name']) ? str_replace('\'', '', $request['rule_name']) : 'New');
 
112
  $slug = str_replace(' ', '-', strtolower($title));
113
 
114
  // To Lowercase.
117
  // Encoding String with Space.
118
  $slug = str_replace(' ', '-', $slug);
119
 
120
+ $request['rule_descr'] = (isset($request['rule_descr']) ? str_replace('\'', '', $request['rule_descr']) : '');
121
  $form = array(
122
  'rule_name',
123
  'rule_descr',
769
  }
770
  return true;
771
  break;
772
+ case ($index == 'customer_email_tld' || $index == 'customer_email_domain'):
773
  $rule = explode(',', $rule);
774
  foreach($rule as $key => $r){
775
  $rule[$key] = trim($r);
796
  if(get_current_user_id()){
797
  update_user_meta(get_current_user_id(), 'billing_email', $user_email);
798
  }
799
+ if($index == 'customer_email_tld')
800
+ $tld = $this->getTLDFromEmail($user_email);
801
+ else
802
+ $tld = $this->getDomainFromEmail($user_email);
803
  if(in_array($tld, $rule)){
804
  return true;
805
  }
806
  } else if(get_current_user_id()){
807
  $user_email = get_user_meta( get_current_user_id(), 'billing_email', true );
808
  if($user_email != '' && !empty($user_email)){
809
+ if($index == 'customer_email_tld')
810
+ $tld = $this->getTLDFromEmail($user_email);
811
+ else
812
+ $tld = $this->getDomainFromEmail($user_email);
813
  if(in_array($tld, $rule)){
814
  return true;
815
  }
817
  $user_details = get_userdata( get_current_user_id() );
818
  if(isset($user_details->data->user_email) && $user_details->data->user_email != ''){
819
  $user_email = $user_details->data->user_email;
820
+ if($index == 'customer_email_tld')
821
+ $tld = $this->getTLDFromEmail($user_email);
822
+ else
823
+ $tld = $this->getDomainFromEmail($user_email);
824
  if(in_array($tld, $rule)){
825
  return true;
826
  }
1124
  return $emailArray[0];
1125
  }
1126
 
1127
+ /**
1128
+ * Get tld from email
1129
+ * */
1130
+ protected function getDomainFromEmail($email){
1131
+ $emailArray = explode('@', $email);
1132
+ if(isset($emailArray[1])){
1133
+ return $emailArray[1];
1134
+ }
1135
+ return $emailArray[0];
1136
+ }
1137
+
1138
  /**
1139
  * Get cart total amount
1140
  *
includes/pricing-rules.php CHANGED
@@ -95,8 +95,7 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
95
 
96
  $id = intval($id);
97
  if (!$id && $id != 0) return false;
98
-
99
- $title = (isset($request['rule_name']) ? $request['rule_name'] : 'New');
100
  $slug = str_replace(' ', '-', strtolower($title));
101
 
102
  // To Lowercase.
@@ -105,6 +104,8 @@ if (!class_exists('FlycartWooDiscountRulesPricingRules')) {
105
  // Encoding String with Space.
106
  $slug = str_replace(' ', '-', $slug);
107
 
 
 
108
  if ($id) {
109
  $post = array(
110
  'ID' => $id,
95
 
96
  $id = intval($id);
97
  if (!$id && $id != 0) return false;
98
+ $title = $request['rule_name'] = (isset($request['rule_name']) ? str_replace('\'', '', $request['rule_name']) : 'New');
 
99
  $slug = str_replace(' ', '-', strtolower($title));
100
 
101
  // To Lowercase.
104
  // Encoding String with Space.
105
  $slug = str_replace(' ', '-', $slug);
106
 
107
+ $request['rule_descr'] = (isset($request['rule_descr']) ? str_replace('\'', '', $request['rule_descr']) : '');
108
+
109
  if ($id) {
110
  $post = array(
111
  'ID' => $id,
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://flycart.org/
4
  Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts
5
  Requires at least: 4.4.1
6
  Tested up to: 4.9
7
- Stable tag: 1.5.7
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -35,6 +35,7 @@ Display the pricing discount table beautifully on the product page. Start sellin
35
  * Coupons based discount rules (The discount will apply after a coupon is entered.)
36
  * Option to set discount for each product variant. - PRO feature
37
  * Option to set Discount for All Products or Global Discount
 
38
  * Display or hide the Discount table in Product Page
39
  * Option to show or hide the discounted price
40
  * Multiple Discount rules can be created
@@ -242,6 +243,10 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
242
 
243
  == Changelog ==
244
 
 
 
 
 
245
  = 1.5.7 - 09/04/18 =
246
  * Feature - Option to apply price rule based on coupon applied(Pro)
247
  * Fix - Loading issue while having large number of rules
4
  Tags: woocommerce, discounts, dynamic pricing, Buy One Get One Free, pricing deals, price rules, bulk discounts, advanced discounts
5
  Requires at least: 4.4.1
6
  Tested up to: 4.9
7
+ Stable tag: 1.5.8
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
35
  * Coupons based discount rules (The discount will apply after a coupon is entered.)
36
  * Option to set discount for each product variant. - PRO feature
37
  * Option to set Discount for All Products or Global Discount
38
+ * Discount for customers with specific domains (10% discount for all emails ending with @acme.com)
39
  * Display or hide the Discount table in Product Page
40
  * Option to show or hide the discounted price
41
  * Multiple Discount rules can be created
243
 
244
  == Changelog ==
245
 
246
+ = 1.5.8 - 11/04/18 =
247
+ * Feature - Option to add rule based on email domain in cart rules(Pro)
248
+ * Improvement - Content improvement
249
+
250
  = 1.5.7 - 09/04/18 =
251
  * Feature - Option to apply price rule based on coupon applied(Pro)
252
  * Fix - Loading issue while having large number of rules
view/settings.php CHANGED
@@ -57,6 +57,36 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
57
  </div>
58
  </div>
59
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
  <div class="row form-group">
61
  <?php $data['price_setup'] = (isset($data['price_setup']) ? $data['price_setup'] : 'first'); ?>
62
  <div class="col-md-2">
@@ -128,30 +158,6 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
128
  <div class="notice notice-info"><p><?php esc_html_e('It displays only if any rule matches', 'woo-discount-rules'); ?></p></div>
129
  </div>
130
  </div>
131
- <div class="row form-group">
132
- <div class="col-md-2">
133
- <label>
134
- <?php esc_html_e('Show strikeout discount in cart item', 'woo-discount-rules'); ?>
135
- </label>
136
- </div>
137
- <?php $data['show_strikeout_in_cart'] = (isset($data['show_strikeout_in_cart']) ? $data['show_strikeout_in_cart'] : 1); ?>
138
- <div class="col-md-6">
139
- <label><input type="radio" name="show_strikeout_in_cart" value="1" <?php echo ($data['show_strikeout_in_cart'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
140
- <label><input type="radio" name="show_strikeout_in_cart" value="0" <?php echo ($data['show_strikeout_in_cart'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
141
- </div>
142
- </div>
143
- <div class="row form-group">
144
- <div class="col-md-2">
145
- <label>
146
- <?php esc_html_e('Coupon Name to be displayed :', 'woo-discount-rules'); ?>
147
- </label>
148
- </div>
149
- <div class="col-md-6">
150
- <input type="text" class="" name="coupon_name"
151
- value="<?php if (isset($data['coupon_name'])) echo $data['coupon_name']; ?>"
152
- placeholder="<?php esc_html_e('Discount Coupon Name', 'woo-discount-rules'); ?>">
153
- </div>
154
- </div>
155
  <div class="row form-group">
156
  <?php $data['show_discount_table'] = (isset($data['show_discount_table']) ? $data['show_discount_table'] : 'show'); ?>
157
  <div class="col-md-2">
@@ -162,10 +168,10 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
162
  <div class="col-md-6">
163
  <select class="selectpicker" name="show_discount_table">
164
  <option <?php if ($data['show_discount_table'] == 'show') { ?> selected=selected <?php } ?>
165
- value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
166
  </option>
167
  <option <?php if ($data['show_discount_table'] == 'dont') { ?> selected=selected <?php } ?>
168
- value="dont"><?php esc_html_e('Don\'t Show', 'woo-discount-rules'); ?>
169
  </option>
170
  </select>
171
  </div>
@@ -180,14 +186,44 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
180
  <div class="col-md-6">
181
  <select class="selectpicker" name="show_discount_title_table">
182
  <option <?php if ($data['show_discount_title_table'] == 'show') { ?> selected=selected <?php } ?>
183
- value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
184
  </option>
185
  <option <?php if ($data['show_discount_title_table'] == 'dont') { ?> selected=selected <?php } ?>
186
- value="dont"><?php esc_html_e('Don\'t Show', 'woo-discount-rules'); ?>
187
  </option>
188
  </select>
189
  </div>
190
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  <div class="row form-group">
192
  <?php $data['cart_setup'] = (isset($data['cart_setup']) ? $data['cart_setup'] : 'first'); ?>
193
  <div class="col-md-2">
@@ -221,18 +257,6 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
221
  </select>
222
  </div>
223
  </div>
224
- <div class="row form-group">
225
- <div class="col-md-2">
226
- <label>
227
- <?php esc_html_e('Enable Bootstrap', 'woo-discount-rules'); ?>
228
- </label>
229
- </div>
230
- <?php $data['enable_bootstrap'] = (isset($data['enable_bootstrap']) ? $data['enable_bootstrap'] : 1); ?>
231
- <div class="col-md-6">
232
- <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>
233
- <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>
234
- </div>
235
- </div>
236
  <div class="row form-group">
237
  <div class="col-md-2">
238
  <label>
@@ -245,18 +269,6 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
245
  <label><input type="radio" name="do_not_run_while_have_third_party_coupon" value="0" <?php echo ($data['do_not_run_while_have_third_party_coupon'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
246
  </div>
247
  </div>
248
- <div class="row form-group">
249
- <div class="col-md-2">
250
- <label>
251
- <?php esc_html_e('Force refresh the cart widget while add and remove item to cart', 'woo-discount-rules'); ?>
252
- </label>
253
- </div>
254
- <?php $data['force_refresh_cart_widget'] = (isset($data['force_refresh_cart_widget']) ? $data['force_refresh_cart_widget'] : 0); ?>
255
- <div class="col-md-6">
256
- <label><input type="radio" name="force_refresh_cart_widget" value="1" <?php echo ($data['force_refresh_cart_widget'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
257
- <label><input type="radio" name="force_refresh_cart_widget" value="0" <?php echo ($data['force_refresh_cart_widget'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
258
- </div>
259
- </div>
260
  <div class="row form-group" style="display: none"><!-- Hide this because it is not required after v1.4.36 -->
261
  <div class="col-md-2">
262
  <label>
57
  </div>
58
  </div>
59
  </div>
60
+ <div class="row form-group">
61
+ <div class="col-md-2">
62
+ <label>
63
+ <?php esc_html_e('Enable Bootstrap', 'woo-discount-rules'); ?>
64
+ </label>
65
+ </div>
66
+ <?php $data['enable_bootstrap'] = (isset($data['enable_bootstrap']) ? $data['enable_bootstrap'] : 1); ?>
67
+ <div class="col-md-6">
68
+ <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>
69
+ <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>
70
+ </div>
71
+ </div>
72
+ <div class="row form-group">
73
+ <div class="col-md-2">
74
+ <label>
75
+ <?php esc_html_e('Force refresh the cart widget while add and remove item to cart', 'woo-discount-rules'); ?>
76
+ </label>
77
+ </div>
78
+ <?php $data['force_refresh_cart_widget'] = (isset($data['force_refresh_cart_widget']) ? $data['force_refresh_cart_widget'] : 0); ?>
79
+ <div class="col-md-6">
80
+ <label><input type="radio" name="force_refresh_cart_widget" value="1" <?php echo ($data['force_refresh_cart_widget'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
81
+ <label><input type="radio" name="force_refresh_cart_widget" value="0" <?php echo ($data['force_refresh_cart_widget'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
82
+ </div>
83
+ </div>
84
+ <div class="row form-group">
85
+ <div class="col-md-12">
86
+ <h4><?php esc_html_e('Price rules settings', 'woo-discount-rules'); ?></h4>
87
+ <hr>
88
+ </div>
89
+ </div>
90
  <div class="row form-group">
91
  <?php $data['price_setup'] = (isset($data['price_setup']) ? $data['price_setup'] : 'first'); ?>
92
  <div class="col-md-2">
158
  <div class="notice notice-info"><p><?php esc_html_e('It displays only if any rule matches', 'woo-discount-rules'); ?></p></div>
159
  </div>
160
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
  <div class="row form-group">
162
  <?php $data['show_discount_table'] = (isset($data['show_discount_table']) ? $data['show_discount_table'] : 'show'); ?>
163
  <div class="col-md-2">
168
  <div class="col-md-6">
169
  <select class="selectpicker" name="show_discount_table">
170
  <option <?php if ($data['show_discount_table'] == 'show') { ?> selected=selected <?php } ?>
171
+ value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
172
  </option>
173
  <option <?php if ($data['show_discount_table'] == 'dont') { ?> selected=selected <?php } ?>
174
+ value="dont"><?php esc_html_e('Don\'t Show', 'woo-discount-rules'); ?>
175
  </option>
176
  </select>
177
  </div>
186
  <div class="col-md-6">
187
  <select class="selectpicker" name="show_discount_title_table">
188
  <option <?php if ($data['show_discount_title_table'] == 'show') { ?> selected=selected <?php } ?>
189
+ value="show"><?php esc_html_e('Show', 'woo-discount-rules'); ?>
190
  </option>
191
  <option <?php if ($data['show_discount_title_table'] == 'dont') { ?> selected=selected <?php } ?>
192
+ value="dont"><?php esc_html_e('Don\'t Show', 'woo-discount-rules'); ?>
193
  </option>
194
  </select>
195
  </div>
196
  </div>
197
+ <div class="row form-group">
198
+ <div class="col-md-2">
199
+ <label>
200
+ <?php esc_html_e('Show strikeout discount in cart item', 'woo-discount-rules'); ?>
201
+ </label>
202
+ </div>
203
+ <?php $data['show_strikeout_in_cart'] = (isset($data['show_strikeout_in_cart']) ? $data['show_strikeout_in_cart'] : 1); ?>
204
+ <div class="col-md-6">
205
+ <label><input type="radio" name="show_strikeout_in_cart" value="1" <?php echo ($data['show_strikeout_in_cart'] == 1)? 'checked': '' ?>/> <?php esc_html_e('Yes', 'woo-discount-rules'); ?></label>
206
+ <label><input type="radio" name="show_strikeout_in_cart" value="0" <?php echo ($data['show_strikeout_in_cart'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
207
+ </div>
208
+ </div>
209
+ <div class="row form-group">
210
+ <div class="col-md-12">
211
+ <h4><?php esc_html_e('Cart rules settings', 'woo-discount-rules'); ?></h4>
212
+ <hr>
213
+ </div>
214
+ </div>
215
+ <div class="row form-group">
216
+ <div class="col-md-2">
217
+ <label>
218
+ <?php esc_html_e('Coupon Name to be displayed :', 'woo-discount-rules'); ?>
219
+ </label>
220
+ </div>
221
+ <div class="col-md-6">
222
+ <input type="text" class="" name="coupon_name"
223
+ value="<?php if (isset($data['coupon_name'])) echo $data['coupon_name']; ?>"
224
+ placeholder="<?php esc_html_e('Discount Coupon Name', 'woo-discount-rules'); ?>">
225
+ </div>
226
+ </div>
227
  <div class="row form-group">
228
  <?php $data['cart_setup'] = (isset($data['cart_setup']) ? $data['cart_setup'] : 'first'); ?>
229
  <div class="col-md-2">
257
  </select>
258
  </div>
259
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
260
  <div class="row form-group">
261
  <div class="col-md-2">
262
  <label>
269
  <label><input type="radio" name="do_not_run_while_have_third_party_coupon" value="0" <?php echo ($data['do_not_run_while_have_third_party_coupon'] == 0)? 'checked': '' ?> /> <?php esc_html_e('No', 'woo-discount-rules'); ?></label>
270
  </div>
271
  </div>
 
 
 
 
 
 
 
 
 
 
 
 
272
  <div class="row form-group" style="display: none"><!-- Hide this because it is not required after v1.4.36 -->
273
  <div class="col-md-2">
274
  <label>
view/view-cart-rules.php CHANGED
@@ -232,15 +232,25 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
232
  <?php } ?>
233
  </option>
234
  </optgroup>
235
- <optgroup label="Customer Email Domain (Eg: edu)">
236
  <option
237
  <?php if (!$pro) { ?> disabled <?php } else { ?> value="customer_email_tld" <?php
238
  }
239
  if ($type == 'customer_email_tld') { ?> selected=selected <?php } ?>>
240
  <?php if (!$pro) { ?>
241
- Email ends with <b><?php echo $suffix; ?></b>
242
  <?php } else { ?>
243
- Email ends with
 
 
 
 
 
 
 
 
 
 
244
  <?php } ?>
245
  </option>
246
  </optgroup>
232
  <?php } ?>
233
  </option>
234
  </optgroup>
235
+ <optgroup label="Customer Email">
236
  <option
237
  <?php if (!$pro) { ?> disabled <?php } else { ?> value="customer_email_tld" <?php
238
  }
239
  if ($type == 'customer_email_tld') { ?> selected=selected <?php } ?>>
240
  <?php if (!$pro) { ?>
241
+ Email with TLD (Eg: edu)<b><?php echo $suffix; ?></b>
242
  <?php } else { ?>
243
+ Email with TLD (Eg: edu)
244
+ <?php } ?>
245
+ </option>
246
+ <option
247
+ <?php if (!$pro) { ?> disabled <?php } else { ?> value="customer_email_domain" <?php
248
+ }
249
+ if ($type == 'customer_email_domain') { ?> selected=selected <?php } ?>>
250
+ <?php if (!$pro) { ?>
251
+ Email with Domain (Eg: gmail.com)<b><?php echo $suffix; ?></b>
252
+ <?php } else { ?>
253
+ Email with Domain (Eg: gmail.com)
254
  <?php } ?>
255
  </option>
256
  </optgroup>
view/view-pricing-rules.php CHANGED
@@ -160,7 +160,7 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
160
  </div>
161
  <?php $is_cumulative_for_products = (isset($data->is_cumulative_for_products))? $data->is_cumulative_for_products : 0 ?>
162
  <div class="form-group" id="cumulative_for_products_cont">
163
- <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">Is Cumulative</label>
164
  </div>
165
  <div class="form-group" id="category_list">
166
  <?php $category_list = json_decode((isset($data->category_to_apply) ? $data->category_to_apply : '{}'), true); ?>
@@ -172,10 +172,10 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
172
  <?php } ?>
173
  </select>
174
  <?php $is_cumulative = (isset($data->is_cumulative))? $data->is_cumulative : 0 ?>
175
- <input type="checkbox" name="is_cumulative" id="is_cumulative" value="1" <?php if($is_cumulative) { echo "checked"; } ?>> <label class="checkbox_label" for="is_cumulative">Is Cumulative</label>
176
  <div class="apply_child_categories">
177
  <?php $apply_child_categories = (isset($data->apply_child_categories))? $data->apply_child_categories : 0 ?>
178
- <input type="checkbox" name="apply_child_categories" id="apply_child_categories" value="1" <?php if($apply_child_categories) { echo "checked"; } ?>> <label class="checkbox_label" for="apply_child_categories">Apply Child Categories</label>
179
  </div>
180
  </div>
181
  </div>
@@ -237,7 +237,7 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
237
  <?php
238
  if($pro){
239
  $roles_list = json_decode((isset($data->user_roles_to_apply) ? $data->user_roles_to_apply : '{}'), true); ?>
240
- <select class="roles_list selectpicker" id="product_roles_list" multiple name="user_roles_to_apply[]">
241
  <?php foreach ($userRoles as $index => $user) { ?>
242
  <option value="<?php echo $index; ?>"<?php if (in_array($index, $roles_list)) { ?> selected=selected <?php } ?>><?php echo $user; ?></option>
243
  <?php } ?>
@@ -266,7 +266,7 @@ $isPro = (new FlycartWooDiscountRulesPurchase())->isPro();
266
  $coupons_to_apply = isset($data->coupons_to_apply) ? $data->coupons_to_apply : '';
267
  ?>
268
  <select class="selectpicker" id="coupon_option_price_rule" name="coupons_to_apply_option">
269
- <option value="none"<?php if ($coupons_to_apply_option == 'none') { ?> selected=selected <?php } ?>><?php esc_html_e('None selected', 'woo-discount-rules'); ?></option>
270
  <option value="any_selected"<?php if ($coupons_to_apply_option == 'any_selected') { ?> selected=selected <?php } ?>><?php esc_html_e('Apply if any one coupon applied', 'woo-discount-rules'); ?></option>
271
  <option value="all_selected"<?php if ($coupons_to_apply_option == 'all_selected') { ?> selected=selected <?php } ?>><?php esc_html_e('Apply if all coupon applied', 'woo-discount-rules'); ?></option>
272
  </select>
160
  </div>
161
  <?php $is_cumulative_for_products = (isset($data->is_cumulative_for_products))? $data->is_cumulative_for_products : 0 ?>
162
  <div class="form-group" id="cumulative_for_products_cont">
163
+ <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">Check this box to count quantities cumulatively across products</label>
164
  </div>
165
  <div class="form-group" id="category_list">
166
  <?php $category_list = json_decode((isset($data->category_to_apply) ? $data->category_to_apply : '{}'), true); ?>
172
  <?php } ?>
173
  </select>
174
  <?php $is_cumulative = (isset($data->is_cumulative))? $data->is_cumulative : 0 ?>
175
+ <input type="checkbox" name="is_cumulative" id="is_cumulative" value="1" <?php if($is_cumulative) { echo "checked"; } ?>> <label class="checkbox_label" for="is_cumulative">Check this box to count quantities cumulatively across category(ies)</label>
176
  <div class="apply_child_categories">
177
  <?php $apply_child_categories = (isset($data->apply_child_categories))? $data->apply_child_categories : 0 ?>
178
+ <input type="checkbox" name="apply_child_categories" id="apply_child_categories" value="1" <?php if($apply_child_categories) { echo "checked"; } ?>> <label class="checkbox_label" for="apply_child_categories">Check this box to apply child category(ies)</label>
179
  </div>
180
  </div>
181
  </div>
237
  <?php
238
  if($pro){
239
  $roles_list = json_decode((isset($data->user_roles_to_apply) ? $data->user_roles_to_apply : '{}'), true); ?>
240
+ <select class="roles_list selectpicker" id="product_roles_list" multiple name="user_roles_to_apply[]" title="Do not use">
241
  <?php foreach ($userRoles as $index => $user) { ?>
242
  <option value="<?php echo $index; ?>"<?php if (in_array($index, $roles_list)) { ?> selected=selected <?php } ?>><?php echo $user; ?></option>
243
  <?php } ?>
266
  $coupons_to_apply = isset($data->coupons_to_apply) ? $data->coupons_to_apply : '';
267
  ?>
268
  <select class="selectpicker" id="coupon_option_price_rule" name="coupons_to_apply_option">
269
+ <option value="none"<?php if ($coupons_to_apply_option == 'none') { ?> selected=selected <?php } ?>><?php esc_html_e('Do not use', 'woo-discount-rules'); ?></option>
270
  <option value="any_selected"<?php if ($coupons_to_apply_option == 'any_selected') { ?> selected=selected <?php } ?>><?php esc_html_e('Apply if any one coupon applied', 'woo-discount-rules'); ?></option>
271
  <option value="all_selected"<?php if ($coupons_to_apply_option == 'all_selected') { ?> selected=selected <?php } ?>><?php esc_html_e('Apply if all coupon applied', 'woo-discount-rules'); ?></option>
272
  </select>
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.5.7
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Requires at least: 4.6.1
5
  * Description: Simple Discount Rules for WooCommerce.
6
  * Author: Flycart Technologies LLP
7
  * Author URI: https://www.flycart.org
8
+ * Version: 1.5.8
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Requires at least: 4.6.1