moduleDataSetup->getConnection()->startSetup(); $this->saveBlock( 'lts-home-announcement', 'LTS Home - Top Announcement', $this->announcementContent() ); $this->saveBlock( 'lts-home-dealer-pricing', 'LTS Home - Dealer Pricing', $this->dealerPricingContent() ); $this->saveBlock( 'lts-home-product-lines', 'LTS Home - Shop By Product Line', $this->productLinesContent() ); $this->saveBlock( 'lts-home-shop-by-category', 'LTS Home - Shop By Category', $this->shopByCategoryContent() ); $page = $this->pageFactory->create()->getCollection() ->addFieldToFilter('identifier', 'athlete2-home-greece') ->addStoreFilter(0, false) ->setPageSize(1) ->getFirstItem(); if ($page->getId()) { $page->setContent($this->homePageContent()); $page->setPageLayout('1column'); $page->setIsActive(true); $page->save(); } $this->moduleDataSetup->getConnection()->endSetup(); return $this; } private function saveBlock(string $identifier, string $title, string $content): void { $block = $this->blockFactory->create()->getCollection() ->addFieldToFilter('identifier', $identifier) ->setPageSize(1) ->getFirstItem(); if (!$block->getId()) { $block = $this->blockFactory->create(); } $block->setTitle($title) ->setIdentifier($identifier) ->setContent($content) ->setIsActive(true) ->setStores([0]) ->save(); } private function announcementContent(): string { return <<<'HTML'
HTML; } private function dealerPricingContent(): string { return <<<'HTML'Unlock Dealer Pricing, Availability, And Checkout.
Platinum
Our flagship line delivering maximum performance, reliability, and innovation.
Explore ⟶
PRO-X
Advanced solutions for professionals who demand more.
Explore ⟶
DEFENDAS
Integrated security systems for access control and device management.
Explore ⟶