Hi,
After nearly 19 hours of continuous coding my brain has finally died on this loop problem.
A main loop counter ($i) steps through an array which holds item lines for s shopping cart. The items in the cart have three delivery options. Standard delivery, Express AM delivery or Express PM delivery. An additonal charge is made for either of the express services for any item which is delivered on a different day to any of the remaining items in the array. Here's my feeble attempt:
// -------------- Any additional charges? ----------------------------------
$duplicate_express = 0;
if ($shopping_basket_delivery_option_array[$i] == 'Guaranteed AM delivery' || $shopping_basket_delivery_option_array[$i] == 'Guaranteed PM delivery'){
for ($z = 0; $z < $i; $z++){
if($shopping_basket_delivery_date_array[$z] == $shopping_basket_delivery_date_array[$i]){
$duplicate_express = 1;
}
}
}
if ($duplicate_express == 1){
$additional_charges_total += $express_charge;
$extra_charge_amount_string = $abbreviation[$TheCurrency].trim(sprintf("%3.2f",($conversion * $express_charge)));
}else {
$extra_charge_amount_string = "";
}
// --------------------------------------------------------------------------
and it's just not giving the correct results.
I'd really appreciate a fresh set of eyes (and brain) to tell me what's wrong here please.
kind regards, Graham