Public Member Functions | |
__construct () | |
setIsNewBasket () | |
isNewBasket () | |
isEmpty () | |
getArticles () | |
getItems ($blReload=false, $blActiveCheck=true) | |
getItem ($sProductId, $aSelList) | |
getItemCount ($blReload=false) | |
addItemToBasket ($sProductId=null, $dAmount=null, $aSel=null, $blOverride=false) | |
delete ($sOXID=null) | |
isVisible () | |
Protected Member Functions | |
_insert () | |
_createItem ($sProductId, $aSelList=null) | |
_getItemKey ($sProductId, $aSel=null) | |
Protected Attributes | |
$_aSkipSaveFields = array('oxcreate') | |
$_sClassName = 'oxUserbasket' | |
$_aBasketItems = null | |
$_blNewBasket = false |
Virtual basket manager class. Virtual baskets are user product lists which are stored in database (stored basket, noticelists, wishlists). Collects shopping basket information, updates it, removes or adds products to the database.
Definition at line 9 of file oxuserbasket.php.
oxUserBasket.__construct | ( | ) |
Class constructor, initiates parent constructor (parent.oxBase()).
Reimplemented from oxBase.
Definition at line 45 of file oxuserbasket.php.
oxUserBasket._createItem | ( | $ | sProductId, | |
$ | aSelList = null | |||
) | [protected] |
Creates and returns oxuserbasketitem object
string | $sProductId Product Id | |
array | $aSelList product select lists |
Definition at line 177 of file oxuserbasket.php.
oxUserBasket._getItemKey | ( | $ | sProductId, | |
$ | aSel = null | |||
) | [protected] |
Returns unique item key according to its ID and user chosen select
string | $sProductId Product Id | |
array | $aSel product select lists |
Definition at line 234 of file oxuserbasket.php.
oxUserBasket._insert | ( | ) | [protected] |
Inserts object data to DB, returns true on success.
Reimplemented from oxBase.
Definition at line 56 of file oxuserbasket.php.
oxUserBasket.addItemToBasket | ( | $ | sProductId = null , |
|
$ | dAmount = null , |
|||
$ | aSel = null , |
|||
$ | blOverride = false | |||
) |
Method adds/removes user chosen article to/from the basket. Returns total amount of articles in list.
string | $sProductId Article ID | |
double | $dAmount Product amount | |
array | $aSel product select lists | |
bool | $blOverride if true overrides $dAmount, else sums previous with current it |
Definition at line 263 of file oxuserbasket.php.
oxUserBasket.delete | ( | $ | sOXID = null |
) |
Deletes current basket history
string | $sOXID Object ID(default null) |
Reimplemented from oxBase.
Definition at line 304 of file oxuserbasket.php.
oxUserBasket.getArticles | ( | ) |
Returns an array of articles belonging to the Items in the basket
Definition at line 115 of file oxuserbasket.php.
oxUserBasket.getItem | ( | $ | sProductId, | |
$ | aSelList | |||
) |
Searches for item in basket items array and returns it. If not item was found - new item is created.
string | $sProductId product id, basket item id or basket item index | |
array | $aSelList select lists |
Definition at line 207 of file oxuserbasket.php.
oxUserBasket.getItemCount | ( | $ | blReload = false |
) |
Returns current basket item count
bool | $blReload if TRUE forces to reload list |
Definition at line 247 of file oxuserbasket.php.
oxUserBasket.getItems | ( | $ | blReload = false , |
|
$ | blActiveCheck = true | |||
) |
Returns list of basket items
bool | $blReload if TRUE forces to reload list | |
bool | $blActiveCheck should articles be checked for active state? |
Definition at line 136 of file oxuserbasket.php.
oxUserBasket.isEmpty | ( | ) |
oxUserBasket.isNewBasket | ( | ) |
oxUserBasket.isVisible | ( | ) |
Checks if user basket is visible for current user (public or own basket)
Definition at line 324 of file oxuserbasket.php.
oxUserBasket.setIsNewBasket | ( | ) |
Sets basket as newly created. This usually means that it is not yet stored in DB and will only be stored if some item is added
Definition at line 78 of file oxuserbasket.php.
oxUserBasket.$_aBasketItems = null [protected] |
Definition at line 31 of file oxuserbasket.php.
oxUserBasket.$_aSkipSaveFields = array('oxcreate') [protected] |
Reimplemented from oxBase.
Definition at line 17 of file oxuserbasket.php.
oxUserBasket.$_blNewBasket = false [protected] |
Definition at line 38 of file oxuserbasket.php.
oxUserBasket.$_sClassName = 'oxUserbasket' [protected] |
Reimplemented from oxBase.
Definition at line 24 of file oxuserbasket.php.