OXID eShop CE  6.1.5
OxidEsales\EshopCommunity\Application\Model\Basket Class Reference
+ Inheritance diagram for OxidEsales\EshopCommunity\Application\Model\Basket:
+ Collaboration diagram for OxidEsales\EshopCommunity\Application\Model\Basket:

Public Member Functions

 enableSaveToDataBase ($blSave=true)
 
 isSaveToDataBaseEnabled ()
 
 isCalculationModeNetto ()
 
 setCalculationModeNetto ($blNettoMode=true)
 
 getNettoSum ()
 
 getBruttoSum ()
 
 setNettoSum ($dNettoSum)
 
 setBruttoSum ($dBruttoSum)
 
 isEnabled ()
 
 addToBasket ($sProductID, $dAmount, $aSel=null, $aPersParam=null, $blOverride=false, $blBundle=false, $sOldBasketItemId=null)
 
 addOrderArticleToBasket ($oOrderArticle)
 
 setStockCheckMode ($blCheck)
 
 getStockCheckMode ()
 
 getItemKey ($sProductId, $aSel=null, $aPersParam=null, $blBundle=false, $sAdditionalParam='')
 
 removeItem ($sItemKey)
 
 setDiscountCalcMode ($blCalcDiscounts)
 
 canCalcDiscounts ()
 
 getBasketUser ()
 
 setBasketUser ($oUser)
 
 getMostUsedVatPercent ()
 
 getAdditionalServicesVatPercent ()
 
 isProportionalCalculationOn ()
 
 setVoucherDiscount ($dDiscount)
 
 isPriceViewModeNetto ()
 
 setCost ($sCostName, $oPrice=null)
 
 calculateBasket ($blForceUpdate=false)
 
 onUpdate ()
 
 afterUpdate ()
 
 getBasketSummary ()
 
 addVoucher ($sVoucherId)
 
 removeVoucher ($sVoucherId)
 
 resetUserInfo ()
 
 load ()
 
 deleteBasket ()
 
 setPayment ($sPaymentId=null)
 
 getPaymentId ()
 
 setShipping ($sShippingSetId=null)
 
 setDeliveryPrice ($oShippingPrice=null)
 
 getShippingId ()
 
 getBasketArticles ()
 
 getDiscountProductsPrice ()
 
 getProductsPrice ()
 
 getPrice ()
 
 setPrice ($oPrice)
 
 getOrderId ()
 
 setOrderId ($sId)
 
 getCosts ($sId=null)
 
 getVouchers ()
 
 getProductsCount ()
 
 getItemsCount ()
 
 getWeight ()
 
 getContents ()
 
 getProductVats ($blFormatCurrency=true)
 
 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 ()
 
 getPaymentCost ()
 
 getFPaymentCosts ()
 
 getVoucherDiscValue ()
 
 getFVoucherDiscountValue ()
 
 getWrappCostVatPercent ()
 
 getGiftCardCostVatPercent ()
 
 getWrappCostVat ()
 
 getWrappCostNet ()
 
 getFWrappingCosts ()
 
 getWrappingCost ()
 
 getGiftCardCostVat ()
 
 getGiftCardCostNet ()
 
 getFGiftCardCosts ()
 
 getGiftCardCost ()
 
 getFPrice ()
 
 getFDeliveryCosts ()
 
 getDeliveryCosts ()
 
 getDeliveryCost ()
 
 setTotalDiscount ($dDiscount)
 
 getPriceForPayment ()
 
 _getDiscountedProductsSum ()
 
 getTotalDiscountSum ()
 
 getDiscountedProductsBruttoPrice ()
 
 isBelowMinOrderPrice ()
 
 getArtStockInBasket ($sArtId, $sExpiredArtId=null)
 
 canAddProductToBasket ($sProductId)
 
 setBasketRootCatId ($sRoot)
 
 getBasketRootCatId ()
 
 setCatChangeWarningState ($blShow)
 
 showCatChangeWarning ()
 
 getNotDiscountProductsPrice ()
 
 __wakeUp ()
 
 isNewItemAdded ()
 
 hasDownloadableProducts ()
 
 hasArticlesWithIntangibleAgreement ()
 
 hasArticlesWithDownloadableAgreement ()
 
 getMinOrderPrice ()
 

Protected Member Functions

 _changeBasketItemKey ($sOldKey, $sNewKey, $value=null)
 
 _clearBundles ()
 
 _getArticleBundles ($oBasketItem)
 
 _getItemBundles ($oBasketItem, $aBundles=[])
 
 _getBasketBundles ($aBundles=[])
 
 _addBundles ()
 
 _addBundlesToBasket ($aBundles)
 
 _calcItemsPrice ()
 
 _mergeDiscounts ($aDiscounts, $aItemDiscounts)
 
 _calcDeliveryCost ()
 
 _calcTotalPrice ()
 
 _calcVoucherDiscount ()
 
 _applyDiscounts ()
 
 _getPriceObject ()
 
 _calcBasketDiscount ()
 
 _calcBasketTotalDiscount ()
 
 _calcBasketWrapping ()
 
 _calcBasketGiftCard ()
 
 _calcPaymentCost ()
 
 formatDiscount ()
 
 _canSaveBasket ()
 
 _save ()
 
 _deleteSavedBasket ()
 
 _findDelivCountry ()
 
 _isProductInRootCategory ($sProductId, $sRootCatId)
 
 _addedNewItem ($sProductID, $dAmount, $aSel, $aPersParam, $blOverride, $blBundle, $sOldBasketItemId)
 
 addedNewItem ($blOverride)
 

