Exclude Products not working
-
WordPress Version: 6.1.1
PHP Version: 8.1.1 (tested on 7.4.33 and also a problem)
Plugin Version: 12.1.8Hi,
I am trying to remove products from the feed linked to but the exclusion setting is not working. Please see the rules below:
The SKU row is the same product 6695, neither are working The first 3 rules appear to be working, which have been part of the feed from the beginning, I added the rest of them this afternoon and have cleared the browser, page and object cache before and after generating the query to no luck.
I have investigated the code and I think I have found the problem.
See classes/class-get-products.php:6049switch ($pr_array['condition']) { case($pr_array['condition'] = "contains"):A switch statement isn’t defined in this manner, this is setting the value for $pr_array[‘condition’] = “contains” and then checking whether $pr_array[‘condition’] == $pr_array[‘condition’] which is true. That block breaks out of the switch statement making the other options in the dropdown for the filters irrelevant. See below:
$a = "test"; switch ($a) { case ($a = 'test1'): echo "1"; break; case ($a = 'test'): echo "2"; break; } stdout> 1It appears all switch statements in, at least, this method have been written the same.
I am happy to answer any further questions you have in order to solve this issue.
Thanks,
DominicThe page I need help with: [log in to see the link]
The topic ‘Exclude Products not working’ is closed to new replies.