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
clearStartField()
public
clearStartField() : bool
Return values
boolcount()
Count elements of an object
public
count() : int
Return values
intcreate()
public
static create(mixed $siteId) : BasketBase
Parameters
- $siteId : mixed
Tags
Return values
BasketBasecreateItem()
public
createItem(mixed $moduleId, mixed $productId[, null $basketCode = null ]) : BasketItemBase
Parameters
- $moduleId : mixed
- $productId : mixed
- $basketCode : null = null
Tags
Return values
BasketItemBasecurrent()
Return the current element
public
current() : mixed
deleteNoDemand()
public
static deleteNoDemand(mixed $idOrder) : Result
Parameters
- $idOrder : mixed
Tags
Return values
ResultdeleteOld()
public
static deleteOld(int $days) : int
Parameters
- $days : int
Return values
intdeleteOldAgent()
public
static deleteOldAgent(mixed $days[, int $speed = 0 ]) : string
Parameters
- $days : mixed
- $speed : int = 0
Return values
stringdoFinalAction()
public
doFinalAction([bool $hasMeaningfulField = false ]) : Result
Parameters
- $hasMeaningfulField : bool = false
Return values
ResultgetBasePrice()
Getting basket price without discounts
public
getBasePrice() : float
Tags
Return values
floatgetBasket()
public
getBasket() : BasketBase
Return values
BasketBasegetBasketItems()
public
getBasketItems() : array<string|int, mixed>
Return values
array<string|int, mixed>getContext()
public
getContext() : array<string|int, mixed>
Tags
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
Return values
BasketItem|nullgetExistsItemByItem()
public
getExistsItemByItem(BasketItemBase $item) : BasketItemBase|null
the basket can contain duplicate items
Parameters
- $item : BasketItemBase
Tags
Return values
BasketItemBase|nullgetExistsItems()
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|nullgetIndexById()
public
getIndexById(mixed $id) : bool|int|null
Parameters
- $id : mixed
Tags
Return values
bool|int|nullgetItemByBasketCode()
public
getItemByBasketCode(mixed $code) : BasketItemBase|null
Parameters
- $code : mixed
Tags
Return values
BasketItemBase|nullgetItemById()
public
getItemById(mixed $id) : BasketItemBase|null
Parameters
- $id : mixed
Tags
Return values
BasketItemBase|nullgetItemByIndex()
public
getItemByIndex(mixed $index) : CollectableEntity|null
Parameters
- $index : mixed
Tags
Return values
CollectableEntity|nullgetItemByXmlId()
public
getItemByXmlId(mixed $xmlId) : BasketItemBase|null
Parameters
- $xmlId : mixed
Tags
Return values
BasketItemBase|nullgetIterator()
public
getIterator() : ArrayIterator
Return values
ArrayIteratorgetList()
public
static getList([array<string|int, mixed> $parameters = array() ]) : Result|mixed
Parameters
- $parameters : array<string|int, mixed> = array()
Tags
Return values
Result|mixedgetListOfFormatText()
public
getListOfFormatText() : array<string|int, mixed>|bool
Tags
Return values
array<string|int, mixed>|boolgetOrder()
Getting the object of the order
public
getOrder() : OrderBase|null
Return values
OrderBase|nullgetOrderableItems()
public
getOrderableItems() : BasketBase
Tags
Return values
BasketBasegetOrderId()
public
getOrderId() : int
Return values
intgetPrice()
Getting basket price with discounts and taxes
public
getPrice() : float
Tags
Return values
floatgetQuantityList()
Getting a list of a count of elements in the basket
public
getQuantityList() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>getRegistryType()
public
static getRegistryType() : string
Return values
stringgetSiteId()
Getting Site ID
public
getSiteId() : string
Return values
stringgetVatRate()
Getting the value of the tax rate basket
public
getVatRate() : float
Tags
Return values
floatgetVatSum()
Getting the value of the tax basket
public
getVatSum() : float
Tags
Return values
floatgetWeight()
Getting the weight basket
public
getWeight() : int
Return values
inthasMeaningfulField()
public
hasMeaningfulField() : bool
Return values
boolisAnyItemAdded()
public
isAnyItemAdded() : bool
Return values
boolisAnyItemDeleted()
public
isAnyItemDeleted() : bool
Return values
boolisChanged()
public
isChanged() : bool
Return values
boolisClone()
public
isClone() : bool
Return values
boolisEmpty()
Checks if collection is empty.
public
isEmpty() : bool
Return values
boolisMathActionOnly()
public
isMathActionOnly() : bool
Return values
boolisSaveRunning()
public
isSaveRunning() : bool
Return values
boolisStartField()
public
isStartField([bool $isMeaningfulField = false ]) : bool
Parameters
- $isMeaningfulField : bool = false
Return values
boolkey()
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
Return values
BasketBasenext()
Move forward to next element
public
next() : mixed
offsetExists()
Whether a offset exists
public
offsetExists(mixed $offset) : bool
Parameters
- $offset : mixed
Return values
booloffsetGet()
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
Return values
Resultrefresh()
public
refresh([RefreshStrategy|null $strategy = null ]) : Result
Parameters
- $strategy : RefreshStrategy|null = null
Return values
ResultrefreshData()
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
Return values
Resultrewind()
Rewind the Iterator to the first element
public
rewind() : mixed
save()
Save basket
public
save() : Result
Return values
ResultsetFUserId()
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
boolsetOrder()
Attach to the essence of the object of the order basket
public
setOrder(OrderBase $order) : mixed
Parameters
- $order : OrderBase
-
- object of the order
toArray()
public
toArray() : mixed
valid()
Checks if current position is valid
public
valid() : mixed
verify()
public
verify() : Result