Public Member Functions | Protected Member Functions | Protected Attributes

oxDiscount Class Reference

Inheritance diagram for oxDiscount:
Collaboration diagram for oxDiscount:

List of all members.

Public Member Functions

 __construct ()
 delete ($sOXID=null)
 isForArticle ($oArticle)
 isForBasketItem ($oArticle)
 isForBasketAmount ($oBasket)
 isForAmount ($dAmount)
 isForBasket ($oBasket)
 isForBundleItem ($oArticle)
 isForBundleBasket ($oBasket)
 getAbsValue ($dPrice, $dAmount=1)
 applyDiscount ($oPrice, $dAmount=1)
 getBundleAmount ($dAmount)
 getSimpleDiscount ()

Protected Member Functions

 _checkForArticleCategories ($oArticle)
 _getProductCheckQuery ($oProduct)

Protected Attributes

 $_sClassName = 'oxdiscount'
 $_dAmount = null
 $_sBasketIdent = null

Detailed Description

Discounts manager.

Definition at line 6 of file oxdiscount.php.


Constructor & Destructor Documentation

oxDiscount.__construct (  ) 

Class constructor, initiates parent constructor (parent.oxBase()).

Reimplemented from oxI18n.

Definition at line 32 of file oxdiscount.php.


Member Function Documentation

oxDiscount._checkForArticleCategories ( oArticle  )  [protected]

Checks if discount may be applied according amounts info

Parameters:
object $oArticle article object to chesk
Returns:
bool

Definition at line 347 of file oxdiscount.php.

oxDiscount._getProductCheckQuery ( oProduct  )  [protected]

Returns part of query for discount check. If product is variant - query contains both id check e.g. "and (oxobjectid = '...' or oxobjectid = '...')

Parameters:
oxarticle $oProduct product used for discount check
Returns:
string

Definition at line 388 of file oxdiscount.php.

oxDiscount.applyDiscount ( oPrice,
dAmount = 1 
)

Applies discount for current price

Parameters:
oxprice $oPrice basket item price object
double $dAmount basket item amount (default 1)
Returns:
null

Definition at line 301 of file oxdiscount.php.

oxDiscount.delete ( sOXID = null  ) 

Delete this object from the database, returns true on success.

Parameters:
string $sOXID Object ID(default null)
Returns:
bool

Reimplemented from oxI18n.

Definition at line 45 of file oxdiscount.php.

oxDiscount.getAbsValue ( dPrice,
dAmount = 1 
)

Returns absolute discount value

Parameters:
float $dPrice item price
float $dAmount item amount, interpretted only when discount is absolute (default 1)
Returns:
float

Definition at line 283 of file oxdiscount.php.

oxDiscount.getBundleAmount ( dAmount  ) 

Returns amount of items to bundle

Parameters:
double $dAmount item amount
Returns:
double

Definition at line 328 of file oxdiscount.php.

oxDiscount.getSimpleDiscount (  ) 

Returns compact discount object which is used in oxbasket

Returns:
oxstdclass

Definition at line 370 of file oxdiscount.php.

oxDiscount.isForAmount ( dAmount  ) 

Tests if passed amount or price fits current discount (price priority)

Parameters:
double $dAmount amount or price to check (price priority)
Returns:
bool

Definition at line 190 of file oxdiscount.php.

oxDiscount.isForArticle ( oArticle  ) 

Checks if discount is setup for article

Parameters:
oxarticle $oArticle article object
Returns:
bool

Definition at line 68 of file oxdiscount.php.

oxDiscount.isForBasket ( oBasket  ) 

Checks if discount is setup for whole basket

Parameters:
object $oBasket basket object
Returns:
bool

Definition at line 211 of file oxdiscount.php.

oxDiscount.isForBasketAmount ( oBasket  ) 

Tests if total amount or price (price priority) of articles that can be applied to current discount fits to discount configuration

Parameters:
oxbasket $oBasket basket
Returns:
bool

Definition at line 153 of file oxdiscount.php.

oxDiscount.isForBasketItem ( oArticle  ) 

Checks if discount is setup for some basket item

Parameters:
object $oArticle basket item
Returns:
bool

Definition at line 121 of file oxdiscount.php.

oxDiscount.isForBundleBasket ( oBasket  ) 

Checks if discount type is whole basket bundle discount

Parameters:
object $oBasket basket object
Returns:
bool

Definition at line 266 of file oxdiscount.php.

oxDiscount.isForBundleItem ( oArticle  ) 

Checks if discount type is bundle discount

Parameters:
object $oArticle article object
Returns:
bool

Definition at line 243 of file oxdiscount.php.


Member Data Documentation

oxDiscount.$_dAmount = null [protected]

Definition at line 20 of file oxdiscount.php.

oxDiscount.$_sBasketIdent = null [protected]

Definition at line 27 of file oxdiscount.php.

oxDiscount.$_sClassName = 'oxdiscount' [protected]

Reimplemented from oxI18n.

Definition at line 13 of file oxdiscount.php.


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