sCountNotes example

/** * Pre dispatch method */
    public function preDispatch()
    {
        $this->View()->setScope(Enlight_Template_Manager::SCOPE_PARENT);
        $this->View()->assign('userInfo', $this->get('shopware_account.store_front_greeting_service')->fetch());
    }

    public function postDispatch()
    {
        Shopware()->Session()->set('sNotesQuantity', Shopware()->Modules()->Basket()->sCountNotes());
    }

    /** * @return void */
    public function indexAction()
    {
        $view = $this->View();
        $view->assign('sNotes', Shopware()->Modules()->Basket()->sGetNotes());
        $view->assign('sUserLoggedIn', Shopware()->Modules()->Admin()->sCheckUser());
        $view->assign('sOneTimeAccount', Shopware()->Session()->offsetGet('sOneTimeAccount'));
    }
$this->session = Shopware()->Session();
        $this->Response()->setHeader('x-robots-tag', 'noindex');
    }

    public function infoAction()
    {
        $view = $this->View();

        $view->assign('userInfo', $this->get('shopware_account.store_front_greeting_service')->fetch());
        $view->assign('sBasketQuantity', isset($this->session->sBasketQuantity) ? $this->session->sBasketQuantity : 0);
        $view->assign('sBasketAmount', isset($this->session->sBasketAmount) ? $this->session->sBasketAmount : 0);
        $view->assign('sNotesQuantity', isset($this->session->sNotesQuantity) ? $this->session->sNotesQuantity : $this->module->sCountNotes());
        $view->assign('sUserLoggedIn', !empty(Shopware()->Session()->get('sUserId')));
        $view->assign('sOneTimeAccount', $this->session->sOneTimeAccount);
    }
}
'uniqueId' => $uniqueId,
                ]
            );

            // destroy cookie             $this->front->Response()->setCookie('sUniqueID');
        }

        $this->session->offsetSet('sUserMail', $email);
        $this->session->offsetSet('sUserPasswordChangeDate', $getUser['password_change_date']);
        $this->session->offsetSet('sUserId', $userId);
        $this->session->offsetSet('sNotesQuantity', $this->moduleManager->Basket()->sCountNotes());

        $this->csrfTokenValidator->clearExistingCookie();

        if (!$this->sCheckUser()) {
            return;
        }

        if ($this->config->get('migrateCartAfterLogin')) {
            Shopware()->Container()->get('shopware.components.cart.cart_migration')->migrate();
        }
    }

    
Home | Imprint | This part of the site doesn't use cookies.