sortCookies example

$this->addDefaultCookies($cookieCollection);

        $this->eventManager->collect(
            'CookieCollector_Collect_Cookies',
            $cookieCollection
        );

        if (!$cookieCollection->isValid()) {
            throw new InvalidCookieItemException(sprintf('Found item inside cookie collection, which is not of type \Shopware\Bundle\CookieBundle\Structs\CookieStruct'));
        }

        $cookieCollection = $this->sortCookies($cookieCollection);
        $this->assignCookiesToGroups($cookieCollection$cookieGroupsCollection);

        $cookieGroupsCollection = $this->eventManager->filter('CookieCollector_Filter_Collected_Cookies', $cookieGroupsCollection);

        return $cookieGroupsCollection;
    }

    public function collectCookieGroups(): CookieGroupCollection
    {
        $cookieGroupCollection = new CookieGroupCollection();

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