Jump to content

Layered block with Product sort problem


Recommended Posts

Hi.

 

I have a problem with layered block, everytime I tick some filter on Layered block and then I sort it with "product sort" (eg. sort by highest price), it only returns with with Product sort filter result meanwhile the layered block became unticked again.

but if I do it the other way, I sort it first by price for example and then tick some checkbox filter on layered block it works fine, both filters works (both layered block and product sort filters on selected value with desired result showing).

 

I also noticed, if I tick layered block checkbox it only refresh the product result, but if I activate product sort filter it refresh the whole page (maybe thats why the tick on checkbox disappear)

 

how to fix it? I'm using prestashop 1.6.0.14 (link: kliknklik.com)

 

Thank you.

Link to comment
Share on other sites

I've updated layered navigation and try with default themes, and it works. when I try with non-default theme but it only works on chrome, while on firefox still the same as before(cache and cookie cleared).

any idea?

Link to comment
Share on other sites

still doesn't work, the page still refreshed on firefox after I pick a sort by filter.

btw I noticed the same case on prestashop demo, regardless of browser when you combine layered navigation filter first and then product sort filter after that, the page refreshed itself.

Edited by Syns (see edit history)
Link to comment
Share on other sites

  • 2 months later...
  • 1 year later...

Go to global.js find event with .selectProductSort and remove or comment it.

$(document).on('change', '.selectProductSort', function(e){
	if (typeof request != 'undefined' && request)
		var requestSortProducts = request;
	var splitData = $(this).val().split(':');
	var url = '';
	if (typeof requestSortProducts != 'undefined' && requestSortProducts)
	{
		url += requestSortProducts ;
		if (typeof splitData[0] !== 'undefined' && splitData[0])
		{
			url += ( requestSortProducts.indexOf('?') < 0 ? '?' : '&') + 'orderby=' + splitData[0] + (splitData[1] ? '&orderway=' + splitData[1] : '');
			if (typeof splitData[1] !== 'undefined' && splitData[1])
				url += '&orderway=' + splitData[1];
		}
		document.location.href = url;
	}
});
Edited by stdeykun (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...