Discount Rules for WooCommerce - Version 1.4.25

Version Description

  • 17/11/17 =
  • Fix Error occurred in Woocommerce product list PRO
Download this release

Release Info

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

Code changes from version 1.4.24 to 1.4.25

includes/pricing-rules-3.php CHANGED
@@ -745,6 +745,7 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
745
  $range = is_array($discount_range) ? (object) $discount_range : $discount_range;
746
  $min = (isset($range->min_qty) ? $range->min_qty : 0);
747
  $max = (isset($range->max_qty) ? $range->max_qty : false);
 
748
 
749
  $type = (isset($range->discount_type) ? $range->discount_type : 'price_discount');
750
 
@@ -1007,6 +1008,7 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
1007
  */
1008
  public function generateDiscountTableData($product)
1009
  {
 
1010
  $id = (($product->get_id() != 0 && $product->get_id() != null) ? $product->get_id() : 0);
1011
  if ($id == 0) return false;
1012
 
@@ -1110,11 +1112,11 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
1110
  $html .= '<tr>';
1111
  if (isset($base_config['show_discount_title_table'])) {
1112
  if ($base_config['show_discount_title_table'] == 'show') {
1113
- $html .= '<td>Name</td>';
1114
  }
1115
  }
1116
- $html .= '<td>Range</td>';
1117
- $html .= '<td>Discount</td>';
1118
  $html .= '</tr>
1119
  </thead>
1120
  <tbody>';
@@ -1127,6 +1129,7 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
1127
  $title = isset($value->title) ? $value->title : '';
1128
  $min = isset($value->min_qty) ? $value->min_qty : 0;
1129
  $max = isset($value->max_qty) ? $value->max_qty : 0;
 
1130
  $discount_type = isset($value->discount_type) ? $value->discount_type : 0;
1131
  $to_discount = isset($value->to_discount) ? $value->to_discount : 0;
1132
  $product_discount = isset($value->discount_product) ? $value->discount_product : array();
@@ -1160,7 +1163,7 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
1160
  }
1161
  }
1162
  if (!$have_discount) {
1163
- $html .= '<tr><td colspan="2">No Active Discounts.</td></tr>';
1164
  }
1165
  $html .= '</tbody>';
1166
  $html .= '</table>';
745
  $range = is_array($discount_range) ? (object) $discount_range : $discount_range;
746
  $min = (isset($range->min_qty) ? $range->min_qty : 0);
747
  $max = (isset($range->max_qty) ? $range->max_qty : false);
748
+ if($max == 0 || $max == '' || $max == false) $max = 999;
749
 
750
  $type = (isset($range->discount_type) ? $range->discount_type : 'price_discount');
751
 
1008
  */
1009
  public function generateDiscountTableData($product)
1010
  {
1011
+ global $product;
1012
  $id = (($product->get_id() != 0 && $product->get_id() != null) ? $product->get_id() : 0);
1013
  if ($id == 0) return false;
1014
 
1112
  $html .= '<tr>';
1113
  if (isset($base_config['show_discount_title_table'])) {
1114
  if ($base_config['show_discount_title_table'] == 'show') {
1115
+ $html .= '<td>'.esc_html__('Name', 'woo-discount-rules').'</td>';
1116
  }
1117
  }
1118
+ $html .= '<td>'.esc_html__('Range', 'woo-discount-rules').'</td>';
1119
+ $html .= '<td>'.esc_html__('Discount', 'woo-discount-rules').'</td>';
1120
  $html .= '</tr>
1121
  </thead>
1122
  <tbody>';
1129
  $title = isset($value->title) ? $value->title : '';
1130
  $min = isset($value->min_qty) ? $value->min_qty : 0;
1131
  $max = isset($value->max_qty) ? $value->max_qty : 0;
1132
+ if($max == 0 || $max == '' || $max == false) $max = 999;
1133
  $discount_type = isset($value->discount_type) ? $value->discount_type : 0;
1134
  $to_discount = isset($value->to_discount) ? $value->to_discount : 0;
1135
  $product_discount = isset($value->discount_product) ? $value->discount_product : array();
1163
  }
1164
  }
1165
  if (!$have_discount) {
1166
+ $html .= '<tr><td colspan="2">'.esc_html__('No Active Discounts.', 'woo-discount-rules').'</td></tr>';
1167
  }
1168
  $html .= '</tbody>';
1169
  $html .= '</table>';
includes/pricing-rules.php CHANGED
@@ -707,6 +707,7 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
707
  $range = is_array($discount_range) ? (object) $discount_range : $discount_range;
708
  $min = (isset($range->min_qty) ? $range->min_qty : 0);
709
  $max = (isset($range->max_qty) ? $range->max_qty : false);
 
710
 
711
  $type = (isset($range->discount_type) ? $range->discount_type : 'price_discount');
712
 
@@ -969,6 +970,7 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
969
  */
970
  public function generateDiscountTableData($product)
