Jump to content

How to set default view in product list as "list" instead of grid in prestashop 1.7.2.4


costin_yo

Recommended Posts

Does anyone know how to change the default view to list in product list in prestashop 1.7 ? I want to remove completely the view buttons and set the view as list permanently without the customer being able to change it. 

I managed to do it in the rudimentary way but I know there is another better way to do it. This is how I did it:

I added in theme.css:

.grid_list {
    display: none;
}

I added in custom.js: 

$(document).ready( function () {
$('#list').trigger("click");
});

My own way is to click on the list view after the page is loaded but I get some kind of strange grid to list  change after the page is loaded and I do not want that. Can someone tell me another way to do it ? I would really appreciate. 

I found how to do it for prestashop 1.6 but there is no global.js file in prestashop 1.7. 

Thank you

Edited by costin_yo (see edit history)
Link to comment
Share on other sites

  • 6 months later...

Hello! I have the same problem but i find my own "answer".

First i hide grid button just as the same as you did.

Later I change css for grid view. 

In file custom.css (your style/assets/css)

<code>

.col-lg-4 {
  1. float: left;
  2. width: 100%;
  3. text-align: left;
}
</code>
Then i got a "list" view but a little another than default list view. Check it and maybe you'll use it too.
And yes, I know it's old topic but maybe my answer will be helpfull to someone in future.

lunch.png

Link to comment
Share on other sites

  • 2 years later...

Hi all, I have the "Extreme Life" theme, and to set up the items default view to list form, I changed in:

themes/extremestyle/templates/catalog/listing/product-list.tpl

 

from: <section id="products" class="grid">

to: <section id="products" class="list">

 

Attention: if you don't have the theme "Extreme Life" the product-list.tpl location should be: themes/YOUR-THEME/templates/catalog/listing/product-list.tpl

I hope it helps! Have a nice day!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...