Another Error in shopping cart - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Another Error in shopping cart (/showthread.php?tid=14482) |
Another Error in shopping cart - El Forum - 01-04-2009 [eluser]clintonbeattie[/eluser] Hi, I have run into another error while building a shopping cart. Apologies for these posts but I think once I get a good grounding in what these errors mean they will help in future projects. Code: A PHP Error was encountered Line 67 is referring to this "$this->MOrders->updateCart($productid,$fullproduct);" Here is my updatecart model... Code: class MOrders extends Model { and this is my updatecart function in my 'welcome' controller... Code: function cart($productid=0){ The session library has been autoloaded and the session_start() implemented. Can anyone shed any light on this? Thanks again. You've been great so far. C Another Error in shopping cart - El Forum - 01-11-2009 [eluser]Nathan Payne[/eluser] You are using the codeigniter book aren't you? I used that for a while and realised that some of the code didn't work so reverted to the forums and guides o the net. You are having one of the problems I had, so I tried to build my own shopping cart lol. I will keep an eye on this thread though, see if someone directs you to the solution. Another Error in shopping cart - El Forum - 01-11-2009 [eluser]Unknown[/eluser] I believe it means that $this->MOrders is null, hence you are trying to call a function on a non-object. It's probably not loading correctly. Can you list two things? 1) The line that loads the model in the controller 2) The name of the file that contains the model I have run into this before when the filename containing the model started with an upper case character. -pc Another Error in shopping cart - El Forum - 03-20-2011 [eluser]leozzz[/eluser] [quote author="puppycrack" date="1231744783"]I believe it means that $this->MOrders is null, hence you are trying to call a function on a non-object. It's probably not loading correctly. Can you list two things? 1) The line that loads the model in the controller 2) The name of the file that contains the model I have run into this before when the filename containing the model started with an upper case character. -pc[/quote] I found the error, you have to add the new model to autoload.php where the book forgot to mention this point. |