Does anybody have any experience using `setSorting...
# suitecommerce
j
Does anybody have any experience using
setSorting
on the PLP component? I’m trying to get category data and use that data to determine the how that category’s items should be sorted. This is the closest I can get, but the page keeps re-rendering itself for some reason…
Copy code
var plpComp = container.getComponent('PLP');

if (plpComp) {
	plpComp.on('beforeShowContent', function () {
		var catInfo = plpComp.getCategoryInfo();
		//conditionally set the sorting based on catInfo properties
		plpComp.setSorting({sorting: "onlinecustomerprice:asc"});
	});
};