close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

PayPal transaction goes through but order information and details are not stored in the database.

Thread began 8/25/2017 4:29 pm by arule414626 | Last modified 8/28/2017 3:59 pm by Ray Borduin | 57 views | 2 replies |

arule414626

PayPal transaction goes through but order information and details are not stored in the database.

The order information and details are stored if checking out with credit card (or purchase order) but not with PayPal. The email is sent after the transaction is processed. The same code to insert into the database is in both the confirm.php page and the pp_confirm.php page the only difference being the trigger. Here's the code from pp_confirm:

<?php
// WA eCart Store Cart Summary in MySQLi Db
if ("" == "") {
$ConditionalQuery = new WA_MySQLi_Query($YLi);
$ConditionalQuery->Action = "conditional";
$ConditionalQuery->Table = "orders";
$ConditionalQuery->saveInSession("YL_OrderID");
$ConditionalGoTo = "";
if (function_exists("rel2abs")) $ConditionalGoTo = $ConditionalGoTo?rel2abs($ConditionalGoTo,dirname(__FILE__)):"";
$ConditionalQuery->redirect($ConditionalGoTo);
if (isset($_SESSION[$ConditionalQuery->SaveAs])) $ConditionalQuery->addFilter("OrderID", "=", "d", $_SESSION[$ConditionalQuery->SaveAs]);
$ConditionalQuery->bindColumn("OrderUserID", "d", "".$_SESSION["UserID"] ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderAmount", "d", "".$YL->GrandTotal() ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipName", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','First_Name_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','First_Name')))) ." ".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Last_Name_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Last_Name')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipAddress", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Address_1_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Address_1')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipAddress2", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Address_2_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Address_2')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderCity", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','City_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','City')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderState", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','State_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','State')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderZip", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Postal_Code_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Postal_Code')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderCountry", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Country_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Country')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderPhone", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Phone_Number_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Phone_Number')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderShipping", "d", "".$YL->GetShipping() ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderTax", "d", "".$YL->GetTax() ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderEmail", "s", "".(WA_coalesce(array(WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Email_Address_2'),WA_getSavedFormValue('CheckoutWizard_NewFromBlank_Default','Email_Address')))) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderDate", "t", "".(date('Y-m-d h:i:s')) ."", "WA_DEFAULT");
$ConditionalQuery->bindColumn("OrderReferrer", "s", "".$_SESSION["referred"] ."", "WA_DEFAULT");
$ConditionalQuery->execute();
}
?>
<?php
// WA eCart Store Cart Details in MySQLi Db
if ("" == "") {
$ReplaceConnection = $YLi;
$ReplaceTable = "orderdetails";
$ReplaceQuery = new WA_MySQLi_Query($ReplaceConnection);
$ReplaceQuery->Action = "delete";
$ReplaceQuery->Table = $ReplaceTable;
$ReplaceQuery->addFilter("DetailOrderID", "=", "d", "".((isset($_SESSION["YL_OrderID"]))?$_SESSION["YL_OrderID"]:"") ."");
$ReplaceQuery->execute();
$YL->MoveFirst();
while (!$YL->EOF())
{
$ReplaceQuery = new WA_MySQLi_Query($ReplaceConnection);
$ReplaceQuery->Action = "insert";
$ReplaceQuery->Table = $ReplaceTable;
$ReplaceQuery->bindColumn("DetailOrderID", "d", "".((isset($_SESSION["YL_OrderID"]))?$_SESSION["YL_OrderID"]:"") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailProductID", "d", "".$YL->DisplayInfo("ID") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailName", "s", "".$YL->DisplayInfo("Name") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailPrice", "d", "".$YL->DisplayInfo("Price") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailSKU", "s", "".$YL->DisplayInfo("Code") ."", "WA_DEFAULT");
$ReplaceQuery->bindColumn("DetailQuantity", "d", "".$YL->DisplayInfo("Quantity") ."", "WA_DEFAULT");
$ReplaceQuery->execute();
$YL->MoveNext();
}
$ReplaceGoTo = "";
$YL->MoveFirst();
if (function_exists("rel2abs")) $ReplaceGoTo = $ReplaceGoTo?rel2abs($ReplaceGoTo,dirname(__FILE__)):"";
if ($ReplaceGoTo) {
header("Location: ".$ReplaceGoTo);
exit;
}
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

After:
$ConditionalQuery->execute();

Add:
var_dump($ConditionalQuery);
die();

That will display information about the attempted store in database including any errors.

Sign in to reply to this post

arule414626

Thanks Ray! The first problem was missing code to require the connection and queryobj and then I had to change some of the fields so they could be Null.

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