Get the cart from the session

@return \Thelia\Model\Cart|null
482299
protected function getCart()
    {
        if (null === $this->cart) {
            $this->cart = $this->getSession() ? $this->getSession()->getSessionCart($this->dispatcher) : null;
        }

        return $this->cart;
    }
1093481
public function getSession()
    {
        if (is_null($this->_session)) {
            $this->_session = $this->getContainer()->get('session');
        }
        return $this->_session;
    }
548660
public function Get()
    {
        $filename = $this->GetPathToFile();
        if (!file_exists($filename)) {
            return null;
        }
        
        $data = file_get_contents($filename);
        if ($data === false) {
            return null;
        }
        
        $serialized = str_replace($this->_prefixContent, '', $data);
        return unserialize($serialized);
    }
1350041
public function getOrder()
    {
        if ($this->oxorderarticles__oxorderid->value) {
            // checking if the object already exists in the cache
            if (isset($this->_aOrderCache[$this->oxorderarticles__oxorderid->value])) {
                // returning the cached object
                return $this->_aOrderCache[$this->oxorderarticles__oxorderid->value];
            }
            // creatina new order object and trying to load it
            $oOrder = oxNew(\OxidEsales\Eshop\Application\Model\Order::class);
            if ($oOrder->load($this->oxorderarticles__oxorderid->value)) {
                return $this->_aOrderCache[$this->oxorderarticles__oxorderid->value] = $oOrder;
            }
        }

        return null;
    }
1261978
protected function getOrderCollection()
    {
        $session = $this->getRequest()->getSession();

        $orderCollection = $this->getRepo('OrderCollection')
            ->find($session->get('cart_id'));

        return $orderCollection;
    }
599287
public function getSession()
    {
        if ($this->_oSessionObject === null) {
            $this->_oSessionObject = oxRegistry::getSession();
        }

        return $this->_oSessionObject;
    }
405707
public function delivery()
    {
        $cart = ShoppingCart::get();
        
        // If we are using simple checkout, skip
        if (Checkout::config()->simple_checkout) {
            return $this->redirect($this->Link('finish'));
        }
            
        // If customer is collecting, skip
        if ($cart->isCollection()) {
            return $this->redirect($this->Link('finish'));
        }
            
        // If cart is not deliverable, also skip
        if (!$cart->isDeliverable()) {
            return $this->redirect($this->Link('finish'));
        }
        
        // Check permissions for guest checkout
        if (!Member::currentUserID() && !Checkout::config()->guest_checkout) {
            return $this->redirect($this->Link('index'));
        }
        
        $this->customise(array(
            'Title'     => _t('Checkout.DeliveryDetails', "Delivery Details"),
            'Form'      => $this->DeliveryForm()
        ));

        $this->extend("onBeforeDelivery");

        return $this->renderWith(array(
            'Checkout_delivery',
            'Checkout',
            'Page'
        ));
    }
747157
protected function getCustomer()
    {
        if (null === $this->customer) {
            $this->customer = $this->getSession() ? $this->getSession()->getCustomerUser() : null;
        }

        return $this->customer;
    }
116204
public function getItemsPerPageSession()
    {
        $variable = 'search/' . $this->getSessionNamespace() . '/items_per_page';
        if ($this->session->has($variable)) {
            return (int) $this->session->get($variable);
        }

        return null;
    }
252325
public static function get()
    {
        $db = Database::connection();
        $treeID = $db->fetchColumn('select Trees.treeID from TreeTypes inner join Trees on TreeTypes.treeTypeID = Trees.treeTypeID where TreeTypes.treeTypeHandle = ?', ['file_manager']);

        return $treeID ? Tree::getByID($treeID) : null;
    }
584981
public function get_active_controller() {
        if ($gradingmethod = $this->get_active_method()) {
            $controller = $this->get_controller($gradingmethod);
            if ($controller->is_form_available()) {
                return $controller;
            }
        }
        return null;
    }
198545
public function delete()
    {
        $cookies = $this->cookiesSupported();
        $cart = $this->getCurrent();

        // Only delete the cart if it has been written to the DB
        if ($cart->exists()) {
            $cart->delete();
        }

        if ($cookies) {
            Cookie::force_expiry(self::COOKIE_NAME);
        } else {
            $this->getSession()->clear(self::COOKIE_NAME);
        }

        return $this;
    }
770178
public function getLegend()
    {
        return (isset($this->fieldsets[$this->current])) ?
            $this->fieldsets[$this->current]->getLegend() : null;
    }
593309
protected function getCart()
    {
        $cart = $this->session->get($this->name);

        return $cart instanceof Collection ? $cart : new Collection();
    }
1012384
public function getNavigation()
    {
        if ( empty( $this->menuId ) )
        {
            return null;
        }

        return $this->getMenuModel()
                    ->findNavigation( $this->menuId );
    }
1286159
protected function getStore()
    {
        $store = null;
        if($this->hasOption(self::STORE_OPT)){
            $store = $this->getOption(self::STORE_OPT);
        }
        return $store;
    }
1023768
public function getItemsPerPage()
    {
        $query = $this->getSessionCurrentQuery();
        if ($query) {
            return $query->getItemsPerPage();
        } else {
            return $this->entity->getItemsPerPage();
        }
    }