in reply to if..elseif...syntax problem
There's no need to check that the price is greater than the previous limit since that's already been determined by the previous condition. Also, the '.00' isn't required although it shouldn't hurt and does make it pretty clear that you're dealing with monetary amounts.
if ($total_price < 20.00) { $ship_price = 3.50; } elsif ($total_price < 50.00) { $ship_price = 5.50; } elsif ($total_price < 80.00) { $ship_price = 10.50; } # else free shipping?
--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';
|
|---|