<?php
declare(strict_types=1);
namespace ApoShop;
use Shopware\Core\Framework\Plugin;
use Shopware\Storefront\Framework\ThemeInterface;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
use Shopware\Core\System\CustomField\CustomFieldTypes;
use Shopware\Core\Framework\Context;
class ApoShop extends Plugin implements ThemeInterface {
public function getThemeConfigPath(): string {
return 'theme.json';
}
public function install(InstallContext $installContext): void {
$customFieldSetRepository = $this->container->get('custom_field_set.repository');
$customFieldSetRepository->create([
[
'name' => 'aposhop_theme_category_set',
'global' => false,
'config' => [
'label' => [
'de-DE' => 'Pharmasana Theme Data',
'en-GB' => 'Pharmasana Theme Data'
]
],
'relations' => [[
'entityName' => 'category'
]],
'customFields' => [
[
'name' => 'pharma_megamenu_content',
'type' => CustomFieldTypes::HTML,
'config' => [
'componentName' => 'sw-text-editor',
'customFieldType' => 'textEditor',
'label' => [
'de-DE' => 'Mega Menu Right Block HTML',
'en-GB' => 'Mega Menu Right Block HTML'
]
]
]
]
]
], Context::createDefaultContext());
parent::install($installContext);
}
public function update(UpdateContext $updateContext): void
{
parent::update($updateContext);
}
}