Page 3 of 5

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 26, 2011 11:14 pm
by uksitebuilder
matlamont wrote:for anyone who have tried all the above and still opencart displays list view the problem lies with you hosting providers firewall settings rejecting the cookie opencart is trying to set to display grid view

Most likely your host has mod_security enabled on the server

for some strange reason mod_security has a stupid rule to block filenames containing the word cookie

Either (a) contact your host and ask them to disable/remove mod_security

or (b) rename catalog/view/javascript/jquery/ui/external/jquery.cookie.js to remove the word cookie
You will also need to edit catalog/view/theme/default/template/common/header.tpl and change the link to the above file to reflect your newly renamed file.

Re: [1.5.0]Set grid view as default

Posted: Thu Sep 29, 2011 9:43 am
by nyomanmusdina
very helpful!

Re: [1.5.0]Set grid view as default

Posted: Sat Oct 01, 2011 11:44 am
by colt1911
What if I'm using XAMPP and working off localhost -- does xampp use mod_security? I've tried every suggestion above, and still no grid view default.

vs 1.5.1.1

Re: [1.5.0]Set grid view as default

Posted: Sat Oct 01, 2011 3:11 pm
by uksitebuilder
Try renaming the cookie file as per (b) in my post above

Or edit your php.ini and comment out the mod_security extension.

Re: [1.5.0]Set grid view as default

Posted: Sun Oct 02, 2011 2:11 am
by colt1911
Thank you, uksitebuilder. I'm sorry I wasted your time, though: The problem was somewhere in the changes I made to the category.php file and category.tpl files.

I've just spent hours going back to the default and adding things one by one to pinpoint the problem, but when all the changes had been reimplemented, I had no answer as everything is now working fine.

Re: [1.5.0]Set grid view as default

Posted: Fri Oct 21, 2011 4:07 pm
by amitgarg
Thanks it works perfectly for me.... :-)

Re: [1.5.0]Set grid view as default

Posted: Fri Oct 28, 2011 4:11 am
by specialtyleds
vqmod worked - thanks saved a bunch of time! Much appreciated. Grid view :)

Re: [1.5.0]Set grid view as default

Posted: Wed Nov 02, 2011 5:52 am
by SpoonIsBad
cryoutcreations wrote:I think the easiest mod to make grid default (until it will be included as an option in the admin) is to add

Code: Select all

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

It is safe to use as it checks if the function is defined before calling it, so the browser doesn't spit out a javascript error on pages without products on them.

LE: I've written a module that does this without the need to edit the theme anymore: CR2 Grid Enabler

CR2 Grid Enabler worked perfectly for me, thanks!

Re: [1.5.0]Set grid view as default

Posted: Sun Nov 13, 2011 6:34 pm
by scoobs001
cryoutcreations wrote:I think the easiest mod to make grid default (until it will be included as an option in the admin) is to add

Code: Select all

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

It is safe to use as it checks if the function is defined before calling it, so the browser doesn't spit out a javascript error on pages without products on them.

LE: I've written a module that does this without the need to edit the theme anymore: CR2 Grid Enabler
Works for me ;D

The VQMOD wasn't working so i tried this.

Re: [1.5.x]Set grid view as default

Posted: Thu Nov 24, 2011 7:39 am
by kaylamatthews
is it possible to have certain categories display in list view and others in grid view?

maybe something like <?php if category="category1" ?> then list, and so on? My store will only have 2 product categories and I am trying to have one display as list and the other as grid...please help!

Re: [1.5.x]Set grid view as default

Posted: Wed Dec 28, 2011 12:00 am
by eline
You can do this in template file by "dirty" way. Not tested but it should work.

<?
if($GET['path'] == '64'){
// grid view
}else{
// another view :)
}
?>

check category name if($category['name'] == 'category 1') should work also ;)

Re: [1.5.x]Set grid view as default

