Advertisement:

Author Topic: Problem with refine category: need URL without GET parameters  (Read 512 times)

abc500x500

  • Jr. Member
  • **
  • Posts: 96
Problem with refine category: need URL without GET parameters
« on: August 05, 2018, 03:38:09 pm »
Hi
please help
Problem:
suppose we have 4 categories with several sub-categoris :
Cars
Books
Jobs
RealEstates

each of these categories has own search attributes.
A user after searching one category for exam Cars decide goes to other category for example Books; he clicks on link of books on Refine categories (search-sidebar.php) after this clicking ,he see a blank page that said error : search has 0 result.
user thinks there is not any ads in this category and he goes out from site!!!
Why? because all attribute of searching in category Cars send to category Books with GET by URL.

I want in refine category links we will have links without Get parameters belong  other category.
Please help what must to do?
« Last Edit: August 05, 2018, 03:55:13 pm by abc500x500 »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Problem with refine category: need URL without GET parameters
« Reply #1 on: August 06, 2018, 11:28:31 pm »
Hi. I just tested.
In my case the url contains for example from 1500 to 1900 as year of manufacturing but the ads are not affected by that if the category in which I click doesn't have those filters.

I'm interested in this, but only if it's an issue.
« Last Edit: August 06, 2018, 11:32:06 pm by marius-ciclistu »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Problem with refine category: need URL without GET parameters
« Reply #2 on: August 08, 2018, 08:48:25 pm »
You could put a link near the no ads found message to the search url without filters, only with category.

abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: Problem with refine category: need URL without GET parameters
« Reply #3 on: August 16, 2018, 06:57:12 pm »
Is not there any code for resetting filter search form in search-sidebar.php?

I add clear and reset button and use this code for search-sidebar.php form:
Code: [Select]

$(document).ready(function()
{
    $('button.reset').on('click', function()
    {
        $("form.nocsrf").trigger("reset");
    });

    $('button.clear').on('click', function()
    {
        $('form.nocsrf').find('input:text, input:password, select, textarea').val('');
        $('form.nocsrf').find('input:radio, input:checkbox').prop('checked', false);
    });
});

but did not work.

1-why html & javascript codes could not reset this form?

2-I write this code for resetting form:
Code: [Select]
            <a class="resetform" href="<?php echo osc_base_url($with_index true)."?page=search"."&sRegion=".$_GET['sRegion'];if ($_GET['sCity']) echo "&sCity=".trim($_GET['sCity']);if ($_GET['sCategory']) echo "&sCategory=".trim($_GET['sCategory']); ?>">
           reset</a>
but it need requesting a url for reseting and cause server resource using.

Please help.
Thanks



« Last Edit: August 16, 2018, 07:01:09 pm by abc500x500 »

marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Problem with refine category: need URL without GET parameters
« Reply #4 on: August 18, 2018, 10:54:09 pm »
If you alter the filter fields without altering the url it makes no changes to the search. You musr reload the page with an url that does not  contain filters.

abc500x500

  • Jr. Member
  • **
  • Posts: 96
Re: Problem with refine category: need URL without GET parameters
« Reply #5 on: August 20, 2018, 10:02:12 pm »
If you alter the filter fields without altering the url it makes no changes to the search. You musr reload the page with an url that does not  contain filters.
thanks for reposing.
I said i can not reset form by html or javascript. because after clicking reset button it can not clear data and data on form stable but when i clear data step by step by focus and delete then ,submit cleared form, it works.

why javascript can not clear data of form?


marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1652
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: Problem with refine category: need URL without GET parameters
« Reply #6 on: August 20, 2018, 10:17:32 pm »
Maybe it's related to the url. Try location.href= instead, and alter the uri string.