How to get query or param from URL and then use in Links?
Use craft.request.getQueryStringWithoutPath() like so:

products/category?{{craft.request.getQueryStringWithoutPath()}}



  Returns the query string, except for the p= param (which was probably added by your .htaccess redirect).


More complicated logic to avoid the ? when the query string is empty (one of several ways to do this):

{# queryString will include '?' if we have one, otherwise '' #}
{% set queryString = (craft.request.getQueryStringWithoutPath() ? '?'~craft.request.getQueryStringWithoutPath()) %}
products/category{{queryString}}