getProductNavigation example

$categoryId = (int) $this->Request()->get('categoryId');
            if (!$categoryId) {
                throw new InvalidArgumentException('Argument categoryId missing');
            }

            if (!$this->Request()->has('sSort')) {
                $default = $this->container->get(Shopware_Components_Config::class)->get('defaultListingSorting');
                $this->Request()->setParam('sSort', $default);
            }

            $navigation = $this->container->get('modules')->Articles()->getProductNavigation($orderNumber$categoryId$this->Request());

            $linkRewriter = function D$link) {
                return $this->container->get('modules')->Core()->sRewriteLink($link);
            };

            if (isset($navigation['previousProduct'])) {
                $navigation['previousProduct']['href'] = $linkRewriter($navigation['previousProduct']['link']);
            }

            if (isset($navigation['nextProduct'])) {
                $navigation['nextProduct']['href'] = $linkRewriter($navigation['nextProduct']['link']);
            }
Home | Imprint | This part of the site doesn't use cookies.