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

Public Member Functions

 getBasketItemKey ()
 
 setBasketItemKey ($itemKey)
 
 getRegularUnitPrice ()
 
 setRegularUnitPrice ($oRegularUnitPrice)
 
 init ($sProductID, $dAmount, $aSel=null, $aPersParam=null, $blBundle=null)
 
 initFromOrderArticle ($oOrderArticle)
 
 setAsDiscountArticle ($blIsDiscountArticle)
 
 setStockCheckStatus ($blStatus)
 
 getStockCheckStatus ()
 
 setAmount ($dAmount, $blOverride=true, $sItemKey=null)
 
 setPrice ($oPrice)
 
 getIconUrl ()
 
 getArticle ($blCheckProduct=false, $sProductId=null, $blDisableLazyLoading=false)
 
 getdBundledAmount ()
 
 getPrice ()
 
 getUnitPrice ()
 
 getAmount ()
 
 getWeight ()
 
 getTitle ()
 
 getLink ()
 
 getShopId ()
 
 getSelList ()
 
 getChosenSelList ()
 
 isBundle ()
 
 isDiscountArticle ()
 
 isSkipDiscount ()
 
 __get ($sName)
 
 __sleep ()
 
 getPersParams ()
 
 setPersParams ($aPersParam)
 
 setBundle ($blBundle)
 
 setSkipDiscounts ($blSkip)
 
 getProductId ()
 
 setWrapping ($sWrapId)
 
 getWrappingId ()
 
 getWrapping ()
 
 getWishId ()
 
 setWishId ($sWishId)
 
 setWishArticleId ($sArticleId)
 
 getWishArticleId ()
 
 getFRegularUnitPrice ()
 
 getFUnitPrice ()
 
 getFTotalPrice ()
 
 getVatPercent ()
 
 getVarSelect ()
 
 getLanguageId ()
 
 setLanguageId ($iLanguageId)
 

Protected Member Functions

 applyPackageOnAmount ($article, $amount)
 
 setArticle ($sProductId)
 
 setFromOrderArticle ($oOrderArticle)
 
 setSelectList ($aSelList)
 

Protected Attributes

 $_sProductId = null
 
 $_sTitle = null
 
 $_sVarSelect = null
 
 $_sIcon = null
 
 $_sLink = null
 
 $_oPrice = null
 
 $_oUnitPrice = null
 
 $_dAmount = 0.0
 
 $_dWeight = 0
 
 $_aSelList = []
 
 $_sShopId = null
 
 $_sNativeShopId = null
 
 $_blSkipDiscounts = false
 
 $_aPersistentParameters = []
 
 $_blBundle = false
 
 $_blIsDiscountArticle = false
 
 $_oArticle = null
 
 $_sDimageDirNoSsl = null
 
 $_sDimageDirSsl = null
 
 $_aChosenSelectlist = []
 
 $_sWrappingId = null
 
 $_sWishId = null
 
 $_sWishArticleId = null
 
 $_blCheckArticleStock = true
 
 $_iLanguageId = null
 
 $_blSsl = null
 
 $_sIconUrl = null
 
 $_oRegularUnitPrice = null
 
 $basketItemKey = null
 

Detailed Description

UserBasketItem class, responsible for storing most important fields

Member Function Documentation

◆ __get()

OxidEsales\EshopCommunity\Application\Model\BasketItem::__get (   $sName)

Special getter function for backwards compatibility. Executes methods by rule "get".$sVariableName and returns result processed by executed function.

Parameters
string$sNameparameter name
Returns
mixed

◆ __sleep()

OxidEsales\EshopCommunity\Application\Model\BasketItem::__sleep ( )

Does not return _oArticle var on serialisation

Returns
array

◆ applyPackageOnAmount()

OxidEsales\EshopCommunity\Application\Model\BasketItem::applyPackageOnAmount (   $article,
  $amount 
)
protected

Apply checks for package on amount

Parameters
\OxidEsales\Eshop\Application\Model\Article$article
double$amount
Returns
double

◆ getAmount()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getAmount ( )

Returns the amount of item.

Returns
double

◆ getArticle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getArticle (   $blCheckProduct = false,
  $sProductId = null,
  $blDisableLazyLoading = false 
)

Retrieves the article .Throws an exception if article does not exist, is not buyable or visible.

Parameters
bool$blCheckProductchecks if product is buyable and visible
string$sProductIdproduct id
bool$blDisableLazyLoadingdisable lazy loading
Exceptions

◆ getBasketItemKey()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getBasketItemKey ( )

Getter for basketItemkey.

Returns
string|null

◆ getChosenSelList()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getChosenSelList ( )

Returns user chosen select list information

Returns
array

◆ getdBundledAmount()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getdBundledAmount ( )

Returns bundle amount

Returns
double

