Added js code to get the query string and the url parameters. All categories and all sub categories options now working.