It seems to have worked, but I have an additional question. At present, where the order is stored to database, I have the following INSERT behaviour:
<?php
if ($rsISFORMINORDERS->TotalRows == 0) {
if (isset($_POST["eCartSMC_1_ATC"]) || isset($_POST["eCartSMC_1_ATC_x"])) {
$InsertQuery = new WA_MySQLi_Query($csdbmysqli);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "SMCorders";
$InsertQuery->bindColumn("SMCorderUSERID", "i", "".($rsEDITFORM->getColumnVal("SMCformUSERID"))."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderFORMID", "i", "".($rsEDITFORM->getColumnVal("SMCformID"))."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderTOTAL", "s", "75", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderSTATUSID", "i", "5", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderREFER", "s", "".((isset($_SESSION['SMCreferral']))?$_SESSION['SMCreferral']:"") ."", "WA_DEFAULT");
$InsertQuery->saveInSession("eCartSMC_OrderID");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
}
?>
As you can see, I'm statically adding the order total, "75", in this behaviour. What I'd prefer to do is add two new columns to the orders table, SubTotal and Tax, and update the INSERT behaviour to the following:
<?php
if ($rsISFORMINORDERS->TotalRows == 0) {
if (isset($_POST["eCartSMC_1_ATC"]) || isset($_POST["eCartSMC_1_ATC_x"])) {
$InsertQuery = new WA_MySQLi_Query($csdbmysqli);
$InsertQuery->Action = "insert";
$InsertQuery->Table = "SMCorders";
$InsertQuery->bindColumn("SMCorderUSERID", "i", "".($rsEDITFORM->getColumnVal("SMCformUSERID"))."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderFORMID", "i", "".($rsEDITFORM->getColumnVal("SMCformID"))."", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderSUBTOTAL", "s", "<eCART Subtotal Value Here>", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderTAX", "s", "<eCART Tax Value Here>", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderTOTAL", "s", "<eCART GrandTotal Value Here>", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderSTATUSID", "i", "5", "WA_DEFAULT");
$InsertQuery->bindColumn("SMCorderREFER", "s", "".((isset($_SESSION['SMCreferral']))?$_SESSION['SMCreferral']:"") ."", "WA_DEFAULT");
$InsertQuery->saveInSession("eCartSMC_OrderID");
$InsertQuery->execute();
$InsertGoTo = "";
if (function_exists("rel2abs")) $InsertGoTo = $InsertGoTo?rel2abs($InsertGoTo,dirname(__FILE__)):"";
$InsertQuery->redirect($InsertGoTo);
}
}
?>
I'm a bit cautious about using the behaviour panel to make this change because of all the hand-coded stuff on this site. How do I add the following into the above INSERT behaviour:
SubTotal
<?php echo WA_eCart_DisplayMoney($eCartSMC, $eCartSMC->TotalColumn("TotalPrice")); ?>
Tax
<?php echo WA_eCart_DisplayMoney($eCartSMC, $eCartSMC->GetTax()); ?>
SubTotal
<?php echo WA_eCart_DisplayMoney($eCartSMC, $eCartSMC->GrandTotal()); ?>
Thank you.
NJ