close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Bug in eCart - Add to Cart behaviour is incorporating recordset code?

Thread began 2/11/2019 4:21 pm by Nathon Jones Web Design | Last modified 2/19/2019 8:27 am by Ray Borduin | 403 views | 4 replies |

Nathon Jones Web Design

Bug in eCart - Add to Cart behaviour is incorporating recordset code?

Hi. I can't get the Add to Cart behaviour to work.

I have a recordset on my page called rsBANNERS and whenever I try to apply the Add to Cart behaviour on the page, for a static item, it saves the Add to Cart behaviour code like this:

<?php
// WA eCart MySQLi AddToCart
if (isset($_POST["eCartSMC_1_ATC"]) || isset($_POST["eCartSMC_1_ATC_x"])) {
$ATC_itemID = $_POST["eCartSMC_1_ID_Add"];
$ATC_AddIfIn = 4;
$ATC_RedirectAfter = "health-screening-form-checkout.php";
$ATC_RedirectIfIn = "";
if (function_exists("rel2abs")) {
$ATC_RedirectIfIn = $ATC_RedirectIfIn?rel2abs($ATC_RedirectIfIn,dirname(__FILE__)):"";
$ATC_RedirectAfter = $ATC_RedirectAfter?rel2abs($ATC_RedirectAfter,dirname(__FILE__)):"";
}
if ("rsBANNERS" != "") $rsBANNERS->FindRow("SMCbannerID",$ATC_itemID);
$ATC_itemName = "Sports Medical Certificate";// column binding
$ATC_itemDescription = "Doctor approved medical certificate for your sporting event/s.";// column binding
$ATC_itemThumbnail = "";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = floatval("1");// column binding
$ATC_itemPrice = floatval("65.00");// column binding
if ("rsBANNERS" != "") $rsBANNERS->Index = 0;
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$eCartSMC->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemThumbnail, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice);
if ($ATC_RedirectAfter != "" && $eCartSMC->redirStr == "") $eCartSMC->redirStr = $ATC_RedirectAfter;
$_SESSION['WAEC_ContinueRedirect'] = $_SERVER['PHP_SELF'].($_SERVER['QUERY_STRING']?"?".htmlentities($_SERVER['QUERY_STRING']):"");
}
}
?>



Why is it pulling in this recordset when I've selected static item? How do I fix this?
Thank you.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

I just uploaded a new version of the extension to fix this issue. I didn't update the version number to save some time, but if you reinstall this should work properly now.

Sign in to reply to this post
Did this help? Tips are appreciated...

Nathon Jones Web Design

It's not re-directing?


<?php
// WA eCart AddToCart
if (isset($_POST["eCartSMC_1_ATC"]) || isset($_POST["eCartSMC_1_ATC_x"])) {
$ATC_itemID = $_POST["eCartSMC_1_ID_Add"];
$ATC_AddIfIn = 4;
$ATC_RedirectAfter = "health-screening-form-checkout.php";
$ATC_RedirectIfIn = "";
$ATC_itemName = "Sports Medical Certificate Form Ref ".$_SESSION['NEWformID'] ."";// column binding
$ATC_itemDescription = "Order Ref ".$_SESSION['NEWorderID'] ."";// column binding
$ATC_itemThumbnail = "";// column binding
$ATC_itemWeight = floatval("0");// column binding
$ATC_itemQuantity = floatval("1");// column binding
$ATC_itemPrice = floatval("65");// column binding
$ATC_itemQuantity = floatval($ATC_itemQuantity);
if (is_numeric($ATC_itemQuantity) && $ATC_itemQuantity != 0) {
$eCartSMC->AddToCart($ATC_AddIfIn, $ATC_RedirectIfIn, $ATC_itemID, $ATC_itemName, $ATC_itemDescription, $ATC_itemThumbnail, $ATC_itemWeight, $ATC_itemQuantity, $ATC_itemPrice);
if ($ATC_RedirectAfter != "" && $eCartSMC->redirStr == "") {
$eCartSMC->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'];
}
}
}
?>



There should be a wee re-direct script on the page shouldn't there? I don't see it.

Hope you can help.
Thank you.
NJ

Sign in to reply to this post

Nathon Jones Web Design

Is this what's missing?

<?php
// WA eCart Redirect
if ($eCartSMC->redirStr != "") {
header("Location: ".$eCartSMC->redirStr);
}
?>



I created a blank page and tried a dry insert (eeuuw!) of the Add to Cart behaviour and it didn't insert this code either, so is this a bug of some kind?

NJ

PS. Sorry, I meant to say that manually adding the above code has fixed the re-direct issue.

Sign in to reply to this post

Ray BorduinWebAssist

Yes, that is supposed to be at the bottom of the server code, just before the <doctype> tag. I'm not sure why it wasn't added properly, but adding it manually is the correct solution.

Sign in to reply to this post
Did this help? Tips are appreciated...

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