Post by Shadowbreed » Thu Jan 19, 2017 5:49 am

Is there any way to make the default view on categories be list view?
It looks much better then grid view, but I can't find a way to change it to be list by default.

All results I've found while searching for a solution refer to changes for 1.5 which no longer seems to be the same for 2.3.0.2

Newbie

Posts

Joined
Thu Jan 19, 2017 5:46 am

Post by OpenCart Addons » Thu Jan 19, 2017 10:17 am

Try this:

In catalog/view/javascript/common.js

Find:

Code: Select all

if (localStorage.getItem('display') == 'list') {
		$('#list-view').trigger('click');
		$('#list-view').addClass('active');
	} else {
		$('#grid-view').trigger('click');
		$('#grid-view').addClass('active');
	}
Replace With:

Code: Select all

if (localStorage.getItem('display') == 'grid') {
		$('#grid-view').trigger('click');
		$('#grid-view').addClass('active');
	} else {
		$('#list-view').trigger('click');
		$('#list-view').addClass('active');
	}

Regards,
Joel.

Canada's Leading Expert In OpenCart Development & Certified OpenCart Development Partner Image


User avatar
Active Member

Posts

Joined
Thu Nov 24, 2011 10:51 am
Location - Canada

Post by Shadowbreed » Mon Jan 23, 2017 4:09 am

That worked, thanks so much :D

Newbie

Posts

Joined
Thu Jan 19, 2017 5:46 am
Who is online

Users browsing this forum: No registered users and 9 guests