I can't get my logic to fall through the "if" statement highlighted below. I have even hard coded the value "us" above the routine to ensure it is the value. When I echo $country at the very end of the routine before I return, $country contains the value "us"
What am I missing? Thanks!
/*******************************************************/
// Begin USPS Insurance functions
/*********************************************************/
function getUSPSIns($cart_total,$total_number_of_items,$destCountryCode) {
global $iso_countries_local,$usps_countries,$USPS_Server,$MailTypeCode;
global $PackageCount;
global $PackageData;
$maxins = 5000.00;
$usps_ins = 0.00;
$country = "us";
$USPS_INS1 = 1.30; /* US/Canada insurance total up to $50*/
$USPS_INS2 = 2.20; /* US/Canada insurance for totals $50.01-$100*/
$USPS_INS3 = 1.00; /* US/Canada for every $100 over $100 add $*/
$USPS_INS4 = 1.85; /* International insurance total up to $50*/
$USPS_INS5 = 2.60; /* International insurance for totals $50.01-$100*/
$USPS_INS6 = 1.00; /* International for every $100 over $100 add $*/
$cart_total = get_paypal_cart_total();
if(!empty($_GET['ship_insured'])){
$packageValue = $cart_total;
}
else{
$packageValue = 0.00;
return $usps_ins;
[COLOR=Red]if (($country == "us") or ($country == "ca")){
if ($packageValue<=50) {
$usps_ins=$USPS_INS1;}
else if ($packageValue<=100) {
$usps_ins=$USPS_INS2;}
else {
$usps_ins = $USPS_INS2 + ((ceil($packageValue/100) - 1) * $USPS_INS3); }[/COLOR]
}
else{
if ($packageValue<=50) {
$usps_ins=$USPS_INS4;}
else if ($packageValue<=100) {
$usps_ins=$USPS_INS5;}
else {
$usps_ins = $USPS_INS4 + ((ceil($packageValue/100) - 1) * $USPS_INS6); }
}
}
return $usps_ins;
}
/*******************************************************/
// End USPS Insurance functions
/*********************************************************/