Tutorial Details
- Technology: CodeIgniter
- Difficulty: Intermediate - Advanced
- Length: 45 Minutes
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 1: Getting Started With the Framework
- Day 2: Database Selecting Methods
- Day 3: Sending Emails
- Day 4: Newsletter Signup
- Day 5: CRUD
- Day 6: Login
- Day 7: Pagination
- Day 8: AJAX
- Day 9: File Uploading and Image Manipulation
- Day 10: The Calendar Library
- Day 11: File and Directory Operations
- Day 12: Shopping Cart
Day 12: Shopping Cart

Awesome! Love seeing this series move forward
yes!
i love this tutorial series. and i think i`ve luck that this series is not only for plus members :)
I needed this. Thanks for the tut Burak :)
Ohh yeah! I have been waiting for a CI shopping cart tut.
Sucks this is one of the last ones, right?
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
Awesome, looking forward to watching this! Huge thanks!
CodeIgniter becomes slowly my favorite framework! Thank you really much for this awesome series!
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.
Is there anywhere we can download this video tutorial????
Nice one by the way!!!
Congrats & thanks!!
http://blip.tv/file/get/NETTUTS-CodeIgniterFromScratchShoppingCart141.flv
Give it a try: http://nettuts.blip.tv/rss
If this is allowed I can upload it somewhere to be downloaded.
It’s on iTunes: http://itunes.apple.com/us/podcast/nettuts/id291173544
For some reason it doesn’t pull up the video for me.
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!
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 :/)
Thanks Burak :)
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.
Great!!!!!
This is going very fantastic :) series. CodeIgniter is my favorite now
Nice tutorial, Thanks Burak (Please Don’t Stop CI Series)
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)
Thank you Burak
And please, please don’t stop CI Series.
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.
Yeah, I agree. I just wanted to keep it simple for the tutorial.
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.
Nice Series, please don’t stop. You are helping a lot of people here. Thanks a lot!
oh, tkx by putting this on blip tv, now i can watch this last one *-*
it seems amazing =D
Great tutorial, thanks for posting dude this really help me a lot. Keep it up.
Awesome, Thank you for sharing.
I was looking for CI cart code.
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.
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!
wow, I can’t believe CI series go this far :D
i love your tutorials.you are my hero :D
wow, just great ! Was looking forward to something like this!
this will be very useful, thank you…
Very nice tut, I love this framework
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!
Unobstrusive but unique! ;)
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.
Where did you read that?
I read that too, i think via twitter. I dont know if Jeff posted that or someone else.
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.
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).
Looks very interesting. When the episode will show up in iTunes Podcasts?
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.
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.
thanks for beautiful article :)
Is this episode going to be released on iTunes? Both this one and Day 11 do not appear to be on iTunes yet. :(
Thanks.
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.
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!
I am not totally familiar with the current PHP plugins for Aptana. I am using an older version (no longer on their website), and not PDT.
You can still download Aptana 1.5 + Aptana PHP plugin here: https://aptanastudio.tenderapp.com/faqs/installing-aptana-studio/downloading-aptana-studio-151-and-aptana-php
Or try this out: http://www.nightlion.net/web/2009/using-aptana-php-module/
In Aptana 2.0 is only PDT available, which is not so good. And… I think You can enable code assist under PHP -> Editor -> Code Assist…
Nice one! Don’t stop this series.
Cheers
i can’t see video.what the matter with it?
Thanks for this series. I joined tuts+ long ago but only now getting around to actually watching these.
Awesome! Thank you for this!
I would like to see this with the implementation of the check out I hope you keep working on this tuts.
I have been waiting for the tutorials to appear on iTunes. Do you know when this will be Jeffery?
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!
I decide to switch from Aptana to Netbeans for PHP coding!!!
Very nice tutorial for beginners. Thank you so much.
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!
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.
@ally
Day 3: http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-3/
Amazing video tutorials. CI is great framework. Don’t stop the series! Thank you!