Uploader Comments (TheTutSpace)
All Comments (17)
-
@sandeepshah89 You can get rid of the :
$key = explode("submit",$key);
$key = end($key);
and replace it with:
if($key == "submit") { unset($_SESSION['cart'][$key])
; }
change the next if to an else if
-
hello.. my problem is when i click add cart its nothing happen it is not adding to my cart.? answer plss.?
-
@TheTutSpace did it!
put if(isset($_POST['quantity-'.$k
ey])){ just outside the if statement if($_POST['quantity-'.$key] == 0){. error message gone, tested the website and all is functional. just wanted to thank you for this tutorial, gonna add new features and stuff, but it was a great learning curve. thanks
-
@TheTutSpace is true! I don't use session_start() sorry! thanks for answer
-
dear sir u are missing the starting of cart.php plz give me starting cart.php toturial...!!! the is main toturial starting cart.php
-
dear sir u are missing the starting of cart.php plz give me starting cart.php toturial...!!!
i keep getting Notice: Undefined index: quantity- in C:\xampp\htdocs\CART\cart.php on line 9
my code around line 9 is: if($_POST['quantity-'.$key] == 0){ unset($_SESSION['cart'][$key]); } else { $_SESSION['cart'][$key]['quantity'] = $value; }
any ideas? its really bugging me. everything still works fine, just get a notice up. thanks!
sandeepshah89 7 months ago
@sandeepshah89 to get rid of the Undefined Index you can use the function isset() within the if() statement. Eg. if(isset($_POST['...'])) blah blah.
Alternatively, there is nothing wrong with just hiding Notice errors, so in your php.ini file, you can edit the error_reporting section to say E_ALL ~ E_NOTICE
TheTutSpace 7 months ago
error Notice: Undefined variable: _SESSION in C: \ xampp \ htdocs \ a\ cart.php on line 31
Warning: Invalid argument Supplied for foreach () in C: \ xampp \ htdocs \ a\ cart.php on line 31
Why?
Kyrakuum 9 months ago
@Kyrakuum Email me your code and I will see what i can do, but to my it looks like you may have not started the session (use session_start() at the top of the page)
TheTutSpace 9 months ago
Thanks Tiger :)
TheTutSpace 2 years ago
seemed pointless being in the group, Where no views were obtained :)
TheTutSpace 2 years ago