WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
Search results orderby glitch when searching with quotation marks (1 post)

  1. SL Blaise
    Member
    Posted 1 month ago #

    Hi,

    We are developing a large Woocommerce store which relies heavily on the search functionality. We have found a potential bug on the search when the user searches for an exact phrase using quotation marks. For example: "John Smith"

    When the user searches for it, everything works correctly and uses the default (or most relevant) sorting. However, if you click ‘Order by newness’ it then re-loads the page retaining some of the query however adds some backslashes.

    For example:
    "John Smith" or: /?s="John+Smith"&post_type=product
    becomes:
    \"John Smith\" or: ?orderby=date&s=%5C"John+Smith%5C"&post_type=product

    Another orderby makes this even worse with:
    \\\"John Smith\\\"

    I can see there is an obvious confliction between the quotation marks and the php I expect — does Woocommerce fully support these exact phrase strings or is there a problem my end? I have tested this on multiple Woocommerce sites and it appears to yield the same results.

    Thanks in advance for any help.

    https://wordpress.org/plugins/woocommerce/

Reply

You must log in to post.

About this Plugin

About this Topic