A
Anonymous
Guest
O.k. I'm having some issues as far as calculating a shipping cost. I want it to calculate a cost on 3 items of say $7.00 +.75 per item, but it is calculating it at $7.75 an item anyone have a clue where I'm going wrong? First it looks to my line items
Then it is supposed to calculate them as I said before at $7.00 + $0.75 per item and give a total
And it is giveing me a total of like $45.60 for 6 items which is WAY more than I want it to charge for shipping as it is over half what they spent in the first place assuming I had this up and running to accept orders...
$module = fetchDbConfig("Per_Category");
$countryISO = countryIso($basket['delInf']['country']);
$zones['n'] = explode(",",str_replace(" ","",strtoupper($module['national'])));
$zones['i'] = explode(",",str_replace(" ","",strtoupper($module['international'])));
$zones['e'] = explode(",",str_replace(" ","",strtoupper($module['excluded'])));
foreach ($zones as $key => $value){
foreach($zones[$key] as $no => $iso){
if($iso == $countryISO){
$shipZone = $key;
}
}
}
if($shipZone == "n"){
$lineShip = $lineShip + ($product[0]['item_ship'] * $quantity);
if(!isset $perShipPrice<$product[0]['per_ship']){
$perShipPrice = $product[0]['per_ship'];
}
} elseif($shipZone == "i"){
$lineShip = $lineShip + ($product[0]['item_int_ship'] * $quantity);
if(!isset $perShipPrice<$product[0]['per_int_ship']){
$perShipPrice = $product[0]['per_int_ship'];
}
} elseif($shipZone == "e" || !isset($shipZone)){
// do nothing?!
}
?>
Then it is supposed to calculate them as I said before at $7.00 + $0.75 per item and give a total
$module = fetchDbConfig("Per_Category");
if($module['status']==1){
$sum = $perShipPrice + ($lineShip);
$taxVal = taxRate($module['tax']);
if($taxVal>0){
$val = ($taxVal / 100) * $sum;
$sum = $sum + $val;
}
if($sum == 0){
$sum = 0.00;
}
$shippingPrice .= "<option value='".$shipKey."'";
if($shipKey ==$basket['shipKey']){
$shippingPrice .= " selected='selected'";
if($shipZone == "n"){
$worldZone = $lang['misc']['national'];
} elseif($shipZone == "i"){
$worldZone = $lang['misc']['international'];
}
$basket = $cart->setVar($lang['misc']['byCategory']." (".$worldZone.")","shipMethod");
$basket = $cart->setVar(sprintf("%.2f",$sum),"shipCost");
}
$shippingPrice .= ">".priceFormat($sum)."</option>\r\n";
$shippingAvailable = TRUE;
$shipKey++;
unset($module, $taxVal);
}
?>
And it is giveing me a total of like $45.60 for 6 items which is WAY more than I want it to charge for shipping as it is over half what they spent in the first place assuming I had this up and running to accept orders...