daxit_x Posted June 30, 2015 Share Posted June 30, 2015 (edited) Hello I have seen the tutorial about changing the product list from default grid view to default list view, but the code shown in the examples are not the same as in the latest prestashop version 1.6.0.14. Here are the code blocks concerning the function "function bindGrid()" Code found in themes/default-bootstrap/js/global.js : function bindGrid() { var view = $.totalStorage('display'); if (!view && (typeof displayList != 'undefined') && displayList) view = 'list'; if (view && view != 'grid') 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'); }); } And here is the code found in /themes/default-bootstrap/product-list.tpl : <!-- Products list --> <ul{if isset($id) && $id} id="{$id}"{/if} class="product_list grid row{if isset($class) && $class} {$class}{/if}"> I do use another theme, so I looked in the same files of the non default theme and found the same code as in the default bootstrap theme, so I guess the changements should be the same in both themes. I tried to change it substituting "grid" with "list" more less as shown in the tutorial that Vekia wrote about Presta 1.6.0.11 (I guess it could be related to that version or earlier, anyway is not about the latest version) Unfortunately I got no good results + some bugs, e.g. changing the modality by hand in front office nothing happens or causes to have tiles in the grid showing not truncated text, so one tile is longer one is shorter etcetera Refreshing the page also causes to show a grid with not truncated text In general grid stays to be default visualization and to obtain the list one have to click at least twice the list button.... Changing category cause the same problems. So I reverted all to the original files, but I really want to get it the other way, list view as default and grid view as an user option.... Anyone knows how to set default list view for the product list also in prestashop 1.6.0.14? Thank you in advance. Edited June 30, 2015 by daxit_x (see edit history) Link to comment Share on other sites More sharing options...
NemoPS Posted July 1, 2015 Share Posted July 1, 2015 You don't need top modify any code, there is an option in the theme configurator module Link to comment Share on other sites More sharing options...
daxit_x Posted July 3, 2015 Author Share Posted July 3, 2015 Hi nemo Thank you for the hint, I knew that there was something alike this, but could not find it back so I thought I was having a mistake with some other platform... I was looking for this switch in the theme configuration not a module.... By the way I solved the issue so far, but noticed that it is not possible to disable the grid... In my case I'd like to completely disable the grid view of the product list, it would be a very easy way to avoid some graphical problems with the layered navigation and the thme I am using... Thank you. Bye Link to comment Share on other sites More sharing options...
NemoPS Posted July 4, 2015 Share Posted July 4, 2015 Oh for that just remove the link from product-sort.tpl Link to comment Share on other sites More sharing options...
daxit_x Posted July 6, 2015 Author Share Posted July 6, 2015 Hi Nemo I just did it, very simple and efficient workaround, I commented one line ad it works properly, the users cannot switch to the grid and see the formatting failures. It is ok for now, inexpensive and resolutive, 1 minute time solution that allows to go on for now. Thank you very much, greatly appreciated. Link to comment Share on other sites More sharing options...
brohemath Posted August 28, 2016 Share Posted August 28, 2016 You don't need top modify any code, there is an option in the theme configurator module I got to Modules and Services> search for "configurator module" no such thing. Link to comment Share on other sites More sharing options...
brohemath Posted August 28, 2016 Share Posted August 28, 2016 Oh for that just remove the link from product-sort.tpl I got to product-sort.tpl file no command line for 'grid'. I think my add on modules modified some of these files because I am missing line commands in this and other tutorials. ;( Link to comment Share on other sites More sharing options...
NemoPS Posted September 5, 2016 Share Posted September 5, 2016 You need to search for "theme"Anyway if you are using custom templates chances are the grid/list switch is located somewhere else Link to comment Share on other sites More sharing options...
Solopixel Posted February 23, 2017 Share Posted February 23, 2017 You don't need top modify any code, there is an option in the theme configurator module Where is the option exactly? Thanks a lot Link to comment Share on other sites More sharing options...
rocky Posted February 26, 2017 Share Posted February 26, 2017 Looks like the "Display categories as a list of products instead of the default grid-based display" option on the "Theme configurator" module's configuration page. Link to comment Share on other sites More sharing options...
Przemysław Suszek Posted July 17, 2017 Share Posted July 17, 2017 Suppose that I have my list, third list. How to I set this list as default view ? even in mobile ? 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