Protected Attributes

 $_aBasketContents = []
 
 $_iProductsCnt = 0
 
 $_dItemsCnt = 0.0
 
 $_dWeight = 0.0
 
 $_oPrice = null
 
 $_isCalculationModeNetto = null
 
 $_dNettoSum = null
 
 $_dBruttoSum = null
 
 $_oProductsPriceList = null
 
 $_aDiscounts = []
 
 $_aItemDiscounts = []
 
 $_sOrderId = null
 
 $_aVouchers = []
 
 $_aCosts = []
 
 $_oDiscountProductsPriceList = null
 
 $_oNotDiscountedProductsPriceList = null
 
 $_blUpdateNeeded = true
 
 $_aBasketSummary = null
 
 $_sPaymentId = null
 
 $_sShippingSetId = null
 
 $_oUser = null
 
 $_oTotalDiscount = null
 
 $_oVoucherDiscount = null
 
 $_oCurrency = null
 
 $_blSkipVouchersAvailabilityChecking = null
 
 $_dDiscountedProductNettoPrice = null
 
 $_aDiscountedVats = null
 
 $_blSkipDiscounts = false
 
 $_oDeliveryPrice = null
 
 $_blCheckStock = true
 
 $_blCalcDiscounts = true
 
 $_sBasketCategoryId = null
 
 $_blShowCatChangeWarning = false
 
 $_blNewITemAdded = null
 
 $_blDownloadableProducts = null
 
 $_blSaveToDataBase = null
 
 $_sCardId = null
 

Detailed Description

Basket manager

Member Function Documentation

◆ __wakeUp()

OxidEsales\EshopCommunity\Application\Model\Basket::__wakeUp ( )

Resets new basket item addition state on unserialization

◆ _addBundles()

OxidEsales\EshopCommunity\Application\Model\Basket::_addBundles ( )
protected

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

◆ _addBundlesToBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::_addBundlesToBasket (   $aBundles)
protected

Adds bundles to basket

Parameters
array$aBundlesadded bundle articles

◆ _addedNewItem()

OxidEsales\EshopCommunity\Application\Model\Basket::_addedNewItem (   $sProductID,
  $dAmount,
  $aSel,
  $aPersParam,
  $blOverride,
  $blBundle,
  $sOldBasketItemId 
)
protected

Is called when new basket item is successfully added.

Parameters
string$sProductIDid of product
double$dAmountproduct amount
array$aSelproduct select lists (default null)
array$aPersParamproduct persistent parameters (default null)
bool$blOverridemarker to accumulate passed amount or renew (default false)
bool$blBundlemarker if product is bundle or not (default false)
string$sOldBasketItemIdid if old basket item if to change it
Deprecated:
since v.6.0.0 (2017-08-24); Use addedNewItem() instead.

◆ _applyDiscounts()

OxidEsales\EshopCommunity\Application\Model\Basket::_applyDiscounts ( )
protected

Performs netto price and VATs calculations including discounts and vouchers.

◆ _calcBasketDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::_calcBasketDiscount ( )
protected

Loads basket discounts and calculates discount values.

◆ _calcBasketGiftCard()

OxidEsales\EshopCommunity\Application\Model\Basket::_calcBasketGiftCard ( )
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
\OxidEsales\Eshop\Core\Price

◆ _calcBasketTotalDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::_calcBasketTotalDiscount ( )
protected

Calculates total basket discount value.

◆ _calcBasketWrapping()

OxidEsales\EshopCommunity\Application\Model\Basket::_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 price object for wrapping.

Returns
\OxidEsales\Eshop\Core\Price

◆ _calcDeliveryCost()

OxidEsales\EshopCommunity\Application\Model\Basket::_calcDeliveryCost ( )
protected

Iterates through basket items and calculates its delivery costs

Returns
\OxidEsales\Eshop\Core\Price

◆ _calcItemsPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::_calcItemsPrice ( )
protected

Iterates through basket items and calculates its prices and discounts

◆ _calcPaymentCost()

OxidEsales\EshopCommunity\Application\Model\Basket::_calcPaymentCost ( )
protected

Payment cost calculation, applying payment discount if available.

Returns
\OxidEsales\Eshop\Core\Price

◆ _calcTotalPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::_calcTotalPrice ( )
protected

