close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Dynamic displays for eCart

Thread began 1/21/2010 6:59 am by fdotmedia | Last modified 1/22/2010 10:16 am by Jason Byrnes | 1814 views | 7 replies |

fdotmedia

Dynamic displays for eCart

I've made an eCart page and want to see if I can show DB values based on whether it exists or not...

example:

id   name   address   email          sex
1 bob 123 s st bob@b.com M
2 kim 123 s st kim@k.com NULL


I want to return something that looks like this in the recordset...

Bob - M - 123 s st - bob@b.com
Kim - 123 s st - kim@k.com


Can I do that with eCart?

Thanks,
Ted

Sign in to reply to this post

Jason ByrnesWebAssist

This is not a function of eCart, you need to add an if statement around the display for the sex column:

php:
<?php if($row_RecordSetName['ColumnName'] != NULL || $row_RecordSetName['ColumnName'] != "") { ?>

<?php 
echo $row_RecordSetName['ColumnName']; ?>
<?php 
?>
Sign in to reply to this post

fdotmedia

so I'd need to have the same code you graciously added to each of the four fields? changing only the recordset row?

Sign in to reply to this post

Jason ByrnesWebAssist

yes, that is correct.

Sign in to reply to this post

fdotmedia

works like a charm thank you...

I have run into a different problem though...

I'm adding the "add to cart" button as a recordset and when you click on the 2nd button the script redirects to the same page and empties the recordset... It's eCart_2_ID_Add I'm not getting anything from eCart_1_ID_Add works as expected...

<?php
// WA eCart AddToCart
if (isset($_POST["eCart1_2_ATC"]) || isset($_POST["eCart1_2_ATC_x"])) {
$ATC_itemID = $_POST["eCart1_2_ID_Add"];
$ATC_AddIfIn = 0;
$ATC_RedirectAfter = "";
$ATC_RedirectIfIn = "";
if (isset($totalRows_products) && $totalRows_products > 0) {
$row_products = WAEC_findRecordMySQL($products, "Pid", $ATC_itemID);
if ($row_products) {
$ATC_itemName = "".$row_products['PFGtitle'] ."";// column binding
$ATC_itemDescription = "";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = "".$_POST["eCart1_2_Quantity_Add"] ."";// column binding
$ATC_itemPrice = floatval("".$row_products['PFGprice'] ."");// column binding
mysql_data_seek($products, 0);
$row_products = mysql_fetch_assoc($products);
}
}
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$eCart1->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice);
if ($ATC_RedirectAfter != "" && $eCart1->redirStr == "") {
$eCart1->redirStr = $ATC_RedirectAfter;
}
if (isset($_SERVER['QUERY_STRING']) && $_SERVER['QUERY_STRING'] != "") {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
}
else {
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'];
}
}
}
?>
<?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr);
}
?>



<?php if($row_products['PFGid'] != "" || $row_products['PFGid'] != "") { ?>
<p> <span style="color:#000; font-weight:bold; font-size:11px;"><?php echo $row_products['PFGid']; ?> - <?php echo $row_products['PFGtitle']; ?> - <?php echo $row_products['PFGprice']; ?></span>
<form name="eCart1_2_ATC_<?php echo $row_products['PFGid']; ?>" method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?><?php echo (isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] != "")?"?".$_SERVER["QUERY_STRING"]:""; ?>">
<input type="hidden" name="eCart1_2_ID_Add" value="<?php echo $row_products['PFGid']; ?>" >
<input type="text" name="eCart1_2_Quantity_Add" value="1" size="4" >
<input type="submit" value="Add to Cart" name="eCart1_2_ATC">
</form>
</p><?php } ?>
Sign in to reply to this post

Jason ByrnesWebAssist

How iis the recordset filtered?

Can you send a copy of your page so I can see the code in context?

Top send a php page, compress it into a zip archive and attach the zip file to your reply.

Sign in to reply to this post

fdotmedia

There's the attachment... Thanks Jason!

Attached Files
mee-series.php.zip
Sign in to reply to this post

Jason ByrnesWebAssist

In the first add to cart button which works, you are binding the ID cart column to the Pid recordset column, in the second one you are binding to the PFGid, Why not the Pid Column?

Sign in to reply to this post

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...