source/Application/Model/UserBasket.php
public function getItem($sProductId, $aSelList, $aPersParams = null)
    {
        // loading basket item list
        $aItems = $this->getItems();
        $sItemKey = $this->_getItemKey($sProductId, $aSelList, $aPersParams);
        $oItem = null;
        // returning existing item
        if (isset($aItems[$sProductId])) {
            $oItem = $aItems[$sProductId];
        } elseif (isset($aItems[$sItemKey])) {
            $oItem = $aItems[$sItemKey];
        } else {
            $oItem = $this->_createItem($sProductId, $aSelList, $aPersParams);
        }

        return $oItem;
    }
public function getItem($sProductId, $aSelList, $aPersParams = null)
    {
        // loading basket item list
        $aItems = $this->getItems();
        $sItemKey = $this->_getItemKey($sProductId, $aSelList, $aPersParams);
        $oItem = null;
        // returning existing item
        if (isset($aItems[$sProductId])) {
            $oItem = $aItems[$sProductId];
        } elseif (isset($aItems[$sItemKey])) {
            $oItem = $aItems[$sItemKey];
        } else {
            $oItem = $this->_createItem($sProductId, $aSelList, $aPersParams);
        }

        return $oItem;
    }
public function getItem ( $ sProductId , $ aSelList , $ aPersParams = null ) { // loading basket item list $ aItems = $ this -> getItems ( ) ; $ sItemKey = $ this -> _getItemKey ( $ sProductId , $ aSelList , $ aPersParams ) ; $ oItem = null ; // returning existing item if ( isset ( $ aItems [ $ sProductId ] ) ) { $ oItem = $ aItems [ $ sProductId ] ; } elseif ( isset ( $ aItems [ $ sItemKey ] ) ) { $ oItem = $ aItems [ $ sItemKey ] ; } else { $ oItem = $ this -> _createItem ( $ sProductId , $ aSelList , $ aPersParams ) ; } return $ oItem ; }
Searches for item in basket items array and returns it. If not item was
found - new item is created.

@param string $sProductId  product id, basket item id or basket item index
@param array  $aSelList    select lists
@param string $aPersParams persistent parameters

@return oxUserBasketItem
Searches for item in basket items array and returns it . If not item was found - new item is created .