Welcome Guest, Not a member yet? Register   Sign In
Basic Cart Example
#1

[eluser]SitesByJoe[/eluser]
I just started playing with the cart class today. I looked around and didn't see a decent example of the basic functions working together so I whipped up a rough example for newbies to play with who are trying the cart for the first time and are confused.

This is a very basic example and I only used a controller since I'm just roughing it together as I post this. No proper MVC is being used - everything is in the controller so you can absorb what's happening very quickly.

The code may very well be missing things that advanced programmers are free to mention.

Enjoy!

The one table so far, "products"
Code:
CREATE TABLE `products` (
  `product_id` int(11) NOT NULL auto_increment,
  `category_id` int(11) NOT NULL default '0',
  `product_name` varchar(50) default NULL,
  `product_short_desc` varchar(255) default NULL,
  `product_long_description` text,
  `product_price` varchar(50) default NULL,
  `product_added` timestamp NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`product_id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=utf8;

insert into `products` values('4','0','Test Product','a short description','a long description','29.95',null),
('5','0','Test Product 2','a short description','a long description','1.95',null);

Controller Code up next...


Messages In This Thread
Basic Cart Example - by El Forum - 09-12-2009, 04:25 PM
Basic Cart Example - by El Forum - 09-12-2009, 04:26 PM
Basic Cart Example - by El Forum - 09-13-2009, 08:11 AM
Basic Cart Example - by El Forum - 09-13-2009, 08:31 AM
Basic Cart Example - by El Forum - 09-13-2009, 12:58 PM
Basic Cart Example - by El Forum - 09-30-2009, 09:00 PM
Basic Cart Example - by El Forum - 09-30-2009, 10:06 PM
Basic Cart Example - by El Forum - 10-01-2009, 07:22 AM
Basic Cart Example - by El Forum - 10-01-2009, 09:38 PM
Basic Cart Example - by El Forum - 10-07-2009, 10:58 AM
Basic Cart Example - by El Forum - 10-24-2009, 07:56 PM
Basic Cart Example - by El Forum - 10-24-2009, 10:07 PM
Basic Cart Example - by El Forum - 10-25-2009, 10:28 AM
Basic Cart Example - by El Forum - 10-25-2009, 12:55 PM
Basic Cart Example - by El Forum - 11-02-2009, 02:21 AM
Basic Cart Example - by El Forum - 11-04-2009, 04:19 AM
Basic Cart Example - by El Forum - 12-08-2009, 04:05 AM
Basic Cart Example - by El Forum - 12-09-2009, 01:19 PM
Basic Cart Example - by El Forum - 12-10-2009, 12:03 PM
Basic Cart Example - by El Forum - 12-10-2009, 12:14 PM



Theme © iAndrew 2016 - Forum software by © MyBB