$rate_wgt_1 AND $chkwgt < $rate_wgt_2){ $rate=$rate_2; }elseif($chkwgt > $rate_wgt_2 AND $chkwgt < $rate_wgt_3){ $rate=$rate_3; }else{ $shipforce="force"; $forcemess="Weight is too great for weight rate to be applied automatically."; }//no rate can be applied force shipping $price=($rate+$handling)*$qty; if($price < $minimum){ $newshipprice=$minimum; }//price is less than minimum else{ $newshipprice=$price; }//price is more than minimum }//gotwgt }//flat is weight else{ $calc="on"; }//flat fits no mold $getit=mysql_query("SELECT carrier,crr_phone,o_city,o_country,o_code,unit,weight_lbs,height_in,width_in,length_in,custom,currency,minimum,handling FROM ship WHERE item='$item'"); if(!$getit){ $air[]="Could not get info for calculation: ".mysql_error(); }else{ $row=mysql_fetch_array($getit); $carrier=$row['carrier']; $crr_phone=$row['crr_phone']; $o_city=$row['o_city']; $o_country=$row['o_country']; $o_code=$row['o_code']; $unit=$row['unit']; $weight_lbs=$row['weight_lbs']; $height_in=$row['height_in']; $width_in=$row['width_in']; $length_in=$row['length_in']; $custom=$row['custom']; $currency=$row['currency']; $minimum=$row['minimum']; $handling=$row['handling']; if($calc=="on"){ if($carrier=="UPS" or $carrier=="ups"){ $girth=($height_in*2)+($width_in*2); $dimension=$girth+$length_in; if($dimension>150){ $shipforce="force"; $forcemess="Package dimensions are oversized. Rate cannot be applied automatically."; $upscrr_phone="1-800-333-7400"; }else{ $upscrr_phone="1-800-742-5877"; if($dimension>130){ $weight=90; }else{ $weight=$weight_lbs; }//dimensions are commensurate with weight class if($Company==""){ $opt1=""; $opt2=""; }else{ $opt1=""; $opt2=""; } ///////////filter before sending to UPS $goup="yes"; if(is_numeric($o_code)){ $goup="yes"; }else{ $goup="no"; $goupmess="Unable to get Outgoing Zip Code."; } if($weight=="" or $weight==0){ $goup="no"; $goupmess="Unable to determine weight."; } if($goup=="yes"){ $ups="on"; echo("" . "
" . "" . "" . "" . "
Calculate UPS Shipping
Address Type: " . "
Shipping Type: " . "
" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "
"); }//goup is yes else{ $shipforce="force"; $forcemess=$goupmess." Rate cannot be applied automatically."; }//goup is not yes }//dimensions are not oversized }//carrier is ups else{ $shipforce="force"; $forcemess="Carrier not automated. Rate cannot be applied automatically."; }//carrier is not UPS }//calculate is on }//gotit if($ups!="on"){ $carrier="BST"; if($shipforce!="force" AND $newshipprice !=""){ echo("" . "" . "
" . "Shipping Cost for: ($quantity) $item" . "
$shipprice" . "
Click "ADD TO QUOTE" to Update Quote." . "
" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "
"); }//ship is not forced else{ echo("" . "" . "
" . "Unable to calculate shipping automatically." . "
$forcemess
" . "Click "GO" to Enable Manual input." . "
Look for shipping information in Quote Notes." . "
" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "" . "
"); }//ship is forced or newshipprice is blank }//upsisnoton echo("" . "
" . "Eco-\$mart Shipping" . "Cancel" . "
" . ""); ?>