OXID eShop CE
6.1.5
|
Public Member Functions | |
__construct () | |
getVoucherByNr ($sVoucherNr, $aVouchers=[], $blCheckavalability=false) | |
markAsUsed ($sOrderId, $sUserId, $dDiscount) | |
markAsReserved () | |
unMarkAsReserved () | |
getDiscountValue ($dPrice) | |
checkVoucherAvailability ($aVouchers, $dPrice) | |
checkBasketVoucherAvailability ($aVouchers, $dPrice) | |
checkUserAvailability ($oUser) | |
getSimpleVoucher () | |
getSerie () | |
getDiscount () | |
getDiscountType () | |
__get ($sName) | |
Protected Member Functions | |
_isAvailablePrice ($dPrice) | |
_isAvailableWithSameSeries ($aVouchers) | |
_isAvailableWithOtherSeries ($aVouchers) | |
_isValidDate () | |
_isNotReserved () | |
_isAvailableInOtherOrder ($oUser) | |
_isValidUserGroup ($oUser) | |
_isProductVoucher () | |
_isCategoryVoucher () | |
_getSerieDiscount () | |
_getBasketItems ($oDiscount=null) | |
_getOrderBasketItems ($oDiscount=null) | |
_getSessionBasketItems ($oDiscount=null) | |
_getGenericDiscoutValue ($dPrice) | |
_getGenericDiscountValue ($dPrice) | |
_getProductDiscoutValue ($dPrice) | |
_getProductDiscountValue ($dPrice) | |
_getCategoryDiscoutValue ($dPrice) | |
_getCategoryDiscountValue ($dPrice) | |
_getVoucherTimeout () | |
Protected Attributes | |
$_oSerie = null | |
$_blDisableShopCheck = true | |
$_sClassName = 'oxvoucher' | |
Voucher manager. Performs deletion, generating, assigning to group and other voucher managing functions.
OxidEsales\EshopCommunity\Application\Model\Voucher::__construct | ( | ) |
Class constructor, initiates parent constructor (parent::oxBase()).
OxidEsales\EshopCommunity\Application\Model\Voucher::__get | ( | $sName | ) |
Extra getter to guarantee compatibility with templates
string | $sName | name of variable to get |
|
protected |
Returns basket item information array from session or order.
\OxidEsales\Eshop\Application\Model\Discount | $oDiscount | discount object |
|
protected |
Returns the discount value used, if voucher is applied only for specific categories.
double | $dPrice | price to calculate discount on it |
oxVoucherException | exception |
|
protected |
Returns the discount value used, if voucher is applied only for specific categories.
double | $dPrice | price to calculate discount on it |
oxVoucherException | exception |
|
protected |
Returns the discount value used.
double | $dPrice | price to calculate discount on it |
oxVoucherException | exception |
|
protected |
Returns the discount value used.
double | $dPrice | price to calculate discount on it |
oxVoucherException | exception |
|
protected |
Returns basket item information (id,amount,price) array takig item list from order.
\OxidEsales\Eshop\Application\Model\Discount | $oDiscount | discount object |
|
protected |
Returns the discount value used, if voucher is aplied only for specific products.
double | $dPrice | price to calculate discount on it |
oxVoucherException | exception |
|
protected |
Returns the discount value used, if voucher is aplied only for specific products.
double | $dPrice | price to calculate discount on it |
oxVoucherException | exception |
|
protected |
Returns the discount object created from voucher serie data
|
protected |
Returns basket item information (id,amount,price) array taking item list from session.
\OxidEsales\Eshop\Application\Model\Discount | $oDiscount | discount object |
|
protected |
Returns a configured value for voucher timeouts or a default of 3 hours if not configured
|
protected |
Checks if user already used vouchers from this series and can he use it again.
object | $oUser | user object |
oxVoucherException | exception |
|
protected |
Checks availability about price. Returns error array.
double | $dPrice | base article price |
oxVoucherException | exception |
|
protected |
Checks if calculation with vouchers from the other series possible. Returns true on success.
array | $aVouchers | array of vouchers |
oxVoucherException | exception |
|
protected |
Checks if calculation with vouchers of the same series possible. Returns true on success.
array | $aVouchers | array of vouchers |
oxVoucherException | exception |
|
protected |
Returns true if voucher is category specific, otherwise false
|
protected |
Checks if voucher is not yet reserved before.
oxVoucherException | exception |
|
protected |
Returns true if voucher is product specific, otherwise false
|
protected |
Checks if voucher is in valid time period. Returns true on success.
oxVoucherException | exception |
|
protected |
Checks if user belongs to the same group as the voucher. Returns true on sucess.
object | $oUser | user object |
oxVoucherException | exception |
OxidEsales\EshopCommunity\Application\Model\Voucher::checkBasketVoucherAvailability | ( | $aVouchers, | |
$dPrice | |||
) |
Performs basket level voucher availability check (no need to check if voucher is reserved or so).
array | $aVouchers | array of vouchers |
double | $dPrice | current sum (price) |
oxVoucherException | exception |
OxidEsales\EshopCommunity\Application\Model\Voucher::checkUserAvailability | ( | $oUser | ) |
Checks availability for the given user. Returns array with errors.
object | $oUser | user object |
oxVoucherException | exception |
OxidEsales\EshopCommunity\Application\Model\Voucher::checkVoucherAvailability | ( | $aVouchers, | |
$dPrice | |||
) |
Checks availability without user logged in. Returns array with errors.
array | $aVouchers | array of vouchers |
double | $dPrice | current sum (price) |
oxVoucherException | exception |
OxidEsales\EshopCommunity\Application\Model\Voucher::getDiscount | ( | ) |
Return discount value
OxidEsales\EshopCommunity\Application\Model\Voucher::getDiscountType | ( | ) |
Return discount type
OxidEsales\EshopCommunity\Application\Model\Voucher::getDiscountValue | ( | $dPrice | ) |
Returns the discount value used.
double | $dPrice | price to calculate discount on it |
oxVoucherException | exception |
OxidEsales\EshopCommunity\Application\Model\Voucher::getSerie | ( | ) |
create oxVoucherSerie object of this voucher
oxObjectException |
OxidEsales\EshopCommunity\Application\Model\Voucher::getSimpleVoucher | ( | ) |
Returns compact voucher object which is used in oxBasket
OxidEsales\EshopCommunity\Application\Model\Voucher::getVoucherByNr | ( | $sVoucherNr, | |
$aVouchers = [] , |
|||
$blCheckavalability = false |
|||
) |
Gets voucher from db by given number.
string | $sVoucherNr | Voucher number |
array | $aVouchers | Array of available vouchers (default array()) |
bool | $blCheckavalability | check if voucher is still reserver od not |
oxVoucherException | exception |
OxidEsales\EshopCommunity\Application\Model\Voucher::markAsReserved | ( | ) |
mark voucher as reserved
OxidEsales\EshopCommunity\Application\Model\Voucher::markAsUsed | ( | $sOrderId, | |
$sUserId, | |||
$dDiscount | |||
) |
marks voucher as used
string | $sOrderId | order id |
string | $sUserId | user id |
double | $dDiscount | used discount |
OxidEsales\EshopCommunity\Application\Model\Voucher::unMarkAsReserved | ( | ) |
un mark as reserved
|
protected |
|
protected |
|
protected |