Zen_j1 Posted April 29, 2017 Share Posted April 29, 2017 (edited) How to show some category in grid view and some as list view in prestashop 1.6.1.x Edited April 29, 2017 by Zen_j1 (see edit history) Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted May 1, 2017 Share Posted May 1, 2017 i think you can modify the product-list.tpl <div {if isset($id) && $id} id="{$id}"{/if} class="display-items product_list product-list grid row{if isset($class) && $class} {$class}{/if} calc-items"> {foreach from=$products item=product name=products} you can set the grid view or list view for different category id Link to comment Share on other sites More sharing options...
Zen_j1 Posted May 4, 2017 Author Share Posted May 4, 2017 i think you can modify the product-list.tpl <div {if isset($id) && $id} id="{$id}"{/if} class="display-items product_list product-list grid row{if isset($class) && $class} {$class}{/if} calc-items"> {foreach from=$products item=product name=products} you can set the grid view or list view for different category id Thanks for your reply can please tell me little more where to paste code in product-list.tpl and where and who to add Ids of category which needs to shown as list view. Link to comment Share on other sites More sharing options...
Zen_j1 Posted May 6, 2017 Author Share Posted May 6, 2017 Link to comment Share on other sites More sharing options...
TiaNex Shopping Posted May 6, 2017 Share Posted May 6, 2017 (edited) hi, in category.tpl add the code like {if $category->id eq xxx1 } {assign var='view' value='list'} {elseif $category->id eq xxx2 } {assign var='view' value='grid'} {elseif} {assign var='view' value='grid'} {if} then in product-list.tpl <div {if isset($id) && $id} id="{$id}"{/if} class="display-items product_list product-list grid row{if isset($class) && $class} {$class}{/if} calc-items"> remove the default view "grid" add the variable view the code will be like <div {if isset($id) && $id} id="{$id}"{/if} class="display-items product_list product-list row {if isset($view) && $view} {$view}{/if} {if isset($class) && $class} {$class}{/if} calc-items"> Edited May 6, 2017 by Irder (see edit history) Link to comment Share on other sites More sharing options...
Zen_j1 Posted May 13, 2017 Author Share Posted May 13, 2017 hi, in category.tpl add the code like {if $category->id eq xxx1 } {assign var='view' value='list'} {elseif $category->id eq xxx2 } {assign var='view' value='grid'} {elseif} {assign var='view' value='grid'} {if} then in product-list.tpl <div {if isset($id) && $id} id="{$id}"{/if} class="display-items product_list product-list grid row{if isset($class) && $class} {$class}{/if} calc-items"> remove the default view "grid" add the variable view the code will be like <div {if isset($id) && $id} id="{$id}"{/if} class="display-items product_list product-list row {if isset($view) && $view} {$view}{/if} {if isset($class) && $class} {$class}{/if} calc-items"> i have add the code at bottom category.tpl {if $category->id eq 4 } {assign var='view' value='list'} {elseif $category->id eq 8 } {assign var='view' value='grid'} {elseif} {assign var='view' value='grid'} {/if} And in product list tpl <ul{if isset($id) && $id} id="{$id}"{else} id="product_list"{/if} class="product_list row{if isset($class) && $class} {$class}{/if}"> I have version prestashop 1.6.1.13 for test I am error This page isn’t workingHTTP ERROR 500 Link to comment Share on other sites More sharing options...
Zen_j1 Posted May 18, 2017 Author Share Posted May 18, 2017 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