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.

Diogo Comprido

Forum Replies Created

Viewing 10 posts - 1 through 10 (of 13 total)
  • Diogo Comprido in reply to:
    “Explode” custom field into several records on the cache table
    #272340

    Thanks. You can close this ticket.

    Diogo Comprido in reply to:
    “Explode” custom field into several records on the cache table
    #266902

    Hi there Ross,

    I understand your developing cycles and agree no major changes should be included, but taking into consideration that:

    1) This a 100% non-breaking change (it’s a filter and it has no impact unless a developer actually hooks into it)

    2) It’s not a good idea to manually patch a plugin after update (I just did it this time to prove the concept that it works)

    3) We’ll probably take a while to update to v3 (due to extreme customization on our filter) but would like to keep v2 updated with the further couple of releases.

    I kindly ask you to reconsider and add this filter to the code.

    Diogo Comprido in reply to:
    “Explode” custom field into several records on the cache table
    #265269

    Hi Trevor,

    I see in class-search-filter-post-cache.php, lines 2071 to 2092, you indeed check if the value is a serialized array and then add it to the cache accordingly: for each array element or the single value.

    So, I’m wondering if you could add a filter after line 2074 so we could take our single value and explode it into an array? This would not have any effect on current users that do not hook into that filter.

    As a matter of fact, I did it and it works:

    $post_custom_data = apply_filters( 'search_filter_post_cache_post_custom_data', $post_custom_data, $postID, $meta_key );

    https://snipboard.io/A6Efs0.jpg

    I then added this to my own code and I successfully split the values into an array and use them as individual values for filtering:
    https://gist.github.com/webdados/9469b44361ef5ac64e8996c2b533c05f

    Before rebuilding the cache:
    https://snipboard.io/9Owq80.jpg

    After rebuilding the cache (with the filter on your plugin and our code in our theme functions.php file):
    https://snipboard.io/uG9zkR.jpg

    So, we just need you to add the filter to the next update of the plugin.
    Is this possible? 🙂

    Diogo Comprido in reply to:
    Pagination opens a lin
    #262534
    This reply has been marked as private.
    Diogo Comprido in reply to:
    Pagination opens a lin
    #262313

    I did that and now clicking on the pagination links after filtering does nothing: https://www.nzytech.com/products-services/category/cazymes/glycoside-hydrolases/cellulases/

    Just filter by pH 5 -6 and you’ll get 49 results.

    Diogo Comprido in reply to:
    Filter that searches in one field or between two fields
    #262310

    @ross

    What’s slowing down the search are the range fields :-/

    Diogo Comprido in reply to:
    Filter that searches in one field or between two fields
    #262161

    We solved it already by filling both regular and max fields.

    Nevermind this. Please look at our other tickets, mainly the one regarding pagination.

    Diogo Comprido in reply to:
    Error when filtering by a product category and a range
    #262088

    You can close this ticket, please.

    Diogo Comprido in reply to:
    Error when filtering by a product category and a range
    #262084

    the pH field is a range, which is not included in the Auto Count function, so it will potentially show ranges that are empty.

    We don’t mind having the empty ranges there on the field, the problem is that when choosing an empty range, no results should be shown, and all are shown.

    In turn, if the template does not have the No Results Found code inside the Ajax Container, then, when submitting a search for a range that has no results could give what you see.

    Our PHP template just includes the regular WooCommerce archive-product.php which does have a regular loop and a “no results” section, but it didn’t had the same CSS class name. That solved, thanks!

    Does the site have a lot of products/posts already, or is it in development? I ask because this might determine which is the best way forwards.

    It’s a live site with 2000+ products.

    If Ajax is OFF in the form, what then happens?

    That’s how I found out the problem 🙂

    Diogo Comprido in reply to:
    Filter that searches in one field or between two fields
    #261610

    This was not a very elegant solution.

    1) Currently, with the post meta “number” type of field, we can create a range filter that allows us to search a specific range of user-selected values in a range defined by two post meta fields.

    Example: https://snipboard.io/1rIUR8.jpg
    Results in: https://snipboard.io/S6aCh8.jpg

    This will show me all the posts that have a value between the range of x and y on the field _ph_key to _ph_key_max range.

    For example, if I search 4 to 5 it will return all posts that have ( _ph_key >= 4 and _ph_key <= 5 ) OR ( _ph_key_max >= 4 and _ph_key_max <= 5 ).
    In sum: all posts which range overlaps.

    2) With the post meta “choice” type of field, we can only search in one specific meta key.

    Example: https://snipboard.io/Myoia7.jpg
    Results in: https://snipboard.io/2FkOCU.jpg

    But this will only search on _ph_key. Not what we need.

    3) We need something that is a mix of these situations. We need a single “choice” field populated with all options existing in both _ph_key and _ph_key_max meta fields and search between them.

    Example: If I chose “5”, we need it to return all posts that have _ph_key>=5 and _ph_key_max<=5

    Is this even possible with this plugin at the moment?
    If this is not an option at the moment, how much would it cost for us to sponsorship this new feature and make it available for everyone?

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