oxBasket Class Reference

Inheritance diagram for oxBasket:

Inheritance graph
[legend]
Collaboration diagram for oxBasket:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 isEnabled ()
 addToBasket ($sProductID, $dAmount, $blAllowUnevenAmounts, $aSel=null, $aPersParam=null, $blOverride=false, $blBundle=false, $sOldBasketItemId=null)
 getItemKey ($sProductId, $aSel=null, $aPersParam=null, $blBundle=false, $sAdditionalParam= '')
 removeItem ($sItemKey)
 getBasketUser ()
 setBasketUser ($oUser)
 getMostUsedVatPercent ()
 setCost ($sCostName, $oPrice=null)
 calculateBasket ($blAllowUnevenAmounts, $blForceUpdate=false, $blExclNonMaterial=false)
 onUpdate ()
 afterUpdate ()
 getBasketSummary ()
 addVoucher ($sVoucherId)
 removeVoucher ($sVoucherId)
 resetUserInfo ()
 deleteBasket ()
 setPayment ($sPaymentId=null)
 getPaymentId ()
 setShipping ($sShippingSetId=null)
 getShippingId ()
 getBasketArticles ()
 getDiscountProductsPrice ()
 getProductsPrice ()
 getPrice ()
 getOrderId ()
 setOrderId ($sId)
 getCosts ($sId=null)
 getVouchers ()
 getProductsCount ()
 getItemsCount ()
 getWeight ()
 getContents ()
 getProductVats ()
 getDiscountedNettoPrice ()
 setCardMessage ($sMessage)
 getCardMessage ()
 setCardId ($sCardId)
 getCardId ()
 getCard ()
 getTotalDiscount ()
 getDiscounts ()
 getVoucherDiscount ()
 setBasketCurrency ($oCurrency)
 getBasketCurrency ()
 setSkipVouchersChecking ($blSkipChecking=null)
 hasSkipedDiscount ()
 setSkipDiscounts ($blSkip)
 getProductsNetPrice ()
 getFProductsPrice ()
 getDelCostVatPercent ()
 getDelCostVat ()
 getDelCostNet ()
 getPayCostVatPercent ()
 getPayCostVat ()
 getPayCostNet ()
 getPaymentCosts ()
 getVoucherDiscValue ()
 getWrappCostVatPercent ()
 getWrappCostVat ()
 getWrappCostNet ()
 getFPrice ()
 getFDeliveryCosts ()
 getDeliveryCosts ()

Protected Member Functions

 _changeBasketItemKey ($sOldKey, $sNewKey, $value=null)
 _clearBundles ()
 _getArticleBundles ($oBasketItem)
 _getItemBundles ($oBasketItem)
 _getBasketBundles ()
 _addBundles ($blAllowUnevenAmounts)
 _addBundlesToBasket ($blAllowUnevenAmounts, $aBundles)
 _calcItemsPrice ()
 _mergeDiscounts ($aDiscounts, $aItemDiscounts)
 _calcDeliveryCost ($blExclNonMaterial=false)
 _calcTotalPrice ()
 _calcVoucherDiscount ()
 _applyDiscounts ()
 _calcBasketDiscount ()
 _calcBasketTotalDiscount ()
 _calcBasketWrapping ()
 _calcPaymentCost ()
 _setDeprecatedValues ()
 _mergeSavedBasket ($blAllowUnevenAmounts)
 _addItemToSavedBasket ($sProductId, $dAmount, $aSel, $blOverride=false)
 _deleteSavedBasket ()
 _findDelivCountry ()

Protected Attributes

 $_aBasketContents = array()
 $_iProductsCnt = 0
 $_dItemsCnt = 0.0
 $_dWeight = 0.0
 $_oPrice = null
 $_oProductsPriceList = null
 $_aDiscounts = array()
 $_aItemDiscounts = array()
 $_sOrderId = null
 $_aVouchers = array()
 $_aCosts = array()
 $_oDiscountProductsPriceList = null
 $_oNotDiscountedProductsPriceList = null
 $_blUpdateNeeded = true
 $_aBasketSummary = null
 $_blBasketMerged = false
 $_sPaymentId = null
 $_sShippingSetId = null
 $_oUser = null
 $_oTotalDiscount = null
 $_oVoucherDiscount = null
 $_oCurrency = null
 $_blSkipVouchersAvailabilityChecking = null
 $_dDiscountedProductNettoPrice = null
 $_aDiscountedVats = null
 $_blSkipDiscounts = false


Member Function Documentation

oxBasket.isEnabled (  ) 

Checks if configuration allows basket usage or if user agent is search engine

Returns:
bool

oxBasket._changeBasketItemKey ( sOldKey,
sNewKey,
value = null 
) [protected]

change old key to new one but retain key position in array

Parameters:
$sOldKey string old key
$sNewKey string new key to place in old one's place
$value mixed (optional)