Posted: Thu Feb 16, 2012 6:57 am
by Gui Siani
How can i do grid as default view in 1.5.3.1? Nothing works ???

Re: [1.5.0]Set grid view as default

Posted: Mon Feb 20, 2012 6:34 pm
by inspirio
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
This is my category.tpl from themes:

Code: Select all

<script type="text/javascript"><!--
function display(view) {
	if (view == 'list') { [b]<-----this is be the "GRID"----->[/b]


		$('.product-grid').attr('class', 'product-list');
		
		$('.product-list > div').each(function(index, element) {
			html  = '<div class="right">';
			html += '  <div class="cart">' + $(element).find('.cart').html() + '</div>';
			html += '  <div class="wishlist">' + $(element).find('.wishlist').html() + '</div>';
			html += '  <div class="compare">' + $(element).find('.compare').html() + '</div>';
			html += '</div>';			
This work for me. Thank you :)

Re: [1.5.x]Set grid view as default

Posted: Sat Feb 25, 2012 4:07 am
by TAC
I used the instructions from cryoutcreations above and it worked first time so thank you very much for your help ;D

Re: [1.5.x]Set grid view as default

Posted: Sat Feb 25, 2012 9:17 am
by ccM
Hi guys I would love an opinion if you have time.

I am upgrading a site to 1.5.1.3.1 and the customer only wants grid view. On the old 151 version we just used the instructions from Simon in a vqmod and it worked a treat (thank you). However we still got a flicker of the list view from time to time and the javascript was unnecessarily slowing things up since not ultimately needed for this customer.

For this site I have removed all of the javascript in the category.tpl and renamed the <div class="product-list"> to <div class="product-grid">. Also removed all css for .product-list, and removed the <div class="display">. This has been done for manufacturer and search as well.

Can anyone see any problems with doing this? It is testing really well and is a highly customised site, but would love to hear anyone's thoughts if they can see any areas I might have missed.

Cheers :)

Re: [1.5.0]Set grid view as default

Posted: Tue Mar 06, 2012 9:04 am
by twilightsprite
cryoutcreations wrote:
LE: I've written a module that does this without the need to edit the theme anymore: CR2 Grid Enabler
Yay for CR2 Grid enabler!! Thanks cryoutcreations, champion effort. It works a treat on 1.5.1.3 - need to update your info.text file to include this version in the description (though it does say compatible on the extension download page).

btw, the blue and purple horrify themes are beautiful :)

Re: [1.5.x]Set grid view as default

Posted: Sat Mar 10, 2012 9:34 am
by bryantklee
My page is alternating between list and grid view...does anyone have a solution for that?

Re: [1.5.x]Set grid view as default

Posted: Thu May 03, 2012 9:02 pm
by prof x
I am having a bit of a problem with grid view as well. I have uploaded the xml file through VQ Mod Manager and it is showing as installed but I cant get the grid view to show at all. I am sure it is something silly I am overlooking as opencart is very new to me. I am also running aceshop through joomla and my paths might be different but if I installed via MOD mgr, all should work right? anyway, here is a link to the sight. It is still a process in the works. www.xwingfactory.com
PS running 1.5.13 with no option to change until aceshop updates.
Thanks,
prof x

Re: [1.5.x]Set grid view as default

Posted: Fri May 04, 2012 12:23 am
by prof x
UPDATE - looks like it is working in IE but not in google chrome.
Any ideas? Thanks

prof x

Re: [1.5.x]Set grid view as default

Posted: Tue May 15, 2012 8:52 pm
by strikeboy
my dirty tricks for some of you who try and try and try and still try but can't get to work.

1 - copy template/default/product/category.tpl
2 - paste inside your own theme
3. open with your editor notepad and search for "list" and replace with all grid
(BEWARE! wishlist do contain "list" so if you are using wishlist do not place that.)

Tadaaa! it works for me....

Finally.......
change to your own CSS style with your own theme....