b22c Posted April 11, 2014 Share Posted April 11, 2014 (edited) Hi, when we click on a category and the products are displayed, they appear in grid format by default. Its possible to put list view by default? I am talking about new theme of prestashop 1.6. Thanks Edited April 11, 2014 by b22c (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted April 12, 2014 Share Posted April 12, 2014 You have to modify themes\default-bootstrap\js bindgrid function Link to comment Share on other sites More sharing options...
vekia Posted April 12, 2014 Share Posted April 12, 2014 i think that it's a bit more complicated because if we change bindgrid function to display "list", if we change product list to grid - website will not "remember" this change and after page reload we will see list again. we have to modify default value of 'dispaly' cookie created with totalStorage jquery plugin Link to comment Share on other sites More sharing options...
b22c Posted April 12, 2014 Author Share Posted April 12, 2014 Ok, how can i do that? Thanks Link to comment Share on other sites More sharing options...
b22c Posted April 12, 2014 Author Share Posted April 12, 2014 List give us details about the product, grid is like we see on featured products on homepage, just show the title, thats why list should be the default Link to comment Share on other sites More sharing options...
vekia Posted April 12, 2014 Share Posted April 12, 2014 finally i analysed code a little and change: var view = $.totalStorage('display'); if (view && view != 'grid') display(view); else $('.display').find('li#grid').addClass('selected'); to: var view = $.totalStorage('display'); if (view && view != 'list') display(view); else { $('.display').find('li#list').addClass('selected'); display("list"); } in: themes/default-bootstrap\js\global.js then go to themes/default-bootstrap/product-list.tpl and change: <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}{if isset($active) && $active == 1} active{/if}"> to: <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list list row{if isset($class) && $class} {$class}{/if}{if isset($active) && $active == 1} active{/if}"> 6 Link to comment Share on other sites More sharing options...
b22c Posted April 12, 2014 Author Share Posted April 12, 2014 Many thanks, i will test it Link to comment Share on other sites More sharing options...
b22c Posted April 12, 2014 Author Share Posted April 12, 2014 Just one question, after i update lets say from 1.6.0.5 to 1.6.0.6 and choose to update the theme also, this settings dissapear and i have to do it again right? Thanks Link to comment Share on other sites More sharing options...
vekia Posted April 12, 2014 Share Posted April 12, 2014 unfortunately, that's right. but you can change theme name for example to mytheme-bootstrap then you will not lose your changes after upgrade Link to comment Share on other sites More sharing options...
dminch Posted February 3, 2015 Share Posted February 3, 2015 (edited) Hello, moderators and members! I want to setup 'grid' view by default. That means any time we reload page. As I understood it is possible to make changes in products-list.tpl and global.js files to setup view (list or grid) when page is released. But, there is another way to set initial view by default, right? I mean to modify default value of 'display'. So please help me to modify default value of 'dispaly' cookie created with totalStorage jquery plugin Edited February 3, 2015 by dminch (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted February 4, 2015 Share Posted February 4, 2015 dminch, did you try the solution provided by vekia above? Link to comment Share on other sites More sharing options...
dminch Posted February 4, 2015 Share Posted February 4, 2015 Hi, Nemo1. No I haven't tried this solution http://mypresta.eu/en/art/prestashop-16/grid-to-list-products-view.html . Because it is "change grid to list" article. I would like to setup 'grid' view by default using cookie. Are there any tips how to do that? Link to comment Share on other sites More sharing options...
dminch Posted February 4, 2015 Share Posted February 4, 2015 (edited) I guess we should add one line in in: themes/default-bootstrap\js\global.js $.totalStorage('display', 'grid'); var view = $.totalStorage('display'); Am I right? Problem has been solved. Edited February 4, 2015 by dminch (see edit history) 1 Link to comment Share on other sites More sharing options...
technocracy Posted September 24, 2015 Share Posted September 24, 2015 Sorry to drag this old thread up - but I've followed the instructions to the letter and I get the nice view without the description but the products still list in Grid by default. As can be seen: http://www.sje-tools.com As the titles of the Carbide inserts page go into the dots (...) because they are too long it's something of a pain - particularly when I sell sets and individuals which you can't distinguish between in grid format. My global.js bindgrid function looks like this: function bindGrid() { var view = $.totalStorage('display'); if (!view && (typeof displayList != 'undefined') && displayList) view = 'list'; if (view && view != 'list') display(view); else $('.display').find('li#grid').addClass('selected'); $(document).on('click', '#grid', function(e){ e.preventDefault(); display('grid'); }); $(document).on('click', '#list', function(e){ e.preventDefault(); display('list'); }); } I've done all the Cache clearing etc both browser/smarty and my ISP cache (I disabled all these whilst doing the build of the site and things updated as I changed things - so I know it's not a cache thing . . . Cheers Steve Link to comment Share on other sites More sharing options...
technocracy Posted September 24, 2015 Share Posted September 24, 2015 Actually scratch that I've extended the Product title and the grid view is perfect now. Link to comment Share on other sites More sharing options...
louis323 Posted August 26, 2016 Share Posted August 26, 2016 the first page of products are not in list, but the other page of products in the same catagorie as list.... www.hp-projects.nl Link to comment Share on other sites More sharing options...
NemoPS Posted August 27, 2016 Share Posted August 27, 2016 It seems to be working for me, is there a category you see being broken, specifically? Link to comment Share on other sites More sharing options...
louis323 Posted August 27, 2016 Share Posted August 27, 2016 hmmm now it is fine with me also...... thanks ps you know how to chance the image ? you can see the img is blowing op to fit. and when you see the normal product info, you see normal img Link to comment Share on other sites More sharing options...
NemoPS Posted September 5, 2016 Share Posted September 5, 2016 Could you be more specific? Product images seem fine to on my end Link to comment Share on other sites More sharing options...
prcwest Posted September 9, 2016 Share Posted September 9, 2016 Hello i switched to list view and it is working perfect but i would like to keep it on small devices like phones and tablets in portrait view (@media (max-width: 767px) and @media (min-width: 768px) and (max-width: 991px) in grid view. Is this possible? best regards Link to comment Share on other sites More sharing options...
prestamax Posted February 4, 2017 Share Posted February 4, 2017 I think you should open a new topic. Nobody wants to read an old thread just to find out that the subject at the end is a totally different one,. Link to comment Share on other sites More sharing options...
marcin_jaworski Posted October 2, 2017 Share Posted October 2, 2017 Just change settings in module -> themeconfigurator Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now