Jump to content

Adjust number of products per row in Top Sellers Home?


Recommended Posts

My Home page has Top Sellers tab on it, which displays a grid view of 4 products per row.

My Products pages have 3 products per row in Grid View. 

 

How do I alter the Top Sellers tab to have the same number of products per row as the Products pages?

 

Thanks

Link to comment
Share on other sites

My Home page has Top Sellers tab on it, which displays a grid view of 4 products per row.

My Products pages have 3 products per row in Grid View. 

 

How do I alter the Top Sellers tab to have the same number of products per row as the Products pages?

 

Thanks

 

Hello,

 

Change code in your file theme -product-list.tpl

   {*define numbers of product per line in other page for desktop*}
	{if $page_name !='category'}
    	{if ($hide_left_column || $hide_right_column) && ($hide_left_column !='true' || $hide_right_column !='true')}     {* left or right column *}
			{assign var='nbItemsPerLine' value=3}
			{assign var='nbItemsPerLineTablet' value=2}
			{assign var='nbItemsPerLineMobile' value=2}
        {elseif ($hide_left_column && $hide_right_column) && ($hide_left_column =='true' && $hide_right_column =='true')} {* no columns *}
        	{assign var='nbItemsPerLine' value=4}
			{assign var='nbItemsPerLineTablet' value=3}
			{assign var='nbItemsPerLineMobile' value=2}
        {else}																											  {* left and right column *}
        	{assign var='nbItemsPerLine' value=2}
			{assign var='nbItemsPerLineTablet' value=1}
			{assign var='nbItemsPerLineMobile' value=2}
        {/if}
    {else}																												  {* category page *}
    	{assign var='nbItemsPerLine' value=3}
		{assign var='nbItemsPerLineTablet' value=2}
		{assign var='nbItemsPerLineMobile' value=2}
	{/if}
  • Like 1
Link to comment
Share on other sites

I really need these products displayed wider, as the text of the words is being clipped (not truncated, actually clipping a character in half!)

 

I figure it's somewhere in this line (59) of product-list.tpl:

<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} 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}">
Edited by benwiggy (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...

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...