source/Core/Session.php
public function getBasket()
    {
        if ($this->_oBasket === null) {
            $serializedBasket = $this->getVariable($this->_getBasketName());

            //init oxbasketitem class first
            //#1746
            oxNew(BasketItem::class);

            // init oxbasket through oxNew and not oxAutoload, Mantis-Bug #0004262
            $emptyBasket = oxNew(Basket::class);

            $basket =
                $this->isSerializedBasketValid($serializedBasket) &&
                ($unserializedBasket = unserialize($serializedBasket)) &&
                $this->isUnserializedBasketValid($unserializedBasket, $emptyBasket) ?
                    $unserializedBasket : $emptyBasket;

            $this->_validateBasket($basket);
            $this->setBasket($basket);
        }

        return $this->_oBasket;
    }
public function getBasket()
    {
        if ($this->_oBasket === null) {
            $serializedBasket = $this->getVariable($this->_getBasketName());

            //init oxbasketitem class first
            //#1746
            oxNew(BasketItem::class);

            // init oxbasket through oxNew and not oxAutoload, Mantis-Bug #0004262
            $emptyBasket = oxNew(Basket::class);

            $basket =
                $this->isSerializedBasketValid($serializedBasket) &&
                ($unserializedBasket = unserialize($serializedBasket)) &&
                $this->isUnserializedBasketValid($unserializedBasket, $emptyBasket) ?
                    $unserializedBasket : $emptyBasket;

            $this->_validateBasket($basket);
            $this->setBasket($basket);
        }

        return $this->_oBasket;
    }
public function getBasket ( ) { if ( $ this -> _oBasket === null ) { $ serializedBasket = $ this -> getVariable ( $ this -> _getBasketName ( ) ) ; //init oxbasketitem class first //#1746 oxNew ( BasketItem :: class ) ; // init oxbasket through oxNew and not oxAutoload, Mantis-Bug #0004262 $ emptyBasket = oxNew ( Basket :: class ) ; $ basket = $ this -> isSerializedBasketValid ( $ serializedBasket ) && ( $ unserializedBasket = unserialize ( $ serializedBasket ) ) && $ this -> isUnserializedBasketValid ( $ unserializedBasket , $ emptyBasket ) ? $ unserializedBasket : $ emptyBasket ; $ this -> _validateBasket ( $ basket ) ; $ this -> setBasket ( $ basket ) ; } return $ this -> _oBasket ; }
Returns basket session object.

@return \OxidEsales\Eshop\Application\Model\Basket
Returns basket session object .