convertShopPageStructList example


        $data = $shopPage->jsonSerialize();

        $data += [
            'attributes' => $shopPage->getAttributes(),
        ];

        if ($shopPage->hasAttribute('core')) {
            $data['attribute'] = $shopPage->getAttribute('core')->jsonSerialize();
        }

        $data['children'] = $this->convertShopPageStructList($shopPage->getChildren());
        $data['parentID'] = $shopPage->getParentId();

        return $data;
    }

    /** * @param ShopPage[] $shopPages * * @return array */
    public function convertShopPageStructList(array $shopPages)
    {
/** * @return void */
    public function getCustomPageAction()
    {
        $shopPageGateway = $this->container->get('shopware_storefront.shop_page_service');
        $list = $shopPageGateway->getList(
            [(int) $this->Request()->getParam('pageId', 0)],
            $this->container->get(ContextServiceInterface::class)->getShopContext()
        );

        $list = $this->container->get(LegacyStructConverter::class)->convertShopPageStructList($list);
        $page = current($list);

        $this->View()->assign('customPage', [
            'parent' => $page,
            'children' => $page['children'],
        ]);
    }

    /** * Helper function to return the category information by category id * * @return array<string, mixed> */
Home | Imprint | This part of the site doesn't use cookies.