oxBasket.addToBasket ( sProductID,
dAmount,
blAllowUnevenAmounts,
aSel = null,
aPersParam = null,
blOverride = false,
blBundle = false,
sOldBasketItemId = null 
)

Adds user item to basket. Returns oxbasketitem object if adding succeded

Parameters:
string $sProductID id of product
double $dAmount product amount
bool $blAllowUnevenAmounts uneven amounts availability
array $aSel product select lists (default null)
array $aPersParam product persistent parameters (default null)
bool $blOverride marker to acumulate passed amount or renew (default false)
bool $blBundle marker if product is bundle or not (default false)
string $sOldBasketItemId id if old basket item if to change it
Exceptions:
oxOutOfStockException oxArticleInputException, oxNoArticleException
Returns:
object

oxBasket.getItemKey ( sProductId,
aSel = null,
aPersParam = null,
blBundle = false,
sAdditionalParam = '' 
)

Returns unique basket item identifier which consist from product ID, select lists data, persistent info and bundle property

Parameters:
string $sProductId basket item id
array $aSel basket item selectlists
array $aPersParam basket item persistent parameters
bool $blBundle bundle marker
var $sAdditionalParam possible additional information
Returns:
string

oxBasket.removeItem ( sItemKey  ) 

Removes item from basket

Parameters:
string $sItemKey basket item key
Returns:
null

oxBasket._clearBundles (  )  [protected]

Unsets bundled basket items from basket contents array

Returns:
null

oxBasket._getArticleBundles ( oBasketItem  )  [protected]

Returns array of bundled articles IDs for basket item

Parameters:
object $oBasketItem basket item object
Returns:
array

oxBasket._getItemBundles ( oBasketItem  )  [protected]

Returns array of bundled discount articles

Parameters:
object $oBasketItem basket item object
Returns:
array

oxBasket._getBasketBundles (  )  [protected]

Returns array of bundled discount articles for whole basket

Returns:
array

oxBasket._addBundles ( blAllowUnevenAmounts  )  [protected]

Iterates through basket contents and adds bundles to items + adds global basket bundles

Parameters:
bool $blAllowUnevenAmounts uneven amounts are either allowed or not
Returns:
null

oxBasket._addBundlesToBasket ( blAllowUnevenAmounts,
aBundles 
) [protected]

Adds bundles to basket

Parameters:
bool $blAllowUnevenAmounts uneven amounts are either allowed or not
array $aBundles added bundle articles
Returns:
null

oxBasket._calcItemsPrice (  )  [protected]

Iterates through basket items and calculates its prices and discounts

Returns:
null

oxBasket._mergeDiscounts ( aDiscounts,
aItemDiscounts 
) [protected]

Merges two discount arrays. If there are two the same discounts, discount values will be added.

Parameters:
array $aDiscounts Discount array
array $aItemDiscounts Discount array
Returns:
array $aDiscounts

oxBasket._calcDeliveryCost ( blExclNonMaterial = false  )  [protected]

Iterates through basket items and calculates its delivery costs

Parameters:
bool $blExclNonMaterial Exclude non material products while calculating
Returns:
oxPrice

oxBasket.getBasketUser (  ) 

Basket user getter

Returns:
oxuser

oxBasket.setBasketUser ( oUser  ) 

Basket user setter

Parameters:
oxuser $oUser Basket user
Returns:
null

oxBasket.getMostUsedVatPercent (  ) 

Get most used vat percent:

Returns:
double

oxBasket._calcTotalPrice (  )  [protected]

Performs final sum calculations and roundings.

Returns:
null

oxBasket._calcVoucherDiscount (  )  [protected]

Calculates voucher discount

Returns:
null

oxBasket._applyDiscounts (  )  [protected]

Performs netto price and VATs calculations including discounts and vouchers.

Returns:
null

oxBasket._calcBasketDiscount (  )  [protected]

Loads basket discounts and calculates discount values.

Returns:
null

oxBasket._calcBasketTotalDiscount (  )  [protected]

Calculates total basket discount value.

Returns:
null

oxBasket._calcBasketWrapping (  )  [protected]