◆ getFRegularUnitPrice()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getFRegularUnitPrice ( )

Returns formatted regular unit price

Deprecated:
in v4.8/5.1 on 2013-10-08; use oxPrice template engine formatter
Returns
string

◆ getFTotalPrice()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getFTotalPrice ( )

Returns formatted total price

Deprecated:
in v4.8/5.1 on 2013-10-08; use oxPrice template engine formatter
Returns
string

◆ getFUnitPrice()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getFUnitPrice ( )

Returns formatted unit price

Deprecated:
in v4.8/5.1 on 2013-10-08; use oxPrice template engine formatter
Returns
string

◆ getIconUrl()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getIconUrl ( )

Returns article icon picture url

Returns
string

◆ getLanguageId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getLanguageId ( )

Get language id

Returns
integer

◆ getLink()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getLink ( )

Returns product details URL

Returns
string

◆ getPersParams()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getPersParams ( )

Get persistent parameters ( oxbasketitem::_aPersistentParameters )

Returns
array

◆ getPrice()

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

Returns the price.

Returns
\OxidEsales\Eshop\Core\Price

◆ getProductId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getProductId ( )

Returns product Id

Returns
string product id

◆ getRegularUnitPrice()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getRegularUnitPrice ( )

Return regular unit price

Returns
\OxidEsales\Eshop\Core\Price

◆ getSelList()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getSelList ( )

Returns user passed select list information

Returns
array

◆ getShopId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getShopId ( )

Returns ID of shop from which this product was added into basket

Returns
string

◆ getStockCheckStatus()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getStockCheckStatus ( )

Returns stock control mode

Returns
bool

◆ getTitle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getTitle ( )

Returns product title

Returns
string

◆ getUnitPrice()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getUnitPrice ( )

Returns the price.

Returns
\OxidEsales\Eshop\Core\Price

◆ getVarSelect()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getVarSelect ( )

Returns varselect value

Returns
string

◆ getVatPercent()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getVatPercent ( )

Returns formatted total price

Returns
string

◆ getWeight()

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

returns the total weight.

Returns
double

◆ getWishArticleId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getWishArticleId ( )

Returns wish article Id

Returns
string

◆ getWishId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getWishId ( )

Returns wishlist user Id

Returns
string

◆ getWrapping()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getWrapping ( )

Returns basket item wrapping object

Returns
\OxidEsales\Eshop\Application\Model\Wrapping

◆ getWrappingId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::getWrappingId ( )

Returns wrapping paper ID (if such was applied)

Returns
string

◆ init()

OxidEsales\EshopCommunity\Application\Model\BasketItem::init (   $sProductID,
  $dAmount,
  $aSel = null,
  $aPersParam = null,
  $blBundle = null 
)

Assigns basic params to basket item

  • oxbasketitem::_setArticle();
  • oxbasketitem::setAmount();
  • oxbasketitem::_setSelectList();
  • oxbasketitem::setPersParams();
  • oxbasketitem::setBundle().
Parameters
string$sProductIDproduct id
double$dAmountamount
array$aSelselection
array$aPersParampersistent params
bool$blBundlebundle
Exceptions
oxNoArticleException
oxOutOfStockException
oxArticleInputException

◆ initFromOrderArticle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::initFromOrderArticle (   $oOrderArticle)

Initializes basket item from oxorderarticle object

  • oxbasketitem::_setFromOrderArticle() - assigns $oOrderArticle parameter to oxBasketItem::_oArticle. Thus oxOrderArticle is used as oxArticle (calls standard methods implemented by oxIArticle interface);
  • oxbasketitem::setAmount();
  • oxbasketitem::_setSelectList();
  • oxbasketitem::setPersParams().
Parameters
\OxidEsales\Eshop\Application\Model\OrderArticle$oOrderArticleorder article to load info from

◆ isBundle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::isBundle ( )

Returns true if product is bundle

Returns
bool

◆ isDiscountArticle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::isDiscountArticle ( )

Returns true if product is given as discount

Returns
bool

◆ isSkipDiscount()

OxidEsales\EshopCommunity\Application\Model\BasketItem::isSkipDiscount ( )

Returns true if discount must be skipped for current product

Returns
bool

◆ setAmount()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setAmount (   $dAmount,
  $blOverride = true,
  $sItemKey = null 
)

Sets item amount and weight which depends on amount ( oxbasketitem::dAmount, oxbasketitem::dWeight )

Parameters
double$dAmountamount
bool$blOverrideWhether to override current amount.
string$sItemKeyitem key
Exceptions
oxArticleInputException
oxOutOfStockException

◆ setArticle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setArticle (   $sProductId)
protected