Performs final sum calculation and rounding.

◆ _calcVoucherDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::_calcVoucherDiscount ( )
protected

Calculates voucher discount

◆ _canSaveBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::_canSaveBasket ( )
protected

Checks whether basket can be saved

Deprecated:
in v5.2.0 on 2013-04-28; use \OxidEsales\Eshop\Application\Model\Basket::isSaveToDataBaseEnabled()
Returns
bool

◆ _changeBasketItemKey()

OxidEsales\EshopCommunity\Application\Model\Basket::_changeBasketItemKey (   $sOldKey,
  $sNewKey,
  $value = null 
)
protected

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

Parameters
string$sOldKeyold key
string$sNewKeynew key to place in old one's place
mixed$value(optional)

◆ _clearBundles()

OxidEsales\EshopCommunity\Application\Model\Basket::_clearBundles ( )
protected

Unsets bundled basket items from basket contents array

◆ _deleteSavedBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::_deleteSavedBasket ( )
protected

Cleans up saved basket data. This method usually is initiated by \OxidEsales\Eshop\Application\Model\Basket::deleteBasket() method which cleans up basket data when user completes order.

◆ _findDelivCountry()

OxidEsales\EshopCommunity\Application\Model\Basket::_findDelivCountry ( )
protected

Tries to fetch user delivery country ID

Returns
string

◆ _getArticleBundles()

OxidEsales\EshopCommunity\Application\Model\Basket::_getArticleBundles (   $oBasketItem)
protected

Returns array of bundled articles IDs for basket item

Parameters
object$oBasketItembasket item object
Returns
array

◆ _getBasketBundles()

OxidEsales\EshopCommunity\Application\Model\Basket::_getBasketBundles (   $aBundles = [])
protected

Returns array of bundled discount articles for whole basket

Parameters
array$aBundlesarray of found bundles
Returns
array

◆ _getDiscountedProductsSum()

OxidEsales\EshopCommunity\Application\Model\Basket::_getDiscountedProductsSum ( )

Returns ( current basket products sum - total discount - voucher discount )

Returns
double

◆ _getItemBundles()

OxidEsales\EshopCommunity\Application\Model\Basket::_getItemBundles (   $oBasketItem,
  $aBundles = [] 
)
protected

Returns array of bundled discount articles

Parameters
object$oBasketItembasket item object
array$aBundlesarray of found bundles
Returns
array

◆ _getPriceObject()

OxidEsales\EshopCommunity\Application\Model\Basket::_getPriceObject ( )
protected

Returns prepared price object depending on view mode

Returns
\OxidEsales\Eshop\Core\Price

◆ _isProductInRootCategory()

OxidEsales\EshopCommunity\Application\Model\Basket::_isProductInRootCategory (   $sProductId,
  $sRootCatId 
)
protected

Checks if product is in root category

Parameters
string$sProductIdproduct id
string$sRootCatIdroot category id
Returns
bool

◆ _mergeDiscounts()

OxidEsales\EshopCommunity\Application\Model\Basket::_mergeDiscounts (   $aDiscounts,
  $aItemDiscounts 
)
protected

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

Parameters
array$aDiscountsDiscount array
array$aItemDiscountsDiscount array
Returns
array $aDiscounts

◆ _save()

OxidEsales\EshopCommunity\Application\Model\Basket::_save ( )
protected

Saves existing basket to database

◆ addedNewItem()

OxidEsales\EshopCommunity\Application\Model\Basket::addedNewItem (   $blOverride)
protected

Is called when new basket item is successfully added.

Parameters
bool$blOverridemarker to accumulate passed amount or renew (default false).

◆ addOrderArticleToBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::addOrderArticleToBasket (   $oOrderArticle)

Adds order article to basket (method normally used while recalculating order)

Parameters
\OxidEsales\Eshop\Application\Model\OrderArticle$oOrderArticleorder article to store in basket
Returns
\OxidEsales\Eshop\Application\Model\BasketItem

◆ addToBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::addToBasket (   $sProductID,
  $dAmount,
  $aSel = null,
  $aPersParam = null,
  $blOverride = false,
  $blBundle = false,
  $sOldBasketItemId = null 
)

Adds user item to basket. Returns oxBasketItem object if adding succeeded

Parameters
string$sProductIDid of product
double$dAmountproduct amount
mixed$aSelproduct select lists (default null)
mixed$aPersParamproduct persistent parameters (default null)
bool$blOverridemarker to accumulate passed amount or renew (default false)
bool$blBundlemarker if product is bundle or not (default false)
mixed$sOldBasketItemIdid if old basket item if to change it
Exceptions

◆ addVoucher()

OxidEsales\EshopCommunity\Application\Model\Basket::addVoucher (   $sVoucherId)

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

Parameters
string$sVoucherIdvoucher ID

◆ afterUpdate()

OxidEsales\EshopCommunity\Application\Model\Basket::afterUpdate ( )

Marks basket as up-to-date

