I'm just adding a working example to my last post; check the
implementation part at the end of the script;
Cheers, Allex
class Item {
var $_productID;
var $_quantity;
function Item($productID, $quantity) {
$this->_productID = $productID;
$this->_q
In my view, to keep the object oriented approach cleaner you should use
another class for describing your item, like:
class Item {
var $_product_id;
var $_quantity;
function Item($productId, $quantity) {
$this->_product_id = $productId;
$this->_quantity = $quantity;
}
function
I am just learning to use objects. I am messing around with a shopping cart
object, but am having confusing problems. I am getting an undefined index
error when trying to assign a key value pair to an array variable within an
object. I am confused becuase I believe this is how you assign array
vari
3 matches
Mail list logo