Post by manny79 » Fri Jun 03, 2011 9:22 am

Love the changes in OC 1.5

Is there a way to set grid view as default in OC 1.5?

Any help will be greatly appreciated
Last edited by uksitebuilder on Wed Nov 02, 2011 6:29 pm, edited 2 times in total.
Reason: Please use [version] TAG in subject!

New member

Posts

Joined
Tue May 24, 2011 7:52 am

Post by justinv » Fri Jun 03, 2011 5:02 pm

Edit catalog/view/theme/<themename>/template/common/footer.tpl:

Place this code before the </body> tag:

Code: Select all

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

Documentation: OpenCart User Guide
Mods: Total Import PRO | CSV Import PRO | Ecom Tracking | Any Feed | Autosuggest | OpenCart CDN
Image


Active Member

Posts

Joined
Tue Oct 12, 2010 1:24 pm

Post by manny79 » Sat Jun 04, 2011 7:10 pm

justinv wrote:Edit catalog/view/theme/<themename>/template/common/footer.tpl:

Place this code before the </body> tag:

Code: Select all

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

Thanx for your reply. Sorry for the late reply... Been on a sabbatical for the last 24 hours...
Thank you again

New member

Posts

Joined
Tue May 24, 2011 7:52 am

Post by sjmaceyful » Thu Jun 16, 2011 5:14 pm

This wont work. Well it will, but it will, throw up an error on any page that doesn't have a category view on it (ie Home page).

Does anyone have a better solution? Surely there must be a way to change this in the admin section.

Newbie

Posts

Joined
Thu Jun 16, 2011 5:11 pm

Post by qahar » Thu Jun 16, 2011 7:36 pm

Open category.tpl and find code bellow:

Code: Select all

if (view) {
	display(view);
} else {
	display('list');    ---> change to grid
}
Do the same thing on other page used grid-list, like manufacturer, special etc

User avatar
Expert Member

Posts

Joined
Tue Jun 29, 2010 10:24 pm
Location - Indonesia

Post by budfox » Wed Jun 22, 2011 4:36 pm

I just cannot get this to work...Cleared cookies, tried in different browsers...nada. Still getting a list view.

Ideas anyone?

New member

Posts

Joined
Fri Oct 01, 2010 4:06 am

Post by jomachi » Wed Jun 22, 2011 5:46 pm

Also, i prefer the grid view. So i try the trick given by qahar and it works on the last version of OC 1.5.0.5

OpenCart 1.5.1 / Install on VPS Hosting


Newbie

Posts

Joined
Wed Jun 22, 2011 3:23 pm

Post by budfox » Wed Jun 22, 2011 5:51 pm

Ah, best get 1.5.05 then...

New member

Posts

Joined
Fri Oct 01, 2010 4:06 am

Post by chokoret » Fri Jun 24, 2011 2:42 am

Find

Code: Select all

  <div class="product-list"> 
from category.tpl
and change it to

Code: Select all

  <div class="product-grid">

User avatar
New member

Posts

Joined
Thu Jun 09, 2011 1:26 am
Location - Los Angeles, CA

Post by Dubblicious » Fri Jun 24, 2011 1:26 pm

qahar wrote:Open category.tpl and find code bellow:

Code: Select all

if (view) {
	display(view);
} else {
	display('list');    ---> change to grid
}
Do the same thing on other page used grid-list, like manufacturer, special etc
Thanks qahar that worked like a charm.
anyone that is looking for it, it is catalog\view\theme\default\template\product.

User avatar
New member

Posts

Joined
Tue Jun 14, 2011 2:35 pm

Post by Jacob » Fri Jun 24, 2011 9:47 pm

anyone that is looking for it, it is catalog\view\theme\default\template\product.
Remember to make your own theme and not edit the default files, it is fairly easy to do :)

Theme documentation

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by Jacob » Fri Jun 24, 2011 10:51 pm

I got rid of the following divs and their code (which includes display grid/list) as it was not wanted on our site.

Code: Select all

  <div class="product-filter">
    <div class="display"></div>
    <div class="limit"></div>
    <div class="sort"></div>
  </div>