Adds Gift price info to $this->oBasket (additional field for basket item "oWrap""). Loads each basket item, checks for wrapping data, updates if available and stores back into $this->oBasket. Returns oxprice object for wrapping.

Returns:
object oxPrice

oxBasket._calcPaymentCost (  )  [protected]

Payment cost calculation, applying payment discount if available. Returns oxprice object.

Returns:
object oxPrice

oxBasket.setCost ( sCostName,
oPrice = null 
)

Sets basket additional costs

Parameters:
string $sCostName additional costs
object $oPrice oxPrice
Returns:
null

oxBasket.calculateBasket ( blAllowUnevenAmounts,
blForceUpdate = false,
blExclNonMaterial = false 
)

Executes all needed functions to calculate basket price and other needed info

Parameters:
bool $blAllowUnevenAmounts uneven amounts are either allowed or not
bool $blForceUpdate set this parameter to TRUE to force basket recalculation
bool $blExclNonMaterial exclude non material products from delivery calculation
Returns:
null

oxBasket.onUpdate (  ) 

Notifies basket that recalculation is needed

Returns:
null

oxBasket.afterUpdate (  ) 

Marks basket as up-to-date

Returns:
null

oxBasket.getBasketSummary (  ) 

Function collects summary information about basket. Usually this info is used while calculating discounts or so. Data is stored in static class parameter oxbasket::$_aBasketSummary

Returns:
object

oxBasket.addVoucher ( sVoucherId  ) 

Checks and sets voucher information. Checks it's availability according to few conditions: oxvoucher.checkVoucherAvailability(), oxvoucher.checkUserAvailability(). Errors are stored in oxbasket.voucherErrors array. After all voucher is marked as reserved (oxvoucher.MarkAsReserved())

Parameters:
string $sVoucherId voucher ID
bool $blSkipChecking skip voucher availability checking
Returns:
null

oxBasket.removeVoucher ( sVoucherId  ) 

Removes voucher from basket and unreserves it.

Parameters:
string $sVoucherId removable voucher ID
Returns:
null

oxBasket.resetUserInfo (  ) 

Resets user related information kept in basket object

Returns:
null

oxBasket._setDeprecatedValues (  )  [protected]

Sets deprecate values

Deprecated:
This method as well as all deprecated class variables is deprecated
Returns:
null

oxBasket._mergeSavedBasket ( blAllowUnevenAmounts  )  [protected]

Populates current basket from the saved one. Saves current basket items to SaveBasket

Parameters:
bool $blAllowUnevenAmounts describes if uneven amounts are allowed
Returns:
null

oxBasket._addItemToSavedBasket ( sProductId,
dAmount,
aSel,
blOverride = false 
) [protected]

Adds item to saved basket (history

Parameters:
string $sProductId product id
double $dAmount item amount
array $aSel article select lists
bool $blOverride override item amount or not
Returns:
null

oxBasket._deleteSavedBasket (  )  [protected]

Cleans up saved basket data. This method usually is initiated by oxbasket.deleteBasket() method which cleans up basket data when user completes order.

Returns:
null

oxBasket._findDelivCountry (  )  [protected]

Tries to fetch user delivery country ID

Returns:
string

oxBasket.deleteBasket (  ) 

Deletes user basket object from session

Returns:
null

oxBasket.setPayment ( sPaymentId = null  ) 

Set basket payment ID

Parameters:
string $sPaymentId payment id
Returns:
null

oxBasket.getPaymentId (  ) 

Get basket payment, if payment id is not set, try to get it from session

Returns:
string

oxBasket.setShipping ( sShippingSetId = null  ) 

Set basket shipping set ID

Parameters:
string $sShippingSetId deliveryset id
Returns:
null

oxBasket.getShippingId (  ) 

Get basket shipping set, if shipping set id is not set, try to get it from session

Returns:
string oxDeliverySet

oxBasket.getBasketArticles (  ) 

Returns array of basket oxarticle objects

Returns:
array

oxBasket.getDiscountProductsPrice (  ) 

Returns discount articles products price object

Returns:
oxprice

oxBasket.getProductsPrice (  ) 

Returns basket products price list object

Returns:
oxpricelist

oxBasket.getPrice (  ) 

Returns basket price object

Returns:
oxprice

oxBasket.getOrderId (  ) 

Returns unique order ID assigned to current basket. This id is only awailable on last order step

Returns:
string

oxBasket.setOrderId ( sId  ) 

Basket order ID setter

Parameters:
string $sId unique id for basket order
Returns:
null

oxBasket.getCosts ( sId = null  ) 

Returns array of basket costs. By passing cost identifier method will return this cost if available

Parameters:
string $sId cost id ( optional )
Returns:
array

oxBasket.getVouchers (  ) 

Returns array of vouchers applied to basket

Returns:
array

oxBasket.getProductsCount (  ) 

Returns number of different products stored in basket

Returns:
int

oxBasket.getItemsCount (  ) 

Returns count of items stored in basket

Returns:
double

oxBasket.getWeight (  ) 

Returns total basket weight

Returns:
double

oxBasket.getContents (  ) 

Returns basket items array

Returns:
array

oxBasket.getProductVats (  ) 

Returns array of formatted VATs which were calculated for basket

Returns:
array

oxBasket.getDiscountedNettoPrice (  ) 

Returns products netto price with applied discounts and vouschers

Returns:
double

oxBasket.setCardMessage ( sMessage  ) 

Gift card message setter

Parameters:
string $sMessage gift card message
Returns:
null

oxBasket.getCardMessage (  ) 

Returns gift card message text

Returns:
string

oxBasket.setCardId ( sCardId  ) 

Gift card ID setter

Parameters:
string $sCardId gift card id
Returns:
null

oxBasket.getCardId (  ) 

Returns applied gift card ID

Returns:
string

oxBasket.getCard (  ) 

Returns gift card object (if available)

Returns:
oxwrapping

oxBasket.getTotalDiscount (  ) 

Returns total basket discount oxprice object

Returns:
oxprice

oxBasket.getDiscounts (  ) 

Returns applied discount information array

Returns:
array

oxBasket.getVoucherDiscount (  ) 

Returns basket voucher discount oxprice object

Returns:
oxprice

oxBasket.setBasketCurrency ( oCurrency  ) 

Set basket currency

Parameters:
object $oCurrency currency object
Returns:
null

oxBasket.getBasketCurrency (  ) 

Basket currency getter

Returns:
oxuser

oxBasket.setSkipVouchersChecking ( blSkipChecking = null  ) 

Set skip or not vouchers availability checking

Parameters:
bool $blSkipChecking skip or not vouchers checking
Returns:
null

oxBasket.hasSkipedDiscount (  ) 

Returns true if discount must be skipped for one of the products

Returns:
bool

oxBasket.setSkipDiscounts ( blSkip  ) 

Used to set "skip discounts" status for basket

Parameters:
bool $blSkip set true to skip discounts
Returns:
null

oxBasket.getProductsNetPrice (  ) 

Formatted Products net price getter

Returns:
string

oxBasket.getFProductsPrice (  ) 

Formatted Products price getter

Returns:
string

oxBasket.getDelCostVatPercent (  ) 

Returns VAT of delivery costs

Returns:
double

oxBasket.getDelCostVat (  ) 

Returns formatted VAT of delivery costs

Returns:
string | bool

oxBasket.getDelCostNet (  ) 

Returns formatted netto price of delivery costs

Returns:
string

oxBasket.getPayCostVatPercent (  ) 

Returns VAT of payment costs

Returns:
double

oxBasket.getPayCostVat (  ) 

Returns formatted VAT of payment costs

Returns:
string

oxBasket.getPayCostNet (  ) 

Returns formatted netto price of payment costs

Returns:
string

oxBasket.getPaymentCosts (  ) 

Returns payment costs

Returns:
double | bool

oxBasket.getVoucherDiscValue (  ) 

Returns value of voucher discount

Returns:
double

oxBasket.getWrappCostVatPercent (  ) 

Returns VAT of wrapping costs

Returns:
double

oxBasket.getWrappCostVat (  ) 

Returns formatted VAT of wrapping costs

Returns:
string | bool

oxBasket.getWrappCostNet (  ) 

Returns formatted netto price of wrapping costs

Returns:
string

oxBasket.getFPrice (  ) 

Returns formatted basket total price

Returns:
string

oxBasket.getFDeliveryCosts (  ) 

Returns if exists formatted delivery costs

Returns:
string | bool

oxBasket.getDeliveryCosts (  ) 

Returns if exists delivery costs

Returns:
string | bool


Member Data Documentation

oxBasket.$_aBasketContents = array() [protected]

oxBasket.$_iProductsCnt = 0 [protected]

oxBasket.$_dItemsCnt = 0.0 [protected]

oxBasket.$_dWeight = 0.0 [protected]

oxBasket.$_oPrice = null [protected]

oxBasket.$_oProductsPriceList = null [protected]

oxBasket.$_aDiscounts = array() [protected]

oxBasket.$_aItemDiscounts = array() [protected]

oxBasket.$_sOrderId = null [protected]

oxBasket.$_aVouchers = array() [protected]

oxBasket.$_aCosts = array() [protected]

oxBasket.$_oDiscountProductsPriceList = null [protected]

oxBasket.$_oNotDiscountedProductsPriceList = null [protected]

oxBasket.$_blUpdateNeeded = true [protected]

oxBasket.$_aBasketSummary = null [protected]

oxBasket.$_blBasketMerged = false [protected]

oxBasket.$_sPaymentId = null [protected]

oxBasket.$_sShippingSetId = null [protected]

oxBasket.$_oUser = null [protected]

oxBasket.$_oTotalDiscount = null [protected]

oxBasket.$_oVoucherDiscount = null [protected]

oxBasket.$_oCurrency = null [protected]

oxBasket.$_blSkipVouchersAvailabilityChecking = null [protected]

oxBasket.$_dDiscountedProductNettoPrice = null [protected]

oxBasket.$_aDiscountedVats = null [protected]

oxBasket.$_blSkipDiscounts = false [protected]


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

Generated on Wed Oct 29 23:43:19 2008 for OXID eShop CE by  doxygen 1.5.5