Bitrix API

Basket extends BasketBase

Class Basket

Table of Contents

Constants

BASKET_DELETE_LIMIT  = 2000

Methods

clearCollection()  : mixed
clearStartField()  : bool
count()  : int
Count elements of an object
create()  : BasketBase
createItem()  : BasketItemBase
current()  : mixed
Return the current element
deleteNoDemand()  : Result
deleteOld()  : int
deleteOldAgent()  : string
doFinalAction()  : Result
getBasePrice()  : float
Getting basket price without discounts
getBasket()  : BasketBase
getBasketItems()  : array<string|int, mixed>
getContext()  : array<string|int, mixed>
getExistsItem()  : BasketItem|null
getExistsItemByItem()  : BasketItemBase|null
getExistsItems()  : array<string|int, BasketItem>
Get all basket items for need moduleId, productId and properties.
getFUserId()  : int|null
Getting Customer ID
getIndexById()  : bool|int|null
getItemByBasketCode()  : BasketItemBase|null
getItemById()  : BasketItemBase|null
getItemByIndex()  : CollectableEntity|null
getItemByXmlId()  : BasketItemBase|null
getIterator()  : ArrayIterator
getList()  : Result|mixed
getListOfFormatText()  : array<string|int, mixed>|bool
getOrder()  : OrderBase|null
Getting the object of the order
getOrderableItems()  : BasketBase
getOrderId()  : int
getPrice()  : float
Getting basket price with discounts and taxes
getQuantityList()  : array<string|int, mixed>
Getting a list of a count of elements in the basket
getRegistryType()  : string
getSiteId()  : string
Getting Site ID
getVatRate()  : float
Getting the value of the tax rate basket
getVatSum()  : float
Getting the value of the tax basket
getWeight()  : int
Getting the weight basket
hasMeaningfulField()  : bool
isAnyItemAdded()  : bool
isAnyItemDeleted()  : bool
isChanged()  : bool
isClone()  : bool
isEmpty()  : bool
Checks if collection is empty.
isMathActionOnly()  : bool
isSaveRunning()  : bool
isStartField()  : bool
key()  : mixed
Return the key of the current element
loadFromArray()  : mixed
loadItemsForFUser()  : BasketBase
next()  : mixed
Move forward to next element
offsetExists()  : bool
Whether a offset exists
offsetGet()  : mixed
Offset to retrieve
offsetSet()  : void
Offset to set
offsetUnset()  : void
Offset to unset
onItemModify()  : Result
refresh()  : Result
refreshData()  : Result
rewind()  : mixed
Rewind the Iterator to the first element
save()  : Result
Save basket
setFUserId()  : mixed
Setting Customer ID to basket
setMathActionOnly()  : bool
setOrder()  : mixed
Attach to the essence of the object of the order basket
toArray()  : mixed
valid()  : mixed
Checks if current position is valid
verify()  : Result

Constants

BASKET_DELETE_LIMIT

public mixed BASKET_DELETE_LIMIT = 2000

Methods

clearCollection()

public clearCollection() : mixed
Tags
throws
ArgumentOutOfRangeException
throws
ObjectNotFoundException

count()

Count elements of an object

public count() : int
Return values
int

create()

public static create(mixed $siteId) : BasketBase
Parameters
$siteId : mixed
Tags
throws
ArgumentException
throws
NotImplementedException
Return values
BasketBase

createItem()

public createItem(mixed $moduleId, mixed $productId[, null $basketCode = null ]) : BasketItemBase
Parameters
$moduleId : mixed
$productId : mixed
$basketCode : null = null
Tags
throws
NotImplementedException
throws
ArgumentException
throws
ArgumentTypeException
Return values
BasketItemBase

deleteNoDemand()

public static deleteNoDemand(mixed $idOrder) : Result
Parameters
$idOrder : mixed
Tags
throws
ArgumentException
throws
ArgumentNullException
throws
NotImplementedException
Return values
Result

deleteOld()

public static deleteOld(int $days) : int
Parameters
$days : int
Return values
int

deleteOldAgent()

public static deleteOldAgent(mixed $days[, int $speed = 0 ]) : string
Parameters
$days : mixed
$speed : int = 0
Return values
string

doFinalAction()

public doFinalAction([bool $hasMeaningfulField = false ]) : Result
Parameters
$hasMeaningfulField : bool = false
Return values
Result

getBasePrice()

Getting basket price without discounts

public getBasePrice() : float
Tags
throws
ArgumentNullException
Return values
float

getBasketItems()

public getBasketItems() : array<string|int, mixed>
Return values
array<string|int, mixed>

getContext()

public getContext() : array<string|int, mixed>
Tags
throws
ArgumentException
throws
LoaderException
Return values
array<string|int, mixed>

getExistsItem()

public getExistsItem(mixed $moduleId, mixed $productId[, array<string|int, mixed> $properties = array() ]) : BasketItem|null

the basket can contain duplicate items. Use method getExistsItems

Get first basket item for need moduleId, productId and properties

Parameters
$moduleId : mixed
$productId : mixed
$properties : array<string|int, mixed> = array()
Tags
throws
NotImplementedException
throws
ArgumentException
throws
ArgumentNullException
Return values
BasketItem|null