<div class="display"></div>
I then deleted all the js at the bottom of the page. ;)

In the css file I commented out all the .product-list styles.

Then renamed .product-grid to .product-list.

This has set our product's default display to grid ;D

It worked for me - someone with more coding knowledge than myself may want to comment on whether they think it is a good solution or not?

Active Member

Posts

Joined
Thu Dec 04, 2008 9:17 pm

Post by Dubblicious » Sat Jun 25, 2011 2:57 am

Jacob wrote:
anyone that is looking for it, it is catalog\view\theme\default\template\product.
Remember to make your own theme and not edit the default files, it is fairly easy to do :)

Theme documentation
Thanks for that, I did not know you could do a child theme like WordPress.

User avatar
New member

Posts

Joined
Tue Jun 14, 2011 2:35 pm

Post by uksitebuilder » Sat Jun 25, 2011 4:22 pm

Thanks to Qahar

There is however an additional code change that is required, especially if using SEO URLs otherwise a cookie is set only on a per category basis and when switching to a different category sometimes it defaults back to list view.

Here is the full code change for category.tpl

Find:

Code: Select all

$.cookie('display', 'grid');
Change to:

Code: Select all

$.cookie('display', 'grid', { path: '/' });
Find:

Code: Select all

$.cookie('display', 'list');
Change to:

Code: Select all

$.cookie('display', 'list', { path: '/' });
Find:

Code: Select all

display('list');
Change to:

Code: Select all

display('grid');
The above changes should be done to the following files:

catalog/view/theme/default/template/product/category.tpl
catalog/view/theme/default/template/product/manufacturer_info.tpl
catalog/view/theme/default/template/product/search.tpl
catalog/view/theme/default/template/product/special.tpl

or better still use vQmod -> http://forum.opencart.com/viewtopic.php ... ilit=vqmod

With my attached xml file:
Last edited by uksitebuilder on Tue Jun 28, 2011 8:07 pm, edited 1 time in total.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by teratyke » Tue Jun 28, 2011 7:49 pm

The above changes should be done to the following files:

catalog/view/theme/default/template/product/category.tpl
catalog/view/theme/default/template/product/manufacturer.tpl
catalog/view/theme/default/template/product/search.tpl
catalog/view/theme/default/template/product/special.tpl

or better still use vQmod -> http://forum.opencart.com/viewtopic.php ... ilit=vqmod

With my attached xml file

uksb_grid_view_default.xml
Grid View Default vQmod xml file
Thank you for posting this vQmod xml file - very helpful indeed!
I think I found an error though - manufacturer.tpl should be manufacturer_info.tpl - at least it is in my 1.5.0.5 installation.

Many thanks again
Rob

Active Member

Posts

Joined
Sun Jun 12, 2011 3:05 pm

Post by uksitebuilder » Tue Jun 28, 2011 8:08 pm

Thanks for spotting my error Rob.

I have edited my post above and the vQmod XML attachment to fix this.

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom

Post by rfary » Sun Jul 03, 2011 7:42 am

tried it and still will not work on my oc1.5.0.5. not sure why. using Vqmod and manual also don't work. any other suggestion?

Newbie

Posts

Joined
Sun Jul 03, 2011 7:39 am

Post by i2Paq » Sun Jul 03, 2011 6:28 pm

rfary wrote:tried it and still will not work on my oc1.5.0.5. not sure why. using Vqmod and manual also don't work. any other suggestion?
Default template?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by rfary » Sun Jul 03, 2011 9:53 pm

i2Paq wrote:
rfary wrote:tried it and still will not work on my oc1.5.0.5. not sure why. using Vqmod and manual also don't work. any other suggestion?
Default template?
i tried both default and my personal and still don't work.

Newbie

Posts

Joined
Sun Jul 03, 2011 7:39 am

Post by uksitebuilder » Mon Jul 04, 2011 12:16 am

make sure you have cleared your cookies

User avatar
Guru Member

Posts

Joined
Thu Jun 09, 2011 11:37 pm
Location - United Kindgom
Who is online

Users browsing this forum: No registered users and 39 guests