TTNZ Posted August 26, 2014 Share Posted August 26, 2014 Hi I can't seem to fix this problem I am having on my website www.touratech.co.nz When viewing products in Grid it shows 3 products on the first row, then 1 product on the next then 3 on the next. I can't seem to fix it after amending the Product_list.tpl and the CSS files under the Bootstrap theme settings. Please can someone help or advise? Thanks :-) Link to comment Share on other sites More sharing options...
PSfever.com Posted August 26, 2014 Share Posted August 26, 2014 Hey, could you give us link directly to the page where you're experiencing this problem? Going through all of your categories manually seems like a waste of time.. Link to comment Share on other sites More sharing options...
TTNZ Posted August 26, 2014 Author Share Posted August 26, 2014 Hi, Sorry, it is happening in every category: http://touratech.co.nz/shop/10930-crash-bars All products list 3 in one row then 1 in the next. Link to comment Share on other sites More sharing options...
PSfever.com Posted August 27, 2014 Share Posted August 27, 2014 Could you check inside of product-list.tpl (in themes/default-bootstrap) to see what is the variable nbItemsPerLine set to? Link to comment Share on other sites More sharing options...
TTNZ Posted August 27, 2014 Author Share Posted August 27, 2014 Here is a cut and paste: {if isset($products) && $products} {*define numbers of product per line in other page for desktop*} {if $page_name !='index' && $page_name !='product'} {assign var='nbItemsPerLine' value=3} {assign var='nbItemsPerLineTablet' value=2} {assign var='nbItemsPerLineMobile' value=3} {else} {assign var='nbItemsPerLine' value=3} {assign var='nbItemsPerLineTablet' value=3} {assign var='nbItemsPerLineMobile' value=2} {/if} {*define numbers of product per line in other page for tablet*} {assign var='nbLi' value=$products|@count} {math equation="nbLi/nbItemsPerLine" nbLi=$nbLi nbItemsPerLine=$nbItemsPerLine assign=nbLines} {math equation="nbLi/nbItemsPerLineTablet" nbLi=$nbLi nbItemsPerLineTablet=$nbItemsPerLineTablet assign=nbLinesTablet} <!-- Products list --> <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}"> {foreach from=$products item=product name=products} {math equation="(total%perLine)" total=$smarty.foreach.products.total perLine=$nbItemsPerLine assign=totModulo} {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineTablet assign=totModuloTablet} {math equation="(total%perLineT)" total=$smarty.foreach.products.total perLineT=$nbItemsPerLineMobile assign=totModuloMobile} {if $totModulo == 0}{assign var='totModulo' value=$nbItemsPerLine}{/if} {if $totModuloTablet == 0}{assign var='totModuloTablet' value=$nbItemsPerLineTablet}{/if} {if $totModuloMobile == 0}{assign var='totModuloMobile' value=$nbItemsPerLineMobile}{/if} <li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-4{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} last-in-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1} first-in-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModulo)} last-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 0} last-item-of-tablet-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineTablet == 1} first-item-of-tablet-line{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 0} last-item-of-mobile-line{elseif $smarty.foreach.products.iteration%$nbItemsPerLineMobile == 1} first-item-of-mobile-line{/if}{if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - $totModuloMobile)} last-mobile-line{/if}"> Link to comment Share on other sites More sharing options...
codvir Posted October 1, 2014 Share Posted October 1, 2014 (edited) Hello, I don't know if it is still relevant, but your code is missing col-md-3. In the line that starts with: <li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-4{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} you should changed col-md-4 to col-md-3. <li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-12 col-sm-4 col-md-3{else} col-xs-12 col-sm-6 col-md-4{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} Hope it helps. Edited October 1, 2014 by codvir (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts