By default, the template script displays products listing as a grid. You can switch display view to list if needed. Let’s see how to change the default product display method from Grid to List. We will change two things: JavaScript file global.js and also template file which displays products listings product-list.tpl:
Modification of script file
- All scripts in the template are stored in /js/ subdirectory of theme root directory. Open the file: /themes/themeXXXX/js/global.js, near line 175 there is a function named bindGrid(), by default it looks like the following:
Change this function to:
Theme template file modification
- Now it is necessary to change the default display method in the template file: product-list.tpl. This file is located in theme folder: themes/themeXXXX/produt-list.tpl.
- There is a code like this:
- Change it to:
Hopefully, this tutorial was helpful for you.