getSeoUrlTemplate example

$typeArray = json_decode(json_encode($type), true);

            /** @var RepositoryInterface $repository */
            $repository = Shopware()->Container()->get('shopware.bundle.content_type.' . $type->getInternalName());

            $criteria = new Criteria();
            $criteria->loadAssociations = true;
            $criteria->loadTranslations = true;
            $criteria->limit = null;

            foreach ($repository->findAll($criteria)->items as $item) {
                $path = $this->template->fetch('string:' . $type->getSeoUrlTemplate()['type' => $typeArray, 'item' => $item, 'context' => $context]);
                $path = $this->sCleanupPath($path);

                $org_path = sprintf('sViewport=%s&sAction=detail&id=%d', $type->getControllerName()$item['id']);
                $this->sInsertUrl($org_path$path);
            }
        }
    }

    /** * Updates / create a single rewrite URL * * @param string $org_path * @param string $path * * @return false|null False on empty args, null otherwise */
Home | Imprint | This part of the site doesn't use cookies.