Here's my php code to create a product list.
I've made a seperate php file for this. But I don't know how to integrate it into the look and feel of X-cart....
Code:
<TABLE ALIGN=CENTER VALIGN=TOP WIDTH=100%>
<? $db = mysql_connect("address","username","password");
mysql_select_db("datasename",$db);
$cats = mysql_query("SELECT * FROM xcart_categories order by category");
while ($row1 = mysql_fetch_array($cats))
{
$currentcat = $row1["category"];
echo "
<tr>
<td>
</td>
</tr>
<tr>
<td width=\"300\">
<font face=\"arial\">$currentcat:</font>
</td>
</tr>
";
$result = mysql_query("SELECT xcart_categories.category, xcart_pricing.price, xcart_products.product, xcart_products.descr FROM (xcart_categories INNER JOIN xcart_products ON xcart_categories.categoryid=xcart_products.categoryid) INNER JOIN xcart_pricing ON xcart_pricing.productid=xcart_products.productid WHERE xcart_categories.category = \"$currentcat\"");
while ($myrow = mysql_fetch_array($result))
{
$product = $myrow["product"];
$prijs = $myrow["price"];
$desc = $myrow["desc"];
echo "
<tr>
<td>
<font face=\"arial\">$product</font>
</td>
<td width=\"100\" align=\"right\">
<font face=\"arial\">$prijs</font>
</td>
</tr>
";
}
}
?>
</table>