![]() |
Ok, managed to pull the icon in, split it up into a 3 column layout and it looks great. Only problem is, if there is only one upselling link, the other two columns show the 'image not available' icon. What I suppose I need is a function to tell X-Cart to not display anything in the extra columns if there are only one or two items. A little help? :) Here's what I have for code:
Code:
{* $Id: related_products.tpl,v 1.7.6.1 2004/07/15 10:28:54 svowl Exp $ *} |
It's because you are telling it to loop 3 times...
Code:
{section name=cat_num loop=3} |
Yep. What I need is an {if} statement in there that tells it to not display anything if there is only 1 or 2 products. Anyone care to help me out with that? I don't know Smarty well enough yet to come up with anything.
|
You need to count the number of results in the loop.
Look for a thread in Custom Mods by 27stars and about subcategory display. You can use a similar method to accomplish what you want to do. or look at skin1/customer/main/productS.tpl |
Solution here: http://forum.x-cart.com/viewtopic.php?t=14995
|
I really like this mod but do have one question, how would I make this mod display a 3x3 table with 9 recommended products instead of just the 3? Thanks in advance.
|
The original 3 column recommends code works fine in V4 (my version anyway), but it looks a bit clumsy as is because it squashes the item title against left hand side. It's easily fixed, here's the original code:
Code:
{* $Id: recommends.tpl,v 1.3 2004/03/01 16:26:00 salsabeel Exp $ *} Just modify the first part to this: Code:
{if $recommends} et voila, just by changing the table width to 200 the title stretches all the way under the thumbnail. |
Quote:
Yes, this would be very nice. I have managed to squeeze in 4 columns across but would like another one or two more rows of it. Had a go at doing it myself, but with no success. The mod works great on 4.0.13 btw. |
Did anyone figure out the IF statement to make a loop count and if EQ then add a
So if loop = 6 and 3 are written a would come before the 4th one. |
This is how I tried to do it but still make 1 row of six instead of 2 rows of 3
{* $Id: recommends.tpl,v 1.3 2004/03/01 16:26:00 salsabeel Exp $ *} {if $recommends} {capture name=recommends} {assign var="col" value="0"} {assign var="numCols" value="3"} <table border=0 width=100%> <tr> {section name=num loop=6} {if $col == $numCols} </tr><tr>{assign var="col" value="0"} {/if} <td width=200 align=center valign=top> {$recommends[num].product}</font> </td> {assign var="col" value="`$col+1`"} {/section} </tr> </table> {/capture} {include file="dialog.tpl" title=$lng.lbl_recommends content=$smarty.capture.recommends extra="width=100%"}{/if} |
All times are GMT -8. The time now is 01:06 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.