I'm struggling with something similar: How do I get all the items from $eCart1 where the Category equals 1 (and so on).
something like
$cartitems[] = ("SELECT * FROM $eCart1 WHERE eCartCatID = 1");
I'm trying to limit the display of all that is in the cart to only those whose category is 1.
Currently I have all cart products displaying:
<?php
echo "Products Related: ";
while (!$eCart1->EOF()) {
?>
<ul>
<li class="itemname" class="eC_ItemName">
<?php
echo $eCart1->DisplayInfo("Name");
?></li></ul>
<?php
$eCart1->MoveNext();
}
$eCart1->MoveFirst();
?>
I tried this but errors out:
<?php
$eCart2 = $eCart1->DisplayInfo("eCartCatID");
$Recordset1 = new WA_MySQLi_RS("Recordset1",$convacc_cx,1);
$Recordset1->setQuery("SELECT Product_Name, Cat_ID FROM eCart_products WHERE Cat_ID = $eCart2");
$Recordset1->execute();
//$cartitems[] = ("SELECT * FROM $eCart1 WHERE eCartCatID = 1");
echo "Products Related: ";
while (!$eCart1->EOF()) {
?>
<?php while (!$Recordset1->EOF()) { ?>
<ul>
<li class="itemname" class="eC_ItemName">
<?php
echo $Recordset1->DisplayInfo("Name");
?></li></ul>
<?php
$Recordset1->MoveNext();
}
$Recordset1->MoveFirst();
?>
<?php
$eCart1->MoveNext();
}
$eCart1->MoveFirst();
?>