- Posts: 165
- Thank you received: 3
Direct link to filter messes up pagination
- jschroeder
-
Topic Author
- Offline
Less
More
12 years 5 months ago - 12 years 5 months ago #151400
by jschroeder
Direct link to filter messes up pagination was created by jschroeder
-- 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
-- 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: 12 years 5 months ago by jschroeder.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
12 years 5 months ago #151539
by Mohamed Thelji
Replied by Mohamed Thelji on topic Direct link to filter messes up pagination
Please Log in or Create an account to join the conversation.
- jschroeder
-
Topic Author
- Offline
Less
More
- Posts: 165
- Thank you received: 3
12 years 5 months ago - 12 years 5 months ago #151541
by jschroeder
Replied by jschroeder on topic Direct link to filter messes up pagination
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?
How do I get this to work?
Last edit: 12 years 5 months ago by jschroeder.
Please Log in or Create an account to join the conversation.
12 years 5 months ago #151783
by Jerome
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.
Replied by Jerome on topic Direct link to filter messes up pagination
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,
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.
- jschroeder
-
Topic Author
- Offline
Less
More
- Posts: 165
- Thank you received: 3
12 years 5 months ago #151845
by jschroeder
Replied by jschroeder on topic Direct link to filter messes up pagination
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
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.
12 years 5 months ago #151906
by nicolas
Replied by nicolas on topic Direct link to filter messes up pagination
Hi,
Change the line:
to:
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.
Change the line:
Code:
if(!is_null($new_filter)){
to:
Code:
$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){
Please Log in or Create an account to join the conversation.
- jschroeder
-
Topic Author
- Offline
Less
More
- Posts: 165
- Thank you received: 3
12 years 5 months ago - 12 years 5 months ago #152134
by jschroeder
Replied by jschroeder on topic Direct link to filter messes up pagination
I am getting an Parse error: syntax error, unexpected T_STRING in line 1
Any ideas?
Thanks,
Josh
Any ideas?
Thanks,
Josh
Last edit: 12 years 5 months ago by jschroeder.
Please Log in or Create an account to join the conversation.
- jschroeder
-
Topic Author
- Offline
Less
More
- Posts: 165
- Thank you received: 3
12 years 5 months ago - 12 years 5 months ago #152141
by jschroeder
Replied by jschroeder on topic Direct link to filter messes up pagination
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
Thanks,
Josh
Last edit: 12 years 5 months ago by jschroeder.
Please Log in or Create an account to join the conversation.
12 years 5 months ago - 12 years 5 months ago #152144
by Xavier
Replied by Xavier on topic Direct link to filter messes up pagination
Hi,
Glad to hear that it's ok now. And thanks to have given the solution to your problem.
Glad to hear that it's ok now. And thanks to have given the solution to your problem.
Last edit: 12 years 5 months ago by Jerome.
Please Log in or Create an account to join the conversation.
Time to create page: 0.260 seconds