getExistsItems()

Get all basket items for need moduleId, productId and properties.

public getExistsItems(string $moduleId, int $productId[, array<string|int, mixed>|null $properties = [] ]) : array<string|int, BasketItem>
Parameters
$moduleId : string
$productId : int
$properties : array<string|int, mixed>|null = []

if NULL - skips checking properties, even if they are setted in the parameters and/or the basket item.

Return values
array<string|int, BasketItem>

getFUserId()

Getting Customer ID

public getFUserId([bool $skipCreate = false ]) : int|null
Parameters
$skipCreate : bool = false
  • Creating a buyer if it is not found
Return values
int|null

getIndexById()

public getIndexById(mixed $id) : bool|int|null
Parameters
$id : mixed
Tags
throws
ArgumentNullException
Return values
bool|int|null

getItemByBasketCode()

public getItemByBasketCode(mixed $code) : BasketItemBase|null
Parameters
$code : mixed
Tags
throws
ArgumentNullException
throws
ArgumentNullException
Return values
BasketItemBase|null

getIterator()

public getIterator() : ArrayIterator
Return values
ArrayIterator

getList()

public static getList([array<string|int, mixed> $parameters = array() ]) : Result|mixed
Parameters
$parameters : array<string|int, mixed> = array()
Tags
throws
ArgumentException
Return values
Result|mixed

getListOfFormatText()

public getListOfFormatText() : array<string|int, mixed>|bool
Tags
throws
ArgumentException
throws
ArgumentNullException
throws
NotImplementedException
Return values
array<string|int, mixed>|bool

getPrice()

Getting basket price with discounts and taxes

public getPrice() : float
Tags
throws
ArgumentNullException
Return values
float

getQuantityList()

Getting a list of a count of elements in the basket

public getQuantityList() : array<string|int, mixed>
Tags
throws
ArgumentNullException
Return values
array<string|int, mixed>

getRegistryType()

public static getRegistryType() : string
Return values
string

getSiteId()

Getting Site ID

public getSiteId() : string
Return values
string

getVatRate()

Getting the value of the tax rate basket

public getVatRate() : float
Tags
throws
ArgumentNullException
Return values
float

getVatSum()

Getting the value of the tax basket

public getVatSum() : float
Tags
throws
ArgumentNullException
Return values
float

getWeight()

Getting the weight basket

public getWeight() : int
Return values
int

hasMeaningfulField()

public hasMeaningfulField() : bool
Return values
bool

isEmpty()

Checks if collection is empty.

public isEmpty() : bool
Return values
bool

isSaveRunning()

public isSaveRunning() : bool
Return values
bool

isStartField()

public isStartField([bool $isMeaningfulField = false ]) : bool
Parameters
$isMeaningfulField : bool = false
Return values
bool

key()

Return the key of the current element

public key() : mixed

loadFromArray()

public loadFromArray(array<string|int, mixed> $itemList) : mixed
Parameters
$itemList : array<string|int, mixed>

loadItemsForFUser()

public static loadItemsForFUser(mixed $fUserId, mixed $siteId) : BasketBase
Parameters
$fUserId : mixed
$siteId : mixed
Tags
throws
ArgumentException
throws
ArgumentTypeException
throws
NotImplementedException
Return values
BasketBase

offsetExists()

Whether a offset exists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

Offset to retrieve

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Attributes
#[ReturnTypeWillChange]

offsetSet()

Offset to set

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

Offset to unset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

onItemModify()

public onItemModify(CollectableEntity $item[, null $name = null ][, null $oldValue = null ][, null $value = null ]) : Result
Parameters
$item : CollectableEntity
$name : null = null
$oldValue : null = null
$value : null = null
Tags
throws
ArgumentTypeException
Return values
Result

refresh()

public refresh([RefreshStrategy|null $strategy = null ]) : Result
Parameters
$strategy : RefreshStrategy|null = null
Return values
Result

refreshData()

public refreshData([array<string|int, mixed> $select = array() ][, BasketItemBase|null $refreshItem = null ]) : Result

Use \Bitrix\Sale\BasketBase::refresh instead

Parameters
$select : array<string|int, mixed> = array()
$refreshItem : BasketItemBase|null = null
Tags
throws
ArgumentNullException
Return values
Result

rewind()

Rewind the Iterator to the first element

public rewind() : mixed

save()

Save basket

public save() : Result
Return values
Result

setFUserId()

Setting Customer ID to basket

public setFUserId(mixed $fUserId) : mixed
Parameters
$fUserId : mixed
  • customer ID

setMathActionOnly()

public setMathActionOnly([bool|false $value = false ]) : bool
Parameters
$value : bool|false = false
Return values
bool

setOrder()

Attach to the essence of the object of the order basket

public setOrder(OrderBase $order) : mixed
Parameters
$order : OrderBase
  • object of the order

valid()

Checks if current position is valid

public valid() : mixed

verify()

public verify() : Result
Tags
throws
ArgumentException
throws
NotImplementedException
throws
ObjectNotFoundException
Return values
Result

        
On this page

Search results