CodeIgniter from Scratch: Shopping Cart
videos

CodeIgniter from Scratch: Shopping Cart

Tutorial Details
  • Technology: CodeIgniter
  • Difficulty: Intermediate - Advanced
  • Length: 45 Minutes
This entry is part 12 of 17 in the CodeIgniter From Scratch Session
« PreviousNext »

Today, we are going to take a look at the Shopping Cart library for CodeIgniter. This useful class allows us to add and remove items to a shopping cart, update them, and calculate prices. I will demonstrate how you can build a simple shopping cart system with the help of this library..


Catch Up


Day 12: Shopping Cart

Final Project

Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • Stephen

    Awesome! Love seeing this series move forward

    • http://http.//www.dosonaro.com Christopher Dosin

      yes!
      i love this tutorial series. and i think i`ve luck that this series is not only for plus members :)

  • http://twitter.com/KGTheNerd Karthik

    I needed this. Thanks for the tut Burak :)

  • Myke

    Ohh yeah! I have been waiting for a CI shopping cart tut.
    Sucks this is one of the last ones, right?

    • http://www.daniel-petrie.com Daniel Petrie

      Yea, I saw that tweet to saying that the CI series is getting close to the end :( sad day. But I’ll enjoy them while they last

  • http://supermumin.net Markus

    Awesome, looking forward to watching this! Huge thanks!

  • http://www.broof.de BroOf

    CodeIgniter becomes slowly my favorite framework! Thank you really much for this awesome series!

  • http://www.daniel-petrie.com Daniel Petrie

    Oh, I wasn’t expecting this until tomorrow, what a surprise. I’ll have to watch this when I get home from work. It will be interesting to see how CI put a shopping cart system into their framework, curious to see how complex or simple it may be.

  • Pablo Martínez

    Is there anywhere we can download this video tutorial????
    Nice one by the way!!!
    Congrats & thanks!!

  • http://matt-bridges.com Matt Bridges

    Fantastic tut!

    One change / improvement I would make is that in the get() function in your model, instead of retrieving the row with result(), you can use row() and not have to then specify the first result out of that object.

    CodeIgniter has indeed become of my favorite framework because of this series. It really stinks that we’ve reached the end, but I am thoroughly looking forward to the next one you guys pump out!

  • http://www.daniel-petrie.com Daniel Petrie

    Can’t wait to look at this when I get home from work, interested to see how simple or complex CI’s shopping cart is. (guess my last post got deleted or something :/)

  • http://wpcanyon.com Slobodan Kustrimovic

    Thanks Burak :)

  • http://www.twitter.com/netjunky88 Eugene

    I just don’t understand one thing. How does or even better, where is the interface with method index. I looked everywhere and still didn’t find it.

  • http://hectorrosa.spaces.live.com/ hector

    Great!!!!!

  • Khalil

    This is going very fantastic :) series. CodeIgniter is my favorite now

    Nice tutorial, Thanks Burak (Please Don’t Stop CI Series)

  • bralens

    if CI tuts come to the end then i realy loved to see tut for security, i realy like CI tuts from Jeffrey Way and Burak Guzel, they help me leran the best way to create web site for me and make Cl the beast framework for me, that i like to use and i hope the Cl tuts never ends :D
    P.S my english isnt realy good. i hope you understund wath i say and some day i will see the “CodeIgniter from Scratch: security” in this page. i appreciate all work that u all make, because they make my learning web programming realy easy and inteteresting.
    thanks you all, and i hope i will see more usefull things from this site and it will grow and grow, and some day it will be the biggest web developer site in the world (if not yet. for me it already is)

  • Carlos

    Thank you Burak

    And please, please don’t stop CI Series.

  • http://twitter.com/hombrepipa Rodolfo

    Awesome! CodeIgniter is by far my favourite PHP framework.

    Great screencast Burak, but instead of exploding the option_values, wouldn’t had been much more easier storing the options as a serialized array and the unserializing it? Maybe a little more tricky due to the serialize/unserialize thing but I think it’s a better practice.

    • http://www.phpandstuff.com/ Burak
      Author

      Yeah, I agree. I just wanted to keep it simple for the tutorial.

  • Bretticus

    Wrote a shopping cart using 1.7.1 just before 1.7.2 came out so I missed the cart class. Haven’t had the opportunity to checkout CI’s implementation. Thanks for an enjoyable tut.

  • http://www.confrariadigital.com.br Mauricio Kalil

    Nice Series, please don’t stop. You are helping a lot of people here. Thanks a lot!

  • Garrafa

    oh, tkx by putting this on blip tv, now i can watch this last one *-*

    it seems amazing =D

  • http://floyd-mayweather-vs-shane-mosley.blogspot.com/ Jax

    Great tutorial, thanks for posting dude this really help me a lot. Keep it up.

  • http://www.jsxtech.com Jaspal Singh

    Awesome, Thank you for sharing.
    I was looking for CI cart code.

  • http://brianswebdesign.com Brian Temecula

    The shopping cart is the easy part as far as I’m concerned. Try displaying the product in nested categories, applying shipping, applying tax, and checking out through your favorite gateway. These are only a small part of creating a complete eCommerce solution, and there’s a lot to think about.

    I’ve got a simple eCommerce application in the CI wiki. It’s called Community Cart. I haven’t worked on it for a while, but it’s a good start, or maybe you just want to see how somebody else did it.

    • bretticus

      I agree with you completely. Handling orders and money, refunds, and all the other minutiae is very time consuming.

      In reality, the CI Cart Class is not very complex and could be easily duplicated, but it’s nice to know there is a standard for that one component of the entire ecommerce system at least (Other components could be a much more difficult to implement in a “vanilla” fashion if you know what I mean. That’s probably why just the basic cart code is offered.) I am finding that one of the most appealing points of using a framework for me is that it facilitates collaboration. That is, my coworkers and I are using the same code base.

      Thanks for contributing a mature and extensive ecommerce application to the community.

      Cheers!

  • Hieu Vo

    wow, I can’t believe CI series go this far :D

  • cipi

    i love your tutorials.you are my hero :D

  • http://www.woony.be woony

    wow, just great ! Was looking forward to something like this!

  • http://ilopezdeaudikana.com mutiu

    this will be very useful, thank you…

  • Khaled

    Very nice tut, I love this framework

  • http://newarts.at Drazen Mokic

    You have an unobstrusive voice like Jeff, i like it! This tut would nice suite with a product management backend (with CI of course). Well done!

    • http://newarts.at Drazen Mokic

      Unobstrusive but unique! ;)

  • Tom Van Assche

    I read that this is one of the last parts, i would hate to see this series go. As soon as im making some money, ill buy a plus account, but I would be dissapointed if this series stopped.

    • http://www.phpandstuff.com/ Burak
      Author

      Where did you read that?

      • http://newarts.at Drazen Mokic

        I read that too, i think via twitter. I dont know if Jeff posted that or someone else.

  • Oskarbravo

    Amazing tutorial Burak! Jeff spoke about creating a CMS when he first kicked the CI series off. Is that something you might think about putting together? And yes, I too think that you should definitely continue this series.

  • Ali Baba

    Great tutorial for basic shopping cart. It will be nice to see database driven cart implementation and not cookie/session base. Note all data saved as cookie (ci_session).

  • Danijel

    Looks very interesting. When the episode will show up in iTunes Podcasts?

  • http://www.maikdiaz.com Maik

    Great tut Burak, thanks is that true that the CI series will stop, I just get my plus account just fot the codeigniter tuts.

    I would like to see this with the implementation of the check out I hope you keep working on this tuts.

  • http://www.nbsilanke.com hookah

    A wonderful article. In my life, I have never seen a man be so selfless in helping others around him to get along and get working.

  • http://codendesign.blogspot.com nXqd

    thanks for beautiful article :)

  • http://www.twitter.com/NeilBradley Neil Bradley

    Is this episode going to be released on iTunes? Both this one and Day 11 do not appear to be on iTunes yet. :(

    Thanks.

  • Seth

    Hey,

    Nice tutorial. One thing I would like to see would be some Advanced Code Igniter tutorials where you go over all the stuff you keep saying is too much for this tutorial. :)

    This has been a really great series.

  • http://www.justingillespie.com Justin

    I’ve just recently switched over to aptana studio from dreamweaver, and I must say I absolutely love it. I installed the PHP plugins, but how do I get the inline tool tips with php functions (like Burak does)? It only seems to do that for css.

    Any help is appreciated!

    Great tutorial!

  • walter

    Nice one! Don’t stop this series.
    Cheers

  • leotran

    i can’t see video.what the matter with it?

  • Cam

    Thanks for this series. I joined tuts+ long ago but only now getting around to actually watching these.

  • http://www.zacvineyard.com Zac

    Awesome! Thank you for this!

  • rachid

    I would like to see this with the implementation of the check out I hope you keep working on this tuts.

  • Warrick

    I have been waiting for the tutorials to appear on iTunes. Do you know when this will be Jeffery?

  • mooret

    Nice tutorial again. Whole CI series has been very helpfull for me.

    Please don’t stop this series. Jeff mentioned something about making a CMS in day 1. Looking forward to…

    Keep them coming!

  • http://parkerituk.com Parker

    I decide to switch from Aptana to Netbeans for PHP coding!!!

  • Subhankar

    Very nice tutorial for beginners. Thank you so much.

  • Tson

    Hi All
    i have problem with may cart, i can’t to delete product with IE 8. But with Firefox is ok.
    Please help me as soon.
    Thanks!

  • ally

    nice post

    guys i need some help I’m new in web developent i m working on a project and client wants a email service in his website like google , yahoo, hotmail. please if some body can post how to build such application i ll really apreciate.

  • hQuse

    Amazing video tutorials. CI is great framework. Don’t stop the series! Thank you!