close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Adding to cart, but not carrying recordset values in item name or description?

Thread began 6/28/2019 10:06 am by Nathon Jones Web Design | Last modified 10/16/2019 1:41 pm by Nathon Jones Web Design | 821 views | 7 replies

Nathon Jones Web Design

Thank you Ray.

The Add to Cart behaviour isn't posting my hidden form field value. My guess is that it's not supposed to.

I added a Set Session Value behaviour:

<?php
@session_start();
if (!isset($_SESSION["eCartSMC_OrderID"])) {
$_SESSION["eCartSMC_OrderID"] = "".($rsEDITFORM->getColumnVal("SMCorderID")) ."";
}
?>



...so that the session would defintely exist, prior to clicking the Add to Cart button. Sure enough, when I display this session value on the add to cart page it exists, and it's the correct number (the order ID from my Orders table).

Clicking the Add to Cart button takes the user to the card/billing address page (health-screening-form-checkout.php) and, on that page, I have the following recordset:

<?php
$rsCONFIRMORDER = new WA_MySQLi_RS("rsCONFIRMORDER",$csdbmysqli,1);
$rsCONFIRMORDER->setQuery("SELECT SMCorders.*, SMCuser.*, userORDER.SMCuserFIRST AS USERORDERfirst, userORDER.SMCuserSUR AS USERORDERsur, userORDER.SMCuserUSER AS USERORDERemail, userORDER.SMCuserADD AS USERORDERadd, userORDER.SMCuserADD1 AS USERORDERadd1, userORDER.SMCuserCITY AS USERORDERcity, userORDER.SMCuserREGION AS USERORDERregion, userORDER.SMCuserZIP AS USERORDERzip, userORDER.SMCuserPHONE AS USERORDERphone, userORDER.SMCuserMOBILE AS USERORDERmobile, SMCcountries.SMCcountryID, SMCcountries.SMCcountryCODE, SMCcountries.SMCcountryNAME, SMCform.*
FROM SMCorders
INNER JOIN SMCuser ON SMCorders.SMCorderUSERID = SMCuser.SMCuserID
INNER JOIN SMCuser userORDER ON SMCorders.SMCorderUSERID = userORDER.SMCuserID
INNER JOIN SMCcountries ON userORDER.SMCuserCOUNTRY = SMCcountries.SMCcountryID
INNER JOIN SMCform ON SMCorders.SMCorderFORMID = SMCform.SMCformID
WHERE SMCorders.SMCorderID = ?");
$rsCONFIRMORDER->bindParam("i", "".(isset($_SESSION['eCartSMC_OrderID'])?$_SESSION['eCartSMC_OrderID']:"") ."", "-1"); //WAQB_Param1
$rsCONFIRMORDER->execute();
?>



This recordset is returning a record, because I have it populating the billing address fields. However, the cart summary section at the bottom has omitted the form ID and order ID, despite them being set in the Add to Cart behaviour on the previous page (itemName and itemDescription):

<?php
// WA eCart AddToCart
if (isset($_POST["eCartSMC_1_ATC"]) || isset($_POST["eCartSMC_1_ATC_x"])) {
$ATC_itemID = $rsEDITFORM->getColumnVal["SMCorderID"];
$ATC_AddIfIn = 4;
$ATC_RedirectAfter = "../health-screening-form-checkout.php";
$ATC_RedirectIfIn = "";
$ATC_itemName = "Sports Medical Certificate Form Ref ". $rsEDITFORM->getColumnVal("SMCformID") ."";// column binding
$ATC_itemDescription = "Order Ref SMC". $rsEDITFORM->getColumnVal("SMCorderID") ."";// 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'];
}
}
}
?>



My conclusion is that this is nothing to do with the session values, it is simply that the Add to Cart behaviour is not allowing/storing the recordset values specified in the itemName and itemDescription sections, which is why they are not displaying in the cart summary section on the subsequent page. That's an issue that I can't resolve without your help.

Will Skype message you around 5pm GMT.
Thank you.
NJ

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