• Hi, thank for the great plugin. Just what I needed.

    I’ve created a rule that looks for a Brand name in the product title and then allocates that product to a brand category

    I’ve created another rule that looks for a spec in the product title and allocates the product another category.

    The first rule is working. The 2nd rule gets ignored.

    So only the first matching rule will work – is that correct?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter alissit

    (@alissit)

    So your plugin is set to strip previously set categories if the rule does not match the product.
    All my products have had their previously set categories stripped because my new rules no longer matched. This behaviour is odd. I’ve had to restore the site because I have 100’s of products and testing the plugin stripped them of all their categories.
    Your applyTo function is as follows:
    else { foreach ($this->terms as $taxonomy => $termIds) { if ($termIds) { wp_remove_object_terms($product->get_id(), $termIds, $taxonomy); } } }

    I can’t recall if this also stripped the manual categories I had placed the products in – but it stripped all the categories that I had set up with one rule – which I then deleted and tried a new rule.

    Your plugin REALLY needs some documentation.

    Plugin Author penthouseplugins

    (@penthouseplugins)

    Hi there,

    You are correct, by default the plugin applies the rule both positively and negatively. So if the rule matches, the indicated categories and/or tags are added, and if the rule does not match, they are removed (whenever the rule is run, manually or automatically). Version 1.0.3 adds an option to each rule titled “Don’t remove categories/tags if rule doesn’t match” which is designed to prevent the negative application of the rule. Hopefully this helps in your use case.

    Any category or tag assignments that are not selected in the “Categories/Tags to Add/Remove” column of the enabled/applied rule(s) should not be touched in your products. If you notice behavior to the contrary, please let me know.

    Regarding multiple rules applying at once, the plugin should apply all enabled/selected rules to each product. Is it possible that one rule was removing the categories added by another rule, or that the conditions weren’t set correctly on one of your rules?

    i have same issue, when adding more than 1 rule, like search for “Chair” in title and search for “Chair” in product description – it won’t add the one from description to category

    i would like to send admin logins, where do i send that to

    Plugin Author penthouseplugins

    (@penthouseplugins)

    Hi there,

    Unfortunately I can’t accept site login details here due to www.ads-software.com policy. Can you confirm the following for me, as I haven’t been able to replicate this issue on my end?

    1. Are your rules two separate rules, or one rule with two conditions?
    2. If they are two separate rules, please confirm:
      • Both rules have “For new products” checked in the “Enabled” column?
      • The word you are searching for is exactly the same in your rule as in the product title and description, including capitalization (unless you are using a rule marked case insensitive)
      • Either the rules are adding different categories, or the “Don’t remove categories if rule doesn’t match” option is enabled for the rule that doesn’t match in the case where a rule doesn’t seem to be working
      • Do the rules work if you run them manually by checking the leftmost checkbox and clicking Save All & Run Selected?

    Check this

    Plugin Author penthouseplugins

    (@penthouseplugins)

    If a rule has multiple conditions, in order for that rule to be applied to a product, ALL of the conditions need to match. So if one condition matches and the other doesn’t, the category won’t be added by the rule. The conditions have an AND relationship. If you want your conditions to have an OR relationship, you would need to create a separate rule for each condition.

    Does that help?

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.