Posts

Showing posts from October, 2012

yii framework simple shopping cart tutorial for beginners

Provides shpping cart functionality for models. Cart is a container object that holds items collection and have handy methods to work with it. It uses user session as a cart data storage. Installing and configuring 1 way: Registration in the config file Add to protected/config/main.php : [php] 'import'=>array( 'ext.yiiext.components.shoppingCart.*' ), 'components' => array( 'shoppingCart' => array( 'class' => 'ext.yiiext.components.shoppingCart.EShoppingCart', ), ) 2 way: Registration by necessity [php] $cart = Yii::createComponent(array( 'class' => 'ext.yiiext.components.shoppingCart.EShoppingCart' )); //Important! $cart->init(); $book = Book::model()->findByPk(1); $cart->put($book); Preparing a model Models that you are planning to put into the cart should implement IECartPosition interface: [php] class Book extends CActiveRecord implements IECartPosit

Object Oriented Concepts in PHP5

Object Oriented Concepts in php: Before we go in detail, lets define important terms related to Object Oriented Programming. Class: This is a programmer-defined datatype, which includes local functions as well as local data. You can think of a class as a template for making many instances of the same kind (or class) of object. Object: An individual instance of the data structure defined by a class. You define a class once and then make many objects that belong to it. Objects are also known as instance. Member Variable: These are the variables defined inside a class. This data will be invisible to the outside of the class and can be accessed via member functions. These variables are called attribute of the object once an object is created. Member function: These are the function defined inside a class and are used to access object data. Inheritance: When a class is defined by inheriting existing function of a parent class then it is called inheritance. Here child class w

Advance plain cart with admin panel(Simple PHP Shopping Cart Tutorial )

Image
Advance plain cart is advance version of http://www.phpwebcommerce.com plain cart. i have added html template to admin panel and shopping cart with special feature like adding sub category and login/logout session for admin and other user level. download the Simple PHP Shopping Cart Tutorial with code AdvancePlainCart Add this embedded code in your blog to share this free Advance plain cart to all php programmers.