oxVoucher Class Reference
List of all members.
Detailed Description
Voucher manager. Performs deletion, generating, assigning to group and other voucher managing functions. 
Definition at line 8 of file oxvoucher.php.
Constructor & Destructor Documentation
      
        
          | oxVoucher.__construct  | 
          ( | 
           | 
           )  | 
           | 
        
      
 
Class constructor, initiates parent constructor (parent.oxBase()). 
Reimplemented from oxBase.
Definition at line 28 of file oxvoucher.php.
 
 
Member Function Documentation
      
        
          | oxVoucher.__get  | 
          ( | 
          $  | 
           sName | 
           )  | 
           | 
        
      
 
Extra getter to guarantee compatibility with templates
- Parameters:
 - 
  
     | string  | $sName name of variable to get | 
  
   
- Returns:
 - string 
 
Reimplemented from oxBase.
Definition at line 747 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._getBasketItems  | 
          ( | 
          $  | 
           oDiscount = null | 
           )  | 
           [protected] | 
        
      
 
Returns basket item information array from session or order.
- Parameters:
 - 
  
     | oxDisvount  | $oDiscount discount object | 
  
   
- Returns:
 - array 
 
Definition at line 533 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._getCategoryDiscoutValue  | 
          ( | 
          $  | 
           dPrice | 
           )  | 
           [protected] | 
        
      
 
Returns the discount value used, if voucher is aplied only for specific categories.
- Parameters:
 - 
  
     | double  | $dPrice price to calculate discount on it | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - double 
 
Definition at line 704 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._getGenericDiscoutValue  | 
          ( | 
          $  | 
           dPrice | 
           )  | 
           [protected] | 
        
      
 
Returns the discount value used.
- Parameters:
 - 
  
     | double  | $dPrice price to calculate discount on it | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - double 
 
Definition at line 621 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._getOrderBasketItems  | 
          ( | 
          $  | 
           oDiscount = null | 
           )  | 
           [protected] | 
        
      
 
Returns basket item information (id,amount,price) array takig item list from order.
- Parameters:
 - 
  
     | oxDisvount  | $oDiscount discount object | 
  
   
- Returns:
 - array 
 
Definition at line 551 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._getProductDiscoutValue  | 
          ( | 
          $  | 
           dPrice | 
           )  | 
           [protected] | 
        
      
 
Returns the discount value used, if voucher is aplied only for specific products.
- Parameters:
 - 
  
     | double  | $dPrice price to calculate discount on it | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - double 
 
Definition at line 650 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._getSerieDiscount  | 
          ( | 
           | 
           )  | 
           [protected] | 
        
      
 
Returns the discount object created from voucher serie data
- Returns:
 - object 
 
Definition at line 502 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._getSessionBasketItems  | 
          ( | 
          $  | 
           oDiscount = null | 
           )  | 
           [protected] | 
        
      
 
Returns basket item information (id,amount,price) array takig item list from session.
- Parameters:
 - 
  
     | oxDisvount  | $oDiscount discount object | 
  
   
- Returns:
 - array 
 
Definition at line 585 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isAvailableInOtherOrder  | 
          ( | 
          $  | 
           oUser | 
           )  | 
           [protected] | 
        
      
 
Checks if user already used vouchers from this series and can he use it again.
- Parameters:
 - 
  
     | object  | $oUser user object | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - boolean 
 
Definition at line 381 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isAvailablePrice  | 
          ( | 
          $  | 
           dPrice | 
           )  | 
           [protected] | 
        
      
 
Checks availability about price. Returns error array.
- Parameters:
 - 
  
     | double  | $dPrice base article price | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - array 
 
Definition at line 210 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isAvailableWithOtherSeries  | 
          ( | 
          $  | 
           aVouchers | 
           )  | 
           [protected] | 
        
      
 
Checks if cumulation with vouchers from the other series possible. Returns true on success.
- Parameters:
 - 
  
     | array  | $aVouchers array of vouchers | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - bool 
 
Definition at line 275 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isAvailableWithSameSeries  | 
          ( | 
          $  | 
           aVouchers | 
           )  | 
           [protected] | 
        
      
 
Checks if cumulation with vouchers of the same series possible. Returns true on success.
- Parameters:
 - 
  
     | array  | $aVouchers array of vouchers | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - bool 
 
Definition at line 241 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isCategoryVoucher  | 
          ( | 
           | 
           )  | 
           [protected] | 
        
      
 
Returns true if voucher is category specific, otherwise false
- Returns:
 - boolean 
 
Definition at line 487 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isNotReserved  | 
          ( | 
           | 
           )  | 
           [protected] | 
        
      
 
Checks if voucher is not yet reserved before.
- Exceptions:
 - 
  
  
 
- Returns:
 - bool 
 
Definition at line 340 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isProductVoucher  | 
          ( | 
           | 
           )  | 
           [protected] | 
        
      
 
