Sort by price on front end

  • Posts: 217
  • Thank you received: 4
8 years 11 months ago #203632

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.1

Hello,

is there any way how to allow users to sort on product listing?
By price (ascending, descending).

I did not found anything

Thank you
Filip

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

  • Posts: 13201
  • Thank you received: 2322
8 years 11 months ago #203634

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

  • Posts: 217
  • Thank you received: 4
8 years 11 months ago #203729

Hello!

I had to miss something. Thank you very much! :)

But when I change sorting twice it makes mistake in url and I get to main page

bad url

http://elody.cz/index.php?filter_styl=+&filter...............

correct url (works only for 1st submiting form)
http://elody.cz/obchod?filter_styl=+&filter...............

Thank you!

Filip

Last edit: 8 years 11 months ago by FilipHradil.

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
8 years 11 months ago #203732

Hi,

Please make sure that you've entered 270 in the menu item id setting of your filter module and that the "force redirect" setting is turned on there and that should avoid the issue.

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

  • Posts: 217
  • Thank you received: 4
8 years 11 months ago #203770

Thank you!

Force redirect on (filter module) worked for filter but on pagination this problem lasts.

Any idea?

And is there any option how to exclude filter module from product view?


Thank you!

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
8 years 11 months ago #203777

Hi,

1. This indicates a problem with the variables passed by PHP in the $_SERVER superglobal array on your server.
Could you add a <?php var_dump($_SERVER); ?> at the beginning of the listing_div file of the product view in order to get the debug data of this array so that we can see what's going on ? (you can just post it here and then remove it from your view)

2. If you want to exclude modules from product pages, the simplest would be to use advanced module manager which allows for such granularity when configuring your modules:
www.nonumber.nl/fr/extensions/advancedmodulemanager

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
8 years 11 months ago #203840

Hello,

thank you for such a great support! I appreciate it!:)

1. Done.

2. Thank you, works great! (Exclude url option)

Filip

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
8 years 11 months ago #203864

Hi,

Could you try to change the code:

if(!empty($_SERVER["REDIRECT_URL"]) && preg_match('#.*index\.php$#',$_SERVER["REDIRECT_URL"]) && empty($_SERVER['QUERY_STRING'])&&(empty($_SERVER['REDIRECT_QUERY_STRING']) || strpos($_SERVER['REDIRECT_QUERY_STRING'],'&')===false) && !empty($_SERVER["REQUEST_URI"])){
to:
if(!empty($_SERVER["REDIRECT_URL"]) && preg_match('#.*index\.php$#',$_SERVER["REDIRECT_URL"]) && !empty($_SERVER["REQUEST_URI"])){
in the file administrator/components/com_hikashop/helpers/helper.php and see if that helps ?

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

  • Posts: 217
  • Thank you received: 4
8 years 11 months ago #203879

Hello,

this change makes url like this:

http://elody.cz/obchod?limit=20&limitstart=0&limitstart=0&limitstart=0&limitstart=60?limit=20&limitstart=0&limitstart=0&limitstart=0&limitstart=60?limit=20&limitstart=0&limitstart=0&limitstart=0&limitstart=60?limit=20&limitstart=0&limitstart=0&limitstart=0&limitstart=60

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

  • Posts: 81677
  • Thank you received: 13102
  • MODERATOR
8 years 11 months ago #203894

Hi,

Ok. Can you remove that change, and instead,
add the code:

	}elseif(!empty($_SERVER["REDIRECT_URL"]) && preg_match('#.*index\.php$#',$_SERVER["REDIRECT_URL"]) && !empty($_SERVER["REQUEST_URI"])){
		$requestUri = $_SERVER["REQUEST_URI"];
before the line:
}elseif(!empty($_SERVER["REDIRECT_URL"]) && (isset($_SERVER['QUERY_STRING'])||isset($_SERVER['REDIRECT_QUERY_STRING']))){
in that same file ?

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

  • Posts: 217
  • Thank you received: 4
8 years 11 months ago #203963

Hi Nicolas,

Yes now it is perfect, thank you!

Filip

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

  • Posts: 217
  • Thank you received: 4
8 years 11 months ago #204394

Hello again,

sorry I just realized that my url is longer and longer when I filter more time.

1st filtering

http://elody.cz/obchod/vse?filter_styl=+&filter_raminka=+&filter_raminka%5B%5D=bezraminek&filter_zdobnost=+&filter_krajka=+&filter_razeni=none&return_url=http%3A%2F%2Felody.cz%2Fobchod%2Fvse&filtered=1&reseted=0

2nd filtering
http://elody.cz/obchod/vse?filter_styl=+&filter_raminka=+&filter_raminka%5B%5D=bezrukavu&filter_zdobnost=+&filter_krajka=+&filter_razeni=none&return_url=http%3A%2F%2Felody.cz%2Fobchod%2Fvse%3Ffilter_styl%3D%2B%26filter_raminka%3D%2B%26filter_raminka%255B%255D%3Dbezraminek%26filter_zdobnost%3D%2B%26filter_krajka%3D%2B%26filter_razeni%3Dnone%26return_url%3Dhttp%253A%252F%252Felody.cz%252Fobchod%252Fvse%26filtered%3D1%26reseted%3D0&filtered=1&reseted=0

3rd filtering
http://elody.cz/obchod/vse?filter_styl=+&filter_raminka=+&filter_raminka%5B%5D=kratkerukavy&filter_zdobnost=+&filter_krajka=+&filter_razeni=none&return_url=http%3A%2F%2Felody.cz%2Fobchod%2Fvse%3Ffilter_styl%3D%2B%26filter_raminka%3D%2B%26filter_raminka%255B%255D%3Dbezrukavu%26filter_zdobnost%3D%2B%26filter_krajka%3D%2B%26filter_razeni%3Dnone%26return_url%3Dhttp%253A%252F%252Felody.cz
%252Fobchod%252Fvse%253Ffilter_styl%253D%252B%2526filter_raminka%253D%252B%2526filter_raminka%25255B%25255D%253Dbezraminek%2526filter_zdobnost%253D%252B%2526filter_krajka%253D%252B%2526filter_razeni%253Dnone%2526return_url%253Dhttp%25253A%25252F%25252Felody.cz%25252Fobchod%25252Fvse%2526filtered%253D1%2526reseted%253D0%26filtered%3D1%26reseted%3D0&filtered=1&reseted=0

Is that purposely or its an error?


Thank you

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

  • Posts: 217
  • Thank you received: 4
8 years 11 months ago #204788

Please, could you help me, Nicolas?

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

  • Posts: 13201
  • Thank you received: 2322
8 years 10 months ago #207213

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

Time to create page: 0.092 seconds
Powered by Kunena Forum