◆ calculateBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::calculateBasket (   $blForceUpdate = false)

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

Parameters
bool$blForceUpdateset this parameter to TRUE to force basket recalculation
Returns
null

◆ canAddProductToBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::canAddProductToBasket (   $sProductId)

Checks if product can be added to basket

Parameters
string$sProductIdproduct id
Returns
bool

◆ canCalcDiscounts()

OxidEsales\EshopCommunity\Application\Model\Basket::canCalcDiscounts ( )

Returns true if discount calculation is enabled

Returns
bool

◆ deleteBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::deleteBasket ( )

Deletes user basket object from session

◆ enableSaveToDataBase()

OxidEsales\EshopCommunity\Application\Model\Basket::enableSaveToDataBase (   $blSave = true)

Enables or disable saving to data base

Parameters
boolean$blSave

◆ formatDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::formatDiscount ( )
protected

Formatting discounts

◆ getAdditionalServicesVatPercent()

OxidEsales\EshopCommunity\Application\Model\Basket::getAdditionalServicesVatPercent ( )

Get most used vat percent:

Returns
double

◆ getArtStockInBasket()

OxidEsales\EshopCommunity\Application\Model\Basket::getArtStockInBasket (   $sArtId,
  $sExpiredArtId = null 
)

Returns stock of article in basket, including bundle article

Parameters
string$sArtIdarticle id
string$sExpiredArtIditem id of updated article
Returns
double

◆ getBasketArticles()

OxidEsales\EshopCommunity\Application\Model\Basket::getBasketArticles ( )

Returns array of basket oxarticle objects

Returns
array

◆ getBasketCurrency()

OxidEsales\EshopCommunity\Application\Model\Basket::getBasketCurrency ( )

Basket currency getter

Returns
object

◆ getBasketRootCatId()

OxidEsales\EshopCommunity\Application\Model\Basket::getBasketRootCatId ( )

Get active basket root category

Returns
string

◆ getBasketSummary()

OxidEsales\EshopCommunity\Application\Model\Basket::getBasketSummary ( )

Function collects summary information about basket. Usually this info is used while calculating discounts or so. Data is stored in static class parameter \OxidEsales\Eshop\Application\Model\Basket::$_aBasketSummary

Returns
object

◆ getBasketUser()

OxidEsales\EshopCommunity\Application\Model\Basket::getBasketUser ( )

Basket user getter

Returns
\OxidEsales\Eshop\Application\Model\User

◆ getBruttoSum()

OxidEsales\EshopCommunity\Application\Model\Basket::getBruttoSum ( )

Return basket brutto sum (in B2C view mode sum include discount)

Returns
float

◆ getCard()

OxidEsales\EshopCommunity\Application\Model\Basket::getCard ( )

Returns gift card object (if available)

Returns
oxWrapping

◆ getCardId()

OxidEsales\EshopCommunity\Application\Model\Basket::getCardId ( )

Returns applied gift card ID

Returns
string

◆ getCardMessage()

OxidEsales\EshopCommunity\Application\Model\Basket::getCardMessage ( )

Returns gift card message text

Returns
string

◆ getContents()

OxidEsales\EshopCommunity\Application\Model\Basket::getContents ( )

Returns basket items array

Returns
array

◆ getCosts()

OxidEsales\EshopCommunity\Application\Model\Basket::getCosts (   $sId = null)

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

Parameters
string$sIdcost id ( optional )
Returns
array|\OxidEsales\Eshop\Core\Price|null

◆ getDelCostNet()

OxidEsales\EshopCommunity\Application\Model\Basket::getDelCostNet ( )

Returns formatted netto price of delivery costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string

◆ getDelCostVat()

OxidEsales\EshopCommunity\Application\Model\Basket::getDelCostVat ( )

Returns formatted VAT of delivery costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getDelCostVatPercent()

OxidEsales\EshopCommunity\Application\Model\Basket::getDelCostVatPercent ( )

Returns VAT of delivery costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
double

◆ getDeliveryCost()

OxidEsales\EshopCommunity\Application\Model\Basket::getDeliveryCost ( )

Returns delivery costs

Returns
\OxidEsales\Eshop\Core\Price

◆ getDeliveryCosts()

OxidEsales\EshopCommunity\Application\Model\Basket::getDeliveryCosts ( )

Returns if exists delivery costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getDiscountedProductsBruttoPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getDiscountedProductsBruttoPrice ( )

Returns ( current basket products sum - total discount - voucher discount )

Returns
double

◆ getDiscountProductsPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getDiscountProductsPrice ( )

Returns price list object of discounted products

Returns
\OxidEsales\Eshop\Core\PriceList

◆ getDiscounts()

OxidEsales\EshopCommunity\Application\Model\Basket::getDiscounts ( )

Returns applied discount information array

Returns
array

◆ getFDeliveryCosts()

OxidEsales\EshopCommunity\Application\Model\Basket::getFDeliveryCosts ( )

