close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Checkout won't calculate shipping

Thread began 2/22/2010 3:45 pm by wilyumcj205276 | Last modified 3/25/2010 6:34 pm by wilyumcj205276 | 4925 views | 41 replies

wilyumcj205276

}
}
$deleteFieldValue = "";
$updateColType = "none,none,NULL";
if ($indexFieldIndex >= 0) $updateFieldValue = $WA_fieldValues[$indexFieldIndex];
if ($updateFieldValue == "" && isset($_SESSION[$WA_sessionName])) $updateFieldValue = $_SESSION[$WA_sessionName];
if ($indexFieldIndex >= 0) $updateColType = $WA_columns[$indexFieldIndex];
if ($updateFieldValue != "") {
$updateParamsObj = WA_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, $indexFieldIndex);
$valueForWhere = WA_generateInsertParams(array($WA_indexField), array($updateColType), array($updateFieldValue), -1);
$WA_Sql = "update " . $WA_table . " SET " . $updateParamsObj->WA_setValues . " where " . $WA_indexField . " = " . $valueForWhere->WA_dbValues;
$WA_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = $updateFieldValue;
$result = mysql_query("SELECT * FROM " . $WA_table . " where " . $WA_indexField . " = " . $valueForWhere->WA_dbValues, $WA_connection);
$num_rows = mysql_num_rows($result);
$NeedInsert = (mysql_num_rows($result) === 0);
}
if ($updateFieldValue === "" || $NeedInsert) {
$updateFieldValue = "";
$insertParamsObj = WA_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "insert into " . $WA_table . " (" . $insertParamsObj->WA_tableValues . ") values (" . $insertParamsObj->WA_dbValues . ")";
$WA_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
}
if ($WA_redirectURL != "") {
header("Location: ".$WA_redirectURL); exit;
}
}
?>
<?php
// WA eCart Store Cart Details in Db
if (($_SERVER["REQUEST_METHOD"] == "POST") && (isset($_SERVER["HTTP_REFERER"]) && strpos(urldecode($_SERVER["HTTP_REFERER"]), urldecode($_SERVER["SERVER_NAME"].$_SERVER["PHP_SELF"])) > 0) && isset($_POST)) // Trigger
{
$WA_connection = $connStore;
$WA_table = "orderdetails";
$WA_redirectURL = "";
$WA_indexField = "DetailOrderID";
$WA_fieldNamesStr = "DetailID|DetailOrderID|DetailName|DetailPrice|DetailQuantity";
$WA_fieldValuesStr = WA_eCDB_ConvertNumber("".$eCart1->DisplayInfo("ID") ."") . "|" . WA_eCDB_ConvertNumber("".((isset($_SESSION["eCart1_OrderID"]))?$_SESSION["eCart1_OrderID"]:"") ."") . "|" . "".$eCart1->DisplayInfo("Name") ."" . "|" . WA_eCDB_ConvertNumber("".$eCart1->DisplayInfo("Price") ."") . "|" . WA_eCDB_ConvertNumber("".$eCart1->DisplayInfo("Quantity") ."");
$WA_columnTypesStr = "none,none,NULL|none,none,NULL|',none,''|none,none,NULL|none,none,NULL";
$WA_sql = "";
mysql_select_db($database_connStore, $WA_connection);
$indexFieldIndex = -1;
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
if (!session_id()) session_start();
if ($WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos('?', $WA_redirectURL) === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
for ($i = 0; $i < sizeof($WA_fieldNames); $i++)
{
if ($WA_indexField == $WA_fieldNames[$i])
{
$indexFieldIndex = $i;
break;
}
}
$deleteFieldValue = $WA_fieldValues[$indexFieldIndex];
if (isset($deleteFieldValue) && $deleteFieldValue != "")
{
$deleteParamsObj = WA_generateInsertParams(array($WA_indexField), array($WA_columns[$indexFieldIndex]), array($deleteFieldValue), -1);
$WA_sql = "Delete from " . $WA_table . " where " . $WA_indexField . " = " . $deleteParamsObj->WA_dbValues;
$WA_editCmd = mysql_query($WA_sql, $WA_connection) or die(mysql_error());
$WA_okToDelete = false;
}
$eCart1->MoveFirst();
while (!$eCart1->EOF())
{
$WA_fieldValuesStr = WA_eCDB_ConvertNumber("".$eCart1->DisplayInfo("ID") ."") . "|" . WA_eCDB_ConvertNumber("".((isset($_SESSION["eCart1_OrderID"]))?$_SESSION["eCart1_OrderID"]:"") ."") . "|" . "".$eCart1->DisplayInfo("Name") ."" . "|" . WA_eCDB_ConvertNumber("".$eCart1->DisplayInfo("Price") ."") . "|" . WA_eCDB_ConvertNumber("".$eCart1->DisplayInfo("Quantity") ."");
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$insertParamsObj = WA_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_sql = "insert into ".$WA_table." (".$insertParamsObj->WA_tableValues.") values (".$insertParamsObj->WA_dbValues.")";
$WA_editCmd = mysql_query($WA_sql, $WA_connection) or die(mysql_error());
$eCart1->MoveNext();
}
if ($WA_redirectURL != "") {
header("Location: ".$WA_redirectURL); exit;
}
$eCart1->MoveFirst();
}
?>
<?php
if ($eCart1->IsEmpty()) {
$eCart1->redirStr = "cart.php";
$eCart1->cartAction = "RedirectIfEmpty";
}
?>
<?php
// WA eCart Redirect
if ($eCart1->redirStr != "") {
header("Location: ".$eCart1->redirStr);
}
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<link href="WA_eCart/CSS/eC_Power_Pacifica_Arial.css" rel="stylesheet" type="text/css" />
<!--[if lte IE 6]>
<style type="text/css" media="all">
img, div, ul, li, span, a {
behavior: url("WA_eCart/CSS/Power/Images/iepngfix.htc");
}
</style>
<![endif]-->
</head>

<body>

<div class="eC_Power_Pacifica_Arial">
<?php
//WA eCart Show If Start
if (!$eCart1->IsEmpty()) {
?>
<h2>Order Confirmation</h2>
<form action="<?php echo ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>" method="post" >
<h2>Your Shopping Cart</h2>
<div class="eC_MediumArea">
<table class="eC_ShoppingCart" border="0" cellspacing="0" cellpadding="0">

<tr>

<th class="eC_GroupColumn" >Name</th>


<th class="eC_PriceItem">Price</th>


<th class="eC_FormItem">Quantity</th>


<th class="eC_PriceItem">Total</th>

</tr>

<?php
while (!$eCart1->EOF()) {
?>
<tr>

<td class="eC_GroupColumn">
<img src="<?php echo $eCart1->DisplayInfo("Thumbnail"); ?>" alt="product thumbnails" class="eC_ProductThumb" />
<p class="eC_ItemName"><?php echo $eCart1->DisplayInfo("Name"); ?></p>
<p class="eC_ItemDescription">Description:&nbsp;<?php echo $eCart1->DisplayInfo("Description"); ?></p>

</td>


<td class="eC_PriceItem">
<?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->DisplayInfo("Price")); ?>
</td>


<td class="eC_FormItem">
<?php echo $eCart1->DisplayInfo("Quantity"); ?>
</td>


<td class="eC_PriceItem">
<?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->DisplayInfo("TotalPrice")); ?>
</td>


</tr>
<?php
$eCart1->MoveNext();
}
$eCart1->MoveFirst();
?>
</table>
</div>
<div class="eC_OrderSummary">
<h2>Order Summary</h2>
<div class="eC_SmallArea">
<table border="0" cellpadding="0" cellspacing="0" class="eC_CartSummary">
<?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetDiscounts() > 0 || $eCart1->GetCharges() > 0 || $eCart1->GetShipping() > 0 || $eCart1->GetTax() > 0) {
?>
<tr>
<td class="eC_Subtotal eC_SummaryLabel">Sub-total</td>
<td class="eC_Subtotal"><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->TotalColumn("TotalPrice")); ?></td>
</tr>
<?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?>
<?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetDiscounts() > 0) {
?>
<tr>
<td class="eC_SummaryLabel">Discounts</td>
<td>-<?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetDiscounts()); ?></td>
</tr>
<?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?><?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetCharges() > 0) {
?>
<tr>
<td class="eC_SummaryLabel">Charges</td>
<td><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetCharges()); ?></td>
</tr>
<?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?><?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetShipping() > 0) {
?>
<tr>
<td class="eC_SummaryLabel">Shipping</td>
<td><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetShipping()); ?></td>
</tr>
<?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?><?php
//WA eCart Merchandizing Show Start
//ecart="eCart1"
if ($eCart1->GetTax() > 0) {
?>
<tr>
<td class="eC_SummaryLabel">Tax</td>
<td><?php echo WA_eCart_DisplayMoney($eCart1, $eCart1->GetTax()); ?></td>
</tr>
<?php
//WA eCart Merchandizing Show End
//ecart="eCart1"
}
?>

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