custom/plugins/ApoShop/src/ApoShop.php line 15

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace ApoShop;
  4. use Shopware\Core\Framework\Plugin;
  5. use Shopware\Storefront\Framework\ThemeInterface;
  6. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  7. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  8. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  9. use Shopware\Core\System\CustomField\CustomFieldTypes;
  10. use Shopware\Core\Framework\Context;
  11. class ApoShop extends Plugin implements ThemeInterface {
  12.     public function getThemeConfigPath(): string {
  13.         return 'theme.json';
  14.     }
  15.     public function install(InstallContext $installContext): void {
  16.         $customFieldSetRepository $this->container->get('custom_field_set.repository');
  17.         $customFieldSetRepository->create([
  18.             [
  19.                 'name' => 'aposhop_theme_category_set',
  20.                 'global' => false,
  21.                 'config' => [
  22.                     'label' => [
  23.                         'de-DE' => 'Pharmasana Theme Data',
  24.                         'en-GB' => 'Pharmasana Theme Data'
  25.                     ]
  26.                 ],
  27.                 'relations' => [[
  28.                 'entityName' => 'category'
  29.                     ]],
  30.                 'customFields' => [
  31.                     [
  32.                         'name' => 'pharma_megamenu_content',
  33.                         'type' => CustomFieldTypes::HTML,
  34.                         'config' => [
  35.                             'componentName' => 'sw-text-editor',
  36.                             'customFieldType' => 'textEditor',
  37.                             'label' => [
  38.                                 'de-DE' => 'Mega Menu Right Block HTML',
  39.                                 'en-GB' => 'Mega Menu Right Block HTML'
  40.                             ]
  41.                         ]
  42.                     ]
  43.                 ]
  44.             ]
  45.                 ], Context::createDefaultContext());
  46.         parent::install($installContext);
  47.     }
  48.     
  49.     
  50.     public function update(UpdateContext $updateContext): void
  51.     {   
  52.         parent::update($updateContext);
  53.     }
  54. }