X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   XC5 Homepage layout (https://forum.x-cart.com/showthread.php?t=68702)

tony_sologubov 10-14-2014 05:41 AM

Re: XC5 Homepage layout
 
Hi guys!

Sorry, it took me so long to publish the code.

This change turned to be really easy one and in order to show 4 products on product lists, you need to specify the following CSS code in the System settings > Look and feel > Custom CSS section in you admin area:

Code:

ul.products-grid.grid-list li.product-cell.box-product {
width: 25%;
}

ul.products-grid.grid-list li.product-cell:nth-child(2n) + li.product-cell{
clear: none;
}

ul.products-grid.grid-list li.product-cell:nth-child(3n) + li.product-cell{
clear: none;
}

ul.products-grid.grid-list li.product-cell:nth-child(4n) + li.product-cell{
clear: none;
}


If you need to show 5 products then you need to replace this piece of code:
Code:

ul.products-grid.grid-list li.product-cell.box-product {
width: 25%;
}


with the next one:
Code:

ul.products-grid.grid-list li.product-cell.box-product {
width: 20%;
}


Obviously, you are just changing the percentage that must belong to the product's box width.

Other lines:
Code:

ul.products-grid.grid-list li.product-cell:nth-child(2n) + li.product-cell{
clear: none;
}

ul.products-grid.grid-list li.product-cell:nth-child(3n) + li.product-cell{
clear: none;
}

ul.products-grid.grid-list li.product-cell:nth-child(4n) + li.product-cell{
clear: none;
}


are needed for disabling hard-coded rules that each 4th, 7th and so on product must start with new line.

If there is any questions, please let me know.

Tony.

RichieRich 10-14-2014 06:34 AM

Re: XC5 Homepage layout
 
This css is best if you specify for a larger screen size only. Smaller screen sizes will cause a problem in the display if you have the side column or in other screen sizes.

To fix the display issues, you can specify only if the screen size is the largest wrapping the css with 4 columns with ;

Code:

@media only screen and  (min-width: 1200px) {

}



All times are GMT -8. The time now is 09:37 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.