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)
 isGlobalDiscount ()
 isForArticle ($oArticle)
 isForBasketItem ($oArticle)
 isForBasketAmount ($oBasket)
 isForAmount ($dAmount)
 isForBasket ($oBasket)
 isForBundleItem ($oArticle)
 isForBundleBasket ($oBasket)
 getAbsValue ($dPrice, $dAmount=1)
 getPercentage ($dPrice)
 getAddSum ()
 getAddSumType ()
 getBundleAmount ($dAmount)
 getSimpleDiscount ()
 getArticleIds ()
 getCategoryIds ()

Protected Member Functions

 _checkForArticleCategories ($oArticle)
 _getProductCheckQuery ($oProduct)
 _isArticleAssigned ($oArticle)
 _isCategoriesAssigned ($aCategoryIds)

Protected Attributes

 $_sClassName = 'oxdiscount'
 $_dAmount = null
 $_sBasketIdent = null
 $_blIsForArticleOrForCategory = null
 $_aHasArticleDiscounts = array()

Detailed Description

Discounts manager.

Definition at line 7 of file oxdiscount.php.


Constructor & Destructor Documentation

oxDiscount.__construct (  ) 

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

Reimplemented from oxI18n.

Definition at line 48 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 426 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 452 of file oxdiscount.php.

oxDiscount._isArticleAssigned ( oArticle  )  [protected]

Checks whether this article is assigned to discount

Parameters:
oxArticle $oArticle
Returns:
bool

Definition at line 472 of file oxdiscount.php.

oxDiscount._isCategoriesAssigned ( aCategoryIds  )  [protected]

Checks whether categories are assigned to discount

Parameters:
array $aCategoryIds
Returns:
bool

Definition at line 492 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 61 of file oxdiscount.php.

oxDiscount.getAbsValue ( dPrice,
dAmount = 1 
)

Returns absolute discount value

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

Definition at line 310 of file oxdiscount.php.

oxDiscount.getAddSum (  ) 

Return add sum in abs type discount with efected currency rate; Return discount percent value in other way;

Returns:
double

Definition at line 343 of file oxdiscount.php.

oxDiscount.getAddSumType (  ) 

Return addsum type

Returns:
string

Definition at line 359 of file oxdiscount.php.

oxDiscount.getArticleIds (  ) 

Returns article ids assigned to discount

Returns:
array

Definition at line 403 of file oxdiscount.php.

oxDiscount.getBundleAmount ( dAmount  ) 

Returns amount of items to bundle

Parameters:
double $dAmount item amount
Returns:
double

Definition at line 371 of file oxdiscount.php.

oxDiscount.getCategoryIds (  ) 

Returns category ids asigned to discount

Returns:
array

Definition at line 413 of file oxdiscount.php.

oxDiscount.getPercentage ( dPrice  ) 

Return discount percent

Parameters:
decimal $dPrice - price from which calculates discount
Returns:
decimal

Definition at line 328 of file oxdiscount.php.

oxDiscount.getSimpleDiscount (  ) 

Returns compact discount object which is used in oxbasket

Returns:
stdClass

Definition at line 388 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 212 of file oxdiscount.php.

oxDiscount.isForArticle ( oArticle  ) 

Checks if discount applies for article

Parameters:
oxArticle $oArticle article object
Returns:
bool

Definition at line 105 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 236 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 175 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 143 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 293 of file oxdiscount.php.

oxDiscount.isForBundleItem ( oArticle  ) 

Checks if discount type is bundle discount

Parameters:
object $oArticle article object
Returns:
bool

Definition at line 269 of file oxdiscount.php.

oxDiscount.isGlobalDiscount (  ) 

Check for global discount (no articles, no categories)

Returns:
bool

Definition at line 82 of file oxdiscount.php.


Member Data Documentation

oxDiscount.$_aHasArticleDiscounts = array() [protected]

Definition at line 43 of file oxdiscount.php.

oxDiscount.$_blIsForArticleOrForCategory = null [protected]

Definition at line 36 of file oxdiscount.php.

oxDiscount.$_dAmount = null [protected]

Definition at line 22 of file oxdiscount.php.

oxDiscount.$_sBasketIdent = null [protected]

Definition at line 29 of file oxdiscount.php.

oxDiscount.$_sClassName = 'oxdiscount' [protected]

Reimplemented from oxI18n.

Definition at line 15 of file oxdiscount.php.


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