i'm running the random products on our main page, 4 across, and i need to remove one category (and all subs) from being displayed in that random display. so, say for example the main category is "kids clothes" or cat id 123.
i tried a few things in the template but guess i'm way off on the way to do this one, so i'm asking here now.
how can we either remove that from the query, or stop any of those products from being called into the loop of random preoducts in the template?
thanks.
here is random.php
Code:
<?
// the database query
$query = "SELECT * FROM $sql_tbl[products],$sql_tbl[pricing] WHERE forsale='Y' AND avail>0 AND $sql_tbl[products].productid=$sql_tbl[pricing].productid ORDER BY RAND() LIMIT 4 ";
// give the product array to smarty to make it available sitewide.
$randoms = func_query($query);
$smarty->assign("randoms",$randoms);
?>
here is the template...
Code:
{if $usertype eq "C" and $config.Appearance.products_per_row ne "" and $config.Appearance.products_per_row gt 0 and $config.Appearance.products_per_row lt 5 and ($featured eq "Y" or $config.Appearance.featured_only_multicolumn eq "N")}
{include file="customer/main/products_t2.tpl" products=$products}
{else}
{if $products}
{section name=product loop=$products}
{assign var="discount" value=0}
<table width="90%" border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td align="right" class="PListImgBox">
<div class="PListImgBox">
<a href="product.php?productid={$products[product].productid}&cat={$cat}&page={$navigation_page}{if $featured eq 'Y'}&featured{/if}">{include file="product_thumbnail.tpl" productid=$products[product].productid image_x=$config.Appearance.thumbnail_width product=$products[product].product tmbn_url=$products[product].tmbn_url}</a>
</div>
</td></tr>
</table>
<br />
<br />
<br />
{/section}
{/if}
{/if}