X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Different Column Number Based on Category (https://forum.x-cart.com/showthread.php?t=41933)

anela2003 08-22-2008 11:44 PM

Different Column Number Based on Category
 
I was looking through the boards and could not find anything that was even remotely similar to my question.

I'd like something like this:

{if $cat eq "342"}
then number of columns 4
{else}
number of columns 3
{/if}

This is for my main categories, by the way.

I tried editing the Appearance.products_per_row, x, %product.index% and any other variable or equation possible in products.tpl and products_t.tpl, but nothing ever does anything. It stubbornly just keeps the 3-column display.


Does anyone have anything that I can do that I haven't done already (=has not been said on these boards already)?


No paid mods, please (I got burnt before).


Thanks. :D/

Piotr M. 08-23-2008 02:17 AM

Re: Different Column Number Based on Category
 
Insert this code at the very top of products_t.tpl
Code:

{if $cat eq 23}{assign var=products_per_row value="2"}{else}{assign var=products_per_row value="3"}{/if}

Then replace $config.Appearance.products_per_row with $products_per_row in the file.

anela2003 08-23-2008 12:44 PM

Re: Different Column Number Based on Category
 
Does a weird design with 3, 1, 2 and 2 products per row. Strange.

Piotr M. 08-23-2008 02:59 PM

Re: Different Column Number Based on Category
 
You probably missed $config.Appearance.products_per_row occurence.
All of them must be replaced with $products_per_row


All times are GMT -8. The time now is 03:11 AM.

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