Jump to content

Edit History

laserloui

laserloui

Hi there!

My shop currently displays several product lists on its frontpage. 
I have a list for each product category displaying 5 products in total as well as 5 per line (1x5).

Of course for mobile, i have to reduce it so i changed it to 2 products per line.
The problem now is that i now end up having 3 lines on mobile: 2 / 2 / 1 

I would prefer changing the limit/amount of items of the list to 4 for mobile, so i only end up having 2 lines (2/2).

Is that possible? If so, how? 
I am familiar with PHP, so if some changes to the code are necessary, thats ok as well.

Maybe if possible adding some code like this would make sense:
If limit is an uneven number -> limit = limit - 1

if mobile { 
 if(($limit % 2) != 0){ $limit = $limit -1; }
}

Thanks in advance! ❤️

laserloui

laserloui

Hi there!

My shop currently displays several product lists on its frontpage. 
I have a list for each product category displaying 5 products in total as well as 5 per line (1x5).

Of course for mobile, i have to reduce it so i changed it to 2 products per line.
The problem now is that i now end up having 3 lines on mobile: 2 / 2 / 1 

I would prefer changing the limit/amount of items of the list to 4 for mobile, so i only end up having 2 lines (2/2).

Is that possible? If so, how? 
I am familiar with PHP, so if some changes to the code are necessary, thats ok as well.

Maybe if possible adding some code like this would make sense:
If limit = uneven number -> limit = limit - 1

if mobile { 
 if(($limit % 2) != 0){ $limit = $limit -1; }
}

Thanks in advance! ❤️

laserloui

laserloui

Hi there!

My shop currently displays several product lists on its frontpage. 
I have a list for each product category displaying 5 products in total as well as 5 per line (1x5).

Of course for mobile, i have to reduce it so i changed it to 2 products per line.
The problem now is that i now end up having 3 lines on mobile: 2 / 2 / 1 

I would prefer changing the limit/amount of items of the list to 4 for mobile, so i only end up having 2 lines (2/2).

Is that possible? If so, how? 
I am familiar with PHP, so if some changes to the code are necessary, thats ok as well.

Maybe if possible adding some code like this would make sense:
If limit = uneven number -> limit = limit - 1
if(($limit % 2) != 0){ $limit = $limit -1; }

Thanks in advance! ❤️

laserloui

laserloui

Hi there!

My shop currently displays several product lists on its frontpage. 
I have a list for each product category displaying 5 products in total as well as 5 per line (1x5).

Of course for mobile, i have to reduce it so i changed it to 2 products per line.
The problem now is that i now end up having 3 lines on mobile: 2 / 2 / 1 

I would prefer changing the limit/amount of items of the list to 4 for mobile, so i only end up having 2 lines (2/2).

Is that possible? If so, how? 
I am familiar with PHP, so if some changes to the code are necessary, thats ok as well.

Thanks in advance! <3 

×
×
  • Create New...