Version Description
- 11/04/17 =
- Fix Warning in pricing table
Download this release
Release Info
Developer | flycart |
Plugin | Discount Rules for WooCommerce |
Version | 1.4.11 |
Comparing to | |
See all releases |
Code changes from version 1.4.10 to 1.4.11
- includes/pricing-rules-3.php +43 -41
- includes/pricing-rules.php +43 -41
- readme.txt +4 -1
- woo-discount-rules.php +1 -1
includes/pricing-rules-3.php
CHANGED
@@ -873,62 +873,64 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
|
|
873 |
$this->organizeRules();
|
874 |
|
875 |
$discount_range = array();
|
876 |
-
|
877 |
-
$
|
878 |
-
|
879 |
-
// Check with Active User Filter.
|
880 |
-
if (isset($rule->customer)) {
|
881 |
$status = false;
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
$
|
886 |
-
$
|
887 |
-
if (count(array_intersect($users, array($user_id))) > 0) {
|
888 |
$status = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
889 |
}
|
890 |
}
|
891 |
-
}
|
892 |
-
|
893 |
-
if ($rule->apply_to == 'specific_products') {
|
894 |
|
895 |
-
|
896 |
-
|
|
|
|
|
897 |
|
898 |
-
|
899 |
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
|
|
904 |
}
|
905 |
-
}
|
906 |
-
} elseif ($rule->apply_to == 'specific_category') {
|
907 |
|
908 |
-
|
909 |
-
|
910 |
|
911 |
-
|
912 |
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
|
|
922 |
}
|
923 |
-
}
|
924 |
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
|
929 |
|
930 |
-
|
931 |
-
|
|
|
932 |
}
|
933 |
}
|
934 |
return $discount_range;
|
873 |
$this->organizeRules();
|
874 |
|
875 |
$discount_range = array();
|
876 |
+
if(is_array($this->rules) && count($this->rules) > 0) {
|
877 |
+
foreach ($this->rules as $index => $rule) {
|
|
|
|
|
|
|
878 |
$status = false;
|
879 |
+
|
880 |
+
// Check with Active User Filter.
|
881 |
+
if (isset($rule->customer)) {
|
882 |
+
$status = false;
|
883 |
+
if ($rule->customer == 'all') {
|
|
|
884 |
$status = true;
|
885 |
+
} else {
|
886 |
+
$users = (is_string($rule->users_to_apply) ? json_decode($rule->users_to_apply, true) : array());
|
887 |
+
$user_id = get_current_user_id();
|
888 |
+
if (count(array_intersect($users, array($user_id))) > 0) {
|
889 |
+
$status = true;
|
890 |
+
}
|
891 |
}
|
892 |
}
|
|
|
|
|
|
|
893 |
|
894 |
+
if ($rule->apply_to == 'specific_products') {
|
895 |
+
|
896 |
+
// Check with Product Filter.
|
897 |
+
$products_to_apply = json_decode($rule->product_to_apply);
|
898 |
|
899 |
+
if ($rule->product_to_apply == null) $status = true;
|
900 |
|
901 |
+
if ($rule->product_to_apply != null) {
|
902 |
+
$status = false;
|
903 |
+
if (array_intersect($products_to_apply, array($id)) > 0) {
|
904 |
+
$status = true;
|
905 |
+
}
|
906 |
}
|
907 |
+
} elseif ($rule->apply_to == 'specific_category') {
|
|
|
908 |
|
909 |
+
// Check with Product Category Filter.
|
910 |
+
$category = woo_dicount_rules_generalHelper::getCategoryByPost($id, true);
|
911 |
|
912 |
+
if ($rule->category_to_apply == null) $status = true;
|
913 |
|
914 |
+
if ($rule->category_to_apply != null) {
|
915 |
+
$category_to_apply = json_decode($rule->category_to_apply);
|
916 |
+
if (isset($rule->apply_child_categories) && $rule->apply_child_categories == 1) {
|
917 |
+
$category_to_apply = $this->getAllSubCategories($category_to_apply);
|
918 |
+
}
|
919 |
+
woo_dicount_rules_generalHelper::toInt($category_to_apply);
|
920 |
+
$status = false;
|
921 |
+
if (count(array_intersect($category_to_apply, $category)) > 0) {
|
922 |
+
$status = true;
|
923 |
+
}
|
924 |
}
|
|
|
925 |
|
926 |
+
} else if ($rule->apply_to == 'all_products') {
|
927 |
+
$status = true;
|
928 |
+
}
|
929 |
|
930 |
|
931 |
+
if ($status) {
|
932 |
+
$discount_range[] = (isset($rule->discount_range) ? json_decode($rule->discount_range) : array());
|
933 |
+
}
|
934 |
}
|
935 |
}
|
936 |
return $discount_range;
|
includes/pricing-rules.php
CHANGED
@@ -873,62 +873,64 @@ if (!class_exists('woo_dicount_rules_pricingRules')) {
|
|
873 |
$this->organizeRules();
|
874 |
|
875 |
$discount_range = array();
|
876 |
-
|
877 |
-
$
|
878 |
-
|
879 |
-
// Check with Active User Filter.
|
880 |
-
if (isset($rule->customer)) {
|
881 |
$status = false;
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
$
|
886 |
-
$
|
887 |
-
if (count(array_intersect($users, array($user_id))) > 0) {
|
888 |
$status = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
889 |
}
|
890 |
}
|
891 |
-
}
|
892 |
-
|
893 |
-
if ($rule->apply_to == 'specific_products') {
|
894 |
|
895 |
-
|
896 |
-
|
|
|
|
|
897 |
|
898 |
-
|
899 |
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
|
|
904 |
}
|
905 |
-
}
|
906 |
-
} elseif ($rule->apply_to == 'specific_category') {
|
907 |
|
908 |
-
|
909 |
-
|
910 |
|
911 |
-
|
912 |
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
|
|
|
922 |
}
|
923 |
-
}
|
924 |
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
|
929 |
|
930 |
-
|
931 |
-
|
|
|
932 |
}
|
933 |
}
|
934 |
return $discount_range;
|
873 |
$this->organizeRules();
|
874 |
|
875 |
$discount_range = array();
|
876 |
+
if(is_array($this->rules) && count($this->rules) > 0){
|
877 |
+
foreach ($this->rules as $index => $rule) {
|
|
|
|
|
|
|
878 |
$status = false;
|
879 |
+
|
880 |
+
// Check with Active User Filter.
|
881 |
+
if (isset($rule->customer)) {
|
882 |
+
$status = false;
|
883 |
+
if ($rule->customer == 'all') {
|
|
|
884 |
$status = true;
|
885 |
+
} else {
|
886 |
+
$users = (is_string($rule->users_to_apply) ? json_decode($rule->users_to_apply, true) : array());
|
887 |
+
$user_id = get_current_user_id();
|
888 |
+
if (count(array_intersect($users, array($user_id))) > 0) {
|
889 |
+
$status = true;
|
890 |
+
}
|
891 |
}
|
892 |
}
|
|
|
|
|
|
|
893 |
|
894 |
+
if ($rule->apply_to == 'specific_products') {
|
895 |
+
|
896 |
+
// Check with Product Filter.
|
897 |
+
$products_to_apply = json_decode($rule->product_to_apply);
|
898 |
|
899 |
+
if ($rule->product_to_apply == null) $status = true;
|
900 |
|
901 |
+
if ($rule->product_to_apply != null) {
|
902 |
+
$status = false;
|
903 |
+
if (array_intersect($products_to_apply, array($id)) > 0) {
|
904 |
+
$status = true;
|
905 |
+
}
|
906 |
}
|
907 |
+
} elseif ($rule->apply_to == 'specific_category') {
|
|
|
908 |
|
909 |
+
// Check with Product Category Filter.
|
910 |
+
$category = woo_dicount_rules_generalHelper::getCategoryByPost($id, true);
|
911 |
|
912 |
+
if ($rule->category_to_apply == null) $status = true;
|
913 |
|
914 |
+
if ($rule->category_to_apply != null) {
|
915 |
+
$category_to_apply = json_decode($rule->category_to_apply);
|
916 |
+
if(isset($rule->apply_child_categories) && $rule->apply_child_categories == 1){
|
917 |
+
$category_to_apply = $this->getAllSubCategories($category_to_apply);
|
918 |
+
}
|
919 |
+
woo_dicount_rules_generalHelper::toInt($category_to_apply);
|
920 |
+
$status = false;
|
921 |
+
if (count(array_intersect($category_to_apply, $category)) > 0) {
|
922 |
+
$status = true;
|
923 |
+
}
|
924 |
}
|
|
|
925 |
|
926 |
+
} else if ($rule->apply_to == 'all_products') {
|
927 |
+
$status = true;
|
928 |
+
}
|
929 |
|
930 |
|
931 |
+
if ($status) {
|
932 |
+
$discount_range[] = (isset($rule->discount_range) ? json_decode($rule->discount_range) : array());
|
933 |
+
}
|
934 |
}
|
935 |
}
|
936 |
return $discount_range;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ 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.7
|
7 |
-
Stable tag: 1.4.
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
@@ -110,6 +110,9 @@ More information could be found in the documentation
|
|
110 |
5. Discounted price is applied in the Cart
|
111 |
|
112 |
== Changelog ==
|
|
|
|
|
|
|
113 |
= 1.4.10 - 10/04/17 =
|
114 |
* WooCommerce 3.0 compatibility added
|
115 |
|
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.7
|
7 |
+
Stable tag: 1.4.11
|
8 |
License: GPLv3 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-3.0.html
|
10 |
|
110 |
5. Discounted price is applied in the Cart
|
111 |
|
112 |
== Changelog ==
|
113 |
+
= 1.4.11 - 11/04/17 =
|
114 |
+
* Fix – Warning in pricing table
|
115 |
+
|
116 |
= 1.4.10 - 10/04/17 =
|
117 |
* WooCommerce 3.0 compatibility added
|
118 |
|
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.
|
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.11
|
9 |
* Slug: woo-discount-rules
|
10 |
* Text Domain: woo-discount-rules
|
11 |
* Requires at least: 4.6.1
|