Post by Cassiefa » Wed Apr 11, 2012 11:47 pm

I'm having trouble setting my default view in categories from list to grid.

I've tried a few things from other threads on the forum including downloading the vqmod and adding this mod uksb_grid_view_default.xml but it hasn't changed the view, despite clearing cookies.

I'm using the default template of Opencart 1.5.2.1 - so do I need to make changes to anything in my admin area to make the default grid setting apply?

This is my store: http://www.tutuswingsandprettythings.com

Any help is greatly appreciated!

Newbie

Posts

Joined
Wed Apr 11, 2012 11:37 pm

Post by dbassa » Thu Apr 12, 2012 12:00 am

Hello Casiefa,

Try to locate this piece of code, generally at the bottom of the tpl category list file:

Code: Select all

view = $.cookie('display');

if (view) {
	display(view);
} else {
	display('list');
}
You should just change de part: display('list') to display('grid')

Like this:

Code: Select all

view = $.cookie('display');

if (view) {
	display(view);
} else {
	display('grid');
}
Best regards,

User avatar
Active Member

Posts

Joined
Tue May 19, 2009 12:11 am
Location - Spain

Post by Melanie » Mon Apr 16, 2012 8:23 am

Hi there,

I done the above but it still didnt make a difference.

Still listing in list view...


Any help?
Thanks.

New member

Posts

Joined
Tue Mar 30, 2010 9:39 am

Post by MarketInSG » Mon Apr 16, 2012 10:24 am

Clear your browser cookies after you done that and you should see the effect. New users to your website will see view as default 'grid'. Else if you want permanent grid layout, add this:

Code: Select all

<script type="text/javascript">$(document).ready(function() { if(typeof display == 'function') { display('grid'); } });</script>


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by dbassa » Mon Apr 16, 2012 8:22 pm

MarketInSG,

Could you explain what does exactly this script?

Thanks,

User avatar
Active Member

Posts

Joined
Tue May 19, 2009 12:11 am
Location - Spain

Post by MarketInSG » Mon Apr 16, 2012 9:36 pm

MarketInSG wrote:Clear your browser cookies after you done that and you should see the effect. New users to your website will see view as default 'grid'. Else if you want permanent grid layout, add this:

Code: Select all

<script type="text/javascript">$(document).ready(function() { if(typeof display == 'function') { display('grid'); } });</script>


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by dbassa » Mon Apr 16, 2012 11:19 pm

I meant the javascript code. It doesn't matter. Thanks anyway.

User avatar
Active Member

Posts

Joined
Tue May 19, 2009 12:11 am
Location - Spain

Post by jariusj77 » Tue Apr 17, 2012 9:41 am

Hopefully somebody else can give you a better answer![img]Hopefully%20somebody%20else%20can%20give%20you%20a%20better%20answer[/img]

Newbie

Posts

Joined
Thu Mar 29, 2012 9:09 am

Post by MarketInSG » Tue Apr 17, 2012 2:16 pm

jariusj77 wrote:Hopefully somebody else can give you a better answer![img]Hopefully%20somebody%20else%20can%20give%20you%20a%20better%20answer[/img]
Not useful comments can be kept :)


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by opm595 » Thu Apr 26, 2012 1:17 pm

I had the same prob, wanting to have Grid by default.
I went with what dbassa instructions and it worked fine for me.
Just changed display('list'); to display('grid'); in the category TPL file, cleared my cache and presto!
All good here.
Many thanks for that tip, dbassa.
Cheers! ;D

======================================
"OpenCart . . . What a Catch! It's Marvelous!"
=======================================


User avatar
Newbie

Posts

Joined
Thu Apr 19, 2012 8:27 am
Location - Sydney, Australia

Post by dbassa » Fri Apr 27, 2012 5:26 pm

You're welcome!

User avatar
Active Member

Posts

Joined
Tue May 19, 2009 12:11 am
Location - Spain

Post by werepair » Tue May 29, 2012 1:16 pm

UKsitebuilder has a vqmod for this http://forum.opencart.com/viewtopic.php?f=131&t=38143

Regards

User avatar
Active Member

Posts

Joined
Sat May 28, 2011 2:54 pm
Location - United Kingdom

Post by onlyjf » Fri Jun 01, 2012 12:16 am

Thanks for this

Newbie

Posts

Joined
Thu Jun 24, 2010 1:57 pm

Post by hellreturn » Fri Jun 01, 2012 4:36 pm

Can someone please tell me the path for that file?

New member

Posts

Joined
Tue May 29, 2012 4:21 am

Post by dbassa » Fri Jun 01, 2012 7:48 pm

tpl category list file:

catalog/view/theme/default/template/product/category.tpl

At the end of the file you will find it.

Best Regards,

User avatar
Active Member

Posts

Joined
Tue May 19, 2009 12:11 am
Location - Spain

Post by lmw1 » Mon Jun 11, 2012 11:56 am

The javascript above to make the grid view permanent. Where do you place this script? I put it in the bottom of the category.tpl file and you can still choose list.

Or am I misinterpreting this? lol

Respectfully,
Len

New member

Posts

Joined
Mon Jun 04, 2012 1:44 pm

Post by sjiitb » Fri Jun 15, 2012 5:03 am

hi
I've changed the default view to grid but what happens now is that it goes back to list randomly - only sometimes, on some machines.

Could someone please point me in the right direction?

This is what i've done

f (view) {
display(view);
} else {
display('list'); ---> change to grid
}

Newbie

Posts

Joined
Sun May 20, 2012 8:51 pm

Post by Rosettes » Thu Jul 05, 2012 3:41 am

dbassa wrote:Hello Casiefa,

Try to locate this piece of code, generally at the bottom of the tpl category list file:

Code: Select all

view = $.cookie('display');

if (view) {
	display(view);
} else {
	display('list');
}
You should just change de part: display('list') to display('grid')

Like this:

Code: Select all

view = $.cookie('display');

if (view) {
	display(view);
} else {
	display('grid');
}
Best regards,

Just wanted to say you star, it worked perfectly for me too! However after clicking around my website I decided I preferred the list view instead, but awesome it worked straight away so thought I would comment :)

User avatar
Newbie

Posts

Joined
Wed Feb 29, 2012 4:43 am


Post by SunehraTech » Thu Jul 26, 2012 5:08 am

dbassa help worked for me.. thanks

New member

Posts

Joined
Sun Jun 24, 2012 1:19 am

Post by ForgetfulGuru » Fri Jul 27, 2012 6:25 am

@dbassa Thanks this simple change was just what I was looking for.

Life is for the taking. It's everything else you need to pay for.
Anne Makes Lovely Candles


User avatar
New member

Posts

Joined
Sun Jul 22, 2012 11:12 pm
Location - Left hand corner as you enter the room, better feng shui.
Who is online

Users browsing this forum: No registered users and 17 guests