ltsecurityinc安防产品在线商城代码
This commit is contained in:
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lts\HomePage\Setup\Patch\Data;
|
||||
|
||||
use Magento\Cms\Model\PageFactory;
|
||||
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
||||
|
||||
class AddResourcesBlockToHomePage implements DataPatchInterface
|
||||
{
|
||||
private const PAGE_IDENTIFIER = 'athlete2-home-greece';
|
||||
private const CATEGORY_BLOCK = '{{block class="Magento\\Cms\\Block\\Block" block_id="lts-home-shop-by-category"}}';
|
||||
private const RESOURCES_BLOCK = '{{block class="Magento\\Cms\\Block\\Block" block_id="lts-home-resources"}}';
|
||||
|
||||
public function __construct(
|
||||
private readonly PageFactory $pageFactory
|
||||
) {
|
||||
}
|
||||
|
||||
public function apply(): self
|
||||
{
|
||||
$page = $this->pageFactory->create()->getCollection()
|
||||
->addFieldToFilter('identifier', self::PAGE_IDENTIFIER)
|
||||
->addStoreFilter(0, false)
|
||||
->setPageSize(1)
|
||||
->getFirstItem();
|
||||
|
||||
if (!$page->getId()) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
$content = (string) $page->getContent();
|
||||
|
||||
if (str_contains($content, self::RESOURCES_BLOCK)) {
|
||||
return $this;
|
||||
}
|
||||
|
||||
if (str_contains($content, self::CATEGORY_BLOCK)) {
|
||||
$content = str_replace(
|
||||
self::CATEGORY_BLOCK,
|
||||
self::CATEGORY_BLOCK . PHP_EOL . ' ' . self::RESOURCES_BLOCK,
|
||||
$content
|
||||
);
|
||||
} else {
|
||||
$feedbackPosition = strpos($content, '<a class="lts-feedback"');
|
||||
|
||||
if ($feedbackPosition === false) {
|
||||
$content .= PHP_EOL . self::RESOURCES_BLOCK;
|
||||
} else {
|
||||
$content = substr($content, 0, $feedbackPosition)
|
||||
. self::RESOURCES_BLOCK
|
||||
. PHP_EOL
|
||||
. ' '
|
||||
. substr($content, $feedbackPosition);
|
||||
}
|
||||
}
|
||||
|
||||
$page->setContent($content)->save();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public static function getDependencies(): array
|
||||
{
|
||||
return [CreateShopByCategoryBlock::class];
|
||||
}
|
||||
|
||||
public function getAliases(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lts\HomePage\Setup\Patch\Data;
|
||||
|
||||
use Magento\Cms\Model\BlockFactory;
|
||||
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
||||
|
||||
class CreateFooterBlocks implements DataPatchInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly BlockFactory $blockFactory
|
||||
) {
|
||||
}
|
||||
|
||||
public function apply(): self
|
||||
{
|
||||
$this->saveBlock(
|
||||
'lts-footer-link-columns',
|
||||
'LTS Footer - Link Columns',
|
||||
$this->getLinkColumnsContent()
|
||||
);
|
||||
$this->saveBlock(
|
||||
'lts-footer-social-app',
|
||||
'LTS Footer - Social And Mobile App',
|
||||
$this->getSocialAppContent()
|
||||
);
|
||||
|
||||
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 getLinkColumnsContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<nav class="lts-footer-links" aria-label="Footer navigation">
|
||||
<div class="lts-footer-links__column">
|
||||
<h2>Support</h2>
|
||||
<a href="{{store url='downloads'}}">Downloads</a>
|
||||
<a href="https://ltsecurityinc.zendesk.com/" target="_blank" rel="noopener">Knowledge Base</a>
|
||||
<a href="{{store url='tools'}}">Tools</a>
|
||||
<a href="https://ns1.dvrlists.com/" target="_blank" rel="noopener">DDNS</a>
|
||||
<a href="{{store url='rma'}}">RMA Form</a>
|
||||
</div>
|
||||
<div class="lts-footer-links__column">
|
||||
<h2>Resources</h2>
|
||||
<a href="{{store url='solutions'}}">Solutions</a>
|
||||
<a href="{{store url='events'}}">Event</a>
|
||||
<a href="{{store url='flyers'}}">Flyers</a>
|
||||
<a href="{{store url='newsletter'}}">Newsletter</a>
|
||||
<a href="{{store url='blog'}}">Blog</a>
|
||||
<a href="https://www.youtube.com/@LTSCCTV/" target="_blank" rel="noopener">Videos</a>
|
||||
<a href="{{store url='customer-testimonials'}}">Customer Testimonials</a>
|
||||
</div>
|
||||
<div class="lts-footer-links__column">
|
||||
<h2>Partners</h2>
|
||||
<a href="{{store url='project-registration'}}">Project Registration</a>
|
||||
<a href="{{store url='technology-partners'}}">Technology Partners</a>
|
||||
<a href="{{store url='international-partners'}}">International Partners</a>
|
||||
</div>
|
||||
<div class="lts-footer-links__column">
|
||||
<h2>Company</h2>
|
||||
<a href="{{store url='about-lts'}}">About LTS</a>
|
||||
<a href="{{store url='contacts'}}">Contact Us</a>
|
||||
</div>
|
||||
<div class="lts-footer-links__column lts-footer-links__column--legal">
|
||||
<h2>Legal & Compliance</h2>
|
||||
<a href="{{store url='sla'}}">Software License Agreement</a>
|
||||
<a href="{{store url='terms-of-use'}}">Terms Of Use</a>
|
||||
<a href="{{store url='privacy-policy'}}">Privacy Policy</a>
|
||||
<a href="{{store url='terms-and-Conditions'}}">Terms And Conditions</a>
|
||||
</div>
|
||||
</nav>
|
||||
HTML;
|
||||
}
|
||||
|
||||
private function getSocialAppContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<div class="lts-footer-app-block">
|
||||
<div class="lts-footer-app-block__download">
|
||||
<p>Download<br>The LTS<br>Mobile App</p>
|
||||
<a href="https://ltsecurityinc.com/" target="_blank" rel="noopener" aria-label="Open LTS website">
|
||||
<img src="{{view url='Magento_Theme::images/lts-footer/mobile-app-qr.png'}}" alt="QR code for the LTS website">
|
||||
</a>
|
||||
</div>
|
||||
<div class="lts-footer-phone" aria-hidden="true">
|
||||
<span class="lts-footer-phone__speaker"></span>
|
||||
<span class="lts-footer-phone__screen">
|
||||
<img src="{{view url='Magento_Theme::images/lts-home-v2/pro-x.png'}}" alt="">
|
||||
</span>
|
||||
</div>
|
||||
<div class="lts-footer-social" aria-label="LTS social media">
|
||||
<a href="https://www.facebook.com/CCTV.LTS/" target="_blank" rel="noopener" aria-label="Facebook"><svg viewBox="0 0 28 28" aria-hidden="true"><rect x="1" y="1" width="26" height="26" rx="3"></rect><path d="M16 25V15h3.3l.5-4H16V8.5c0-1.2.4-2 2-2h2.1V3a28 28 0 0 0-3.1-.2c-3.1 0-5.2 1.9-5.2 5.4V11H8.3v4h3.5v10"></path></svg></a>
|
||||
<a href="https://www.instagram.com/ltsecurityinc/" target="_blank" rel="noopener" aria-label="Instagram"><svg viewBox="0 0 28 28" aria-hidden="true"><rect x="1" y="1" width="26" height="26" rx="3"></rect><rect x="6" y="6" width="16" height="16" rx="5"></rect><circle cx="14" cy="14" r="4"></circle><circle cx="19.5" cy="8.7" r="1"></circle></svg></a>
|
||||
<a href="https://twitter.com/LTSecurityinc" target="_blank" rel="noopener" aria-label="X"><svg viewBox="0 0 28 28" aria-hidden="true"><rect x="1" y="1" width="26" height="26" rx="3"></rect><path d="M7 6l14 16M21 6 7 22"></path></svg></a>
|
||||
<a href="https://www.youtube.com/@LTSCCTV/" target="_blank" rel="noopener" aria-label="YouTube"><svg viewBox="0 0 28 28" aria-hidden="true"><rect x="1" y="1" width="26" height="26" rx="3"></rect><rect x="5" y="8" width="18" height="12" rx="3"></rect><path d="m12 11 6 3-6 3z"></path></svg></a>
|
||||
<a href="https://www.linkedin.com/company/ltsecurityinc/" target="_blank" rel="noopener" aria-label="LinkedIn"><svg viewBox="0 0 28 28" aria-hidden="true"><rect x="1" y="1" width="26" height="26" rx="3"></rect><circle cx="8.5" cy="9" r="1.4"></circle><path d="M7 12v9M12 21v-9m0 4c0-2.5 1.5-4 3.8-4 2.8 0 4.2 1.8 4.2 5v4"></path></svg></a>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
public static function getDependencies(): array
|
||||
{
|
||||
return [CreateShopByCategoryBlock::class];
|
||||
}
|
||||
|
||||
public function getAliases(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lts\HomePage\Setup\Patch\Data;
|
||||
|
||||
use Magento\Cms\Model\BlockFactory;
|
||||
use Magento\Cms\Model\PageFactory;
|
||||
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
||||
|
||||
class CreateShopByCategoryBlock implements DataPatchInterface
|
||||
{
|
||||
private const BLOCK_IDENTIFIER = 'lts-home-shop-by-category';
|
||||
|
||||
public function __construct(
|
||||
private readonly BlockFactory $blockFactory,
|
||||
private readonly PageFactory $pageFactory
|
||||
) {
|
||||
}
|
||||
|
||||
public function apply(): self
|
||||
{
|
||||
$block = $this->blockFactory->create()->getCollection()
|
||||
->addFieldToFilter('identifier', self::BLOCK_IDENTIFIER)
|
||||
->setPageSize(1)
|
||||
->getFirstItem();
|
||||
|
||||
if (!$block->getId()) {
|
||||
$block = $this->blockFactory->create();
|
||||
}
|
||||
|
||||
$block->setTitle('LTS Home - Shop By Category')
|
||||
->setIdentifier(self::BLOCK_IDENTIFIER)
|
||||
->setContent($this->getBlockContent())
|
||||
->setIsActive(true)
|
||||
->setStores([0])
|
||||
->save();
|
||||
|
||||
$page = $this->pageFactory->create()->getCollection()
|
||||
->addFieldToFilter('identifier', 'athlete2-home-greece')
|
||||
->addStoreFilter(0, false)
|
||||
->setPageSize(1)
|
||||
->getFirstItem();
|
||||
|
||||
if ($page->getId()) {
|
||||
$content = (string) $page->getContent();
|
||||
$categoryStart = strpos($content, '<section class="lts-categories"');
|
||||
$categoryEnd = strpos($content, '</section>', $categoryStart ?: 0);
|
||||
|
||||
if ($categoryStart !== false && $categoryEnd !== false) {
|
||||
$categoryEnd += strlen('</section>');
|
||||
$content = substr($content, 0, $categoryStart)
|
||||
. '{{block class="Magento\\Cms\\Block\\Block" block_id="'
|
||||
. self::BLOCK_IDENTIFIER
|
||||
. '"}}'
|
||||
. substr($content, $categoryEnd);
|
||||
$page->setContent($content)->save();
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function getBlockContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<section class="lts-categories" aria-labelledby="lts-categories-title">
|
||||
<h2 id="lts-categories-title" class="lts-home-heading">Shop By Category</h2>
|
||||
<div class="lts-categories__grid">
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-solutions/ip-network-cameras'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/ip-camera.png'}}" alt=""></span><strong>IP Cameras</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-solutions/network-video-recorders'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/nvr.png'}}" alt=""></span><strong>NVR</strong></a>
|
||||
<a class="lts-category lts-category--featured" href="{{store url='products/product-categories/hd-tvi-solutions/hd-tvi-camera'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/tvi-camera.png'}}" alt=""></span><strong>TVI Cameras</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/hd-tvi-solutions/hd-tvi-dvr'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/dvr.png'}}" alt=""></span><strong>DVR</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/news/access-control'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/access-control.png'}}" alt=""></span><strong>Access Control</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-video-system-accessories/cable'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/cable.png'}}" alt=""></span><strong>Cable</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-video-system-accessories/storage-devices'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/hdd.png'}}" alt=""></span><strong>HDD</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-video-system-accessories/poe-switches'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/accessories.png'}}" alt=""></span><strong>Accessories</strong></a>
|
||||
</div>
|
||||
</section>
|
||||
HTML;
|
||||
}
|
||||
|
||||
public static function getDependencies(): array
|
||||
{
|
||||
return [UpdateDealerPricingBlock::class];
|
||||
}
|
||||
|
||||
public function getAliases(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,205 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lts\HomePage\Setup\Patch\Data;
|
||||
|
||||
use Magento\Cms\Model\BlockFactory;
|
||||
use Magento\Cms\Model\PageFactory;
|
||||
use Magento\Framework\Setup\ModuleDataSetupInterface;
|
||||
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
||||
|
||||
class InstallHomePageContent implements DataPatchInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly ModuleDataSetupInterface $moduleDataSetup,
|
||||
private readonly BlockFactory $blockFactory,
|
||||
private readonly PageFactory $pageFactory
|
||||
) {
|
||||
}
|
||||
|
||||
public function apply(): self
|
||||
{
|
||||
$this->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'
|
||||
<div class="lts-announcement" role="region" aria-label="Store announcements" data-mage-init='{"Magento_Theme/js/lts-announcement":{"delay":3000,"duration":1200}}'>
|
||||
<div class="lts-announcement__inner">
|
||||
<div class="lts-announcement__viewport" aria-live="off">
|
||||
<div class="lts-announcement__track">
|
||||
<a class="lts-announcement__item is-active" href="{{store url='promotions'}}">LTS Summer Savings Event – Save up to 40%</a>
|
||||
<a class="lts-announcement__item" href="{{store url='products/4k'}}">Explore LTS 4K Security Solutions</a>
|
||||
<a class="lts-announcement__item" href="{{store url='customer/account/login'}}">Sign In For Dealer Pricing, Availability & Checkout</a>
|
||||
</div>
|
||||
</div>
|
||||
<span class="lts-announcement__links">
|
||||
<a href="{{store url='request-a-quote'}}">Request a Quote</a>
|
||||
<a href="{{store url='contacts'}}">Help</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
private function dealerPricingContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<section class="lts-dealer" aria-labelledby="lts-dealer-title">
|
||||
<div class="lts-dealer__icon" aria-hidden="true">
|
||||
<img src="{{view url='Magento_Theme::images/lts-home-v2/dealer-sign-in.png'}}" alt="">
|
||||
</div>
|
||||
<div class="lts-dealer__content">
|
||||
<h2 id="lts-dealer-title">Sign In For Dealer Pricing</h2>
|
||||
<p>Unlock Dealer Pricing, Availability, And Checkout.</p>
|
||||
<div class="lts-dealer__actions">
|
||||
<a class="lts-dealer__button" href="{{store url='customer/account/login'}}">Sign In</a>
|
||||
<span class="lts-dealer__divider" aria-hidden="true"></span>
|
||||
<div class="lts-dealer__new">
|
||||
<span>New To LTS?</span>
|
||||
<a href="{{store url='customer/account/create'}}">Become A Customer Today <span aria-hidden="true">⟶</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
HTML;
|
||||
}
|
||||
|
||||
private function productLinesContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<section class="lts-product-lines" aria-labelledby="lts-product-lines-title">
|
||||
<h2 id="lts-product-lines-title" class="lts-home-heading">Shop By Product Line</h2>
|
||||
<div class="lts-product-lines__grid">
|
||||
<a class="lts-line-card lts-line-card--platinum" href="{{store url='products/product-lines/platinum.html'}}">
|
||||
<img src="{{view url='Magento_Theme::images/lts-home-v2/platinum.png'}}" alt="Platinum Plus cameras and recorder">
|
||||
<span class="lts-line-card__copy">
|
||||
<strong>Platinum</strong>
|
||||
<i></i>
|
||||
<span>Our flagship line delivering maximum performance, reliability, and innovation.</span>
|
||||
<b>Explore ⟶</b>
|
||||
</span>
|
||||
</a>
|
||||
<a class="lts-line-card lts-line-card--prox" href="{{store url='products/product-lines/pro-x.html'}}">
|
||||
<img src="{{view url='Magento_Theme::images/lts-home-v2/pro-x.png'}}" alt="Pro-X cameras and recorder">
|
||||
<span class="lts-line-card__copy">
|
||||
<strong>PRO-<em>X</em></strong>
|
||||
<i></i>
|
||||
<span>Advanced solutions for professionals who demand more.</span>
|
||||
<b>Explore ⟶</b>
|
||||
</span>
|
||||
</a>
|
||||
<a class="lts-line-card lts-line-card--defendas" href="{{store url='products/product-lines/defendas.html'}}">
|
||||
<img src="{{view url='Magento_Theme::images/lts-home-v2/defendas.png'}}" alt="Defendas integrated access control system">
|
||||
<span class="lts-line-card__copy">
|
||||
<strong>DEFENDAS</strong>
|
||||
<i></i>
|
||||
<span>Integrated security systems for access control and device management.</span>
|
||||
<b>Explore ⟶</b>
|
||||
</span>
|
||||
</a>
|
||||
</div>
|
||||
</section>
|
||||
HTML;
|
||||
}
|
||||
|
||||
private function homePageContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<div class="lts-home-content">
|
||||
{{block class="Magento\Cms\Block\Block" block_id="lts-home-dealer-pricing"}}
|
||||
{{block class="Magento\Cms\Block\Block" block_id="lts-home-product-lines"}}
|
||||
{{block class="Magento\Cms\Block\Block" block_id="lts-home-shop-by-category"}}
|
||||
{{block class="Magento\Cms\Block\Block" block_id="lts-home-resources"}}
|
||||
<a class="lts-feedback" href="{{store url='contacts'}}">Feedback</a>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
private function shopByCategoryContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<section class="lts-categories" aria-labelledby="lts-categories-title">
|
||||
<h2 id="lts-categories-title" class="lts-home-heading">Shop By Category</h2>
|
||||
<div class="lts-categories__grid">
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-solutions/ip-network-cameras'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/ip-camera.png'}}" alt=""></span><strong>IP Cameras</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-solutions/network-video-recorders'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/nvr.png'}}" alt=""></span><strong>NVR</strong></a>
|
||||
<a class="lts-category lts-category--featured" href="{{store url='products/product-categories/hd-tvi-solutions/hd-tvi-camera'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/tvi-camera.png'}}" alt=""></span><strong>TVI Cameras</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/hd-tvi-solutions/hd-tvi-dvr'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/dvr.png'}}" alt=""></span><strong>DVR</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/news/access-control'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/access-control.png'}}" alt=""></span><strong>Access Control</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-video-system-accessories/cable'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/cable.png'}}" alt=""></span><strong>Cable</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-video-system-accessories/storage-devices'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/hdd.png'}}" alt=""></span><strong>HDD</strong></a>
|
||||
<a class="lts-category" href="{{store url='products/product-categories/ip-video-system-accessories/poe-switches'}}"><span class="lts-category__image"><img src="{{view url='Magento_Theme::images/lts-home-v2/accessories.png'}}" alt=""></span><strong>Accessories</strong></a>
|
||||
</div>
|
||||
</section>
|
||||
HTML;
|
||||
}
|
||||
|
||||
public static function getDependencies(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getAliases(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lts\HomePage\Setup\Patch\Data;
|
||||
|
||||
use Magento\Cms\Model\BlockFactory;
|
||||
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
||||
|
||||
class UpdateAnnouncementTicker implements DataPatchInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly BlockFactory $blockFactory
|
||||
) {
|
||||
}
|
||||
|
||||
public function apply(): self
|
||||
{
|
||||
$block = $this->blockFactory->create()->getCollection()
|
||||
->addFieldToFilter('identifier', 'lts-home-announcement')
|
||||
->setPageSize(1)
|
||||
->getFirstItem();
|
||||
|
||||
if (!$block->getId()) {
|
||||
$block = $this->blockFactory->create()
|
||||
->setTitle('LTS Home - Top Announcement')
|
||||
->setIdentifier('lts-home-announcement')
|
||||
->setIsActive(true)
|
||||
->setStores([0]);
|
||||
}
|
||||
|
||||
$block->setContent($this->getContent())->save();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function getContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<div class="lts-announcement" role="region" aria-label="Store announcements" data-mage-init='{"Magento_Theme/js/lts-announcement":{"delay":3000,"duration":1200}}'>
|
||||
<div class="lts-announcement__inner">
|
||||
<div class="lts-announcement__viewport" aria-live="off">
|
||||
<div class="lts-announcement__track">
|
||||
<a class="lts-announcement__item is-active" href="{{store url='promotions'}}">LTS Summer Savings Event – Save up to 40%</a>
|
||||
<a class="lts-announcement__item" href="{{store url='products/4k'}}">Explore LTS 4K Security Solutions</a>
|
||||
<a class="lts-announcement__item" href="{{store url='customer/account/login'}}">Sign In For Dealer Pricing, Availability & Checkout</a>
|
||||
</div>
|
||||
</div>
|
||||
<span class="lts-announcement__links">
|
||||
<a href="{{store url='request-a-quote'}}">Request a Quote</a>
|
||||
<a href="{{store url='contacts'}}">Help</a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
HTML;
|
||||
}
|
||||
|
||||
public static function getDependencies(): array
|
||||
{
|
||||
return [InstallHomePageContent::class];
|
||||
}
|
||||
|
||||
public function getAliases(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Lts\HomePage\Setup\Patch\Data;
|
||||
|
||||
use Magento\Cms\Model\BlockFactory;
|
||||
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
||||
|
||||
class UpdateDealerPricingBlock implements DataPatchInterface
|
||||
{
|
||||
public function __construct(
|
||||
private readonly BlockFactory $blockFactory
|
||||
) {
|
||||
}
|
||||
|
||||
public function apply(): self
|
||||
{
|
||||
$block = $this->blockFactory->create()->getCollection()
|
||||
->addFieldToFilter('identifier', 'lts-home-dealer-pricing')
|
||||
->setPageSize(1)
|
||||
->getFirstItem();
|
||||
|
||||
if ($block->getId()) {
|
||||
$block->setContent($this->getContent())->save();
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function getContent(): string
|
||||
{
|
||||
return <<<'HTML'
|
||||
<section class="lts-dealer" aria-labelledby="lts-dealer-title">
|
||||
<div class="lts-dealer__icon" aria-hidden="true">
|
||||
<img src="{{view url='Magento_Theme::images/lts-home-v2/dealer-sign-in.png'}}" alt="">
|
||||
</div>
|
||||
<div class="lts-dealer__content">
|
||||
<h2 id="lts-dealer-title">Sign In For Dealer Pricing</h2>
|
||||
<p>Unlock Dealer Pricing, Availability, And Checkout.</p>
|
||||
<div class="lts-dealer__actions">
|
||||
<a class="lts-dealer__button" href="{{store url='customer/account/login'}}">Sign In</a>
|
||||
<span class="lts-dealer__divider" aria-hidden="true"></span>
|
||||
<div class="lts-dealer__new">
|
||||
<span>New To LTS?</span>
|
||||
<a href="{{store url='customer/account/create'}}">Become A Customer Today <span aria-hidden="true">⟶</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
HTML;
|
||||
}
|
||||
|
||||
public static function getDependencies(): array
|
||||
{
|
||||
return [InstallHomePageContent::class];
|
||||
}
|
||||
|
||||
public function getAliases(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user