Returns if exists formatted delivery costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getFGiftCardCosts()

OxidEsales\EshopCommunity\Application\Model\Basket::getFGiftCardCosts ( )

Returns if exists formatted gift card costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getFPaymentCosts()

OxidEsales\EshopCommunity\Application\Model\Basket::getFPaymentCosts ( )

Returns if exists formatted payment costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getFPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getFPrice ( )

Returns formatted basket total price

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string

◆ getFProductsPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getFProductsPrice ( )

Formatted Products price getter

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string

◆ getFVoucherDiscountValue()

OxidEsales\EshopCommunity\Application\Model\Basket::getFVoucherDiscountValue ( )

Returns formatted voucher discount

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getFWrappingCosts()

OxidEsales\EshopCommunity\Application\Model\Basket::getFWrappingCosts ( )

Returns if exists formatted wrapping costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getGiftCardCost()

OxidEsales\EshopCommunity\Application\Model\Basket::getGiftCardCost ( )

Gets gift card cost.

Returns
\OxidEsales\Eshop\Core\Price

◆ getGiftCardCostNet()

OxidEsales\EshopCommunity\Application\Model\Basket::getGiftCardCostNet ( )

Returns formatted netto price of gift card costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string

◆ getGiftCardCostVat()

OxidEsales\EshopCommunity\Application\Model\Basket::getGiftCardCostVat ( )

Returns formatted VAT of gift card costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getGiftCardCostVatPercent()

OxidEsales\EshopCommunity\Application\Model\Basket::getGiftCardCostVatPercent ( )

Returns VAT of gift card costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
double

◆ getItemKey()

OxidEsales\EshopCommunity\Application\Model\Basket::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$sProductIdbasket item id
array$aSelbasket item selectlists
array$aPersParambasket item persistent parameters
bool$blBundlebundle marker
string$sAdditionalParampossible additional information
Returns
string

◆ getItemsCount()

OxidEsales\EshopCommunity\Application\Model\Basket::getItemsCount ( )

Returns count of items stored in basket.

Returns
double

◆ getMinOrderPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getMinOrderPrice ( )

Returns min order price value

Returns
float

◆ getMostUsedVatPercent()

OxidEsales\EshopCommunity\Application\Model\Basket::getMostUsedVatPercent ( )

Get most used vat percent:

Returns
double

◆ getNettoSum()

OxidEsales\EshopCommunity\Application\Model\Basket::getNettoSum ( )

Return basket netto sum (in B2B view mode sum include discount)

Returns
float

◆ getNotDiscountProductsPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getNotDiscountProductsPrice ( )

Returns price list object of not discounted products

Returns
\OxidEsales\Eshop\Core\PriceList in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin

◆ getOrderId()

OxidEsales\EshopCommunity\Application\Model\Basket::getOrderId ( )

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

Returns
string

◆ getPayCostNet()

OxidEsales\EshopCommunity\Application\Model\Basket::getPayCostNet ( )

Returns formatted netto price of payment costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string

◆ getPayCostVat()

OxidEsales\EshopCommunity\Application\Model\Basket::getPayCostVat ( )

Returns formatted VAT of payment costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string

◆ getPayCostVatPercent()

OxidEsales\EshopCommunity\Application\Model\Basket::getPayCostVatPercent ( )

Returns VAT of payment costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
double

◆ getPaymentCost()

OxidEsales\EshopCommunity\Application\Model\Basket::getPaymentCost ( )

Returns payment costs

Returns
\OxidEsales\Eshop\Core\Price

◆ getPaymentCosts()

OxidEsales\EshopCommunity\Application\Model\Basket::getPaymentCosts ( )

Returns payment costs brutto value

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
double | bool

◆ getPaymentId()

OxidEsales\EshopCommunity\Application\Model\Basket::getPaymentId ( )

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

Returns
string

◆ getPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getPrice ( )

Returns basket price object

Returns
\OxidEsales\Eshop\Core\Price

◆ getPriceForPayment()

OxidEsales\EshopCommunity\Application\Model\Basket::getPriceForPayment ( )

Get basket price for payment cost calculation. Returned price is with applied discounts, vouchers and added delivery cost

Returns
double

◆ getProductsCount()

OxidEsales\EshopCommunity\Application\Model\Basket::getProductsCount ( )

Returns number of different products stored in basket.

Returns
int

◆ getProductsNetPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getProductsNetPrice ( )

Formatted Products net price getter

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string

◆ getProductsPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::getProductsPrice ( )

Returns basket products price list object

Returns
\OxidEsales\Eshop\Core\PriceList

◆ getProductVats()

OxidEsales\EshopCommunity\Application\Model\Basket::getProductVats (   $blFormatCurrency = true)

Returns array of plain of formatted VATs which were calculated for basket

Parameters
bool$blFormatCurrencyenables currency formatting
Returns
array

◆ getShippingId()

