oxDiscount Class Reference

Inheritance diagram for oxDiscount:

Inheritance graph
[legend]
Collaboration diagram for oxDiscount:

Collaboration graph
[legend]

List of all members.


Detailed Description

Discounts manager.

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)

Protected Attributes

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

Constructor & Destructor Documentation

oxDiscount.__construct (  ) 

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

Reimplemented from oxI18n.


Member Function Documentation

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 oxBase.

oxDiscount.isForArticle ( oArticle  ) 

Checks if discount is setup for article

Parameters:
object $oArticle article object
Returns:
bool

oxDiscount.isForBasketItem ( oArticle  ) 

Checks if discount is setup for some basket item

Parameters:
object $oArticle basket item
Returns:
bool

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

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

oxDiscount.isForBasket ( oBasket  ) 

Checks if discount is setup for whole basket

Parameters:
object $oBasket basket object
Returns:
bool

oxDiscount.isForBundleItem ( oArticle  ) 

Checks if discount type is bundle discount

Parameters:
object $oArticle article object
Returns:
bool

oxDiscount.isForBundleBasket ( oBasket  ) 

Checks if discount type is whole basket bundle discount

Parameters:
object $oBasket basket object
Returns:
bool

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

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

oxDiscount.getBundleAmount ( dAmount  ) 

Returns amount of items to bundle

Parameters:
double $dAmount item amount
Returns:
double

oxDiscount._checkForArticleCategories ( oArticle  )  [protected]

Checks if discount may be applied according amounts info

Parameters:
object $oArticle article object to chesk
bool $blSpecForItem check individually for passed item. If false - will be checked for categories item belongs
mixed $oBasketInfo basket info as returned by $oBasket->getBasketSummary()
Returns:
bool

oxDiscount.getSimpleDiscount (  ) 

Returns compact discount object which is used in oxbasket

Returns:
oxstdclass


Member Data Documentation

oxDiscount.$_sClassName = 'oxdiscount' [protected]

Reimplemented from oxI18n.

oxDiscount.$_dAmount = null [protected]

oxDiscount.$_sBasketIdent = null [protected]


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

Generated on Wed Oct 29 23:44:11 2008 for OXID eShop CE by  doxygen 1.5.5