close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

How do I capture a column that's added to Cart in an array?

Thread began 5/31/2019 10:50 am by lr_leal239405 | Last modified 1/20/2020 10:44 am by lr_leal239405 | 1918 views | 22 replies

lr_leal239405

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();
?>

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...