Jump to content

Recommended Posts

hey...

 

I am getting 5.99 back as my shipping every time. I am missing something, I cannot figure out what it is. No matter what the $t_number is... it is returning 5.99..

 

<?php
function calculate_shipping_cost()
{

// return 20.00;
  
$t_number =   number_format($_SESSION['total_price'],2);
  
if ($t_number >= 0.01 and $number <= 14.99) {
return 5.99;
}

else if ($t_number >= 15.00 and $number <= 29.99) {
return 8.99;
}
  
else if ($t_number >= 30.00 and $number <= 49.99) {
return 10.99;
}

else if ($t_number >= 50.00 and $number <= 74.99) {
return 12.99;
}

else if ($t_number >= 75.00 and $number <= 99.99) {
return 14.99;
}

else if ($t_number >= 100.00 and $number <= 149.99) {
return 16.99;
}
  
else if ($t_number >= 150.00 and $number <= 199.99) {
return 18.99;
}
  
else if ($t_number >= 200.00 and $number <= 299.99) {
return 21.99;
}

else if ($t_number >= 300.00) {
return 28.99;
}
  
else {
return 10.00;
} 
  
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.