OxidEsales\EshopCommunity\Application\Model\Basket::getShippingId ( )

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

Returns
string oxDeliverySet

◆ getStockCheckMode()

OxidEsales\EshopCommunity\Application\Model\Basket::getStockCheckMode ( )

Returns stock control mode

Returns
bool

◆ getTotalDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::getTotalDiscount ( )

Returns total basket discount Price object

Returns
\OxidEsales\Eshop\Core\Price

◆ getTotalDiscountSum()

OxidEsales\EshopCommunity\Application\Model\Basket::getTotalDiscountSum ( )

Gets total discount sum.

Returns
float|int

◆ getVoucherDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::getVoucherDiscount ( )

Returns basket voucher discount price object

Returns
\OxidEsales\Eshop\Core\Price

◆ getVoucherDiscValue()

OxidEsales\EshopCommunity\Application\Model\Basket::getVoucherDiscValue ( )

Returns value of voucher discount

Returns
double

◆ getVouchers()

OxidEsales\EshopCommunity\Application\Model\Basket::getVouchers ( )

Returns array of vouchers applied to basket

Returns
array

◆ getWeight()

OxidEsales\EshopCommunity\Application\Model\Basket::getWeight ( )

Returns total basket weight.

Returns
double

◆ getWrappCostNet()

OxidEsales\EshopCommunity\Application\Model\Basket::getWrappCostNet ( )

Returns formatted netto price of wrapping costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string

◆ getWrappCostVat()

OxidEsales\EshopCommunity\Application\Model\Basket::getWrappCostVat ( )

Returns formatted VAT of wrapping costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
string | bool

◆ getWrappCostVatPercent()

OxidEsales\EshopCommunity\Application\Model\Basket::getWrappCostVatPercent ( )

Returns VAT of wrapping costs

Deprecated:
in v4.8/5.1 on 2013-10-14; for formatting use oxPrice smarty plugin
Returns
double

◆ getWrappingCost()

OxidEsales\EshopCommunity\Application\Model\Basket::getWrappingCost ( )

Returns array of wrapping costs

Returns
array

◆ hasArticlesWithDownloadableAgreement()

OxidEsales\EshopCommunity\Application\Model\Basket::hasArticlesWithDownloadableAgreement ( )

Returns whether there are any articles in basket with downloadable products agreement enabled.

Returns
bool

◆ hasArticlesWithIntangibleAgreement()

OxidEsales\EshopCommunity\Application\Model\Basket::hasArticlesWithIntangibleAgreement ( )

Returns whether there are any articles in basket with intangible products agreement enabled.

Returns
bool

◆ hasDownloadableProducts()

OxidEsales\EshopCommunity\Application\Model\Basket::hasDownloadableProducts ( )

Returns true if at least one product is downloadable in basket

Returns
bool

◆ hasSkipedDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::hasSkipedDiscount ( )

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

Returns
bool

◆ isBelowMinOrderPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::isBelowMinOrderPrice ( )

Returns TRUE if ( current basket products sum - total discount - voucher discount ) > 0

Returns
bool

◆ isCalculationModeNetto()

OxidEsales\EshopCommunity\Application\Model\Basket::isCalculationModeNetto ( )

Return true if calculation mode is netto

Returns
bool

◆ isEnabled()

OxidEsales\EshopCommunity\Application\Model\Basket::isEnabled ( )

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

Returns
bool

◆ isNewItemAdded()

OxidEsales\EshopCommunity\Application\Model\Basket::isNewItemAdded ( )

Returns true if new product was just added to basket

Returns
bool

◆ isPriceViewModeNetto()

OxidEsales\EshopCommunity\Application\Model\Basket::isPriceViewModeNetto ( )

Returns true if view mode is netto

Returns
bool

◆ isProportionalCalculationOn()

OxidEsales\EshopCommunity\Application\Model\Basket::isProportionalCalculationOn ( )

Get most used vat percent:

Returns
double

◆ isSaveToDataBaseEnabled()

OxidEsales\EshopCommunity\Application\Model\Basket::isSaveToDataBaseEnabled ( )

Returns true if saving to data base enabled

Returns
boolean

◆ load()

OxidEsales\EshopCommunity\Application\Model\Basket::load ( )

Populates current basket from the saved one.

Returns
null

◆ onUpdate()

OxidEsales\EshopCommunity\Application\Model\Basket::onUpdate ( )

Notifies basket that recalculation is needed

◆ removeItem()

OxidEsales\EshopCommunity\Application\Model\Basket::removeItem (   $sItemKey)

Removes item from basket

Parameters
string$sItemKeybasket item key

◆ removeVoucher()

OxidEsales\EshopCommunity\Application\Model\Basket::removeVoucher (   $sVoucherId)

Removes voucher from basket and unreserved it.

Parameters
string$sVoucherIdremovable voucher ID

◆ resetUserInfo()

OxidEsales\EshopCommunity\Application\Model\Basket::resetUserInfo ( )

