Tom Muck

Flash Remoting | Community MX | CMXtraneous
Home page
All articles | DWTeam | Flash Remoting | Basic-Ultradev | Community MX
All Extensions | Extension News | Extension FAQs | Customer Login
Books authored or co-authored by Tom Muck
Extensions, books, and other products | Customer Login
Your current cart contents
Tom-Muck.com Blog | CMXTraneous Blog | Flash Remoting Blog
About the site

Add Tax To Shipping

Adding tax to shipping:

Change this section:

/* Calculate Tax */
$tallyTaxAmt = 0;
$tallyTaxAmt = $tallyTaxAmt + ($_SESSION["cartSubtotal"] * $row_rsCWGetBillTo["stprv_Tax"]);
$_SESSION["taxAmt"] = $tallyTaxAmt;
/* For Shipping, set ship to StProv Shipping extension */
$_SESSION["shipExtension"] = $row_rsCWGetShipTo["stprv_Ship_Ext"];

/* ============================================================= */
/* Calculate SHIPPING [ START ]================================ */
/* ============================================================= */
/* [ Call Shipping include file ] ..................................................
All shipping calculations are handled by the CWFunShipping.php include file */
$shipType = $_SESSION["shipCalcType"];
include("CWLibrary/CWFunShipping.php");
/* ============================================================= */
/* Calculate ORDER TOTAL [ START ]============================= */
/* ============================================================= */
$tallyOrder = 0;
$tallyOrder += ( $_SESSION["cartSubtotal"] + $_SESSION["taxAmt"] ) + $_SESSION["shipTotal"];
$_SESSION["orderTotal"] = $tallyOrder;
/* Calculate ORDER TOTAL [ END ]=============================== */

To this:

/* For Shipping, set ship to StProv Shipping extension */
$_SESSION["shipExtension"] = $row_rsCWGetShipTo["stprv_Ship_Ext"];

/* ============================================================= */
/* Calculate SHIPPING [ START ]================================ */
/* ============================================================= */
/* [ Call Shipping include file ] ..................................................
All shipping calculations are handled by the CWFunShipping.php include file */
$shipType = $_SESSION["shipCalcType"];
include("CWLibrary/CWFunShipping.php");
/* ============================================================= */
/* Calculate ORDER TOTAL [ START ]============================= */
/* ============================================================= */
$tallyOrder = 0;
/* Calculate Tax */
$tallyTaxAmt = 0;
$tallyTaxAmt = $tallyTaxAmt + (($_SESSION["cartSubtotal"] + $_SESSION["shipTotal"]) * $row_rsCWGetBillTo["stprv_Tax"]);
$_SESSION["taxAmt"] = $tallyTaxAmt;
$tallyOrder += ( $_SESSION["cartSubtotal"] + $_SESSION["taxAmt"] + $_SESSION["shipTotal"]);
$_SESSION["orderTotal"] = $tallyOrder;
/* Calculate ORDER TOTAL [ END ]=============================== */

Back to Cartweaver PHP FAQ, code changes, and samples

Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
Pay me securely with your Visa, MasterCard, Discover, or American Express card through PayPal!
About | Privacy Policy | Contact | License Agreement | ©2002-2010 Tom Muck | Dreamweaver Extensions