Version Description
Fixed an exclude filter issue (Thanks @Fabrice for reporting and solving!)
Download this release
Release Info
Developer | jorisverwater |
Plugin | Product Feed PRO for WooCommerce |
Version | 9.3.3 |
Comparing to | |
See all releases |
Code changes from version 9.3.2 to 9.3.3
- classes/class-get-products.php +414 -438
- js/woosea_key.js +1 -1
- readme.txt +7 -1
- woocommerce-sea.php +2 -2
classes/class-get-products.php
CHANGED
@@ -4906,236 +4906,135 @@ class WooSEA_Get_Products {
|
|
4906 |
$pr_array['attribute'] = "raw_categories";
|
4907 |
}
|
4908 |
|
4909 |
-
if(array_key_exists($pr_array['attribute'], $product_data)){
|
4910 |
|
4911 |
-
|
4912 |
-
|
|
|
4913 |
|
4914 |
-
|
|
|
4915 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4916 |
if($pd_key == "price"){
|
4917 |
-
|
4918 |
-
$pd_value = wc_format_decimal($pd_value);
|
4919 |
}
|
4920 |
-
|
4921 |
-
if (is_numeric($pd_value)){
|
4922 |
-
$old_value = $pd_value;
|
4923 |
-
if($pd_key == "price"){
|
4924 |
-
$pd_value = @number_format($pd_value,2);
|
4925 |
-
}
|
4926 |
|
4927 |
-
|
4928 |
-
|
4929 |
-
|
4930 |
-
|
4931 |
-
|
4932 |
-
|
4933 |
-
|
4934 |
-
|
4935 |
-
|
4936 |
-
|
4937 |
-
|
4938 |
-
|
4939 |
-
|
4940 |
-
|
4941 |
-
|
4942 |
-
|
4943 |
-
|
4944 |
-
|
4945 |
-
|
4946 |
-
|
4947 |
-
|
4948 |
-
|
4949 |
-
|
4950 |
-
|
4951 |
-
|
4952 |
-
|
4953 |
-
|
4954 |
-
}
|
4955 |
-
} elseif (($old_value == $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4956 |
-
$allowed = 0;
|
4957 |
-
}
|
4958 |
-
break;
|
4959 |
-
case($pr_array['condition'] = ">"):
|
4960 |
-
if (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4961 |
-
$allowed = 0;
|
4962 |
-
} elseif (($old_value <= $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4963 |
-
$allowed = 0;
|
4964 |
-
}
|
4965 |
-
break;
|
4966 |
-
case($pr_array['condition'] = ">="):
|
4967 |
-
if (($old_value >= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4968 |
-
$allowed = 0;
|
4969 |
-
} elseif (($old_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4970 |
-
$allowed = 0;
|
4971 |
-
}
|
4972 |
-
break;
|
4973 |
-
case($pr_array['condition'] = "<"):
|
4974 |
-
if (($old_value < $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4975 |
-
$allowed = 0;
|
4976 |
-
} elseif (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4977 |
-
$allowed = 0;
|
4978 |
-
}
|
4979 |
-
break;
|
4980 |
-
case($pr_array['condition'] = "=<"):
|
4981 |
-
if (($old_value <= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4982 |
-
$allowed = 0;
|
4983 |
-
} elseif (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4984 |
-
$allowed = 0;
|
4985 |
-
}
|
4986 |
-
break;
|
4987 |
-
case($pr_array['condition'] = "empty"):
|
4988 |
-
if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
|
4989 |
-
$allowed = 0;
|
4990 |
-
} elseif ((strlen($pd_value > 0)) && ($pr_array['than'] == "include_only")){
|
4991 |
-
$allowed = 0;
|
4992 |
-
}
|
4993 |
-
break;
|
4994 |
-
default:
|
4995 |
-
break;
|
4996 |
-
}
|
4997 |
-
} elseif (is_array($pd_value)){
|
4998 |
-
// Tis can either be a shipping or product_tag array
|
4999 |
-
if($pr_array['attribute'] == "product_tag"){
|
5000 |
-
$in_tag_array = "not";
|
5001 |
-
|
5002 |
-
foreach($pd_value as $pt_key => $pt_value){
|
5003 |
-
// Rules for string values
|
5004 |
-
if (!array_key_exists('cs', $pr_array)){
|
5005 |
-
$pt_value = strtolower($pt_value);
|
5006 |
-
$pr_array['criteria'] = strtolower($pr_array['criteria']);
|
5007 |
-
}
|
5008 |
-
|
5009 |
-
if(preg_match('/'.$pr_array['criteria'].'/', $pt_value)){
|
5010 |
-
$in_tag_array = "yes";
|
5011 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5012 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5013 |
|
5014 |
-
|
5015 |
-
|
5016 |
-
|
5017 |
-
|
5018 |
-
|
5019 |
-
|
5020 |
-
|
5021 |
-
if($pr_array['than'] == "include_only"){
|
5022 |
-
if($allowed <> 0){
|
5023 |
-
$allowed = 1;
|
5024 |
-
}
|
5025 |
-
} else {
|
5026 |
-
$allowed = 0;
|
5027 |
-
}
|
5028 |
-
} else {
|
5029 |
-
$allowed = 0;
|
5030 |
-
}
|
5031 |
-
break;
|
5032 |
-
case($pr_array['condition'] = "containsnot"):
|
5033 |
-
if ((!preg_match('/'.$pr_array['criteria'].'/', $v))){
|
5034 |
-
if($pr_array['than'] == "include_only"){
|
5035 |
-
if($allowed <> 0){
|
5036 |
-
$allowed = 1;
|
5037 |
-
}
|
5038 |
-
} else {
|
5039 |
-
$allowed = 0;
|
5040 |
-
}
|
5041 |
-
} else {
|
5042 |
-
$allowed = 0;
|
5043 |
-
}
|
5044 |
-
break;
|
5045 |
-
case($pr_array['condition'] = "="):
|
5046 |
-
if (($v == $pr_array['criteria'])){
|
5047 |
-
if($pr_array['than'] == "include_only"){
|
5048 |
-
if($allowed <> 0){
|
5049 |
-
$allowed = 1;
|
5050 |
-
}
|
5051 |
-
} else {
|
5052 |
-
$allowed = 0;
|
5053 |
-
}
|
5054 |
-
} else {
|
5055 |
-
$allowed = 0;
|
5056 |
-
}
|
5057 |
-
break;
|
5058 |
-
case($pr_array['condition'] = "!="):
|
5059 |
-
if (($v != $pr_array['criteria'])){
|
5060 |
-
if($pr_array['than'] == "include_only"){
|
5061 |
-
if($allowed <> 0){
|
5062 |
-
$allowed = 1;
|
5063 |
-
}
|
5064 |
-
} else {
|
5065 |
-
$allowed = 0;
|
5066 |
-
}
|
5067 |
-
}
|
5068 |
-
break;
|
5069 |
-
case($pr_array['condition'] = ">"):
|
5070 |
-
if (($v > $pr_array['criteria'])){
|
5071 |
-
if($pr_array['than'] == "include_only"){
|
5072 |
-
if($allowed <> 0){
|
5073 |
-
$allowed = 1;
|
5074 |
-
}
|
5075 |
-
} else {
|
5076 |
-
$allowed = 0;
|
5077 |
-
}
|
5078 |
-
}
|
5079 |
-
break;
|
5080 |
-
case($pr_array['condition'] = ">="):
|
5081 |
-
if (($v >= $pr_array['criteria'])){
|
5082 |
-
if($pr_array['than'] == "include_only"){
|
5083 |
-
if($allowed <> 0){
|
5084 |
-
$allowed = 1;
|
5085 |
-
}
|
5086 |
-
} else {
|
5087 |
-
$allowed = 0;
|
5088 |
-
}
|
5089 |
-
}
|
5090 |
-
break;
|
5091 |
-
case($pr_array['condition'] = "<"):
|
5092 |
-
if (($v < $pr_array['criteria'])){
|
5093 |
-
if($pr_array['than'] == "include_only"){
|
5094 |
-
if($allowed <> 0){
|
5095 |
-
$allowed = 1;
|
5096 |
-
}
|
5097 |
-
} else {
|
5098 |
-
$allowed = 0;
|
5099 |
-
}
|
5100 |
-
}
|
5101 |
-
break;
|
5102 |
-
case($pr_array['condition'] = "=<"):
|
5103 |
-
if (($v <= $pr_array['criteria'])){
|
5104 |
-
if($pr_array['than'] == "include_only"){
|
5105 |
-
if($allowed <> 0){
|
5106 |
-
$allowed = 1;
|
5107 |
-
}
|
5108 |
-
} else {
|
5109 |
-
$allowed = 0;
|
5110 |
-
}
|
5111 |
-
}
|
5112 |
-
break;
|
5113 |
-
case($pr_array['condition'] = "empty"):
|
5114 |
-
if (strlen($v) < 1){
|
5115 |
-
if($pr_array['than'] == "include_only"){
|
5116 |
-
if($allowed <> 0){
|
5117 |
-
$allowed = 1;
|
5118 |
-
}
|
5119 |
-
} else {
|
5120 |
-
$allowed = 0;
|
5121 |
-
}
|
5122 |
-
}
|
5123 |
-
break;
|
5124 |
-
default:
|
5125 |
-
break;
|
5126 |
-
}
|
5127 |
-
} else {
|
5128 |
-
switch ($pr_array['condition']) {
|
5129 |
-
case($pr_array['condition'] = "contains"):
|
5130 |
if($pr_array['than'] == "include_only"){
|
5131 |
-
$allowed = 0;
|
5132 |
-
} else {
|
5133 |
if($allowed <> 0){
|
5134 |
$allowed = 1;
|
5135 |
}
|
|
|
|
|
5136 |
}
|
5137 |
-
|
5138 |
-
|
|
|
|
|
|
|
|
|
5139 |
if($pr_array['than'] == "include_only"){
|
5140 |
if($allowed <> 0){
|
5141 |
$allowed = 1;
|
@@ -5143,17 +5042,25 @@ class WooSEA_Get_Products {
|
|
5143 |
} else {
|
5144 |
$allowed = 0;
|
5145 |
}
|
5146 |
-
|
5147 |
-
|
|
|
|
|
|
|
|
|
5148 |
if($pr_array['than'] == "include_only"){
|
5149 |
-
$allowed = 0;
|
5150 |
-
} else {
|
5151 |
if($allowed <> 0){
|
5152 |
$allowed = 1;
|
5153 |
}
|
|
|
|
|
5154 |
}
|
5155 |
-
|
5156 |
-
|
|
|
|
|
|
|
|
|
5157 |
if($pr_array['than'] == "include_only"){
|
5158 |
if($allowed <> 0){
|
5159 |
$allowed = 1;
|
@@ -5161,267 +5068,336 @@ class WooSEA_Get_Products {
|
|
5161 |
} else {
|
5162 |
$allowed = 0;
|
5163 |
}
|
5164 |
-
|
5165 |
-
|
|
|
|
|
5166 |
if($pr_array['than'] == "include_only"){
|
5167 |
-
$allowed
|
|
|
|
|
5168 |
} else {
|
5169 |
$allowed = 0;
|
5170 |
}
|
5171 |
-
|
5172 |
-
|
|
|
|
|
5173 |
if($pr_array['than'] == "include_only"){
|
5174 |
-
$allowed
|
|
|
|
|
5175 |
} else {
|
5176 |
$allowed = 0;
|
5177 |
}
|
5178 |
-
|
5179 |
-
|
|
|
|
|
5180 |
if($pr_array['than'] == "include_only"){
|
5181 |
-
$allowed
|
|
|
|
|
5182 |
} else {
|
5183 |
$allowed = 0;
|
5184 |
}
|
5185 |
-
|
5186 |
-
|
|
|
|
|
5187 |
if($pr_array['than'] == "include_only"){
|
5188 |
-
$allowed
|
|
|
|
|
5189 |
} else {
|
5190 |
$allowed = 0;
|
5191 |
}
|
5192 |
-
|
5193 |
-
|
|
|
|
|
5194 |
if($pr_array['than'] == "include_only"){
|
5195 |
-
if($allowed <> 0){
|
5196 |
$allowed = 1;
|
5197 |
}
|
5198 |
} else {
|
5199 |
-
|
5200 |
}
|
5201 |
-
|
5202 |
-
|
5203 |
-
|
5204 |
-
|
5205 |
}
|
5206 |
} else {
|
5207 |
-
|
5208 |
-
|
5209 |
-
|
5210 |
-
|
5211 |
-
|
5212 |
-
|
5213 |
-
|
5214 |
-
if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5215 |
-
$allowed = 0;
|
5216 |
-
}
|
5217 |
-
break;
|
5218 |
-
case($pr_array['condition'] = "containsnot"):
|
5219 |
-
if ((!preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5220 |
-
$allowed = 0;
|
5221 |
-
}
|
5222 |
-
break;
|
5223 |
-
case($pr_array['condition'] = "="):
|
5224 |
-
if (($vv == $pr_array['criteria'])){
|
5225 |
-
$allowed = 0;
|
5226 |
-
}
|
5227 |
-
break;
|
5228 |
-
case($pr_array['condition'] = "!="):
|
5229 |
-
if (($vv != $pr_array['criteria'])){
|
5230 |
-
$allowed = 0;
|
5231 |
-
}
|
5232 |
-
break;
|
5233 |
-
case($pr_array['condition'] = ">"):
|
5234 |
-
if (($vv > $pr_array['criteria'])){
|
5235 |
-
$allowed = 0;
|
5236 |
-
}
|
5237 |
-
break;
|
5238 |
-
case($pr_array['condition'] = ">="):
|
5239 |
-
if (($vv >= $pr_array['criteria'])){
|
5240 |
-
$allowed = 0;
|
5241 |
-
}
|
5242 |
-
break;
|
5243 |
-
case($pr_array['condition'] = "<"):
|
5244 |
-
if (($vv < $pr_array['criteria'])){
|
5245 |
-
$allowed = 0;
|
5246 |
-
}
|
5247 |
-
break;
|
5248 |
-
case($pr_array['condition'] = "=<"):
|
5249 |
-
if (($vv <= $pr_array['criteria'])){
|
5250 |
-
$allowed = 0;
|
5251 |
-
}
|
5252 |
-
break;
|
5253 |
-
case($pr_array['condition'] = "empty"):
|
5254 |
-
if (strlen($vv) < 1){
|
5255 |
-
$allowed = 0;
|
5256 |
-
}
|
5257 |
-
break;
|
5258 |
-
default:
|
5259 |
-
break;
|
5260 |
}
|
5261 |
}
|
5262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5263 |
}
|
5264 |
}
|
5265 |
} else {
|
5266 |
-
//
|
5267 |
-
|
5268 |
-
|
5269 |
-
|
5270 |
-
$
|
5271 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5272 |
}
|
5273 |
-
}
|
5274 |
-
$pos = strpos($pd_value, '&');
|
5275 |
-
$pos_slash = strpos($pr_array['criteria'], '\\');
|
5276 |
-
if($pos !== false){
|
5277 |
-
$pd_value = str_replace("&","&",$pd_value);
|
5278 |
}
|
5279 |
-
|
5280 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
5281 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5282 |
|
5283 |
-
|
5284 |
-
|
5285 |
-
|
5286 |
-
|
5287 |
-
|
5288 |
-
|
5289 |
-
|
5290 |
-
|
5291 |
-
|
5292 |
-
}
|
5293 |
-
}
|
5294 |
-
break;
|
5295 |
-
case($pr_array['condition'] = "containsnot"):
|
5296 |
-
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5297 |
-
$allowed = 0;
|
5298 |
-
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5299 |
-
$allowed = 0;
|
5300 |
}
|
5301 |
-
|
5302 |
-
|
5303 |
-
|
5304 |
-
|
5305 |
-
|
5306 |
-
|
5307 |
-
|
5308 |
-
|
5309 |
-
|
5310 |
-
|
5311 |
-
|
5312 |
-
|
5313 |
-
|
5314 |
-
|
5315 |
-
|
5316 |
-
|
5317 |
-
|
|
|
|
|
|
|
|
|
|
|
5318 |
}
|
5319 |
-
}
|
5320 |
-
|
5321 |
-
if($allowed <> 0){
|
5322 |
-
$allowed = 1;
|
5323 |
}
|
5324 |
}
|
5325 |
} else {
|
5326 |
-
$allowed
|
5327 |
-
|
5328 |
-
|
5329 |
-
if($allowed <> 0){
|
5330 |
-
$allowed = 1;
|
5331 |
-
}
|
5332 |
-
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5333 |
-
$allowed = 0;
|
5334 |
-
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5335 |
-
$allowed = 1;
|
5336 |
-
}
|
5337 |
-
break;
|
5338 |
-
case($pr_array['condition'] = "!="):
|
5339 |
-
if (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "exclude")){
|
5340 |
-
if($allowed <> 0){
|
5341 |
-
$allowed = 1;
|
5342 |
}
|
5343 |
-
}
|
5344 |
-
$allowed = 0;
|
5345 |
-
} elseif (($pr_array['criteria'] != "$pd_value") && ($pr_array['than'] == "exclude")){
|
5346 |
-
$allowed = 0;
|
5347 |
-
}
|
5348 |
-
break;
|
5349 |
-
case($pr_array['condition'] = ">"):
|
5350 |
-
// Use a lexical order on relational string operators
|
5351 |
-
if (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5352 |
-
$allowed = 0;
|
5353 |
-
} elseif (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5354 |
-
$allowed = 0;
|
5355 |
-
}
|
5356 |
-
break;
|
5357 |
-
case($pr_array['condition'] = ">="):
|
5358 |
-
// Use a lexical order on relational string operators
|
5359 |
-
if (($pd_value >= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5360 |
-
$allowed = 0;
|
5361 |
-
} elseif (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5362 |
-
$allowed = 0;
|
5363 |
-
}
|
5364 |
-
break;
|
5365 |
-
case($pr_array['condition'] = "<"):
|
5366 |
-
// Use a lexical order on relational string operators
|
5367 |
-
if (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5368 |
-
$allowed = 0;
|
5369 |
-
} elseif (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5370 |
$allowed = 0;
|
5371 |
}
|
5372 |
-
|
5373 |
-
|
5374 |
-
|
5375 |
-
if (($pd_value <= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5376 |
-
$allowed = 0;
|
5377 |
-
} elseif (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5378 |
-
$allowed = 0;
|
5379 |
}
|
5380 |
-
|
5381 |
-
|
5382 |
-
|
5383 |
-
|
5384 |
-
|
5385 |
-
|
5386 |
-
|
5387 |
-
|
5388 |
-
|
5389 |
-
$allowed =
|
5390 |
}
|
5391 |
-
|
5392 |
-
|
5393 |
-
|
5394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5395 |
}
|
5396 |
}
|
5397 |
}
|
5398 |
-
} else {
|
5399 |
-
// A empty rule has been set on an attribute that is not in a product anyhow. Still, remove this product from the feed
|
5400 |
-
if($pr_array['condition'] == "empty"){
|
5401 |
-
if($pr_array['than'] == "exclude"){
|
5402 |
-
$allowed = 0;
|
5403 |
-
} else {
|
5404 |
-
$allowed = 1;
|
5405 |
-
}
|
5406 |
-
} elseif($pr_array['condition'] == "="){
|
5407 |
-
if($pr_array['than'] == "exclude"){
|
5408 |
-
$allowed = 1;
|
5409 |
-
} else {
|
5410 |
-
$allowed = 0;
|
5411 |
-
}
|
5412 |
-
} elseif($pr_array['condition'] == "contains"){
|
5413 |
-
if($pr_array['than'] == "exclude"){
|
5414 |
-
$allowed = 1;
|
5415 |
-
} else {
|
5416 |
-
$allowed = 0;
|
5417 |
-
}
|
5418 |
-
} else {
|
5419 |
-
if($pr_array['than'] == "exclude"){
|
5420 |
-
$allowed = 0;
|
5421 |
-
} else {
|
5422 |
-
$allowed = 1;
|
5423 |
-
}
|
5424 |
-
}
|
5425 |
}
|
5426 |
}
|
5427 |
|
4906 |
$pr_array['attribute'] = "raw_categories";
|
4907 |
}
|
4908 |
|
4909 |
+
//if(array_key_exists($pr_array['attribute'], $product_data)){
|
4910 |
|
4911 |
+
if(!array_key_exists($pr_array['attribute'], $product_data)) {
|
4912 |
+
$product_data[$pr_array['attribute']] = ""; // Sets an empty postmeta value in place of a missing one.
|
4913 |
+
}
|
4914 |
|
4915 |
+
foreach ($product_data as $pd_key => $pd_value){
|
4916 |
+
// Check is there is a rule on specific attributes
|
4917 |
|
4918 |
+
if(in_array($pd_key, $pr_array, TRUE)){
|
4919 |
+
|
4920 |
+
if($pd_key == "price"){
|
4921 |
+
//$pd_value = @number_format($pd_value,2);
|
4922 |
+
$pd_value = wc_format_decimal($pd_value);
|
4923 |
+
}
|
4924 |
+
|
4925 |
+
if (is_numeric($pd_value)){
|
4926 |
+
$old_value = $pd_value;
|
4927 |
if($pd_key == "price"){
|
4928 |
+
$pd_value = @number_format($pd_value,2);
|
|
|
4929 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
4930 |
|
4931 |
+
// Rules for numeric values
|
4932 |
+
switch ($pr_array['condition']) {
|
4933 |
+
case($pr_array['condition'] = "contains"):
|
4934 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
4935 |
+
$allowed = 0;
|
4936 |
+
} elseif ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
4937 |
+
$allowed = 0;
|
4938 |
+
}
|
4939 |
+
break;
|
4940 |
+
case($pr_array['condition'] = "containsnot"):
|
4941 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
4942 |
+
$allowed = 0;
|
4943 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
4944 |
+
$allowed = 0;
|
4945 |
+
}
|
4946 |
+
break;
|
4947 |
+
case($pr_array['condition'] = "="):
|
4948 |
+
if (($old_value == $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4949 |
+
$allowed = 0;
|
4950 |
+
} elseif (($old_value != $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4951 |
+
$allowed = 0;
|
4952 |
+
}
|
4953 |
+
break;
|
4954 |
+
case($pr_array['condition'] = "!="):
|
4955 |
+
if (($old_value == $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4956 |
+
if($allowed <> 0){
|
4957 |
+
$allowed = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4958 |
}
|
4959 |
+
} elseif (($old_value == $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4960 |
+
$allowed = 0;
|
4961 |
+
}
|
4962 |
+
break;
|
4963 |
+
case($pr_array['condition'] = ">"):
|
4964 |
+
if (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4965 |
+
$allowed = 0;
|
4966 |
+
} elseif (($old_value <= $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4967 |
+
$allowed = 0;
|
4968 |
}
|
4969 |
+
break;
|
4970 |
+
case($pr_array['condition'] = ">="):
|
4971 |
+
if (($old_value >= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4972 |
+
$allowed = 0;
|
4973 |
+
} elseif (($old_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4974 |
+
$allowed = 0;
|
4975 |
+
}
|
4976 |
+
break;
|
4977 |
+
case($pr_array['condition'] = "<"):
|
4978 |
+
if (($old_value < $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4979 |
+
$allowed = 0;
|
4980 |
+
} elseif (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4981 |
+
$allowed = 0;
|
4982 |
+
}
|
4983 |
+
break;
|
4984 |
+
case($pr_array['condition'] = "=<"):
|
4985 |
+
if (($old_value <= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
4986 |
+
$allowed = 0;
|
4987 |
+
} elseif (($old_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
4988 |
+
$allowed = 0;
|
4989 |
+
}
|
4990 |
+
break;
|
4991 |
+
case($pr_array['condition'] = "empty"):
|
4992 |
+
if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
|
4993 |
+
$allowed = 0;
|
4994 |
+
} elseif ((strlen($pd_value > 0)) && ($pr_array['than'] == "include_only")){
|
4995 |
+
$allowed = 0;
|
4996 |
+
}
|
4997 |
+
break;
|
4998 |
+
default:
|
4999 |
+
break;
|
5000 |
+
}
|
5001 |
+
} elseif (is_array($pd_value)){
|
5002 |
+
// Tis can either be a shipping or product_tag array
|
5003 |
+
if($pr_array['attribute'] == "product_tag"){
|
5004 |
+
$in_tag_array = "not";
|
5005 |
+
|
5006 |
+
foreach($pd_value as $pt_key => $pt_value){
|
5007 |
+
// Rules for string values
|
5008 |
+
if (!array_key_exists('cs', $pr_array)){
|
5009 |
+
$pt_value = strtolower($pt_value);
|
5010 |
+
$pr_array['criteria'] = strtolower($pr_array['criteria']);
|
5011 |
+
}
|
5012 |
+
|
5013 |
+
if(preg_match('/'.$pr_array['criteria'].'/', $pt_value)){
|
5014 |
+
$in_tag_array = "yes";
|
5015 |
+
}
|
5016 |
+
}
|
5017 |
|
5018 |
+
if($in_tag_array == "yes"){
|
5019 |
+
//if(in_array($pr_array['criteria'], $pd_value, TRUE)) {
|
5020 |
+
$v = $pr_array['criteria'];
|
5021 |
+
|
5022 |
+
switch ($pr_array['condition']) {
|
5023 |
+
case($pr_array['condition'] = "contains"):
|
5024 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $v))){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5025 |
if($pr_array['than'] == "include_only"){
|
|
|
|
|
5026 |
if($allowed <> 0){
|
5027 |
$allowed = 1;
|
5028 |
}
|
5029 |
+
} else {
|
5030 |
+
$allowed = 0;
|
5031 |
}
|
5032 |
+
} else {
|
5033 |
+
$allowed = 0;
|
5034 |
+
}
|
5035 |
+
break;
|
5036 |
+
case($pr_array['condition'] = "containsnot"):
|
5037 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $v))){
|
5038 |
if($pr_array['than'] == "include_only"){
|
5039 |
if($allowed <> 0){
|
5040 |
$allowed = 1;
|
5042 |
} else {
|
5043 |
$allowed = 0;
|
5044 |
}
|
5045 |
+
} else {
|
5046 |
+
$allowed = 0;
|
5047 |
+
}
|
5048 |
+
break;
|
5049 |
+
case($pr_array['condition'] = "="):
|
5050 |
+
if (($v == $pr_array['criteria'])){
|
5051 |
if($pr_array['than'] == "include_only"){
|
|
|
|
|
5052 |
if($allowed <> 0){
|
5053 |
$allowed = 1;
|
5054 |
}
|
5055 |
+
} else {
|
5056 |
+
$allowed = 0;
|
5057 |
}
|
5058 |
+
} else {
|
5059 |
+
$allowed = 0;
|
5060 |
+
}
|
5061 |
+
break;
|
5062 |
+
case($pr_array['condition'] = "!="):
|
5063 |
+
if (($v != $pr_array['criteria'])){
|
5064 |
if($pr_array['than'] == "include_only"){
|
5065 |
if($allowed <> 0){
|
5066 |
$allowed = 1;
|
5068 |
} else {
|
5069 |
$allowed = 0;
|
5070 |
}
|
5071 |
+
}
|
5072 |
+
break;
|
5073 |
+
case($pr_array['condition'] = ">"):
|
5074 |
+
if (($v > $pr_array['criteria'])){
|
5075 |
if($pr_array['than'] == "include_only"){
|
5076 |
+
if($allowed <> 0){
|
5077 |
+
$allowed = 1;
|
5078 |
+
}
|
5079 |
} else {
|
5080 |
$allowed = 0;
|
5081 |
}
|
5082 |
+
}
|
5083 |
+
break;
|
5084 |
+
case($pr_array['condition'] = ">="):
|
5085 |
+
if (($v >= $pr_array['criteria'])){
|
5086 |
if($pr_array['than'] == "include_only"){
|
5087 |
+
if($allowed <> 0){
|
5088 |
+
$allowed = 1;
|
5089 |
+
}
|
5090 |
} else {
|
5091 |
$allowed = 0;
|
5092 |
}
|
5093 |
+
}
|
5094 |
+
break;
|
5095 |
+
case($pr_array['condition'] = "<"):
|
5096 |
+
if (($v < $pr_array['criteria'])){
|
5097 |
if($pr_array['than'] == "include_only"){
|
5098 |
+
if($allowed <> 0){
|
5099 |
+
$allowed = 1;
|
5100 |
+
}
|
5101 |
} else {
|
5102 |
$allowed = 0;
|
5103 |
}
|
5104 |
+
}
|
5105 |
+
break;
|
5106 |
+
case($pr_array['condition'] = "=<"):
|
5107 |
+
if (($v <= $pr_array['criteria'])){
|
5108 |
if($pr_array['than'] == "include_only"){
|
5109 |
+
if($allowed <> 0){
|
5110 |
+
$allowed = 1;
|
5111 |
+
}
|
5112 |
} else {
|
5113 |
$allowed = 0;
|
5114 |
}
|
5115 |
+
}
|
5116 |
+
break;
|
5117 |
+
case($pr_array['condition'] = "empty"):
|
5118 |
+
if (strlen($v) < 1){
|
5119 |
if($pr_array['than'] == "include_only"){
|
5120 |
+
if($allowed <> 0){
|
5121 |
$allowed = 1;
|
5122 |
}
|
5123 |
} else {
|
5124 |
+
$allowed = 0;
|
5125 |
}
|
5126 |
+
}
|
5127 |
+
break;
|
5128 |
+
default:
|
5129 |
+
break;
|
5130 |
}
|
5131 |
} else {
|
5132 |
+
switch ($pr_array['condition']) {
|
5133 |
+
case($pr_array['condition'] = "contains"):
|
5134 |
+
if($pr_array['than'] == "include_only"){
|
5135 |
+
$allowed = 0;
|
5136 |
+
} else {
|
5137 |
+
if($allowed <> 0){
|
5138 |
+
$allowed = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5139 |
}
|
5140 |
}
|
5141 |
+
break;
|
5142 |
+
case($pr_array['condition'] = "containsnot"):
|
5143 |
+
if($pr_array['than'] == "include_only"){
|
5144 |
+
if($allowed <> 0){
|
5145 |
+
$allowed = 1;
|
5146 |
+
}
|
5147 |
+
} else {
|
5148 |
+
$allowed = 0;
|
5149 |
+
}
|
5150 |
+
break;
|
5151 |
+
case($pr_array['condition'] = "="):
|
5152 |
+
if($pr_array['than'] == "include_only"){
|
5153 |
+
$allowed = 0;
|
5154 |
+
} else {
|
5155 |
+
if($allowed <> 0){
|
5156 |
+
$allowed = 1;
|
5157 |
+
}
|
5158 |
+
}
|
5159 |
+
break;
|
5160 |
+
case($pr_array['condition'] = "!="):
|
5161 |
+
if($pr_array['than'] == "include_only"){
|
5162 |
+
if($allowed <> 0){
|
5163 |
+
$allowed = 1;
|
5164 |
+
}
|
5165 |
+
} else {
|
5166 |
+
$allowed = 0;
|
5167 |
+
}
|
5168 |
+
break;
|
5169 |
+
case($pr_array['condition'] = ">"):
|
5170 |
+
if($pr_array['than'] == "include_only"){
|
5171 |
+
$allowed = 0;
|
5172 |
+
} else {
|
5173 |
+
$allowed = 0;
|
5174 |
+
}
|
5175 |
+
break;
|
5176 |
+
case($pr_array['condition'] = ">="):
|
5177 |
+
if($pr_array['than'] == "include_only"){
|
5178 |
+
$allowed = 0;
|
5179 |
+
} else {
|
5180 |
+
$allowed = 0;
|
5181 |
+
}
|
5182 |
+
break;
|
5183 |
+
case($pr_array['condition'] = "<"):
|
5184 |
+
if($pr_array['than'] == "include_only"){
|
5185 |
+
$allowed = 0;
|
5186 |
+
} else {
|
5187 |
+
$allowed = 0;
|
5188 |
+
}
|
5189 |
+
break;
|
5190 |
+
case($pr_array['condition'] = "=<"):
|
5191 |
+
if($pr_array['than'] == "include_only"){
|
5192 |
+
$allowed = 0;
|
5193 |
+
} else {
|
5194 |
+
$allowed = 0;
|
5195 |
+
}
|
5196 |
+
break;
|
5197 |
+
case($pr_array['condition'] = "empty"):
|
5198 |
+
if($pr_array['than'] == "include_only"){
|
5199 |
+
if($allowed <> 0){
|
5200 |
+
$allowed = 1;
|
5201 |
+
}
|
5202 |
+
} else {
|
5203 |
+
$allowed = 0;
|
5204 |
+
}
|
5205 |
+
break;
|
5206 |
+
default:
|
5207 |
+
break;
|
5208 |
}
|
5209 |
}
|
5210 |
} else {
|
5211 |
+
// For now only shipping details are in an array
|
5212 |
+
foreach ($pd_value as $k => $v){
|
5213 |
+
foreach ($v as $kk => $vv){
|
5214 |
+
// Only shipping detail rule can be on price for now
|
5215 |
+
if($kk == "price"){
|
5216 |
+
switch ($pr_array['condition']) {
|
5217 |
+
case($pr_array['condition'] = "contains"):
|
5218 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5219 |
+
$allowed = 0;
|
5220 |
+
}
|
5221 |
+
break;
|
5222 |
+
case($pr_array['condition'] = "containsnot"):
|
5223 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $vv))){
|
5224 |
+
$allowed = 0;
|
5225 |
+
}
|
5226 |
+
break;
|
5227 |
+
case($pr_array['condition'] = "="):
|
5228 |
+
if (($vv == $pr_array['criteria'])){
|
5229 |
+
$allowed = 0;
|
5230 |
+
}
|
5231 |
+
break;
|
5232 |
+
case($pr_array['condition'] = "!="):
|
5233 |
+
if (($vv != $pr_array['criteria'])){
|
5234 |
+
$allowed = 0;
|
5235 |
+
}
|
5236 |
+
break;
|
5237 |
+
case($pr_array['condition'] = ">"):
|
5238 |
+
if (($vv > $pr_array['criteria'])){
|
5239 |
+
$allowed = 0;
|
5240 |
+
}
|
5241 |
+
break;
|
5242 |
+
case($pr_array['condition'] = ">="):
|
5243 |
+
if (($vv >= $pr_array['criteria'])){
|
5244 |
+
$allowed = 0;
|
5245 |
+
}
|
5246 |
+
break;
|
5247 |
+
case($pr_array['condition'] = "<"):
|
5248 |
+
if (($vv < $pr_array['criteria'])){
|
5249 |
+
$allowed = 0;
|
5250 |
+
}
|
5251 |
+
break;
|
5252 |
+
case($pr_array['condition'] = "=<"):
|
5253 |
+
if (($vv <= $pr_array['criteria'])){
|
5254 |
+
$allowed = 0;
|
5255 |
+
}
|
5256 |
+
break;
|
5257 |
+
case($pr_array['condition'] = "empty"):
|
5258 |
+
if (strlen($vv) < 1){
|
5259 |
+
$allowed = 0;
|
5260 |
+
}
|
5261 |
+
break;
|
5262 |
+
default:
|
5263 |
+
break;
|
5264 |
+
}
|
5265 |
+
}
|
5266 |
}
|
|
|
|
|
|
|
|
|
|
|
5267 |
}
|
5268 |
+
}
|
5269 |
+
} else {
|
5270 |
+
// Filters for string values
|
5271 |
+
// If case-sensitve is off than lowercase both the criteria and attribute value
|
5272 |
+
if (array_key_exists('cs', $pr_array)){
|
5273 |
+
if ($pr_array['cs'] != "on"){
|
5274 |
+
$pd_value = strtolower($pd_value);
|
5275 |
+
$pr_array['criteria'] = strtolower($pr_array['criteria']);
|
5276 |
}
|
5277 |
+
}
|
5278 |
+
$pos = strpos($pd_value, '&');
|
5279 |
+
$pos_slash = strpos($pr_array['criteria'], '\\');
|
5280 |
+
if($pos !== false){
|
5281 |
+
$pd_value = str_replace("&","&",$pd_value);
|
5282 |
+
}
|
5283 |
+
if($pos_slash !== false){
|
5284 |
+
$pr_array['criteria'] = str_replace("\\","",$pr_array['criteria']);
|
5285 |
+
}
|
5286 |
|
5287 |
+
switch ($pr_array['condition']) {
|
5288 |
+
case($pr_array['condition'] = "contains"):
|
5289 |
+
if ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5290 |
+
$allowed = 0;
|
5291 |
+
} elseif ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5292 |
+
$allowed = 0;
|
5293 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5294 |
+
if($allowed <> 0){
|
5295 |
+
$allowed = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5296 |
}
|
5297 |
+
}
|
5298 |
+
break;
|
5299 |
+
case($pr_array['condition'] = "containsnot"):
|
5300 |
+
if ((!preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5301 |
+
$allowed = 0;
|
5302 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5303 |
+
$allowed = 0;
|
5304 |
+
}
|
5305 |
+
break;
|
5306 |
+
case($pr_array['condition'] = "="):
|
5307 |
+
if (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "exclude")){
|
5308 |
+
$allowed = 0;
|
5309 |
+
} elseif (($pr_array['criteria'] != "$pd_value") && ($pr_array['than'] == "include_only")){
|
5310 |
+
$found = strpos($pd_value,$pr_array['criteria']);
|
5311 |
+
if ($found !== false) {
|
5312 |
+
//for category mapping check if its an array
|
5313 |
+
if($pr_array['attribute'] == "raw_categories"){
|
5314 |
+
$raw_cats_arr = explode("||",$pd_value);
|
5315 |
+
if(is_array($raw_cats_arr)){
|
5316 |
+
if(in_array($pr_array['criteria'],$raw_cats_arr, TRUE)){
|
5317 |
+
if($allowed <> 0){
|
5318 |
+
$allowed = 1;
|
5319 |
}
|
5320 |
+
} else {
|
5321 |
+
$allowed = 0;
|
|
|
|
|
5322 |
}
|
5323 |
}
|
5324 |
} else {
|
5325 |
+
if($allowed <> 0){
|
5326 |
+
$allowed = 1;
|
5327 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5328 |
}
|
5329 |
+
} else {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5330 |
$allowed = 0;
|
5331 |
}
|
5332 |
+
} elseif (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "include_only")){
|
5333 |
+
if($allowed <> 0){
|
5334 |
+
$allowed = 1;
|
|
|
|
|
|
|
|
|
5335 |
}
|
5336 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "exclude")){
|
5337 |
+
$allowed = 0;
|
5338 |
+
} elseif ((preg_match('/'.$pr_array['criteria'].'/', $pd_value)) && ($pr_array['than'] == "include_only")){
|
5339 |
+
$allowed = 1;
|
5340 |
+
}
|
5341 |
+
break;
|
5342 |
+
case($pr_array['condition'] = "!="):
|
5343 |
+
if (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "exclude")){
|
5344 |
+
if($allowed <> 0){
|
5345 |
+
$allowed = 1;
|
5346 |
}
|
5347 |
+
} elseif (($pr_array['criteria'] == "$pd_value") && ($pr_array['than'] == "include_only")){
|
5348 |
+
$allowed = 0;
|
5349 |
+
} elseif (($pr_array['criteria'] != "$pd_value") && ($pr_array['than'] == "exclude")){
|
5350 |
+
$allowed = 0;
|
5351 |
+
}
|
5352 |
+
break;
|
5353 |
+
case($pr_array['condition'] = ">"):
|
5354 |
+
// Use a lexical order on relational string operators
|
5355 |
+
if (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5356 |
+
$allowed = 0;
|
5357 |
+
} elseif (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5358 |
+
$allowed = 0;
|
5359 |
+
}
|
5360 |
+
break;
|
5361 |
+
case($pr_array['condition'] = ">="):
|
5362 |
+
// Use a lexical order on relational string operators
|
5363 |
+
if (($pd_value >= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5364 |
+
$allowed = 0;
|
5365 |
+
} elseif (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5366 |
+
$allowed = 0;
|
5367 |
+
}
|
5368 |
+
break;
|
5369 |
+
case($pr_array['condition'] = "<"):
|
5370 |
+
// Use a lexical order on relational string operators
|
5371 |
+
if (($pd_value < $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5372 |
+
$allowed = 0;
|
5373 |
+
} elseif (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5374 |
+
$allowed = 0;
|
5375 |
+
}
|
5376 |
+
break;
|
5377 |
+
case($pr_array['condition'] = "=<"):
|
5378 |
+
// Use a lexical order on relational string operators
|
5379 |
+
if (($pd_value <= $pr_array['criteria']) && ($pr_array['than'] == "exclude")){
|
5380 |
+
$allowed = 0;
|
5381 |
+
} elseif (($pd_value > $pr_array['criteria']) && ($pr_array['than'] == "include_only")){
|
5382 |
+
$allowed = 0;
|
5383 |
+
}
|
5384 |
+
break;
|
5385 |
+
case($pr_array['condition'] = "empty"):
|
5386 |
+
if ((strlen($pd_value) < 1) && ($pr_array['than'] == "exclude")){
|
5387 |
+
$allowed = 0;
|
5388 |
+
} elseif ((strlen($pd_value) > 0) && ($pr_array['than'] == "exclude")){
|
5389 |
+
if($allowed <> 0){
|
5390 |
+
$allowed = 1;
|
5391 |
+
}
|
5392 |
+
} elseif ((strlen($pd_value) > 0) && ($pr_array['than'] == "include_only")){
|
5393 |
+
$allowed = 0;
|
5394 |
+
}
|
5395 |
+
break;
|
5396 |
+
default:
|
5397 |
+
break;
|
5398 |
}
|
5399 |
}
|
5400 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5401 |
}
|
5402 |
}
|
5403 |
|
js/woosea_key.js
CHANGED
@@ -27,7 +27,7 @@ jQuery(document).ready(function($) {
|
|
27 |
var license_key = $('#license-key').val();
|
28 |
|
29 |
jQuery.ajax({
|
30 |
-
url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=9.3.
|
31 |
jsonp: 'callback',
|
32 |
dataType: 'jsonp',
|
33 |
type: 'GET',
|
27 |
var license_key = $('#license-key').val();
|
28 |
|
29 |
jQuery.ajax({
|
30 |
+
url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=9.3.3',
|
31 |
jsonp: 'callback',
|
32 |
dataType: 'jsonp',
|
33 |
type: 'GET',
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
|
|
5 |
Tags: Product Feed, Google Shopping, Google Shopping Feed, WooCommerce Product Feed, WooCommerce Product Feed PRO, Bing Shopping, Bing product feed, Bing remarking, Google Merchant Feed, Google DRM Feed, Google Dynamic Remarketing Feed, Facebook feed, Google feed, Bing feed, Facebook Product Feed, Facebook Dynamic remarketing, Data Feed, WooCommerce Feed, XML product feed, CSV product feed, TSV, TXT product feed, comparison shopping engines, comparison shopping websites, vergelijk.nl, vergelijk.be, vertaa.fi, beslist.nl, kieskeurig.nl, bol.com, raketten, pricerunner, pricegrabber, Buy, leGuide, Kelkoo, Twenga, Yandex, Etsy, Dealtime, Shopzilla, Billiger, Google Product Review feed
|
6 |
Requires at least: 4.5
|
7 |
Tested up to: 5.6
|
8 |
-
Stable tag: 9.3.
|
9 |
|
10 |
== Description ==
|
11 |
|
@@ -321,6 +321,9 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
|
|
321 |
|
322 |
=== Changelog ===
|
323 |
|
|
|
|
|
|
|
324 |
= 9.3.2 (2020-12-29) =
|
325 |
* Added support for the Yandex group_id attribute
|
326 |
|
@@ -2972,6 +2975,9 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
|
|
2972 |
|
2973 |
== Upgrade Notice ==
|
2974 |
|
|
|
|
|
|
|
2975 |
= 9.3.2 =
|
2976 |
Added support for the Yandex group_id attribute
|
2977 |
|
5 |
Tags: Product Feed, Google Shopping, Google Shopping Feed, WooCommerce Product Feed, WooCommerce Product Feed PRO, Bing Shopping, Bing product feed, Bing remarking, Google Merchant Feed, Google DRM Feed, Google Dynamic Remarketing Feed, Facebook feed, Google feed, Bing feed, Facebook Product Feed, Facebook Dynamic remarketing, Data Feed, WooCommerce Feed, XML product feed, CSV product feed, TSV, TXT product feed, comparison shopping engines, comparison shopping websites, vergelijk.nl, vergelijk.be, vertaa.fi, beslist.nl, kieskeurig.nl, bol.com, raketten, pricerunner, pricegrabber, Buy, leGuide, Kelkoo, Twenga, Yandex, Etsy, Dealtime, Shopzilla, Billiger, Google Product Review feed
|
6 |
Requires at least: 4.5
|
7 |
Tested up to: 5.6
|
8 |
+
Stable tag: 9.3.3
|
9 |
|
10 |
== Description ==
|
11 |
|
321 |
|
322 |
=== Changelog ===
|
323 |
|
324 |
+
= 9.3.3 (2021-01-02) =
|
325 |
+
* Fixed an exclude filter issue (Thanks @Fabrice for reporting and solving!)
|
326 |
+
|
327 |
= 9.3.2 (2020-12-29) =
|
328 |
* Added support for the Yandex group_id attribute
|
329 |
|
2975 |
|
2976 |
== Upgrade Notice ==
|
2977 |
|
2978 |
+
= 9.3.3 =
|
2979 |
+
Fixed an exclude filter issue (Thanks @Fabrice for reporting and solving!)
|
2980 |
+
|
2981 |
= 9.3.2 =
|
2982 |
Added support for the Yandex group_id attribute
|
2983 |
|
woocommerce-sea.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Product Feed PRO for WooCommerce
|
4 |
-
* Version: 9.3.
|
5 |
* Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
|
6 |
* Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Facebook, Remarketing, Bing, Yandex, Comparison shopping websites and over a 100 channels more.
|
7 |
* Author: AdTribes.io
|
@@ -48,7 +48,7 @@ if (!defined('ABSPATH')) {
|
|
48 |
* Plugin versionnumber, please do not override.
|
49 |
* Define some constants
|
50 |
*/
|
51 |
-
define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '9.3.
|
52 |
define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
|
53 |
define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
|
54 |
|
1 |
<?php
|
2 |
/**
|
3 |
* Plugin Name: Product Feed PRO for WooCommerce
|
4 |
+
* Version: 9.3.3
|
5 |
* Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
|
6 |
* Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Facebook, Remarketing, Bing, Yandex, Comparison shopping websites and over a 100 channels more.
|
7 |
* Author: AdTribes.io
|
48 |
* Plugin versionnumber, please do not override.
|
49 |
* Define some constants
|
50 |
*/
|
51 |
+
define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '9.3.3' );
|
52 |
define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
|
53 |
define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
|
54 |
|