jarvis Posted March 30, 2011 Share Posted March 30, 2011 Hi, I can't see for looking on quite simply a very easy statement; $cartTotal = '900'; echo 'cart total '.$cartTotal.'<br/>'; $postage = '100'; echo 'Postage '.$postage.'<br/>'; $postThreshold = '85'; echo 'Post Threshold '.$postThreshold.'<br/>'; if ($cartTotal <= $postThreshold) { echo 'too little'; } elseif (($cartTotal >= $postThreshold) || ($cartTotal <= $postage)) { echo 'difference'; } else { echo 'over a ton'; } It works apart from if the cart total is above 100. What have I missed? Thanks Link to comment https://forums.phpfreaks.com/topic/232161-php-if-elseif/ Share on other sites More sharing options...
KevinM1 Posted March 30, 2011 Share Posted March 30, 2011 What results are you expecting to get? Link to comment https://forums.phpfreaks.com/topic/232161-php-if-elseif/#findComment-1194249 Share on other sites More sharing options...
jarvis Posted March 30, 2011 Author Share Posted March 30, 2011 Hi, If the cart total is less than 85 - too little If its between 85 - 100 - difference Above 100 - over a ton Thanks for looking Link to comment https://forums.phpfreaks.com/topic/232161-php-if-elseif/#findComment-1194254 Share on other sites More sharing options...
KevinM1 Posted March 30, 2011 Share Posted March 30, 2011 Change the || to && Link to comment https://forums.phpfreaks.com/topic/232161-php-if-elseif/#findComment-1194258 Share on other sites More sharing options...
jarvis Posted March 30, 2011 Author Share Posted March 30, 2011 D'oh! Thanks that's worked a treat!! Link to comment https://forums.phpfreaks.com/topic/232161-php-if-elseif/#findComment-1194263 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.