Resets user related information kept in basket object

◆ setBasketCurrency()

OxidEsales\EshopCommunity\Application\Model\Basket::setBasketCurrency (   $oCurrency)

Set basket currency

Parameters
object$oCurrencycurrency object

◆ setBasketRootCatId()

OxidEsales\EshopCommunity\Application\Model\Basket::setBasketRootCatId (   $sRoot)

Set active basket root category

Parameters
string$sRootRoot category id

◆ setBasketUser()

OxidEsales\EshopCommunity\Application\Model\Basket::setBasketUser (   $oUser)

Basket user setter

Parameters
\OxidEsales\Eshop\Application\Model\User$oUserBasket user

◆ setBruttoSum()

OxidEsales\EshopCommunity\Application\Model\Basket::setBruttoSum (   $dBruttoSum)

Set basket brutto sum

Parameters
float$dBruttoSumsum of basket in brutto mode

◆ setCalculationModeNetto()

OxidEsales\EshopCommunity\Application\Model\Basket::setCalculationModeNetto (   $blNettoMode = true)

Set netto calculation mode

Parameters
bool$blNettoMode- true in netto; false - turn off

◆ setCardId()

OxidEsales\EshopCommunity\Application\Model\Basket::setCardId (   $sCardId)

Gift card ID setter

Parameters
string$sCardIdgift card id

◆ setCardMessage()

OxidEsales\EshopCommunity\Application\Model\Basket::setCardMessage (   $sMessage)

Gift card message setter

Parameters
string$sMessagegift card message

◆ setCatChangeWarningState()

OxidEsales\EshopCommunity\Application\Model\Basket::setCatChangeWarningState (   $blShow)

Sets category change warn state

Parameters
bool$blShowto show warning or not

◆ setCost()

OxidEsales\EshopCommunity\Application\Model\Basket::setCost (   $sCostName,
  $oPrice = null 
)

Sets basket additional costs

Parameters
string$sCostNameadditional costs
object$oPrice\OxidEsales\Eshop\Core\Price

◆ setDeliveryPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::setDeliveryPrice (   $oShippingPrice = null)

Set basket shipping price

Parameters
\OxidEsales\Eshop\Core\Price$oShippingPricedelivery costs

◆ setDiscountCalcMode()

OxidEsales\EshopCommunity\Application\Model\Basket::setDiscountCalcMode (   $blCalcDiscounts)

Sets discount calculation mode

Parameters
bool$blCalcDiscountscalculate discounts or not

◆ setNettoSum()

OxidEsales\EshopCommunity\Application\Model\Basket::setNettoSum (   $dNettoSum)

Set basket netto sum

Parameters
float$dNettoSumsum of basket in netto mode

◆ setOrderId()

OxidEsales\EshopCommunity\Application\Model\Basket::setOrderId (   $sId)

Basket order ID setter

Parameters
string$sIdunique id for basket order

◆ setPayment()

OxidEsales\EshopCommunity\Application\Model\Basket::setPayment (   $sPaymentId = null)

Set basket payment ID

Parameters
string$sPaymentIdpayment id

◆ setPrice()

OxidEsales\EshopCommunity\Application\Model\Basket::setPrice (   $oPrice)

Set basket total sum price object

Parameters
\OxidEsales\Eshop\Core\Price$oPricePrice object

◆ setShipping()

OxidEsales\EshopCommunity\Application\Model\Basket::setShipping (   $sShippingSetId = null)

Set basket shipping set ID

Parameters
string$sShippingSetIddelivery set id

◆ setSkipDiscounts()

OxidEsales\EshopCommunity\Application\Model\Basket::setSkipDiscounts (   $blSkip)

Used to set "skip discounts" status for basket

Parameters
bool$blSkipset true to skip discounts

◆ setSkipVouchersChecking()

OxidEsales\EshopCommunity\Application\Model\Basket::setSkipVouchersChecking (   $blSkipChecking = null)

Set skip or not vouchers availability checking

Parameters
bool$blSkipCheckingskip or not vouchers checking

◆ setStockCheckMode()

OxidEsales\EshopCommunity\Application\Model\Basket::setStockCheckMode (   $blCheck)

Sets stock control mode

Parameters
bool$blCheckstock control mode

◆ setTotalDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::setTotalDiscount (   $dDiscount)

Sets total discount value

Parameters
double$dDiscountnew total discount value

◆ setVoucherDiscount()

OxidEsales\EshopCommunity\Application\Model\Basket::setVoucherDiscount (   $dDiscount)

Voucher discount setter

Parameters
double$dDiscountvoucher discount value

◆ showCatChangeWarning()

OxidEsales\EshopCommunity\Application\Model\Basket::showCatChangeWarning ( )

Tells to show category change warning

Returns
bool

Member Data Documentation

◆ $_aBasketContents

OxidEsales\EshopCommunity\Application\Model\Basket::$_aBasketContents = []
protected

◆ $_aBasketSummary

