Quote Originally Posted by dale88 View Post
I was experimenting on this code on WIKI API tutorial. i tried to remove this condition statement " if ($_SESSION['cart']->show_total() < $this->freeAmount && $_SESSION['cart']->in_cart($this->freeProductID) )
{
" that is when the error comes up when i'm trying to add a product in the cart. i scanned shopping cart class and still haven't figured why it has to have that statement for the class to work
But ... an "if" clause which contains an opening brace { must also include a closing brace }
And, if you only removed the "if" condition and its opening brace, then you've created an ugly PHP error situation.
If you really want to remove that particular "if" clause, you need to remove the *whole* thing:
Code:
  if ($_SESSION['cart']->show_total() < $this->freeAmount && $_SESSION['cart']->in_cart($this->freeProductID) ) 
  {
    $_SESSION['cart']->remove($this->freeProductID);
  }
I recommend going back to the PHP website and studying the code syntax before adjusting further PHP code.