Support Forums

The forums are closed and will be removed when we launch our new site.

Looking for support? You can access the support system via your account.

Forums Forums Search & Filter Pro Caching WooCommerce Price Issue

Tagged: , ,

Viewing 10 posts - 1 through 10 (of 14 total)
  • Matthew
    #29071

    Hi,

    We are using S&F pro on a WooCommerce site of ours. You can find the filter page at https://www.bathcollege.ac.uk/course-search/

    Before the v2 release that included the introduction of the cache, we had a price filter that was working perfectly.

    Since the update, I have noticed that the ‘price’ field is only being cached for products that have a price set, and that this is causing those products with no price set to not be returned (whereas previously they were returned if the price range filter was set to a range with a minimum of 0).

    To combat this, is it possible to include in the Number Range a default option of ‘Not Set’? I tried to replicate this functionality using the standard ‘Choice Dropdown’ and adding the number ranges as values to my custom options, but this was returning an empty results set.

    Thanks

    Matt

    Ross Moderator
    #29289

    Hey Matt

    So what you’re basically trying to do is also include results where this field/key has not even been set?

    To be honest, I’m 99% sure that this was how it worked before, because I’ve been toying with this idea for a while.

    Thanks

    Matthew
    #29372

    Hi Ross,

    Thanks for your reply. I’m sure that previously the query was returning results for products without prices set (although I’m not sure how).

    An ideal solution would be the introduction of an additional option to the Number Dropdown. This option would be ‘None set’ and default as a null value so that the filters do not include the number field when searching unless it has been selected by the user.

    Currently, if I include a number field I have to set a minimum of ‘0’, which is of course causing the products without a price set to not display.

    Could you point me in the direction of how I could add this myself. I have been hunting around the code for somewhere I could potentially hook in to add the additional option, but I am yet to find anywhere.

    Thanks for your help.

    Matt

    Matthew
    #31022

    Hi Ross,

    Do you know if there was ever a solution to this issue?

    If not, and if you don’t think it’s something you’ll be implementing in the future, could you point me in the right direction so that I can add an additional ‘Not Set’ option to the Number Dropdown?

    Thanks

    Matt

    Ross Moderator
    #31523

    Hey Matt

    I’ve been scratching my head on this one.

    To be honest, because this ties in to the caching system its going to be a real pain to figure it out.

    First you’d have to get the posts actually indexed (the cache class is in the /includes/ folder), then you have to figure out the indexing / caching logic on the front end and how that ties in to WP_Query and modify accordingly (cache class found in /public/includes/).

    Its a bit complicated and not too well documented as its still changing a lot (there will be some serious refactoring in a couple of minor releases) so I think its going to be quite a lot of trouble modifying that to do what you need.

    I’ll try to take a look as soon as is feasible (there’s quite a big to do list), for now if you want me to send you an older version let me know – it would actually be great to see this effect in action too 😉

    Thanks

    Matthew
    #31587

    Hi Ross,

    Thanks for your reply, and for looking into this for me.

    I understand that it may be a step too far to cache those products without a price, especially considering the refactoring you have planned.

    Do you have any thoughts on my plan b, which is to add an option to the number dropdown (select) that is simlpy ‘No Price Selected’, and use this as the default for my filters so that all results return unless a user selects a specific price?

    This would solve my issue as atm the default price is ‘0’ (and you cannot filter without setting a price) which is causing all of those products without a price to never show.

    If you can point me towards a hook I could use to add the option to the number select, or even the file i’ll need to update to add the option, i’m happy to do this myself.

    I understand you’re getting a lot of enquiries these days, and really appreciate the help you can give me.

    Best

    Matt

    Ross Moderator
    #31687

    Hey Matt

    I’ll have an update out at some point this evening which allows you to to filer every field in S&F, this means you can filter the possible values and add in your own – which I’m guessing is what you are after?

    Thanks

    Matthew
    #31701

    Hi Ross,

    Yes, this sounds like it should do the trick. If it allows me to add a filter to filter a field by price, using values of my own (which include a ‘not set’ value) then we should be good.

    I’ll look out for this later today, and test once we have it in place.

    Thanks for all your help on this.

    Matt

    Matthew
    #31920

    Hi Ross,

    Were you able to release the update with the additional filter type?

    I’m up to date with version 2.0.3 and wasn’t sure if there has been a release since then.

    Thanks

    Matt

    Ross Moderator
    #32119

    Hey Matthew – not just yet – hoping for tomorrow now.

    Just to let you know (after re-reading the comments abvoe) all this does is allow you to edit any field before its displayed – so you can control the options and labels in teh form, and classes and html attributes – it doesn’t affect the query itself though.

    Thanks

Viewing 10 posts - 1 through 10 (of 14 total)

The forum ‘Search & Filter Pro’ is closed to new topics and replies.