Support » Plugin: Advanced AJAX Product Filters » Conditions for Filters and Filter groups – (how) do they work?

  • 1) Is there any documentation about the ‘Conditions’ for Filters and Filter Groups?

    I tried by trial and error, a LOT of times and different combinations, but can’t figure out the erratic behavior of this functionality, it never works as I expect.

    What I would like to do is only show certain filters if a specific product category has been selected. So at the shop homepage, when all products are selected, this Product Filter should NOT show, but once a customer selects a specific category, the corresponding Filter should show.
    I guess this should be done by setting a ‘Condition’ in the Filter.
    I tried either ‘Product Category’ equal, and then selecting one (or more) product categories, and with or without ‘include subcategories’. This doesn’t work.
    Also tried ‘Product Attribute’ equal ‘product Categories’, and then selecting a Product Category.
    Also doesn’t work.

    The I tried adding conditions to an existing Filter Group with several Filters, amongst which the filter I wanted to use. Same examples as above, also doesn’t work. hen I tried creating a special Filter Group with only one Filter in it. Same examples as above, also doesn’t work.

    I also tried numerous othe rvariations, such as including an AND (and OR) condition in combination with a page, etc. I tried almost anything that is possible, I think.

    How do I accomplish what I want?

    2) If I select ” in a Filter Group it shows up irrespective of making a Widget. So if the Filter Group exists, but isn’t called in any widget, it still appears on top.

    Note: It looks like the documentation has not been updated after the plugin overhaul a while back (when old widgets became ‘legacy’ and then disappeared).

    By the way:
    I have the premium plugin, but my first support answers were so vague (generic answers to very specific questions) and written in broken English that I prefer to try it here where more pointed answers seem to be given.
    Sorry if it sounds offensive, not intended, but I just need to get results fast.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Dima Holovnia

    (@dholovnia)

    Hi Paul,

    Lets try to make it less vague.

    You have 2 filters: first – Product Categories, second – Attribute Color.
    User open shop page and see only Product Categories filter.
    User is clicking some value in first filter – you expect now second filter to show up. Is this what you need?

    Conditions will not help here.

    Our plugin has such option but only for the hierarchical elements(eg custom taxonomies). Please check https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-5/
    Brands here is custom taxonomy with hierarchy. All 3 Brand filters are the same taxonomy but on different levels.

    Relationship that we have in an example ( Product Categories -> Attribute Color ) cannot be configured.

    “generic answers” that I provide you before has a solution that could be used.

    – You can add WooCommerce categories widget to your shop and set in Conditions to hide filters on shop page.
    – When user will click any link in categories widget he will be redirected to show page eg example.com/product-cat/cars
    – And there will be shown our filters as that is not shop page.

    You can have different filters per different categories using Conditions.

    Regards,
    Dima

    Allow me to rephrase my question, perhaps it’s clearer what I mean like this:

    Normally all filters are shown that are applicable for products selected. So on the shop homepage all filters are shown.
    I have many filters, most of which are subcategory specific. I would prefer that these specific filters are only shown once a subcategory filter is actually selected.
    Otherwise an enormeous list of filters are shown at the shop homepage which have no relevence for 99% of products listed.

    Is this possible with your plugin?

    If yes, could you explain, and point me to the relevant documentation?

    If not yet possible consider it a feature suggestion πŸ˜‰

    Regarding your suggestion for the plugin, I tried but it doesn’t work. Nothing shows on either shop page or product category page if I use any conditions in the plugin.

    Plugin Author Dima Holovnia

    (@dholovnia)

    Hi Paul,

    “Is this possible with your plugin? ” – my answer above 100% answering your question.

    Our plugin has such option but only for the hierarchical elements(eg custom taxonomies). Please check https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-5/
    Brands here is custom taxonomy with hierarchy. All 3 Brand filters are the same taxonomy but on different levels.

    Relationship that we have in an example ( Product Categories -> Attribute Color ) cannot be configured.

    Solution I told above:

    – You can add WooCommerce categories widget to your shop and set in Conditions to hide filters on shop page.
    – When user will click any link in categories widget he will be redirected to show page eg example.com/product-cat/cars
    – And there will be shown our filters as that is not shop page.

    Regards,
    Dima

    Ref your reply:

    Our plugin has such option but only for the hierarchical elements(eg custom taxonomies). Please check https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-5/
    Brands here is custom taxonomy with hierarchy. All 3 Brand filters are the same taxonomy but on different levels.

    How do I do this? The demo just shows the end result, not the way to get there.
    Where is the up-to-date documentation?

    As for this:

    – You can add WooCommerce categories widget to your shop and set in Conditions to hide filters on shop page.

    a) How? There is no such thing as a ‘Woocommerce category widget’ that I can find. Do you mean I need to install a third party plugin which adds WooCommerce category widgets? If yes, which one do you suggest?
    b) And how should I set a condition to hide filters. Do you mean I do this in your plugin in an individual Filter under ‘Condition’? Your earlier quote was:

    Conditions will not help here.

    So it is a tad confusing..

    Plugin Author Dima Holovnia

    (@dholovnia)

    a) Open widgets page. Find there widget called “Product categories” (that is added by the WooCommerce plugin). Add it to the sidebar.

    b) Yes, “individual Filter under β€˜Condition’”. Or you can use Group if few filters have the same logic.

    “Your earlier quote was” – that quote was for the first part of the message. And under it I provide explanation how you can do it with WooCommerce product categories widget + Conditions.

    Please answer this:

    Ref your reply:

    Our plugin has such option but only for the hierarchical elements(eg custom taxonomies). Please check https://woocommerce-products-filter.berocket.com/woocommerce-products-filter-demo-5/
    Brands here is custom taxonomy with hierarchy. All 3 Brand filters are the same taxonomy but on different levels.

    How do I do this? The demo just shows the end result, not the way to get there.
    Where is the up-to-date documentation?

    Plugin Author Dima Holovnia

    (@dholovnia)

    What is custom taxonomy – https://www.google.com/search?client=firefox-b-ab&q=wordpress+custom+taxonomy
    Plugins to create custom taxonomy – https://wordpress.org/plugins/tags/custom-taxonomies/
    Child/Parent limitation – https://berocket.com/docs/plugin/woocommerce-ajax-products-filter#widget_filter_settings and scroll to Child/Parent Limitation option.

    Screen from the docs – https://screenshotscdn.firefoxusercontent.com/images/3ff98d64-0dea-481b-8608-09a0f668db73.png

    First level of the taxonomy is Parent.
    All other are Child with depth level 1,2,3, etc
    Child with depth level 3 will be waiting for Child with depth level 2 and Child with depth level 2 will be waiting for Parent filter.

    AA) I set a condition in a Product Filter Group.
    It does what I would like but requires a browser page refresh (F5) before the Filter Group is actually displayed or hidden.
    In other words: On the shop page the filters are not shown (correct), then I go to a category with applicable (hierarchical) taxonomies and the Filter Group is not displayed until I refresh the browser. If I then go back to the shop page the filter is still displayed (though not meeting the Condition anymore) until the browser is refreshed after which the Filter disappears (which is according to the Condition).

    So it seems the enforcing of the Condition is only done on a page refresh.

    Is there something I can do to change this?

    (I’m using Enfold theme on this site, in case it matters).

    BB) Question regarding Permalinks:
    I could use your advice what to set up in WooCommerce product permalinks settings.
    I did as follows:
    Product Category Base: /filters/product_cat
    Product Tag Base: /filters/poduct_tag
    Attribute Base: /filters/attribute-name/attribute/
    Product Permalinks Custom Base: /product/

    (I selected BeRocket AJAX Product Filters Nice URLs).
    BeRocket AJAX Product Filters Nice URL settings:
    /product/filters/taxonomy_name/values/taxonomy_name/values/

    The idea is that Product Category URLs are the same as filters, so that I can use shortcodes and database calls on URLs to automatically be the same as your filters.

    Could this be causing problems, or should this be possible?

    I’d appreciate your help in understanding the world of filtering πŸ™‚

    paulnl

    (@paulnl)

    Could you please reply?

    Plugin Author Dima Holovnia

    (@dholovnia)

    AA) You can change products selector on the plugin settings to some dummy value. This will reload the page after filter applied.
    As for now this is all that could be done.

    BB) This is kind of a hack. Even if it will work now it is a potential problems in the future.

    paulnl

    (@paulnl)

    Please help me understand this comment:

    BB) This is kind of a hack. Even if it will work now it is a potential problems in the future.

    What is a normal setting I should use if I do NOT want to hack anything. I don’t understand what to fill here. What would you consider good settings. Please help me fill this:

    Product Category Base =
    Product Tag Base =
    Attribute Base =
    Product Permalinks Custom Base = /product/

    (I selected BeRocket AJAX Product Filters Nice URLs).
    BeRocket AJAX Product Filters Nice URL settings =
    /product/filters/taxonomy_name/values/taxonomy_name/values/

    Thanks.

    • This reply was modified 9 months ago by paulnl.
    paulnl

    (@paulnl)

    I guess I had trouble explaining exactly what I need. But this plugin (which is for another Filter product WOOF) does exactly what I’m looking for (for WOOF), and it works with Ajax.
    So it helps explaining my needs for your plugin!

    https://wordpress.org/plugins/woof-by-category/

    Could you add this functionality to your plugin? It would be extremely helpful!

    I realize I can switch to WOOF, but apart from this one issue I like your plugin much better. So I hope you’ll consider it.

    Plugin Author Dima Holovnia

    (@dholovnia)

    What is a normal setting I should use

    Product Category Base, Product Tag Base, Attribute Base, Product Permalinks Custom Base – all this values should be set without filters. This is just common pages.

    I’ll ask our tester to check this. I’d recommend you to use common pages without filters in the url.

    it helps explaining my needs for your plugin!

    I’ll check this plugin with WOOF and get back to you with better understanding of the issue.

    Regards,
    Dima

    Plugin Author Dima Holovnia

    (@dholovnia)

    Please update plugin to the recent version.
    Open plugin settings page, last tab Addons and turn on the single Addon there (just click the image) and Save.
    Now open some filter for edit(or create new). You will find there second Condtions box called Filtering Conditions.
    Add new condition to show filter based on filter applied.
    This is first version of this feature but tests show good results already.

    Feedback will be appreciated.

    Thanks, that’s a good first step, appreciated.
    Feedback:
    – Add option to apply to all children of an attribute (now I have to choose each individual child separately, what if you have 50 children, and what if you add a child later and forget to update this filter
    – Fix the disappearing of the ‘selected filters’ filter when using this beta. How to replicate? Set ‘Filtering Condition’ to a product category (for example ‘cables’), let an attribute appear (for example ‘colors’), select an attribute (for example ‘white’) and then deselect the product category. This will show all products that have the color ‘white’ from any product category because the color filter remains selected in the url, and it will make the ‘selected filters’ filter disappear.
    Suggestion: The solution might be that you ensure there is another check done when the product category filter changes, so that any attributes are no longer selected?

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