Unfriendly url after filtering

  • Posts: 217
  • Thank you received: 4
9 years 5 months ago #203249

-- url of the page with the problem -- : elody.cz/obchod
-- HikaShop version -- : 2.3.5

Hello,

I just upraged my hikashop essential to business version.

I tried to add some filters and after filtering url looks like:

http://elody.cz/component/hikashop/product/listing?Itemid=0

before filtering:
http://elody.cz/obchod

desired url
http://elody.cz/obchod?filtername=filter_value

is it possible to make it?

Thank you in advance!

Filip

Last edit: 9 years 5 months ago by FilipHradil.

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 5 months ago #203288

Hi,

Please see the "redirect POST mode" setting.
www.hikashop.com/support/support/documen...g.html#main_advanced

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.
The following user(s) said Thank You: FilipHradil

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

  • Posts: 217
  • Thank you received: 4
9 years 5 months ago #203365

Thank you!

Is there any way how to customize/shorten url or hide unused filters in url?

Thank you!

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
9 years 5 months ago #203366

Hi,

The parts component/hikashop and ?Itemid=0 comes from the fact that you didn't enter any menu item id in the correspoding setting of your filtering module.
The product/listing part is necessary but can be simplified as well. Specially with the Itemid being set to a products listing menu item, it will normally be removed automatically.

For the filters, not much can be done. The parameters are necessary for the filtering system to work properly in all the cases.
That's why by default we don't activate the filter parameters in the URLs as it can get messy if you have a lot of filters, pagination, etc.

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

  • Posts: 217
  • Thank you received: 4
9 years 5 months ago #203427

Hello,

thank you very much for your reply, Nicolas.

  • If Messy url - nevermind, but if I filter once and then click on filter button again it redirect me on homepage url:
    http://elody.cz/index.php?filter_Styl=+&filter_Styl%5B%5D=uzke&filter_Raminka___rukavy=+&filter_Zdobnost=+&filter_Krajka=+&filter_Cena=&filter_Cena_values=6000+-+14000&return_url=http%3A%2F%2Felody.cz%2Findex.php%3Ffilter_Styl%3D%2B%26filter_Styl%255B%255D%3Duzke%26filter_Raminka___rukavy%3D%2B%26filter_Zdobnost%3D%2B%26filter_Krajka%3D%2B%26filter_Cena%3D%26filter_Cena_values%3D6000%2B-%2B14000%26return_url%3Dhttp%253A%252F%252Felody.cz%252Fobchod%26filtered%3D1%26reseted%3D0&filtered=1&reseted=0
  • I placed filters in module but the problem is that the module is shown in product page, is there any way how to show it only on product listing?

Can you recommend me how to solve it, please?

Filip

Last edit: 9 years 5 months ago by FilipHradil.

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

  • Posts: 13201
  • Thank you received: 2322
9 years 4 months ago #207212

Hi,

- Do you have many filters on the same page ? We were not able to reproduce your issue on our end. So please give us full details on our settings :)

- To have a module only on a listing and not on a product page, please use "advanced module manager" which has an integration with us.

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

  • Posts: 217
  • Thank you received: 4
9 years 4 months ago #207334

Hello,

thank you.

Now, I have just problem with extending url by every filtering.

See my sublast post in this thread, please:
www.hikashop.com/forum/product-category-...ront-end.html#204788


Thank you!

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
9 years 4 months ago #207342

Hi,

Add the code:

}else{
		$url = preg_replace('#&return_url=[^&]+#i','',$url);
after the line:
$url = hikashop_completeLink($type.'&task=listing&Itemid='.$this->params->get('itemid',0));
in the file "filter" of the view "product" via the menu Display>Views and that should fix the problem.

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

  • Posts: 217
  • Thank you received: 4
9 years 4 months ago #207375

Hi Nicolas,

thank you. But it did not solve the problem.

Code after few filtering:¨

http://elody.cz/obchod/vse?filter_styl=+&filter_styl%5B%5D=acko&filter_raminka=+&filter_
raminka%5B%5D=bezrukavu&filter_zdobnost=+&filter_zdobnost%5B%5D=decent&filter_krajka=
+&filter_krajka%5B%5D=ano&filter_razeni=none&return_url=http%3A%2F%2Felody.cz%2Fobchod
%2Fvse%3Ffilter_styl%3D%2B%26filter_styl%255B%255D%3Dacko%26filter_raminka%3D%2B%26
filter_raminka%255B%255D%3Dbezrukavu%26filter_zdobnost%3D%2B%26filter_zdobnost%255B
%255D%3Ddecent%26filter_krajka%3D%2B%26filter_razeni%3Dnone%26filtered%3D1%26reseted
%3D0&filtered=1&reseted=0

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
9 years 4 months ago #207439

Hi,

I beg to differ.
Your issue was that the return_url parameter kept on being added over and over, making the URL bigger and bigger.
This is not the case anymore.
But I couldn't understand why that parameter was still added. I thus didn't some tests on my end and didn't had the issue at all. Then I debugged the issue on your website and found out that you had changed the method of the filter form to "get" instead of "post" in the filter view file and thus the form was adding the return_url parameter to the URLs.
So the issue actually comes from a modification you did to the view file.

I've actually tried to revert your change and it seems that it breaks the filters modification capability. Maybe due to another modification or a bug fixed since then ( as you're on the 2.4.0).
So I would recommend to keep it like this and live with it. It should not change anything for SEO anyway.

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

  • Posts: 217
  • Thank you received: 4
9 years 4 months ago #207533

Hello Nicolas,

thank you very much. I appreciate your help.
I changed get method to post in filter view and it does the trict.
Url is now very short.

Best Regards
Filip

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

  • Posts: 217
  • Thank you received: 4
9 years 4 months ago #207779

Hello,

sorry Nicolas, it is not still ok. When I set more parameters for one filter it do not show any results.
Before (with long url) it was alright.

Any idea please?

Filip

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

  • Posts: 82867
  • Thank you received: 13373
  • MODERATOR
9 years 4 months ago #207891

Hi,

I've added a patch in order to have the filters to work with several values.
It's working on your website now.

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

  • Posts: 217
  • Thank you received: 4
9 years 4 months ago #208049

Hello,

thank you! Now it's perfect! B)

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

Time to create page: 0.091 seconds
Powered by Kunena Forum