I have a shopping cart that spits out an end shopping value lets call it $grand_total
what I want is if $grand_total is less than 500 shipping (lets call it $shipping)is 39.95 and shipping should increase by $10 per $100 that grand_total increases.
obviously I could write this to infinity
if ( $grand_total < 400.01 ) {
$shipping= "39.95";}
elsif ( $grand_total < 500.01 ) {
$shipping= "49.95";}
but I'm looking for a dynamic approach.
I'm guessing my $i =
$i++; would be where you start but i'm not sure
what I want is if $grand_total is less than 500 shipping (lets call it $shipping)is 39.95 and shipping should increase by $10 per $100 that grand_total increases.
obviously I could write this to infinity
if ( $grand_total < 400.01 ) {
$shipping= "39.95";}
elsif ( $grand_total < 500.01 ) {
$shipping= "49.95";}
but I'm looking for a dynamic approach.
I'm guessing my $i =
$i++; would be where you start but i'm not sure