Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

oxDiscountList Class Reference

Inheritance diagram for oxDiscountList:
Collaboration diagram for oxDiscountList:

List of all members.

Public Member Functions

 __construct ($sObjectsInListName= 'oxdiscount')
 getCountryId ($oUser)
 forceReload ()
 getArticleDiscounts ($oArticle, $oUser=null)
 getBasketItemDiscounts ($oArticle, $oBasket, $oUser=null)
 getBasketDiscounts ($oBasket, $oUser=null)
 getBasketItemBundleDiscounts ($oArticle, $oBasket, $oUser=null)
 getBasketBundleDiscounts ($oBasket, $oUser=null)
 applyDiscounts ($oPrice, $aDiscounts)
 applyBasketDiscounts (oxPrice $oPrice, $aDiscounts, $dAmount=1)

Static Public Member Functions

static getInstance ()

Protected Member Functions

 _getList ($oUser=null)
 _getFilterSelect ($oUser)

Protected Attributes

 $_sUserId = null
 $_blReload = true

Static Protected Attributes

static $_instance = null

Detailed Description

Discount list manager. Organizes list of discount objects.

Definition at line 7 of file oxdiscountlist.php.


Constructor & Destructor Documentation

oxDiscountList.__construct ( sObjectsInListName = 'oxdiscount'  ) 

Class Constructor

Parameters:
string $sObjectsInListName Associated list item object type

Reimplemented from oxList.

Definition at line 35 of file oxdiscountlist.php.


Member Function Documentation

oxDiscountList._getFilterSelect ( oUser  )  [protected]

Creates discount list filter SQL to load current state discount list

Parameters:
object $oUser user object
Returns:
string

Definition at line 124 of file oxdiscountlist.php.

oxDiscountList._getList ( oUser = null  )  [protected]

Initializes current state discount list

Parameters:
object $oUser user object (optional)
Returns:
array

Definition at line 71 of file oxdiscountlist.php.

oxDiscountList.applyBasketDiscounts ( oxPrice oPrice,
aDiscounts,
dAmount = 1 
)

Applies discounts which are supposed to be applied on amounts greater than zero. Returns applied discounts.

Parameters:
oxPrice $oPrice Old article price
array $aDiscounts Discount array
amount $dAmount Amount in basket
Returns:
array

Definition at line 308 of file oxdiscountlist.php.

oxDiscountList.applyDiscounts ( oPrice,
aDiscounts 
)

Applies discounts which should be applied in general case (for 0 amount)

Parameters:
oxprice $oPrice Price object
array $aDiscounts Discount list
Returns:
null

Definition at line 290 of file oxdiscountlist.php.

oxDiscountList.forceReload (  ) 

Used to force discount list reload

Returns:
null

Definition at line 112 of file oxdiscountlist.php.

oxDiscountList.getArticleDiscounts ( oArticle,
oUser = null 
)

Returns array of discounts that can be globally (transparently) applied

Parameters:
object $oArticle article object
object $oUser oxuser object (optional)
Returns:
array

Definition at line 186 of file oxdiscountlist.php.

oxDiscountList.getBasketBundleDiscounts ( oBasket,
oUser = null 
)

Returns array of basket bundle discounts

Parameters:
oxbasket $oBasket oxbasket object
oxuser $oUser oxuser object (optional)
Returns:
array

Definition at line 269 of file oxdiscountlist.php.

oxDiscountList.getBasketDiscounts ( oBasket,
oUser = null 
)

Returns array of discounts that can be applied for whole basket

Parameters:
object $oBasket basket
object $oUser user object (optional)
Returns:
array

Definition at line 227 of file oxdiscountlist.php.

oxDiscountList.getBasketItemBundleDiscounts ( oArticle,
oBasket,
oUser = null 
)

Returns array of bundle discounts that can be applied for whole basket

Parameters:
object $oArticle article object
object $oBasket basket
object $oUser user object (optional)
Returns:
array

Definition at line 249 of file oxdiscountlist.php.

oxDiscountList.getBasketItemDiscounts ( oArticle,
oBasket,
oUser = null 
)

Returns array of discounts that can be applied for individual basket item

Parameters:
mixed $oArticle article object or article id (according to needs)
object $oBasket array of basket items containing article id, amount and price
object $oUser user object (optional)
Returns:
array

Definition at line 207 of file oxdiscountlist.php.

oxDiscountList.getCountryId ( oUser  ) 

Returns user country id for for discount selection

Parameters:
oxuser $oUser oxuser object
Returns:
string

Definition at line 97 of file oxdiscountlist.php.

static oxDiscountList.getInstance (  )  [static]

Returns discount list instance

Returns:
oxDiscountList

Definition at line 45 of file oxdiscountlist.php.


Member Data Documentation

oxDiscountList.$_blReload = true [protected]

Definition at line 28 of file oxdiscountlist.php.

oxDiscountList.$_instance = null [static, protected]

Definition at line 14 of file oxdiscountlist.php.

oxDiscountList.$_sUserId = null [protected]

Definition at line 21 of file oxdiscountlist.php.


The documentation for this class was generated from the following file: