jpldisplays Posted June 6, 2005 Share Posted June 6, 2005 Hi all, Wondering if someone can assist me with a little mod I am trying to make to one of the shipping contributions. This little bit of code looks up the size of the box in my admin but I am trying to break it up into different size boxes based on the total weight. if ($delivery_weight >= 7.0) { $swidth = MODULE_SHIPPING_AUSPOST_SWIDTH; $sheight = MODULE_SHIPPING_AUSPOST_SHEIGHT; $slength = MODULE_SHIPPING_AUSPOST_SDEPTH; } elseif ($delivery_weight > 5.0) and ($delivery_weight < 7.0) { $swidth = "270"; $sheight = "210"; $slength = "370"; } elseif ($delivery_weight > 3.0) and ($delivery_weight <= 5.0) { $swidth = "310"; $sheight = "110"; $slength = "370"; } elseif ($delivery_weight > 0.9) and ($delivery_weight <= 3.0) { $swidth = "185"; $sheight = "135"; $slength = "235"; } else { $swidth = "100"; $sheight = "100"; $slength = "100"; } My problem is that it does not seem to like the and function, can someone tell me how this should read.. Thanks in advance!! Link to comment Share on other sites More sharing options...
Guest Posted June 6, 2005 Share Posted June 6, 2005 switch (true){ case ($delivery_weight >= 7.0): $swidth = MODULE_SHIPPING_AUSPOST_SWIDTH; $sheight = MODULE_SHIPPING_AUSPOST_SHEIGHT; $slength = MODULE_SHIPPING_AUSPOST_SDEPTH; break; case ($delivery_weight > 5.0) and ($delivery_weight < 7.0): $swidth = "270"; $sheight = "210"; $slength = "370"; break; case ($delivery_weight > 3.0) and ($delivery_weight <= 5.0): $swidth = "310"; $sheight = "110"; $slength = "370"; break; case ($delivery_weight > 0.9) and ($delivery_weight <= 3.0): $swidth = "185"; $sheight = "135"; $slength = "235"; break; default: $swidth = "100"; $sheight = "100"; $slength = "100"; break; } # end switch Bobby Link to comment Share on other sites More sharing options...
♥yesudo Posted June 6, 2005 Share Posted June 6, 2005 if ($delivery_weight >= 7.0) { $swidth = MODULE_SHIPPING_AUSPOST_SWIDTH; $sheight = MODULE_SHIPPING_AUSPOST_SHEIGHT; $slength = MODULE_SHIPPING_AUSPOST_SDEPTH; } elseif (($delivery_weight > 5.0) and ($delivery_weight < 7.0)) { $swidth = "270"; $sheight = "210"; $slength = "370"; } elseif (($delivery_weight > 3.0) and ($delivery_weight <= 5.0)) { $swidth = "310"; $sheight = "110"; $slength = "370"; } elseif (($delivery_weight > 0.9) and ($delivery_weight <= 3.0)) { $swidth = "185"; $sheight = "135"; $slength = "235"; } else { $swidth = "100"; $sheight = "100"; $slength = "100"; } Your online success is Paramount. Link to comment Share on other sites More sharing options...
jpldisplays Posted June 7, 2005 Author Share Posted June 7, 2005 Thanks guys!! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.