Okay, I'm getting close, but I've made an error somewhere. My UPS shipping is still working fine, but if I select one of the flat-rate options, I get the error message, "invalid service type" on my shipping failure page. I'm thinking my error is in setting my session server behavior, but I also noticed that when I was making the shipping rules for flat-rate shipping, I would add the $5 or $10 cost (using the wizard for shipping rules), and when I would reopen my cart object, it had been reset to 0.
On my checkout page, I have the following select list for shipping:
<select name="UPS_Service" id="UPS_Service">
<option value="01">UPS Next Day Air</option>
<option value="02">UPS 2nd Day Air</option>
<option value="03" selected="selected">UPS Ground</option>
<option value="50">Standard USA</option>
<option value="100">Standard International</option>
</select>
On my confirm page, I have added the following session, selecting "UPS_Service" from my ecart_checkout_form (this is where I think I have made an error):
<?php
if (!session_id()) session_start();
if((((isset($_POST["UPS_Service"]))?$_POST["UPS_Service"]:"") != "")) {
$_SESSION["flat_shipping"] = "".((isset($_POST["UPS_Service"]))?$_POST["UPS_Service"]:"") ."";
}
if(($_POST["UPS_Service"] != "") && (($_POST["UPS_Service"] == '50') || ($_POST["UPS_Service"] == '100')) ) { // I used 50 for US and 100 for internationsl
$_SESSION["flat_shipping"] = $_POST["UPS_Service"];
}
?>
Below are my reconfigured shipping rules:
UPS Shipping Rule:
function WAEC_TJCart_UPSShipping() {
$totalShipping = 0;
if (true && (("UPS"=="UPS")&&(isset($_SESSION["TJCart_UPS_Quote"]))&&(floatval($_SESSION["TJCart_UPS_Quote"]) != 0) && ((isset($_SESSION['flat_rate'])?$_SESSION['flat_rate']:"") != "0") && ((isset($_SESSION['flat_rate'])?$_SESSION['flat_rate']:"") != "0"))) {
$totalShipping += floatval($_SESSION["TJCart_UPS_Quote"]) + 0;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
Flat-Rate Rules:
//eCart Rule
function WAEC_TJCart_FlatRateUSA() {
$totalShipping = 0;
if (true && ((isset($_SESSION['flat_shipping'])) && ((isset($_SESSION['flat_rate'])?$_SESSION['flat_rate']:"") == "50"))) {
$totalShipping += 0;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
//eCart Rule
//eCart Rule
function WAEC_TJCart_FlatRateInternational() {
$totalShipping = 0;
if (true && ((isset($_SESSION['flat_rate'])) && ((isset($_SESSION['flat_rate'])?$_SESSION['flat_rate']:"") == "100"))) {
$totalShipping += 0;//Result
}
return WA_eCart_FormatNumber($totalShipping, $this->ForceDecimalsC, $this->DecimalPlacesC);
}
Thanks again for all your help!!