OxidEsales\EshopCommunity\Application\Model\Basket::$_aBasketSummary = null
protected

◆ $_aCosts

OxidEsales\EshopCommunity\Application\Model\Basket::$_aCosts = []
protected

◆ $_aDiscountedVats

OxidEsales\EshopCommunity\Application\Model\Basket::$_aDiscountedVats = null
protected

◆ $_aDiscounts

OxidEsales\EshopCommunity\Application\Model\Basket::$_aDiscounts = []
protected

◆ $_aItemDiscounts

OxidEsales\EshopCommunity\Application\Model\Basket::$_aItemDiscounts = []
protected

◆ $_aVouchers

OxidEsales\EshopCommunity\Application\Model\Basket::$_aVouchers = []
protected

◆ $_blCalcDiscounts

OxidEsales\EshopCommunity\Application\Model\Basket::$_blCalcDiscounts = true
protected

◆ $_blCheckStock

OxidEsales\EshopCommunity\Application\Model\Basket::$_blCheckStock = true
protected

◆ $_blDownloadableProducts

OxidEsales\EshopCommunity\Application\Model\Basket::$_blDownloadableProducts = null
protected

◆ $_blNewITemAdded

OxidEsales\EshopCommunity\Application\Model\Basket::$_blNewITemAdded = null
protected

◆ $_blSaveToDataBase

OxidEsales\EshopCommunity\Application\Model\Basket::$_blSaveToDataBase = null
protected

◆ $_blShowCatChangeWarning

OxidEsales\EshopCommunity\Application\Model\Basket::$_blShowCatChangeWarning = false
protected

◆ $_blSkipDiscounts

OxidEsales\EshopCommunity\Application\Model\Basket::$_blSkipDiscounts = false
protected

◆ $_blSkipVouchersAvailabilityChecking

OxidEsales\EshopCommunity\Application\Model\Basket::$_blSkipVouchersAvailabilityChecking = null
protected

◆ $_blUpdateNeeded

OxidEsales\EshopCommunity\Application\Model\Basket::$_blUpdateNeeded = true
protected

◆ $_dBruttoSum

OxidEsales\EshopCommunity\Application\Model\Basket::$_dBruttoSum = null
protected

◆ $_dDiscountedProductNettoPrice

OxidEsales\EshopCommunity\Application\Model\Basket::$_dDiscountedProductNettoPrice = null
protected

◆ $_dItemsCnt

OxidEsales\EshopCommunity\Application\Model\Basket::$_dItemsCnt = 0.0
protected

◆ $_dNettoSum

OxidEsales\EshopCommunity\Application\Model\Basket::$_dNettoSum = null
protected

◆ $_dWeight

OxidEsales\EshopCommunity\Application\Model\Basket::$_dWeight = 0.0
protected

◆ $_iProductsCnt

OxidEsales\EshopCommunity\Application\Model\Basket::$_iProductsCnt = 0
protected

◆ $_isCalculationModeNetto

OxidEsales\EshopCommunity\Application\Model\Basket::$_isCalculationModeNetto = null
protected

◆ $_oCurrency

OxidEsales\EshopCommunity\Application\Model\Basket::$_oCurrency = null
protected

◆ $_oDeliveryPrice

OxidEsales\EshopCommunity\Application\Model\Basket::$_oDeliveryPrice = null
protected

◆ $_oDiscountProductsPriceList

OxidEsales\EshopCommunity\Application\Model\Basket::$_oDiscountProductsPriceList = null
protected

◆ $_oNotDiscountedProductsPriceList

OxidEsales\EshopCommunity\Application\Model\Basket::$_oNotDiscountedProductsPriceList = null
protected

◆ $_oPrice

OxidEsales\EshopCommunity\Application\Model\Basket::$_oPrice = null
protected

◆ $_oProductsPriceList

OxidEsales\EshopCommunity\Application\Model\Basket::$_oProductsPriceList = null
protected

◆ $_oTotalDiscount

OxidEsales\EshopCommunity\Application\Model\Basket::$_oTotalDiscount = null
protected

◆ $_oUser

OxidEsales\EshopCommunity\Application\Model\Basket::$_oUser = null
protected

◆ $_oVoucherDiscount

OxidEsales\EshopCommunity\Application\Model\Basket::$_oVoucherDiscount = null
protected

◆ $_sBasketCategoryId

OxidEsales\EshopCommunity\Application\Model\Basket::$_sBasketCategoryId = null
protected

◆ $_sCardId

OxidEsales\EshopCommunity\Application\Model\Basket::$_sCardId = null
protected

◆ $_sOrderId

OxidEsales\EshopCommunity\Application\Model\Basket::$_sOrderId = null
protected

◆ $_sPaymentId

OxidEsales\EshopCommunity\Application\Model\Basket::$_sPaymentId = null
protected

◆ $_sShippingSetId

OxidEsales\EshopCommunity\Application\Model\Basket::$_sShippingSetId = null
protected

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