• Resolved guteLaune

    (@gutelaune)


    Great plugin!
    I want to use it for a Woocommerce-Shop with membership function.

    If I activate Ajax for the filter function and don’t choose any options for restriction (e.g. product categories or product tags), all articles of the shop will be called – even those that should be visible for members only.

    I am aware that you can’t adapt your product filter for all other Woocommerce plugins (including the official extension Woocommerce-Memberships https://woocommerce.com/products/woocommerce-memberships/ I use). On the other hand, an Ajax filter is useless if it does not filter (because no options are selected).

    My question:
    Is there a way to disable the display of all products using the Ajax filter function?

    a) By displaying a message: ‘You have not made a selection’, or
    b) by adapting the Ajax product search query in such a way that it excludes products with certain characteristics (view-restricted by membership-plan).

    Many thanks for any comments.
    Frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Nick McReynolds

    (@woobewoo)

    Hello @gutelaune,

    Thanks for your feedback.

    “Ajax” – https://prnt.sc/tfgt34 If I correctly grasped the essence of the issue, then try to activate automatic filtering, and then until at least one filter is selected, it will not filter.

    “Woocommerce-Memberships” We can make support for this plugin, but for this please contact our internal support team.

    Thread Starter guteLaune

    (@gutelaune)

    Hi Nick,

    very fast response. Thank you!!!

    Yes you grasped the issue correctly:

    The problem is indeed that user has to check at leat one filter option in order to avoid show unfiltered database product entries.

    This changes the woocommerce query behaviour completely. Woocommerce query hooks do not work any longer.

    However, if ajax is disabled, your plugin works fine (uses woocommerce query logic).

    Why not 1 single method for both product queries: Ajax and None-Ajax, using woocommerce query logic?


    The problem is not Membership-plugin related at all. There are a lot of other snippets/plugins using the woocommerce query hooks … for which your ajax-query-method is not compatible with!


    Would be great, if you could provide a solution, so we could use ajax for filtering!

    Thanks a lot
    Frank

    Thread Starter guteLaune

    (@gutelaune)

    Hi, Nick,

    when i set > Buttons > Filter Activations type > autofiltering (Ajax is enabled) the following happens:

    1. calling the catalog page via URL input in the browser:
    – the Woocommerce-product-query is called,
    – all woocommerce products are displayed (except those that were excluded via dieverse query-hooks).

    2. check a filter option:
    – your ajax product-query is called,
    – all products filtered according to this ajax-query are displayed – in my case this fits perfectly, because I can adapt the filters very well to my needs.

    3. i uncheck all filter options:
    – your Ajax product query is called,
    – since no filter is checked, all (1) woocommerce products are called, no matter if they are prohibited by woocommerce-query-filter-hooks or not.

    #3 is really a No-Go!

    Why does your Ajax-product-query not respect the woocommerce-query-hooks?

    I think this is a limitation that makes the otherwise great designed product filter plugin not work for many individual applications. Maybe you can find an easy way to set up your Ajax-query on the woocommerce-query including the woocommerce-product-query-hooks.

    Would this be an option for your development team?

    Greetings
    Frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Prevent Ajax filter without selected options from calling all products’ is closed to new replies.