karmapool Posted September 2, 2005 Share Posted September 2, 2005 Do I have a problem. My shopping cart is not displaying all its contents? Things work fine on my test server. And things work fine for some customers but for other customers there is a problem when they log off and log back in not all of there contents are displayed? I did do a modification to add a free foot massager with the purchase of certain products. There seems to be a faulty ?if? statement or something? Here is the code: echo "test, " . $flagit . ', ' . $n; // enters the foot massager info if ($flagit!='true'){ echo "test, " . $flagit . ', ' . $n; And here is the only line that is displayed test, 0, 2 $flagit = 0 not true so how come only the one test line is being displayed??? Any help or direction at all would be appreciated, Billy Z Link to comment Share on other sites More sharing options...
Guest Posted September 2, 2005 Share Posted September 2, 2005 how do you treat $flagit? as a string or a flag? if its a combination then you should have this if ($flagit===false){ Link to comment Share on other sites More sharing options...
karmapool Posted September 2, 2005 Author Share Posted September 2, 2005 Mark you are a life saver. It works. But now I want to know why. Is it because of the name of my variable? I was using it as a flag to determine if a free foot massager should be added to the cart and also to mark the place in the loop so I could add the foot massager at the bottom of the cart. You know, don?t worry about it I can look it up now that I know what was happening. Once again thanks. :D Billy Z Link to comment Share on other sites More sharing options...
Guest Posted September 2, 2005 Share Posted September 2, 2005 hello billy I think you were trying to check if the $flagit was containing a string instead of comparing. php is slightly different than cpp for instance. here is the comparison reference. http://www.php.net/manual/en/language.oper....comparison.php notice the statement "of the same type" Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.