Jump to content
  • 0

Zmiana liczby kolumn dla mobilnego widoku


cel3ct

Question

Presta 1.6

Nie mogę sobie poradzić ze zmianą liczby kolumn na liście produktów dla mobilnego widoku. Aktualnie na telefonie wyświetla mi się jedna kolumna, a chciałbym to zmienić na dwie.

Oto co zmieniłem, ale i tak nie pomogło.

product-list.tpl

{*define number of products per line in other page for desktop*}
	{if $page_name !='index' && $page_name !='product'}
		{assign var='nbItemsPerLine' value=4}
		{assign var='nbItemsPerLineTablet' value=3}
		{assign var='nbItemsPerLineMobile' value=2}
	{else}
		{assign var='nbItemsPerLine' value=4}
		{assign var='nbItemsPerLineTablet' value=3}
		{assign var='nbItemsPerLineMobile' value=2}
	{/if}
	{*define numbers of product per line in other page for tablet*}
<li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-6 col-sm-3 col-md-3{else} col-xs-6 col-sm-3 col-md-3{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0}

 

 

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

2 answers to this question

Recommended Posts

  • 0

A co dokładnie należałoby zmienić? Trochę tych "media" w global.css jest.

E:

Poradziłem sobie.
W product_lis.css wywaliłem:

@media (max-width:410px){
    ul.product_list.grid > li, ul.product_list.grid .owl-item .ajax_block_product{float:none;width:50%;}
}

a w product-list.tpl zmieniłem:

<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-4 col-md-3{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} 

na:

<li class="ajax_block_product{if $page_name == 'index' || $page_name == 'product'} col-xs-6 col-sm-4 col-md-3{else} col-xs-6 col-sm-4 col-md-3{/if}{if $smarty.foreach.products.iteration%$nbItemsPerLine == 0} 

 

Edited by cel3ct (see edit history)
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...