Page 2 of 5

Re: [1.5.0]Set grid view as default

Posted: Mon Jul 04, 2011 5:46 am
by rfary
uksitebuilder wrote:make sure you have cleared your cookies
using fire fox and ie both cleared cookie still the same.not working for me. must be something dumb that i'm not getting right. i'm still using vqmod to test currently.

Re: [1.5.0]Set grid view as default

Posted: Mon Jul 04, 2011 3:00 pm
by uksitebuilder
Is the following file being created in your vqmod/vqcache folder

vq-catalog_view_theme_default_template_product_category.tpl

if it is, please attach it to a reply to this post

--

In addition, edit your vqmod/vqmod.php

Make sure:

public $useCache = TRUE;
public $logging = FALSE;

Re: [1.5.0]Set grid view as default

Posted: Tue Jul 05, 2011 9:28 pm
by rfary
uksitebuilder wrote:Is the following file being created in your vqmod/vqcache folder

vq-catalog_view_theme_default_template_product_category.tpl

if it is, please attach it to a reply to this post

--

In addition, edit your vqmod/vqmod.php

Make sure:

public $useCache = TRUE;
public $logging = FALSE;
hi attached is the file and the vqmod.php changed still will not work.
thanks for your help.

Re: [1.5.0]Set grid view as default

Posted: Tue Jul 05, 2011 9:34 pm
by uksitebuilder
Can we have a URL for your site please?

PM me if you dont want to publicise.

Re: [1.5.0]Set grid view as default

Posted: Tue Jul 05, 2011 9:36 pm
by uksitebuilder
p.s. Your cached vqmod file is perfect.

Re: [1.5.0]Set grid view as default

Posted: Thu Aug 04, 2011 5:55 am
by jeroendolstra
chokoret wrote:Find

Code: Select all

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

Code: Select all

  <div class="product-grid">
thanks! works perfectly

Re: [1.5.0]Set grid view as default

Posted: Fri Aug 12, 2011 11:55 pm
by reynierpm
Hi:
I change the code in files, clear cookies and get this error:
$.cookie is not a function
view = $.cookie('display');
I'm using OC 1.5.1.1 and custom theme based on default, any help?

Re: [1.5.0]Set grid view as default

Posted: Sun Aug 28, 2011 12:54 am
by seniorx
I did all the steps, made all the changes on those files but still not working... Deleting the cookies also.
Hope someone can help me, i'v been trying many ways.
uksitebuilder wrote: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:
uksb_grid_view_default.xml

Re: [1.5.0]Set grid view as default

Posted: Sun Aug 28, 2011 12:57 am
by uksitebuilder
Did you manually make the changes or did you use the vQmod file ?

If manually, please paste contents or attach the file you edited

If you used vQmod, then please attach the cached file

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 05, 2011 3:44 am
by cryoutcreations
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

Re: [1.5.0]Set grid view as default

Posted: Sun Sep 11, 2011 1:03 pm
by dustyadmin
Hi guys. Is there any way to do this in OC version 1.4.9.3? I have a custom theme installed and can't update to 1.5 because I have made significant modifications to. I am so new to this and am not a programmer. In fact, I had a programmer but he has a family emergency and I have been stuck trying to learn how to customize everything myself. I desperately want to be able to have the user be able to actually select between grid and list view where the grid view is set as default. I'm willing to pay someone to help me do this. Here is my website and I would love if someone might be able to contact me to help me. My email is christa at dustyknuckles.com and our website address is www.dustyknuckles.com/shop

Thanks so much !

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 19, 2011 5:01 pm
by smitch6
strange i tried manually editing the code and that didn't work so i tried the module and that didn't work either
i'm still getting the option for list/grid

any ideas please thanks

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 19, 2011 5:16 pm
by smitch6
i just had a thought i think this doesn't actually remove the option of list/grid does it?

i'd like to remove that option and only have grid is this possible please

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 19, 2011 5:31 pm
by cryoutcreations
smitch6 wrote:i just had a thought i think this doesn't actually remove the option of list/grid does it?
Nope, it does not remove the List/Grid selector. It just switches the view to Grid (without you clicking on it every time).
But you just gave me the idea to include this "Hide selector" option in the module :)

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 19, 2011 5:34 pm
by smitch6
brill cos i'd much prefer not to give them the option
can you let me know if and when you have it sorted please ;D

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 19, 2011 6:02 pm
by uksitebuilder
In which case you need to edit the following files to remove the links:

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

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 19, 2011 6:07 pm
by smitch6
what should i remove please?

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 19, 2011 6:18 pm
by uksitebuilder

Code: Select all

<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>

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 19, 2011 8:25 pm
by smitch6
brill worked a treat ;D
thanks for your help on this topic, off to the next one now lol

Re: [1.5.0]Set grid view as default

Posted: Mon Sep 26, 2011 10:12 pm
by matlamont
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