Home Forums WoodMart support forum Add time param to querystring of AJAX search form

Add time param to querystring of AJAX search form

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #640621

    dimmisel
    Participant

    I’d like to be able to add a time param to the AJAX request URL of an AJAX search, in order to prevent caching. I noticed that a specific value regarding the returned products is cached, and I also noticed that on key-up of typing a keyword, for a keyword that has already been searched, no new AJAX call is made. I’d like to prevent that, and so I’d like to add a time param to the query string of the call… Something like https://domain.tld/wp-admin/admin-ajax.php?action=woodmart_ajax_search&number=20&post_type=product&query=keyword&time=1740414270

    Is that possible? I searched the source code of WD and noticed that the relevant code can be found in combine.js and ajaxSearch.js files and no hook is involved. So how could I achieve what I need? Thanks in advance.

    #641252

    Hung Pham
    Keymaster

    Hi dimmisel,

    Thanks for reaching to us and appreciate your patience.

    Regarding request caching during the search, you can try configuring your server to prevent this request from being cached.

    Adding an additional time parameter to the request is considered a customization, which unfortunately is not covered by our technical support.

    Additionally, as you mentioned, when you enter a keyword that has previously returned results, those results are displayed without a new AJAX request. This behavior is correct because the result after the AJAX request would be the same. This is how the search library functions.

    Hope this answer is useful.

    Regards,

    • This reply was modified 4 hours, 30 minutes ago by Hung Pham.
Viewing 2 posts - 1 through 2 (of 2 total)