Assigns general product parameters to oxbasketitem object :

  • sProduct - oxarticle object ID;
  • title - products title;
  • icon - icon name;
  • link - details URL's;
  • sShopId - current shop ID;
  • sNativeShopId - article shop ID;
  • _sDimageDirNoSsl - NON SSL mode image path;
  • _sDimageDirSsl - SSL mode image path;
Parameters
string$sProductIdproduct id
Exceptions
oxNoArticleExceptionexception

◆ setAsDiscountArticle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setAsDiscountArticle (   $blIsDiscountArticle)

Marks if item is discount bundle ( oxbasketitem::_blIsDiscountArticle )

Parameters
bool$blIsDiscountArticleif item is discount bundle

◆ setBasketItemKey()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setBasketItemKey (   $itemKey)

Setter for basketItemkey.

Parameters
string$itemKey

◆ setBundle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setBundle (   $blBundle)

Marks if item is bundle ( oxbasketitem::blBundle )

Parameters
bool$blBundleif item is bundle

◆ setFromOrderArticle()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setFromOrderArticle (   $oOrderArticle)
protected

Assigns general product parameters to oxbasketitem object:

  • sProduct - oxarticle object ID;
  • title - products title;
  • sShopId - current shop ID;
  • sNativeShopId - article shop ID;
Parameters
\OxidEsales\Eshop\Application\Model\OrderArticle$oOrderArticleorder article

◆ setLanguageId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setLanguageId (   $iLanguageId)

Set language Id, reload basket content on language change.

Parameters
integer$iLanguageIdlanguage id

◆ setPersParams()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setPersParams (   $aPersParam)

Stores items persistent parameters ( oxbasketitem::_aPersistentParameters )

Parameters
array$aPersParamitems persistent parameters

◆ setPrice()

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

Sets $this->_oPrice

Parameters
object$oPriceprice

◆ setRegularUnitPrice()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setRegularUnitPrice (   $oRegularUnitPrice)

Set regular unit price

Parameters
\OxidEsales\Eshop\Core\Price$oRegularUnitPriceregular price

◆ setSelectList()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setSelectList (   $aSelList)
protected

Stores item select lists ( oxbasketitem::aSelList )

Parameters
array$aSelListitem select lists

◆ setSkipDiscounts()

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

Used to set "skip discounts" status for basket item

Parameters
bool$blSkipset true to skip discounts

◆ setStockCheckStatus()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setStockCheckStatus (   $blStatus)

Sets stock control mode

Parameters
bool$blStatusstock control mode

◆ setWishArticleId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setWishArticleId (   $sArticleId)

Wish article Id setter

Parameters
string$sArticleIdwish article id

◆ setWishId()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setWishId (   $sWishId)

Wish user id setter

Parameters
string$sWishIduser id

◆ setWrapping()

OxidEsales\EshopCommunity\Application\Model\BasketItem::setWrapping (   $sWrapId)

Product wrapping paper id setter

Parameters
string$sWrapIdwrapping paper id

Member Data Documentation

◆ $_aChosenSelectlist

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_aChosenSelectlist = []
protected

◆ $_aPersistentParameters

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_aPersistentParameters = []
protected

◆ $_aSelList

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_aSelList = []
protected

◆ $_blBundle

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_blBundle = false
protected

◆ $_blCheckArticleStock

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_blCheckArticleStock = true
protected

◆ $_blIsDiscountArticle

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_blIsDiscountArticle = false
protected

◆ $_blSkipDiscounts

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

◆ $_blSsl

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_blSsl = null
protected

◆ $_dAmount

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_dAmount = 0.0
protected

◆ $_dWeight

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_dWeight = 0
protected

◆ $_iLanguageId

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_iLanguageId = null
protected

◆ $_oArticle

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_oArticle = null
protected

◆ $_oPrice

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

◆ $_oRegularUnitPrice

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_oRegularUnitPrice = null
protected

◆ $_oUnitPrice

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_oUnitPrice = null
protected

◆ $_sDimageDirNoSsl

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sDimageDirNoSsl = null
protected

◆ $_sDimageDirSsl

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sDimageDirSsl = null
protected

◆ $_sIcon

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sIcon = null
protected

◆ $_sIconUrl

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sIconUrl = null
protected

◆ $_sLink

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sLink = null
protected

◆ $_sNativeShopId

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sNativeShopId = null
protected

◆ $_sProductId

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sProductId = null
protected

◆ $_sShopId

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sShopId = null
protected

◆ $_sTitle

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sTitle = null
protected

◆ $_sVarSelect

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sVarSelect = null
protected

◆ $_sWishArticleId

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sWishArticleId = null
protected

◆ $_sWishId

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sWishId = null
protected

◆ $_sWrappingId

OxidEsales\EshopCommunity\Application\Model\BasketItem::$_sWrappingId = null
protected

◆ $basketItemKey

OxidEsales\EshopCommunity\Application\Model\BasketItem::$basketItemKey = null
protected

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