Community Forums

setting grid view as default

Please post any issues you are having concerning installation or upgrade of OpenCart v1.x

setting grid view as default

Postby DnAWebCreations » Sat Mar 10, 2012 7:00 pm

I am using the default theme for opencart. I have grid size set to how I want it but I am trying to set the grad view a the default. The code I have tried to change to get it to work is below. But it did not work when I open it in another browser so it is not loading from the admin panel it shows as a list view.
This is the code I changed in the catalog/view/theme/default/template/product/category.tpl file
<div class="display"><b><?php echo $text_display; ?></b> <?php echo $text_list; ?> <b>/</b> <a onclick="display('grid');"><?php echo $text_grid; ?></a></div>

I changed it to this but it did no good.
<div class="display"><b><?php echo $text_display; ?></b> <?php echo $text_grid; ?> <b>/</b> <a onclick="display('list');"><?php echo $text_list; ?></a></div>


Can anyone help me with this?
DnAWebCreations
 
Posts: 17
Joined: Sun Feb 12, 2012 5:52 pm

Re: setting grid view as default

Postby florinsith » Sun Mar 11, 2012 2:02 am

see this topic: viewtopic.php?t=38143
User avatar
florinsith
 
Posts: 3855
Joined: Thu May 13, 2010 1:36 pm

Re: setting grid view as default

Postby DnAWebCreations » Sun Mar 11, 2012 9:52 am

Thanks a lot, as best I can tell it is working great.
DnAWebCreations
 
Posts: 17
Joined: Sun Feb 12, 2012 5:52 pm

Re: setting grid view as default

Postby callaghand » Tue Mar 13, 2012 7:40 pm

Hi,
im using version 1.5.1.3 and the following has worked for me.

Try the following in category.tpl. Change the last line : display('list'); to display('grid');

view = $.cookie('display');

if (view) {
display(view);
} else {
display('grid');

my website is http://www.callaghancandles.ie
callaghand
 
Posts: 1
Joined: Tue Mar 13, 2012 4:45 pm

Re: setting grid view as default

Postby DnAWebCreations » Sun Mar 18, 2012 12:09 pm

callaghand wrote:Hi,
im using version 1.5.1.3 and the following has worked for me.

Try the following in category.tpl. Change the last line : display('list'); to display('grid');

view = $.cookie('display');

if (view) {
display(view);
} else {
display('grid');

my website is http://www.callaghancandles.ie


When you update do you have to go back in and change the code to have the default as a grid? I had it working with the first way I tried but after update it is back to list view.
DnAWebCreations
 
Posts: 17
Joined: Sun Feb 12, 2012 5:52 pm

Re: setting grid view as default

Postby jty » Mon Mar 19, 2012 5:58 pm

DnAWebCreations wrote:When you update do you have to go back in and change the code to have the default as a grid? I had it working with the first way I tried but after update it is back to list view.

Depends on what theme ou are using. If you are using the default open cart theme, then yes as the upgrade will have overwritten the previous version of the file.

If you are using a custom file, then in this particular instance, probably not as you custom file will not ave been overridden. Then again, if you are using a custom theme, then you might have other problem as you need to upgrade your custom file.

Have a look at your file, is the change you made still there ?
jty
 
Posts: 1228
Joined: Fri Aug 29, 2008 7:19 pm


Return to Installation, Upgrade, & Config Support

Who is online

Users browsing this forum: 1975bloom and 29 guests

Hosted by Arvixe Web Hosting