Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

PHP Tutorials: Mini Shopping Cart (Part 5/7)

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
5,876
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Mar 9, 2011

Create a mini shopping cart, easy to integrate into any design using only a couple of functions.

Official website
http://phpacademy.org

Support Forum
http://phpacademy.org/forum

Follow us on Twitter!
http://twitter.com/phpacademy

Category:

Education

Tags:

License:

Standard YouTube License

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (phpacademy)

  • I'm a little confused here...

    I've finished the cart and I just noticed that if I have 3 items in my cart...

    1 x Tea @ $1.50 = $1.50

    2 x Book @ 9.99 = $19.98

    Total: $41.46

    What's with the total being wrong..? I'm a little confused.. Like I said.

  • @Hug0101 It's not wrong. 2 x 19.98 is 39.96, add 1.50 is 41.46. Unless I'm missing something there.

Top Comments

  • To those that may geta undefined error just put $sub = ""; and $total=""; before the foreach loop and that will go away.

  • Hi Alex It's because of guys like you that donate your time and energy to educate the rest of us that I get up in the mornings. Well done I have followed the shopping cart to here and all is working well to this point. Thanks again for a wonderful tutorial.

see all

All Comments (21)

Sign In or Sign Up now to post a comment!
  • thx 4 ur really awesome tutorial......i coded a per your script bt facing a notice like " Notice: Undefined variable: total in C:\xampp\htdocs\shoppingcart\c­art.php on line 70 " . whts the problem......could you plz help me......

  • If you are getting the error: Parse error: syntax error, unexpected ';' in cart.php on line 21

    replace the:

    $_SESSION['cart_'.(int)$_GET['­remove']]==;

    with:

    $_SESSION['cart_'.(int)$_GET['­remove']] -='1';

  • hello im building a e commerce site i have everything made but my problem now is finding a way other than paypal having a button that says buy here i was looking for a gateway payment so the user can but their credit card info through my ssl site how would i go about doing this what kind of variables do i need in the check out section to communicate with the gateway i have tried to communicat the gateway company but they are clueless thank you

  • Alexs Id product number is different with yours change this cart_1 To cart_ one of your product  id number !!!!

  • Instead of three if statements for Add Remove and Delete try a switch statement to make things more organized.

  • Great video! Set up your ecommerce business for free with our Easy Help Zen Cart Tutorials:

    

  • This is very tidy. Excellent!

  • Notice: Undefined variable: total

    any help where i have to place it

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more