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
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!
Reason: Please use [version] TAG in subject!
Edit catalog/view/theme/<themename>/template/common/footer.tpl:
Place this code before the </body> tag:
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
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
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.
Does anyone have a better solution? Surely there must be a way to change this in the admin section.
Open category.tpl and find code bellow:
Do the same thing on other page used grid-list, like manufacturer, special etc
Code: Select all
if (view) {
display(view);
} else {
display('list'); ---> change to grid
}
Find
from category.tpl
and change it to
Code: Select all
<div class="product-list">
and change it to
Code: Select all
<div class="product-grid">
Thanks qahar that worked like a charm.qahar wrote:Open category.tpl and find code bellow:Do the same thing on other page used grid-list, like manufacturer, special etcCode: Select all
if (view) { display(view); } else { display('list'); ---> change to grid }
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 doanyone that is looking for it, it is catalog\view\theme\default\template\product.
Theme documentation
I got rid of the following divs and their code (which includes display grid/list) as it was not wanted on our site.
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
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?
Code: Select all
<div class="product-filter">
<div class="display"></div>
<div class="limit"></div>
<div class="sort"></div>
</div>
<div class="display"></div>
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
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?
Thanks for that, I did not know you could do a child theme like WordPress.Jacob wrote:Remember to make your own theme and not edit the default files, it is fairly easy to doanyone that is looking for it, it is catalog\view\theme\default\template\product.
Theme documentation
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:
Change to:
Find:
Change to:
Find:
Change to:
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:
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');
Code: Select all
$.cookie('display', 'grid', { path: '/' });
Code: Select all
$.cookie('display', 'list');
Code: Select all
$.cookie('display', 'list', { path: '/' });
Code: Select all
display('list');
Code: Select all
display('grid');
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.
Thank you for posting this vQmod xml file - very helpful indeed!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
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
Thanks for spotting my error Rob.
I have edited my post above and the vQmod XML attachment to fix this.
I have edited my post above and the vQmod XML attachment to fix this.
Default template?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?
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.
Who is online
Users browsing this forum: No registered users and 27 guests