• Resolved dominicwtd

    (@dominicwtd)


    WordPress Version: 6.1.1
    PHP Version: 8.1.1 (tested on 7.4.33 and also a problem)
    Plugin Version: 12.1.8

    Hi,

    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:6049

    switch ($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> 1

    It 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,
    Dominic

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dominicwtd

    (@dominicwtd)

    Hi,

    It appears to have worked and removed those items nearly 24 hours later, after the cronjob has fired. I don’t count this as solved since the “refresh feed” option didn’t update it.

    Thanks,
    Dominic

    Are you sure this is not caching related, weren’t you looking at an old cached version of the feed?

    Hi,

    Assuming the issue at hand has been resolved and/or our help is no longer needed I will close this topic for housekeeping reasons. Do not hesitate to reach out to us again whenever you need our support.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Exclude Products not working’ is closed to new replies.