971
  {
 
972
  $id = ((isset($product->id) && $product->id != 0 && $product->id != null) ? $product->id : 0);
973
  if ($id == 0) return false;
974
 
@@ -1072,11 +1074,11 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
1072
  $html .= '<tr>';
1073
  if (isset($base_config['show_discount_title_table'])) {
1074
  if ($base_config['show_discount_title_table'] == 'show') {
1075
- $html .= '<td>Name</td>';
1076
  }
1077
  }
1078
- $html .= '<td>Range</td>';
1079
- $html .= '<td>Discount</td>';
1080
  $html .= '</tr>
1081
  </thead>
1082
  <tbody>';
@@ -1089,6 +1091,7 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
1089
  $title = isset($value->title) ? $value->title : '';
1090
  $min = isset($value->min_qty) ? $value->min_qty : 0;
1091
  $max = isset($value->max_qty) ? $value->max_qty : 0;
 
1092
  $discount_type = isset($value->discount_type) ? $value->discount_type : 0;
1093
  $to_discount = isset($value->to_discount) ? $value->to_discount : 0;
1094
  $product_discount = isset($value->discount_product) ? $value->discount_product : array();
@@ -1120,7 +1123,7 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
1120
  }
1121
  }
1122
  if (!$have_discount) {
1123
- $html .= '<tr><td colspan="2">No Active Discounts.</td></tr>';
1124
  }
1125
  $html .= '</tbody>';
1126
  $html .= '</table>';
707
  $range = is_array($discount_range) ? (object) $discount_range : $discount_range;
708
  $min = (isset($range->min_qty) ? $range->min_qty : 0);
709
  $max = (isset($range->max_qty) ? $range->max_qty : false);
710
+ if($max == 0 || $max == '' || $max == false) $max = 999;
711
 
712
  $type = (isset($range->discount_type) ? $range->discount_type : 'price_discount');
713
 
970
  */
971
  public function generateDiscountTableData($product)
972
  {
973
+ global $product;
974
  $id = ((isset($product->id) && $product->id != 0 && $product->id != null) ? $product->id : 0);
975
  if ($id == 0) return false;
976
 
1074
  $html .= '<tr>';
1075
  if (isset($base_config['show_discount_title_table'])) {
1076
  if ($base_config['show_discount_title_table'] == 'show') {
1077
+ $html .= '<td>'.esc_html__('Name', 'woo-discount-rules').'</td>';
1078
  }
1079
  }
1080
+ $html .= '<td>'.esc_html__('Range', 'woo-discount-rules').'</td>';
1081
+ $html .= '<td>'.esc_html__('Discount', 'woo-discount-rules').'</td>';
1082
  $html .= '</tr>
1083
  </thead>
1084
  <tbody>';
1091
  $title = isset($value->title) ? $value->title : '';
1092
  $min = isset($value->min_qty) ? $value->min_qty : 0;
1093
  $max = isset($value->max_qty) ? $value->max_qty : 0;
1094
+ if($max == 0 || $max == '' || $max == false) $max = 999;
1095
  $discount_type = isset($value->discount_type) ? $value->discount_type : 0;
1096
  $to_discount = isset($value->to_discount) ? $value->to_discount : 0;
1097
  $product_discount = isset($value->discount_product) ? $value->discount_product : array();
1123
  }
1124
  }
1125
  if (!$have_discount) {
1126
+ $html .= '<tr><td colspan="2">'.esc_html__('No Active Discounts.', 'woo-discount-rules').'</td></tr>';
1127
  }
1128
  $html .= '</tbody>';
1129
  $html .= '</table>';
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: flycart
3
  Donate link: https://flycart.org/
4
  Tags: woocommerce, ecommerce, discounts, coupons, promotion, campaigns, sales, price rules, advanced coupons, advanced discounts
5
  Requires at least: 4.4.1
6
- Tested up to: 4.8.3
7
- Stable tag: 1.4.24
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -176,6 +176,9 @@ Discount - Enter minimum & Maximum quantity -> Adjustment Type -> Product Discou
176
 
177
  == Changelog ==
178
 
 
 
 
179
  = 1.4.24 - 13/11/17 =
180
  * Feature – Show discount price in product page
181
  * Feature – Discount based on Purchase history for pro version
3
  Donate link: https://flycart.org/
4
  Tags: woocommerce, ecommerce, discounts, coupons, promotion, campaigns, sales, price rules, advanced coupons, advanced discounts
5
  Requires at least: 4.4.1
6
+ Tested up to: 4.9
7
+ Stable tag: 1.4.25
8
  License: GPLv3 or later
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
176
 
177
  == Changelog ==
178
 
179
+ = 1.4.25 - 17/11/17 =
180
+ * Fix – Error occurred in Woocommerce product list PRO
181
+
182
  = 1.4.24 - 13/11/17 =
183
  * Feature – Show discount price in product page
184
  * Feature – Discount based on Purchase history for pro version
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.4.24
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.4.25
9
  * Slug: woo-discount-rules
10
  * Text Domain: woo-discount-rules
11
  * Requires at least: 4.6.1