Returns true if voucher is product specific, otherwise false
- Returns:
 - boolean 
 
Definition at line 472 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isValidDate  | 
          ( | 
           | 
           )  | 
           [protected] | 
        
      
 
Checks if voucher is in valid time period. Returns true on success.
- Exceptions:
 - 
  
  
 
- Returns:
 - bool 
 
Definition at line 311 of file oxvoucher.php.
 
 
      
        
          | oxVoucher._isValidUserGroup  | 
          ( | 
          $  | 
           oUser | 
           )  | 
           [protected] | 
        
      
 
Checks if user belongs to the same group as the voucher. Returns true on sucess.
- Parameters:
 - 
  
     | object  | $oUser user object | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - bool 
 
Definition at line 410 of file oxvoucher.php.
 
 
      
        
          | oxVoucher.checkBasketVoucherAvailability  | 
          ( | 
          $  | 
           aVouchers,  | 
        
        
           | 
           | 
          $  | 
           dPrice |   | 
        
        
           | 
          ) | 
           |  |  | 
        
      
 
Performs basket level voucher availability check (no need to check if voucher is reserved or so).
- Parameters:
 - 
  
     | array  | $aVouchers array of vouchers  | 
     | double  | $dPrice current sum (price) | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - array 
 
Definition at line 190 of file oxvoucher.php.
 
 
      
        
          | oxVoucher.checkUserAvailability  | 
          ( | 
          $  | 
           oUser | 
           )  | 
           | 
        
      
 
Checks availability for the given user. Returns array with errors.
- Parameters:
 - 
  
     | object  | $oUser user object | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - array 
 
Definition at line 362 of file oxvoucher.php.
 
 
      
        
          | oxVoucher.checkVoucherAvailability  | 
          ( | 
          $  | 
           aVouchers,  | 
        
        
           | 
           | 
          $  | 
           dPrice |   | 
        
        
           | 
          ) | 
           |  |  | 
        
      
 
Checks availability without user logged in. Returns array with errors.
- Parameters:
 - 
  
     | array  | $aVouchers array of vouchers  | 
     | double  | $dPrice current sum (price) | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - array 
 
Definition at line 167 of file oxvoucher.php.
 
 
      
        
          | oxVoucher.getDiscountValue  | 
          ( | 
          $  | 
           dPrice | 
           )  | 
           | 
        
      
 
Returns the discount value used.
- Parameters:
 - 
  
     | double  | $dPrice price to calculate discount on it | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - double 
 
Definition at line 145 of file oxvoucher.php.
 
 
      
        
          | oxVoucher.getSimpleVoucher  | 
          ( | 
           | 
           )  | 
           | 
        
      
 
 
      
        
          | oxVoucher.getVoucherByNr  | 
          ( | 
          $  | 
           sVoucherNr,  | 
        
        
           | 
           | 
          $  | 
           aVouchers = array(),  | 
        
        
           | 
           | 
          $  | 
           blCheckavalability = false |   | 
        
        
           | 
          ) | 
           |  |  | 
        
      
 
Gets voucher from db by given number.
- Parameters:
 - 
  
     | string  | $sVoucherNr Voucher number  | 
     | array  | $aVouchers Array of available vouchers (default array())  | 
     | bool  | $blCheckavalability check if voucher is still reserver od not | 
  
   
- Exceptions:
 - 
  
  
 
- Returns:
 - mixed 
 
Definition at line 45 of file oxvoucher.php.
 
 
      
        
          | oxVoucher.markAsReserved  | 
          ( | 
           | 
           )  | 
           | 
        
      
 
mark voucher as reserved
- Returns:
 - null 
 
Definition at line 109 of file oxvoucher.php.
 
 
      
        
          | oxVoucher.markAsUsed  | 
          ( | 
          $  | 
           sOrderId,  | 
        
        
           | 
           | 
          $  | 
           sUserId,  | 
        
        
           | 
           | 
          $  | 
           dDiscount |   | 
        
        
           | 
          ) | 
           |  |  | 
        
      
 
marks voucher as used
- Parameters:
 - 
  
     | string  | $sOrderId order id  | 
     | string  | $sUserId user id  | 
     | double  | $dDiscount used discount | 
  
   
- Returns:
 - null 
 
Definition at line 92 of file oxvoucher.php.
 
 
      
        
          | oxVoucher.unMarkAsReserved  | 
          ( | 
           | 
           )  | 
           | 
        
      
 
 
Member Data Documentation
      
        
          oxVoucher.$_blDisableShopCheck = true [protected] | 
        
      
 
 
      
        
          oxVoucher.$_oSerie = null [protected] | 
        
      
 
 
      
        
          oxVoucher.$_sClassName = 'oxvoucher' [protected] | 
        
      
 
 
The documentation for this class was generated from the following file: