Init
CSaleBasket::Init();
The method Init initialises the internal ID of the basket owner. Upon
initialisation, the internal ID can be accessed via the session variable: $_SESSION["SALE_USER_ID"]
.
The internal ID must be initialised prior to its use. Wrapper functions (e.g. GetBasketList) automatically initialises the internal ID of the basket owner.
The system ignores repeated attempts to re-initialise the internal ID of the basket owner.
Example
<? // Obtain the content of the current user basket on the current site // (the GetBasketList function performs the full initialisation, // including the basket actualization) CSaleBasket::Init(); $db_res = CSaleBasket::GetList(($b=""), ($o=""), array("FUSER_ID"=>$_SESSION["SALE_USER_ID"], "LID"=>SITE_ID, "ORDER_ID"=>"NULL")); ?>
© «Bitrix24», 2001-2024