Search results page sorting problem

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search results page sorting problem

This topic contains 16 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 3 years, 6 months ago.

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #29552
    msamavi64
    msamavi64
    Participant

    Hello,

    I have set the search results page will redirect to Woocommerce Results Page.
    The results page default sort is based in Relevance.
    In the results page when I want to change the sort criteria (for example to Name or Date), the page displays “No products were found matching your selection”

    Can you please advise any fix?

    Kind regards,
    Majid

    #29561
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Majid,

    Can I take a look at this issue somewhere? Also, can you please add temporary back-end and FTP details, in case I need to debug anything. Thank you!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #29588
    msamavi64
    msamavi64
    Participant
    You cannot access this content.
    #29590
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Majid,

    The issue seems to be with the URL encoding – when I click on the switch button, it removes encoded URI components, such as empty whitespaces like ” ” or other characters as well.

    You can try this even with the native search, for example searching “far mu”, results in this URL (replace yoursite.com with your site domain): https://www.yoursite.com/?post_type=product&s=far%20mu
    When clicking on the sorting, it removes the “%20” whitespace character and changes the phrase to “farmu” which is incorrect: https://i.imgur.com/O3vh4R6.png
    See after: https://i.imgur.com/y1hkKZz.png

    Unfortunately that section is unrelated to the plugin, so it needs to be corrected elswhere.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #29591
    msamavi64
    msamavi64
    Participant

    Hi,

    Thanks for the reply.

    I changed the Action for “Show ‘More results..’ text in the bottom of the search box” option.
    Please try now using your own example search words and comment.

    Kind regards,
    Majid

    #29592
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    I changed the Action for “Show ‘More results..’ text in the bottom of the search box” option.
    Please try now using your own example search words and comment.

    Can you please explain? Is there an issue I should look for? I cannot tell only by looking at the site front-end, I don’t know what your configuration is.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #29593
    msamavi64
    msamavi64
    Participant

    The same issue exists while the url is different and the “%20” whitespace character is not removed now!
    Please have a look at the urls while searching “far mu” and try to change the sort.

    #29594
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That is what I am saying, please take a look: https://www.youtube.com/watch?v=tco5uyRKJOQ
    Changing the sorting removes the special characters from the URI, which is not supposed to happen, and that is causing the problem. It is not the plugin creating the issue, as it does not print the sorting drop-down, it is probably a theme/page builder feature.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #29595
    msamavi64
    msamavi64
    Participant

    Ernest, Please ready my previous post once again!
    I did write that in the new test, the “%20” whitespace character is NOT removed but the results page again displays nothing!

    #29596
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    I understand that, but other encoded components are still removed. For example:
    Original end of URI before sorting: https://i.imgur.com/MUNLeMK.png
    After sorting, missing HTML encoded components as well as other arguments: https://i.imgur.com/fEgnkjn.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #29597
    msamavi64
    msamavi64
    Participant

    I see.
    Are you aware of any possible incompatibility with other plugins?

    Regards,
    Majid

    #29598
    msamavi64
    msamavi64
    Participant

    By the way, I am using the following snippet based on your older solution to be able to search for some special characters:

    add_filter(‘asp_indexing_string_pre_process’, ‘custom_chars_asp_indexing_string_pre_process’, 10, 1);
    add_filter(‘asp_search_phrase_before_cleaning’, ‘custom_chars_asp_indexing_string_pre_process’, 10, 1);
    add_filter(‘asp_query_args’, ‘custom_chars_asp_indexing_string_pre_process’, 10, 1);
    function custom_chars_asp_indexing_string_pre_process($s) {
    $original = array(
    ‘Ā’, ‘ā’, ‘Ā’, ‘ā’, ‘Ḥ’, ‘ḥ’, ‘Ḥ’, ‘ḥ’, ‘Ī’, ‘ī’, ‘Ī’, ‘ī’, ‘Ṣ’, ‘ṣ’, ‘Ṣ’, ‘ṣ’, ‘S̲’, ‘s̲’, ‘Ṭ’, ‘ṭ’, ‘Ṭ’, ‘ṭ’, ‘Ū’, ‘ū’, ‘Ū’, ‘ū’, ‘Z̤’, ‘z̤’, ‘Ẓ’, ‘ẓ’, ‘Ẓ’, ‘ẓ’, ‘Z̲’, ‘z̲’, ‘Ẕ’, ‘ẕ’, ‘ʼ’, ‘ʻ’, ‘ʹ’
    );
    $replace = array(
    ‘a’, ‘a’, ‘a’, ‘a’, ‘h’, ‘h’, ‘h’, ‘h’, ‘i’, ‘i’, ‘i’, ‘i’, ‘s’, ‘s’, ‘s’, ‘s’, ‘s’, ‘s’, ‘t’, ‘t’, ‘t’, ‘t’, ‘u’, ‘u’, ‘u’, ‘u’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ‘z’, ”, ”, ”
    );

    // Replace them
    if ( is_array($s) ) {
    if ( isset($s[‘s’]) && !$s[‘_ajax_search’] )
    $s[‘s’] = str_replace($original, $replace, $s[‘s’]);
    } else {
    $s = str_replace($original, $replace, $s);
    }

    return $s;
    }

    #29603
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    We are not aware of any issues with other plugins at the moment. I just tested this exact feature with WooCommerce core and it works all right. That custom code unfortunately has no effect on this. You can try removing it briefly, but it should not change anything.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #29605
    msamavi64
    msamavi64
    Participant

    Wouldn’t you like to have closer look to find the issue?

    #29606
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Unfortunately I cannot tell what is exactly causing this. It looks like probably the theme. Try switching the theme to the default one (twenty twenty perhaps) to see if the issue continues.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 15 posts - 1 through 15 (of 17 total)

You must be logged in to reply to this topic.