close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

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

Thread began 6/28/2019 1:06 pm by Nathon Jones Web Design | Last modified 7/09/2019 7:02 pm by Ray Borduin | 16 views | 4 replies |

Nathon Jones Web Design

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

When I click the Add to Cart button, it appears to add to cart but it's not bringing over the dynamic recordset values in the item name and dsecrption?

This is my add to cart code:

// 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'];
}
}
}
?>



I've provided a link and instructions on how to replicate this in the thread below.
Hope you can help. Thank you.
NJ

Sign in to reply to this post

Nathon Jones Web Design

Link and details below. Thank you.

Sign in to reply to this post

Ray BorduinWebAssist

Your recordset: $rsEDITFORM wasn't returning a result after the form submit. I updated it to fix the issue.

Sign in to reply to this post

Nathon Jones Web Design

There is a still a problem here. It's carrying over the SMCformID and SMCorderID values to the subsequent page, health-screening-form-checkout.php, but when it gets there I have a recordset on that page that's supposed to pre-fill the billing information form.

The recordset is as follows:

<?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 checkout page works for both new orders and returning orders so I need the order ID, in the above process, to also be set up as the eCartSMC_OrderID session. Is that possible?

Thank you.
NJ

Sign in to reply to this post

Ray BorduinWebAssist

This could be an issue with the Session variable not being set correctly in the first place, or an issue with the query itself not returning a result.

I'd first confirm that the Session variable is being set and is available. Then I'd use:

<?php echo($rsCONFIRMORDER->debugSQL()); ?>

And then copy/paste the result into your phpMyAdmin to see if it has a result. I'm not sure if the session variable is the issue or the Query or how you have it populated on the page. If the query returns the correct result and the session appears to be set, then then issue is with how you are using the recordset to populate the form.

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