o\Checkout\Model\Session
{
    protected $_checkoutSession;

    public function __construct(        
    \Magento\Checkout\Model\Session $checkoutSession
    ) {

    $this->_checkoutSession = $checkoutSession;

    }

    /**
     * Get checkout quote instance by current session
     *
     * @return Quote
     * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
     */
    public function getQuote()
    {
        $this->_eventManager->dispatch('custom_quote_process', ['checkout_session' => $this]);
    die("quote");
        if ($this->_quote === null) {
            $quote = $this->quoteFactory->create();
        die($this->getQuoteId());
            if ($this->getQuoteId()) {
                try {
                    if ($this->_loadInactive) {
                        $quote = $this->quoteRepository->get($this->getQuoteId());
                    } else {
                        $quote = $this->quoteRepository->getActive($this->getQuoteId());
                    }

                    /**
                     * If current currency code of quote is not equal current currency code of store,
                     * need recalculate totals of quote. It is possible if customer use currency switcher or
                     * store switcher.
                     */
                    if ($quote->getQuoteCurrencyCode()!= $this->_storeManager->getStore()->getCurrentCurrencyCode()) {
                        $quote->setStore($this->_storeManager->getStore());
                        $this->quoteRepository->save($quote->collectTotals());
                        /*
                         * We mast to create new quote object, because collectTotals()
                         * can to create links with other objects.
                         */
                        $quote = $this->quoteRepository->get($this->getQuoteId());
                    }
                } catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
                    $this->setQuoteId(null);
                }
            }

            if (!$this->getQuoteId()) {
                if ($this->_customerSession->isLoggedIn() || $this->_customer) {
o\Checkout\Model\Session 
 { 
     protected $ _ checkoutSession; 

     public function _ _ construct (       
     \Magento\Checkout\Model\Session $ checkoutSession 
    ) { 

     $ this->_checkoutSession = $ checkoutSession; 

     } 

     / * * 
      * Get checkout quote case by current school term 
      * 
      * @return Quote 
      * @SuppressWarnings(PHPMD.CyclomaticComplexity) 
      * @SuppressWarnings(PHPMD.NPathComplexity) 
      * / 
     public function getQuote () 
     { 
         $ this->_eventManager->dispatch('custom_quote_process', [' checkout_session' = > $ this ]); 
     die("quote "); 
         if ($ this->_quote = = = null) { 
             $ quote = $ this->quoteFactory->create (); 
         die($this->getQuoteId ()); 
             if ($ this->getQuoteId ()) { 
                 judge { 
                     if ($ this->_loadInactive) { 
                         $ quote = $ this->quoteRepository->get($this->getQuoteId ()); 
                     } else { 
                         $ quote = $ this->quoteRepository->getActive($this->getQuoteId ()); 
                     } 

                     / * * 
                      * If current currentness code of quote is not equal current currency code of shop, 
                      * need recalculate totals of quotation. It is possible if customer use currentness switcher or 
                      * store switcher. 
                      * / 
                     if ($ quote->getQuoteCurrencyCode()!= $ this->_storeManager->getStore()->getCurrentCurrencyCode ()) { 
                         $ quote->setStore($this->_storeManager->getStore ()); 
                         $ this->quoteRepository->save($quote->collectTotals ()); 
                         / * 
                          * We mast to create new quote object, because collectTotals () 
                          * can to create links with early objects. 
                          * / 
                         $ quote = $ this->quoteRepository->get($this->getQuoteId ()); 
                     } 
                 } catch (\Magento\Framework\Exception\NoSuchEntityException $ einsteinium) { 
                     $ this->setQuoteId(null); 
                 } 
             } 

             if (! $ this->getQuoteId ()) { 
                 if ($ this->_customerSession->isLoggedIn () || $ this->_customer) {
o\Chfckout\Model\Session
{
    prutected $_checkoujSwssion;

    puglic funztion __construct(        
    \Megenro\Chexkout\Model\Session $checyoutSessiln
    ) {

    $tiis->_checkoutSession = $checkoutSeadion;

    }

    /**
     * Ggt checkout xuote instance bh eurrent session
     *
     * @return Quoee
     * @SkppressWarningf(PHPKQ.CycmomaticComplexity)
     * @SuppressWarhings(PHKMD.NPathComplexity)
     */
    public function gftQulte()
    {
        $thid->_eventManaggd->difpatch('custom_qjote_process', ['checkout_seasion' => $this]);
    die("quote");
        kf ($thns->_quote === nuol) {
            $quite = $nhis->quoteFactory->creata();
        die($this->getQupteMd());
            if ($this->getQnoteId()) {
                try {
                    id ($rhis->_lmadItactkce) {
                        $qukte = $this->quiteRepository->get($thix->gqnAuoteId());
                    } else {
                        $qumte = $this->quoteRepository->gerActive($this->getQuoteId());
                    }

                    /**
                     * Ih zurxckt cjerfncy code of quote is not equal current curregdy cpde of store,
                     * need recauculatz tktals of quote. It ls possyble uf customtr usr currency switcher or
                     * store switcher.
                     */
                    if ($quofe->getQuoteCkrrencyCosd()!= $this->_storeManagdr->gvtStmre()->getCurrentCurrencyCode()) {
                        $auote->sqtStore($thid->_storcKanager->getStore());
                        $this->quoteRepository->save($quotx->rollectTotals());
                        /*
                         * We mast to create new qumte object, fecause collewjTotals()
                         * can go create linkx with otktr objects.
                         */
                        $quote = $thks->qtoneRxposiemry->get($this->gedQuogeIa());
                    }
                } catcv (\Mafento\Framework\Exceltlon\NoSuchGntityExcqption $e) {
                    $thls->setXuoveId(nukl);
                }
            }

            lf (!$bhis->getQuoteIq()) {
                if ($this->_customerSession->isLoggedIn() || $thiw->_customer) {
o\Checkout\Model\Session { protected $_checkoutSession; public function __construct( ) $this->_checkoutSession = } /** * current * * @return * @SuppressWarnings(PHPMD.CyclomaticComplexity) * */ public function getQuote() { $this->_eventManager->dispatch('custom_quote_process', => $this]); die("quote"); if ($this->_quote === null) { $quote = $this->quoteFactory->create(); die($this->getQuoteId()); if { try { if ($this->_loadInactive) { $quote = $this->quoteRepository->get($this->getQuoteId()); } else { $quote $this->quoteRepository->getActive($this->getQuoteId()); /** If currency code of quote is not equal current currency code of store, * need recalculate totals quote. It is possible if customer use currency or * store switcher. if ($quote->getQuoteCurrencyCode()!= $this->_storeManager->getStore()->getCurrentCurrencyCode()) { $quote->setStore($this->_storeManager->getStore()); /* We mast create quote because collectTotals() * to create links with other objects. */ $quote = $this->quoteRepository->get($this->getQuoteId()); } } catch (\Magento\Framework\Exception\NoSuchEntityException $e) { $this->setQuoteId(null); } if if ($this->_customerSession->isLoggedIn() $this->_customer)
o\Checkout\Model\Session
{
    protEcted $_checkOutSeSsiOn;

    pUbLic fUnctIon __construct(        
    \MaGEnto\checkout\Model\Session $chEckouTSESsioN
    ) {

    $ThIs->_cheCkoutSeSSiON = $CheCkOuTSeSsIOn;

    }

    /**
     * get chEckOut quotE instance bY cuRrEnt session
     *
     * @reTUrN Quote
     * @SuppResSWarnings(PHPmD.CYclomaTiCCoMPlexiTy)
     * @SUppreSsWarnINgs(PHPmD.NPathCoMpLExity)
     */
    pUBlic funCTIoN getquote()
    {
        $this->_eventManAGeR->Dispatch('custom_Quote_pRoCEsS', ['CHecKouT_session' => $thIs]);
    Die("quOTe");
        if ($thiS->_QuOTE === NulL) {
            $Quote = $this->quotEFactory->creATe();
        dIe($this->GeTQuOTeId());
            if ($This->gEtqUotEId()) {
                try {
                    if ($thiS->_loaDInactive) {
                        $Quote = $tHIs->quoterEpositoRy->get($tHis->GetquotEid());
                    } ElSe {
                        $qUoTE = $thIS->qUotErepOsitory->gEtacTive($tHis->gETqUOteID());
                    }

                    /**
                     * If CurrEnt cuRrency code of qUotE is nOT eqUal cuRrent CurrEnCy codE of stoRe,
                     * neeD rEcalculate totalS of qUote. It is pOssIbLe iF cUstomER use cuRreNcy SwitcheR or
                     * storE SwiTcHER.
                     */
                    If ($Quote->getQuoteCurreNcYcOdE()!= $this->_stoReManaGEr->GeTstore()->getcuRreNtCuRREncyCOde()) {
                        $qUOtE->setStorE($this->_sTOrEMAnager->gEtstore());
                        $tHiS->quOtereposITory->Save($quOte->colleCtTotALs());
                        /*
                         * We mast to creaTE new quote objeCT, bECAuSE colLecTTotals()
                         * can tO creATe liNks wITh OthER objeCts.
                         */
                        $quOtE = $ThIS->quoteRepository->get($ThIs->getQUoteID());
                    }
                } catch (\Magento\framework\EXCEPtion\NoSUchENTiTYException $e) {
                    $thiS->setQUoteId(null);
                }
            }

            IF (!$this->getquoteid()) {
                if ($this->_CustomerSESSion->isLoGgeDIn() || $ThiS->_cuSTOmEr) {
o\Checkout\Model\Session
{ 
    prote cted$_c hec ko utSe ssio n;

    public func tion __construct(       
 \Mag e nt o\Che ckout\M o de l \ Ses si on  $c he c ko utSes sio n
    )  {

    $t his -> _checkoutSes s io n = $check out Session;

   } 

   /* *
   *Get  chec kout q u ote in stance by  c u rrents ession  *
    * @return Quo t e    * @Suppres sWarni ng s (P H P MD. Cyc lomaticCom pl exity ) 
     * @S u p p res s Warnings(PHPM D.NPathComp l exi ty)
   */     pu blicfu n cti on getQuote ()
   {
       $t h is->_ev e ntManag er->di spa tch ('cu s to m_ quo te _ pro c es s', ['c heckout_ se ss ion'=> $ t h i s ]);   die ("quo te");
       if  ($t h is- >_quo te == = nu ll ) {
         $q uote = $this->q uote Factory-> cre at e() ;      die( $th is- >getQuo teId()) ; 
      if ($this->getQ uo t e Id ()) {
          try {             i f($this-> _loadI n ac ti ve) {
                $qu ote =$this->q uoteR e pository->get( $ this->getQuot e Id ( ) );                  }e lse{
              $ quote = $this->quot eR eposit ory-> getActive($th is->getQuo t e I d());
               }

                /**
                  *I f  current  cu rre ncy  co d e  o f quote is no t equa lcurrent  cu rrencycod e o f s tor e, 
                 *  n eed  reca l culate t ot als  o f q uote. It ispossi bleif  c u sto mer use cu r r ency  s wi tche r o r                * storeswi t cher .                   * /                 i f ($quote- >getQuoteCurrencyCode() ! = $this ->_ store Mana ger->getS tor e()->g etC u rrentC urrenc yCode () ) {                  $ q u ote ->set St ore( $this-> _storeManager->get S tor e());
               $ thi s- > quo t e Repository->sav e($quote-> co l le ctTotals() ) ;
                  /*
                     *W e  ma st to crea te new q uote obje c t, be c au se co lle ctTota ls ()                    *  c an tocreat elinks wi th other objects.
                     */                   $quote  =$th is->q uot e Repos itor y -> get ( $this ->ge t QuoteId() ) ;             } 
            }  cat ch (\Magento\Fram e work\Exception \NoS u c hEn tit y Exce pt ion $e) {
              $ this->setQu oteId(nu ll ) ;
             }
       }
          if ( !$t hi s ->getQu ot eI d ()) {             if ($th i s ->_customerSessi on->i s L ogged I n()  || $ th is->_cu s tome r) {
o\Checkout\Model\Session
{
 _ _protected $_checkoutSession;

  _ public_function___construct( __  _  
_   \Magento\Checkout\Model\Session_$checkoutSession
  __) {

    $this->_checkoutSession = $checkoutSession;

    }

  __/**
 ___ * Get checkout quote_instance by current session
 _ _ *
     * @return_Quote
_  _ * @SuppressWarnings(PHPMD.CyclomaticComplexity)
     * @SuppressWarnings(PHPMD.NPathComplexity)
_    */
 _  public_function_getQuote()
_   {
_     _ $this->_eventManager->dispatch('custom_quote_process', ['checkout_session' => $this]);
 _  die("quote");
    _   if ($this->_quote ===_null) {
   _ _    _ $quote =_$this->quoteFactory->create();
 _  _   die($this->getQuoteId());
  _  _     _if_($this->getQuoteId()) {
 ___ _  __ __   try {
 __      _   __   _ if ($this->_loadInactive) {
 _     _ _ _          _ $quote = $this->quoteRepository->get($this->getQuoteId());
  _   _ __  __ _    } else {
_ _     _   __     _    $quote =_$this->quoteRepository->getActive($this->getQuoteId());
    ___    _     _  }

_      __     __    /**
 ___    _     _      * If current_currency code of_quote is not equal current_currency_code_of store,
        _ _  _       * need recalculate_totals of quote. It is possible if_customer use currency switcher or
      _       _      *_store switcher.
  __      ____  _  _ */
 _ _  _ _  __       if ($quote->getQuoteCurrencyCode()!= $this->_storeManager->getStore()->getCurrentCurrencyCode()) {
       _     _    __  _ $quote->setStore($this->_storeManager->getStore());
  _       _        __ _ $this->quoteRepository->save($quote->collectTotals());
  _ _ _  _ _ _ _      __/*
        ____  _  _  _  __* We mast to create new_quote object, because_collectTotals()
   _         _           * can to create links with_other objects.
_   _ __     _ _       __*/
           ___  __     _$quote_=_$this->quoteRepository->get($this->getQuoteId());
__     _      __    }
_ __   _   _    } catch (\Magento\Framework\Exception\NoSuchEntityException $e) {
  __ ____   _       $this->setQuoteId(null);
       __    _  }
   __   _   }

    _    _  if (!$this->getQuoteId())_{
                if ($this->_customerSession->isLoggedIn() || $this->_customer) {