Page 1 of 1

Need a little help with my shipping calculation....

Posted: Thu Jan 19, 2006 3:33 pm
by michlcamp
I've got to add another condition to my shipping calculation - right now it reads:

Code: Select all

if ($total > 81.75) 
 {printf ("%01.2f", $total * .11);}
 else {echo "8.99 ";}
The condition I need to add needs to accomodate International shipping - $total * .25

I have a field for '$shipcountry' - the new condition needs to identify whether the order is being shipping with USA or goes to another country... :

something like....

Code: Select all

IF $shipcountry = "USA",
THEN DO USE CODE ABOVE
ELSE $total * .25
It looks like a couple of IFs AND then ELSE to me...just wish I knew how to write it...

any help appreciated in advance..
mc

Re: Need a little help with my shipping calculation....

Posted: Thu Jan 19, 2006 4:03 pm
by neophyte

Code: Select all

if($shipcountry == "USA"){
if ($total > 81.75) {
     printf ("%01.2f", $total * .11);
} else {
     echo "8.99 "; 
}
} else {
  $total = printf("%01.2f", $total * .25);
}

I don't know if this is what you are looking for...