Direct link to filter messes up pagination

  • Posts: 165
  • Thank you received: 3
10 years 7 months ago #151400

-- url of the page with the problem -- : 209.59.173.183/mattresses/category.html?...filtered=1&reseted=0
-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.2.3
-- PHP version -- : x.x.x
-- Browser(s) name and version -- : XXXXX x.x.x
-- Error-message(debug-mod must be tuned on) -- : Error_message

Hi I have a problem where I want a direct link to a filter url. I need to have a page that lists all products $599 and more for the price. This link is linked from an image so I cannot use the actual filter that is why I have to have a direct link. The filter url I listed above works but it messes up the pagination on the results and the pagination just does not work at all. The pagination will not go past page 1. The only way to see all the products is to change the display to all. How can I fix this?

I am supposed to launch the store in 1 day. Any help would be greatly appreciated.

Thanks,

Josh

Last edit: 10 years 7 months ago by jschroeder.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
10 years 7 months ago #151539

Hello Josh,
I just tested it and it seems to be working fine :

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 165
  • Thank you received: 3
10 years 7 months ago #151541

Hi thanks for the response but it is not working click on page 2, page 3 or page 4 it will not change pages it just reloads page 1 again. The pagination navigation just does not work at all when you use a direct filter link.

How do I get this to work?

Last edit: 10 years 7 months ago by jschroeder.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
10 years 7 months ago #151783

Hi,

The problem comes from the URL parameters.
The way that the Joomla pagination works, it use the current url and submit a form to say that you want to change the page.

So, it will reload the current page and ask to display the page 2. But in your parameters, you forced some filters which are applied and put you in the first page (because potentially, some filters have changed).
If you apply the filters using the button "Find your Mattress!", you will have a clean url and you will be able to change the pagination.

So I will recommend you for the moment to redirect the user to the "short" url when giving some filters parameters. At this moment the parameters won't be in the url when changing the pagination.

I will create a bug issue in our tracker to fix in HikaShop as soon as possible.
There are several possible solution for this problem and I don't know which one the team will prefer.
But we will fix it.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 165
  • Thank you received: 3
10 years 7 months ago #151845

Thank you for the response please let me know when it is fixed. The problem with using the find your mattress is I have an image that says free shipping on orders 599 and over and it needs to have a direct link to a filter that lists all products 599 and over and this cannot be done by the short link because it is always the same url so there is no way to link to this.

Are you saying to actually create a link to this url but have the below url redirect to /mattresses/category.html which is the shorter url until yall get it fixed?
/mattresses/category.html?filter_Price_Range=1&filter_Price_Range_values=599+-+20000&filter_Mattress_Firmness=&filter_Mattress_Firmness_values=1+-+6&filter_Mattress_Brand=+&filter_Mattress_Size=+&filter_Mattress_Type=+&return_url=%2Fmattresses%2Fcategory.html&filtered=1&reseted=0


Thanks,

Josh

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
10 years 7 months ago #151906

Hi,

Change the line:

if(!is_null($new_filter)){

to:
			$cid = JRequest::getInt("cid",'itemid_'.JRequest::getInt("Itemid",0));
			$oldValue = $app->getUserState('com_hikashop.'.$cid.'_filter_'.$filter->filter_namekey, '');

			if(!is_null($new_filter) && $new_filter!=$oldValue){
in the file administrator/components/com_hikashop/classes/filter.php and that will allow the filtering system to not reset the pagination on each page when you set the filter via the URL instead of using the POST like we do with the default filters display.

Please Log in or Create an account to join the conversation.

  • Posts: 165
  • Thank you received: 3
10 years 7 months ago #152134

I am getting an Parse error: syntax error, unexpected T_STRING in line 1

Any ideas?

Thanks,

Josh

Last edit: 10 years 7 months ago by jschroeder.

Please Log in or Create an account to join the conversation.

  • Posts: 165
  • Thank you received: 3
10 years 7 months ago #152141

It is working now. It is something weird in how you paste the text into the file. Sometimes it gives a parse error. I am using notepad ++ so I am not sure why it is doing this. I just edited it in regular notepad and it worked fine now.

Thanks,

Josh

Last edit: 10 years 7 months ago by jschroeder.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
10 years 7 months ago #152144

Hi,

Glad to hear that it's ok now. And thanks to have given the solution to your problem.

Last edit: 10 years 7 months ago by Jerome.

Please Log in or Create an account to join the conversation.

Time to create page: 0.067 seconds
Powered by Kunena Forum