custom/plugins/WbfkExtensions/src/WbfkExtensions.php line 27

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace WbfkExtensions;
  4. use Doctrine\DBAL\Connection;
  5. use Exception;
  6. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
  7. use Shopware\Core\Framework\Plugin;
  8. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  9. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  10. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  11. use Shopware\Core\Kernel;
  12. use Shopware\Core\System\CustomField\CustomFieldTypes;
  13. use Symfony\Component\Config\FileLocator;
  14. use Symfony\Component\Config\Loader\DelegatingLoader;
  15. use Symfony\Component\Config\Loader\LoaderResolver;
  16. use Symfony\Component\DependencyInjection\ContainerBuilder;
  17. use Symfony\Component\DependencyInjection\Loader\GlobFileLoader;
  18. use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  19. use WbfkExtensions\DependencyInjection\WbfkExtensionsExtension;
  20. use WbfkExtensions\Install\PartnerMediaFolder;
  21. use WbfkExtensions\Lifecycle\CustomFieldsInvoiceData;
  22. use WbfkExtensions\Lifecycle\MailLifecycle;
  23. class WbfkExtensions extends Plugin
  24. {
  25.     public const PARTIAL_CHOOSER_CONTENT 'wbfk_footer_cms_partial_chooser_content';
  26.     public function getTemplatePriority(): int
  27.     {
  28.         return 5000;
  29.     }
  30.     public function createContainerExtension(): WbfkExtensionsExtension
  31.     {
  32.         return new WbfkExtensionsExtension();
  33.     }
  34.     public function build(ContainerBuilder $container): void
  35.     {
  36.         $this->buildConfig($container);
  37.         parent::build($container);
  38.     }
  39.     private function buildConfig(ContainerBuilder $container): void
  40.     {
  41.         $locator = new FileLocator('Resources/config');
  42.         $resolver = new LoaderResolver([
  43.             new YamlFileLoader($container$locator),
  44.             new GlobFileLoader($container$locator),
  45.         ]);
  46.         $configLoader = new DelegatingLoader($resolver);
  47.         $confDir $this->getPath().'/Resources/config';
  48.         $configLoader->load($confDir.'/{packages}/*'.Kernel::CONFIG_EXTS'glob');
  49.     }
  50.     /**
  51.      * @param ActivateContext $activateContext
  52.      */
  53.     public function activate(ActivateContext $activateContext): void
  54.     {
  55.         parent::activate($activateContext);
  56.         PartnerMediaFolder::activate($activateContext$this->container);
  57.         /** @var EntityRepositoryInterface $customFieldSetRepository */
  58.         $customFieldSetRepository $this->container->get(
  59.             'custom_field_set.repository'
  60.         );
  61.         $fieldSets $this->getCustomFieldSets();
  62.         foreach ($fieldSets as $fieldSet) {
  63.             try {
  64.                 $customFieldSetRepository->upsert(
  65.                     [$fieldSet],
  66.                     $activateContext->getContext()
  67.                 );
  68.             } catch (Exception $exception) {
  69.                 var_dump($exception->getMessage());
  70.             }
  71.         }
  72.         CustomFieldsInvoiceData::upsert($customFieldSetRepository$activateContext->getContext());
  73.     }
  74.     /**
  75.      * @param UpdateContext $updateContext
  76.      */
  77.     public function update(UpdateContext $updateContext): void
  78.     {
  79.         parent::update($updateContext);
  80.         /** @var EntityRepositoryInterface $customFieldSetRepository */
  81.         $customFieldSetRepository $this->container->get(
  82.             'custom_field_set.repository'
  83.         );
  84.         $fieldSets $this->getCustomFieldSets();
  85.         foreach ($fieldSets as $fieldSet) {
  86.             try {
  87.                 $customFieldSetRepository->upsert(
  88.                     [$fieldSet],
  89.                     $updateContext->getContext()
  90.                 );
  91.             } catch (Exception $exception) {
  92.                 var_dump($exception->getMessage());
  93.             }
  94.         }
  95.         CustomFieldsInvoiceData::upsert($customFieldSetRepository$updateContext->getContext());
  96.     }
  97.     public function uninstall(UninstallContext $uninstallContext): void
  98.     {
  99.         parent::uninstall($uninstallContext);
  100.         PartnerMediaFolder::uninstall($uninstallContext$this->container);
  101.         if ($uninstallContext->keepUserData()) {
  102.             return;
  103.         }
  104.         /** @var Connection $connection */
  105.         $connection $this->container->get(Connection::class);
  106.         $mailLifecycle = new MailLifecycle($connection);
  107.         $mailLifecycle->delete();
  108.         /** @var EntityRepositoryInterface $customFieldSetRepository */
  109.         $customFieldSetRepository $this->container->get(
  110.             'custom_field_set.repository'
  111.         );
  112.         CustomFieldsInvoiceData::delete($customFieldSetRepository$uninstallContext->getContext());
  113.     }
  114.     /**
  115.      * @return array
  116.      */
  117.     private function getCustomFieldSets(): array
  118.     {
  119.         $fieldsets = [];
  120.         /* Fieldset for categories */
  121.         $fieldsets[] = [
  122.             'id' => 'efd76a2fe19d451293d613051a9055ce',
  123.             'name' => 'wbfk_cms_parial_selector',
  124.             'active' => true,
  125.             'global' => false,
  126.             'config' => [
  127.                 'translated' => true,
  128.                 'label' => [
  129.                     'en-GB' => 'CMS Partial Selector',
  130.                     'de-DE' => 'CMS Partial Auswahl',
  131.                 ],
  132.             ],
  133.             'customFields' => [
  134.                 [
  135.                     'id' => '4dd5a2970f354a948a6696ac611398cd',
  136.                     'name' => 'm24_footer_partial_headline',
  137.                     'type' => CustomFieldTypes::TEXT,
  138.                     'config' => [
  139.                         'customFieldPosition' => 1000,
  140.                         'label' => [
  141.                             'en-GB' => 'Headline for the CMS partial in the footer',
  142.                             'de-DE' => 'Headline für das CMS Partial im Footer',
  143.                         ],
  144.                     ],
  145.                 ],
  146.                 [
  147.                     'id' => 'f703ed9862a7481f9b581e3104d50e0e',
  148.                     'name' => $this::PARTIAL_CHOOSER_CONTENT,
  149.                     'type' => CustomFieldTypes::ENTITY,
  150.                     'config' => [
  151.                         'customFieldPosition' => 10000,
  152.                         'required' => false,
  153.                         'componentName' => 'sw-entity-single-select-wbfk-partial',
  154.                         'entity' => 'cms_page',
  155.                         'label' => [
  156.                             'en-GB' => 'CMS partial in the footer area',
  157.                             'de-DE' => 'CMS Partial im Footer',
  158.                         ],
  159.                     ],
  160.                 ],
  161.                 [
  162.                     'id' => 'a6ab954fb5944711b31f46d00438aeaa',
  163.                     'name' => 'wbfk_feed_delivery_country',
  164.                     'type' => CustomFieldTypes::ENTITY,
  165.                     'config' => [
  166.                         'customFieldPosition' => 10020,
  167.                         'required' => false,
  168.                         'componentName' => 'sw-entity-single-select-wbfk-partial',
  169.                         'entity' => 'country',
  170.                         'label' => [
  171.                             'en-GB' => 'Country for calulating delivery times in this feed.',
  172.                             'de-DE' => 'Land für die Berechnung der Lieferzeiten in diesem Feed.',
  173.                         ],
  174.                     ],
  175.                 ],
  176.             ],
  177.             'relations' => [
  178.                 [
  179.                     'id' => '6b71f634b1544877beae1bd282e4a544',
  180.                     'entityName' => 'sales_channel',
  181.                 ],
  182.             ],
  183.         ];
  184.         $position 10000;
  185.         $fieldsets[] = [
  186.             'id' => '1292346c3ed642059bc1fbe1848fcb17',
  187.             'name' => 'wbfk_further_technical_data',
  188.             'active' => true,
  189.             'global' => false,
  190.             'config' => [
  191.                 'translated' => true,
  192.                 'label' => [
  193.                     'en-GB' => 'M24 - Further techn. data',
  194.                     'de-DE' => 'M24 - Weitere techn. Daten',
  195.                 ],
  196.             ],
  197.             'customFields' => [
  198.                 [
  199.                     'id' => 'c558c7feda32498e85e4c078730f704c',
  200.                     'name' => 'wbfk_product_housing_dimension',
  201.                     'type' => CustomFieldTypes::FLOAT,
  202.                     'config' => [
  203.                         'customFieldPosition' => 3000,
  204.                         'required' => true,
  205.                         'label' => [
  206.                             'en-GB' => 'Housing dimension in inches',
  207.                             'de-DE' => 'Gehäusemaß in Zoll',
  208.                         ],
  209.                     ],
  210.                 ],
  211.                 [
  212.                     'id' => '78c265afa8274d38a3f5deaab413a04b',
  213.                     'name' => 'wbfk_product_load_capacity',
  214.                     'type' => CustomFieldTypes::FLOAT,
  215.                     'config' => [
  216.                         'customFieldPosition' => 3000,
  217.                         'required' => true,
  218.                         'label' => [
  219.                             'en-GB' => 'Load capacity in kg.',
  220.                             'de-DE' => 'Belastbarkeit in kg.',
  221.                         ],
  222.                     ],
  223.                 ],
  224.                 [
  225.                     'id' => '7e451487ecb2434f9d9eb47bf392b24c',
  226.                     'name' => 'wbfk_product_power_consumption',
  227.                     'type' => CustomFieldTypes::FLOAT,
  228.                     'config' => [
  229.                         'customFieldPosition' => 3000,
  230.                         'required' => true,
  231.                         'label' => [
  232.                             'en-GB' => 'Electricity consumption in kwh/year',
  233.                             'de-DE' => 'Stromverbrauch in kwh/Jahr',
  234.                         ],
  235.                     ],
  236.                 ],
  237.                 [
  238.                     'id' => '6d4a28c016cc4fb49f6c141dabcc64ab',
  239.                     'name' => 'wbfk_product_range',
  240.                     'type' => CustomFieldTypes::FLOAT,
  241.                     'config' => [
  242.                         'customFieldPosition' => 3000,
  243.                         'required' => true,
  244.                         'label' => [
  245.                             'en-GB' => 'Range in m',
  246.                             'de-DE' => 'Reichweite in m',
  247.                         ],
  248.                     ],
  249.                 ],
  250.                 [
  251.                     'id' => '8a5fd5c785984a179b23111e692d1f70',
  252.                     'name' => 'wbfk_product_microphone',
  253.                     'type' => CustomFieldTypes::TEXT,
  254.                     'config' => [
  255.                         'componentName' => 'sw-textarea-field',
  256.                         'customFieldType' => 'textEditor',
  257.                         'customFieldPosition' => $position++,
  258.                         'label' => [
  259.                             'en-GB' => 'Microphone',
  260.                             'de-DE' => 'Mikrofon',
  261.                         ],
  262.                     ],
  263.                 ],
  264.                 [
  265.                     'id' => 'd7c634fd91ed478cad66b5805e641a5a',
  266.                     'name' => 'wbfk_product_height_adjustment',
  267.                     'type' => CustomFieldTypes::FLOAT,
  268.                     'config' => [
  269.                         'customFieldPosition' => 3000,
  270.                         'required' => true,
  271.                         'label' => [
  272.                             'en-GB' => 'Height adjustment in mm',
  273.                             'de-DE' => 'Höhenverstellung in mm',
  274.                         ],
  275.                     ],
  276.                 ],
  277.                 [
  278.                     'id' => 'ef59b5500894485bbcebcb9ed2bd342d',
  279.                     'name' => 'wbfk_product_weight',
  280.                     'type' => CustomFieldTypes::FLOAT,
  281.                     'config' => [
  282.                         'customFieldPosition' => 3000,
  283.                         'required' => true,
  284.                         'label' => [
  285.                             'en-GB' => 'Product weight in kg',
  286.                             'de-DE' => 'Produktgewicht in kg',
  287.                         ],
  288.                     ],
  289.                 ],
  290.                 [
  291.                     'id' => '20d8c99765f14f5da4b94fd7893ab1d0',
  292.                     'name' => 'wbfk_product_scope_of_delivery',
  293.                     'type' => CustomFieldTypes::TEXT,
  294.                     'config' => [
  295.                         'componentName' => 'sw-textarea-field',
  296.                         'customFieldType' => 'textEditor',
  297.                         'customFieldPosition' => $position++,
  298.                         'label' => [
  299.                             'en-GB' => 'Scope of delivery',
  300.                             'de-DE' => 'Lieferumfang',
  301.                         ],
  302.                     ],
  303.                 ],
  304.                 [
  305.                     'id' => '2d0bf50da0134dd9a7649234bd3b3994',
  306.                     'name' => 'wbfk_product_measurements',
  307.                     'type' => CustomFieldTypes::TEXT,
  308.                     'config' => [
  309.                         'componentName' => 'sw-textarea-field',
  310.                         'customFieldType' => 'textEditor',
  311.                         'customFieldPosition' => $position++,
  312.                         'label' => [
  313.                             'en-GB' => 'Dimensions W x H x D',
  314.                             'de-DE' => 'Abmessungen B x H x T',
  315.                         ],
  316.                     ],
  317.                 ],
  318.                 [
  319.                     'id' => 'e0cdb5755def44af8cc5037329d2acb4',
  320.                     'name' => 'wbfk_product_brightness_guide',
  321.                     'type' => CustomFieldTypes::TEXT,
  322.                     'config' => [
  323.                         'componentName' => 'sw-textarea-field',
  324.                         'customFieldType' => 'textEditor',
  325.                         'customFieldPosition' => $position++,
  326.                         'label' => [
  327.                             'en-GB' => 'Brightness guide',
  328.                             'de-DE' => 'Helligkeit Kaufberater',
  329.                         ],
  330.                     ],
  331.                 ],
  332.                 [
  333.                     'id' => 'b7ba6db3e38a40308ac853ebaf17d8d3',
  334.                     'name' => 'wbfk_product_not_for_private',
  335.                     'type' => CustomFieldTypes::BOOL,
  336.                     'config' => [
  337.                         'customFieldPosition' => $position++,
  338.                         'label' => [
  339.                             'en-GB' => 'Only for commercial customers',
  340.                             'de-DE' => 'Nur für Firmenkunden',
  341.                         ],
  342.                     ],
  343.                 ],
  344.                 [
  345.                     'id' => '46c19d08cd0e4912bbfd1d79ef11dd07',
  346.                     'name' => 'wbfk_product_field_of_application',
  347.                     'type' => CustomFieldTypes::TEXT,
  348.                     'config' => [
  349.                         'componentName' => 'sw-textarea-field',
  350.                         'customFieldType' => 'textarea',
  351.                         'customFieldPosition' => $position++,
  352.                         'label' => [
  353.                             'en-GB' => 'Field of application',
  354.                             'de-DE' => 'Anwendungsgebiet',
  355.                         ],
  356.                     ],
  357.                 ],
  358.                 [
  359.                     'id' => '02df420e210d42e4a07d05b668b3e079',
  360.                     'name' => 'wbfk_product_energy_efficiency',
  361.                     'type' => CustomFieldTypes::TEXT,
  362.                     'config' => [
  363.                         'customFieldPosition' => $position++,
  364.                         'label' => [
  365.                             'en-GB' => 'EEK class',
  366.                             'de-DE' => 'EEK-Klasse',
  367.                         ],
  368.                     ],
  369.                 ],
  370.                 [
  371.                     'id' => '7386018c47ad403ea7906343f14349d9',
  372.                     'name' => 'wbfk_product_special_features',
  373.                     'type' => CustomFieldTypes::TEXT,
  374.                     'config' => [
  375.                         'type' => CustomFieldTypes::TEXT,
  376.                         'componentName' => 'sw-field',
  377.                         'customFieldType' => 'textEditor',
  378.                         'customFieldPosition' => $position++,
  379.                         'label' => [
  380.                             'en-GB' => 'Special features',
  381.                             'de-DE' => 'Besonderheiten',
  382.                         ],
  383.                     ],
  384.                 ],
  385.                 [
  386.                     'id' => 'ae65b48fda294b64af9822c3f15214ff',
  387.                     'name' => 'wbfk_product_inputs',
  388.                     'type' => CustomFieldTypes::TEXT,
  389.                     'config' => [
  390.                         'type' => CustomFieldTypes::TEXT,
  391.                         'componentName' => 'sw-field',
  392.                         'customFieldType' => 'textEditor',
  393.                         'customFieldPosition' => $position++,
  394.                         'label' => [
  395.                             'en-GB' => 'Inputs',
  396.                             'de-DE' => 'Eingänge',
  397.                         ],
  398.                     ],
  399.                 ],
  400.                 [
  401.                     'id' => '73d1da6d99774e0188c2522bdef8cef7',
  402.                     'name' => 'wbfk_product_supported_video_formats',
  403.                     'type' => CustomFieldTypes::TEXT,
  404.                     'config' => [
  405.                         'type' => CustomFieldTypes::TEXT,
  406.                         'componentName' => 'sw-field',
  407.                         'customFieldType' => 'textEditor',
  408.                         'customFieldPosition' => $position++,
  409.                         'label' => [
  410.                             'en-GB' => 'Supported video formats',
  411.                             'de-DE' => 'Unterstützte Videoformate',
  412.                         ],
  413.                     ],
  414.                 ],
  415.                 [
  416.                     'id' => 'a71805ad8ace47cabdb308415c665084',
  417.                     'name' => 'wbfk_product_certifications',
  418.                     'type' => CustomFieldTypes::TEXT,
  419.                     'config' => [
  420.                         'type' => CustomFieldTypes::TEXT,
  421.                         'componentName' => 'sw-field',
  422.                         'customFieldType' => 'textEditor',
  423.                         'customFieldPosition' => $position++,
  424.                         'label' => [
  425.                             'en-GB' => 'Certifications',
  426.                             'de-DE' => 'Zertifikate',
  427.                         ],
  428.                     ],
  429.                 ],
  430.                 [
  431.                     'id' => '9f83eb4c30b9473cb4b5009eb3ff7ca2',
  432.                     'name' => 'wbfk_product_connections',
  433.                     'type' => CustomFieldTypes::TEXT,
  434.                     'config' => [
  435.                         'type' => CustomFieldTypes::TEXT,
  436.                         'componentName' => 'sw-field',
  437.                         'customFieldType' => 'textEditor',
  438.                         'customFieldPosition' => $position++,
  439.                         'label' => [
  440.                             'en-GB' => 'Connections',
  441.                             'de-DE' => 'Konnektivität',
  442.                         ],
  443.                     ],
  444.                 ],
  445.                 [
  446.                     'id' => '57c294c2467047bb9523ef1d58dd7b2c',
  447.                     'name' => 'wbfk_product_notices',
  448.                     'type' => CustomFieldTypes::TEXT,
  449.                     'config' => [
  450.                         'type' => CustomFieldTypes::TEXT,
  451.                         'componentName' => 'sw-field',
  452.                         'customFieldType' => 'textEditor',
  453.                         'customFieldPosition' => $position++,
  454.                         'label' => [
  455.                             'en-GB' => 'Notices',
  456.                             'de-DE' => 'Hinweise',
  457.                         ],
  458.                     ],
  459.                 ],
  460.                 [
  461.                     'id' => '5aefd6a397f7481facd49fef68553e1f',
  462.                     'name' => 'wbfk_product_microsoft_teams_button',
  463.                     'type' => CustomFieldTypes::TEXT,
  464.                     'config' => [
  465.                         'type' => CustomFieldTypes::TEXT,
  466.                         'componentName' => 'sw-field',
  467.                         'customFieldType' => 'textEditor',
  468.                         'customFieldPosition' => $position++,
  469.                         'label' => [
  470.                             'en-GB' => 'Microsoft Teams button',
  471.                             'de-DE' => 'Microsoft Teams Taste',
  472.                         ],
  473.                     ],
  474.                 ],
  475.                 [
  476.                     'id' => '828d9ab76c0c4298841cc70c30fa604c',
  477.                     'name' => 'wbfk_product_security',
  478.                     'type' => CustomFieldTypes::TEXT,
  479.                     'config' => [
  480.                         'type' => CustomFieldTypes::TEXT,
  481.                         'componentName' => 'sw-field',
  482.                         'customFieldType' => 'textEditor',
  483.                         'customFieldPosition' => $position++,
  484.                         'label' => [
  485.                             'en-GB' => 'Security',
  486.                             'de-DE' => 'Sicherheit',
  487.                         ],
  488.                     ],
  489.                 ],
  490.                 [
  491.                     'id' => '1e3b6236df2d4646a3f40163b6cc4ba0',
  492.                     'name' => 'wbfk_product_minimum_contract_period',
  493.                     'type' => CustomFieldTypes::TEXT,
  494.                     'config' => [
  495.                         'type' => CustomFieldTypes::TEXT,
  496.                         'componentName' => 'sw-field',
  497.                         'customFieldType' => 'textEditor',
  498.                         'customFieldPosition' => $position++,
  499.                         'label' => [
  500.                             'en-GB' => 'Minimum contract period',
  501.                             'de-DE' => 'Mindestvertragslaufzeit',
  502.                         ],
  503.                     ],
  504.                 ],
  505.             ],
  506.             'relations' => [
  507.                 [
  508.                     'id' => '1ab60e265e6f42a6a2e4923ea117760c',
  509.                     'entityName' => 'product',
  510.                 ],
  511.             ],
  512.         ];
  513.         $position 10000;
  514.         $fieldsets[] = [
  515.             'id' => '158deef417c84656a63fc9d10cb56c34',
  516.             'name' => 'wbfk_product_data',
  517.             'active' => true,
  518.             'global' => false,
  519.             'config' => [
  520.                 'translated' => true,
  521.                 'label' => [
  522.                     'en-GB' => 'M24 - add. data',
  523.                     'de-DE' => 'M24 - zus. Daten',
  524.                 ],
  525.             ],
  526.             'customFields' => [
  527.                 [
  528.                     'id' => '26e1197d4f864b53b59530fb7375a4be',
  529.                     'name' => 'wbfk_product_sennheiser_id',
  530.                     'type' => CustomFieldTypes::TEXT,
  531.                     'config' => [
  532.                         'customFieldPosition' => $position++,
  533.                         'label' => [
  534.                             'en-GB' => 'Sennheiser ID',
  535.                             'de-DE' => 'Sennheiser ID',
  536.                         ],
  537.                     ],
  538.                 ],
  539.                 [
  540.                     'id' => '256deef417c84656a63fc9d10cb57c37',
  541.                     'name' => 'wbfk_product_terms_and_conditions_file',
  542.                     'type' => CustomFieldTypes::TEXT,
  543.                     'config' => [
  544.                         'customFieldType' => CustomFieldTypes::MEDIA,
  545.                         'customFieldPosition' => $position++,
  546.                         'componentName' => 'sw-media-field',
  547.                         'label' => [
  548.                             'en-GB' => 'Terms and conditions file',
  549.                             'de-DE' => 'AGB-Datei',
  550.                         ],
  551.                     ],
  552.                 ],
  553.                 [
  554.                     'id' => 'fd8289f4db5e44b9af3c33ed71f118b3',
  555.                     'name' => 'wbfk_product_energylabel_file',
  556.                     'type' => CustomFieldTypes::TEXT,
  557.                     'config' => [
  558.                         'customFieldType' => CustomFieldTypes::MEDIA,
  559.                         'customFieldPosition' => $position++,
  560.                         'componentName' => 'sw-media-field',
  561.                         'label' => [
  562.                             'en-GB' => 'EEK label',
  563.                             'de-DE' => 'EEK-Label',
  564.                         ],
  565.                     ],
  566.                 ],
  567.                 [
  568.                     'id' => '9d91bd6724694e8696a1514b9c340b86',
  569.                     'name' => 'wbfk_product_energylabel_datasheet_file',
  570.                     'type' => CustomFieldTypes::TEXT,
  571.                     'config' => [
  572.                         'customFieldType' => CustomFieldTypes::MEDIA,
  573.                         'customFieldPosition' => $position++,
  574.                         'componentName' => 'sw-media-field',
  575.                         'label' => [
  576.                             'en-GB' => 'EEK datasheet',
  577.                             'de-DE' => 'EEK-Datenblatt',
  578.                         ],
  579.                     ],
  580.                 ],
  581.                 [
  582.                     'id' => '3fdeb9bbf6214e249c49168106888f83',
  583.                     'name' => 'wbfk_product_only_on_request',
  584.                     'type' => CustomFieldTypes::BOOL,
  585.                     'config' => [
  586.                         'customFieldPosition' => $position++,
  587.                         'label' => [
  588.                             'en-GB' => 'Product available only on request',
  589.                             'de-DE' => 'Produkt nur auf Anfrage verfügbar',
  590.                         ],
  591.                     ],
  592.                 ],
  593.             ],
  594.             'relations' => [
  595.                 [
  596.                     'id' => '1ac61e275e6f43a6a2e3923ea117761d',
  597.                     'entityName' => 'product',
  598.                 ],
  599.             ],
  600.         ];
  601.         $position 10000;
  602.         $fieldsets[] = [
  603.             'id' => 'd62717d4547149a39ee25a8ac067672b',
  604.             'name' => 'wbfk_product_data_feeds',
  605.             'active' => true,
  606.             'global' => false,
  607.             'config' => [
  608.                 'translated' => true,
  609.                 'label' => [
  610.                     'en-GB' => 'M24 - Feed data',
  611.                     'de-DE' => 'M24 - Feeddaten',
  612.                 ],
  613.             ],
  614.             'customFields' => [
  615.                 [
  616.                     'id' => 'caf8dd9d6a684ca4ad2f3c7519787118',
  617.                     'name' => 'idealo_puretext_description',
  618.                     'type' => CustomFieldTypes::TEXT,
  619.                     'config' => [
  620.                         'type' => CustomFieldTypes::TEXT,
  621.                         'componentName' => 'sw-field',
  622.                         'customFieldType' => 'textEditor',
  623.                         'customFieldPosition' => $position++,
  624.                         'label' => [
  625.                             'en-GB' => 'Idealo: Product description (only text)',
  626.                             'de-DE' => 'Idealo: Produktbeschreibung (nur Text)',
  627.                         ],
  628.                         'helpText' => [
  629.                             'en-GB' => 'With this field you can store your own article description for Idealo. No HTML allowed!',
  630.                             'de-DE' => 'Mit diesem Feld können Sie für Idealo eine eigene Artikelbeschreibung hinterlegen. Kein HTML erlaubt!',
  631.                         ],
  632.                     ],
  633.                 ],
  634.             ],
  635.             'relations' => [
  636.                 [
  637.                     'id' => '4c772afcbb7146659a0599be0d72f1f7',
  638.                     'entityName' => 'product',
  639.                 ],
  640.             ],
  641.         ];
  642.         $position 10000;
  643.         $fieldsets[] = [
  644.             'id' => 'c2c930bb10c54637ae102a736176365f',
  645.             'name' => 'wbfk_product_data_internal',
  646.             'active' => true,
  647.             'global' => false,
  648.             'config' => [
  649.                 'translated' => true,
  650.                 'label' => [
  651.                     'en-GB' => 'M24 - internal',
  652.                     'de-DE' => 'M24 - intern',
  653.                 ],
  654.             ],
  655.             'customFields' => [
  656.                 [
  657.                     'id' => '7fc0d7eb9f624de09513e0902146bfbe',
  658.                     'name' => 'wbfk_product_author',
  659.                     'type' => CustomFieldTypes::TEXT,
  660.                     'config' => [
  661.                         'customFieldPosition' => $position++,
  662.                         'label' => [
  663.                             'en-GB' => 'Author',
  664.                             'de-DE' => 'Autor',
  665.                         ],
  666.                     ],
  667.                 ],
  668.                 [
  669.                     'id' => '1f3b942c6d6c4f39aad6ec7f109023c6',
  670.                     'name' => 'wbfk_product_author_info',
  671.                     'type' => CustomFieldTypes::TEXT,
  672.                     'config' => [
  673.                         'customFieldPosition' => $position++,
  674.                         'label' => [
  675.                             'en-GB' => 'Info article editor',
  676.                             'de-DE' => 'Info Artikeleinsteller',
  677.                         ],
  678.                     ],
  679.                 ],
  680.                 [
  681.                     'id' => '4ba665b9850b4246901c18c02b6e07af',
  682.                     'name' => 'wbfk_product_buy_price',
  683.                     'type' => CustomFieldTypes::TEXT,
  684.                     'config' => [
  685.                         'type' => CustomFieldTypes::TEXT,
  686.                         'componentName' => 'sw-field',
  687.                         'customFieldType' => 'textEditor',
  688.                         'customFieldPosition' => $position++,
  689.                         'label' => [
  690.                             'en-GB' => 'Buy price',
  691.                             'de-DE' => 'Einkaufspreis',
  692.                         ],
  693.                     ],
  694.                 ],
  695.                 [
  696.                     'id' => 'f871975c8db948c592d1981ac47d3e2e',
  697.                     'name' => 'wbfk_product_buy_price_without_project',
  698.                     'type' => CustomFieldTypes::TEXT,
  699.                     'config' => [
  700.                         'type' => CustomFieldTypes::TEXT,
  701.                         'componentName' => 'sw-field',
  702.                         'customFieldType' => 'textEditor',
  703.                         'customFieldPosition' => $position++,
  704.                         'label' => [
  705.                             'en-GB' => 'Buy price without project',
  706.                             'de-DE' => 'Einkaufspreis ohne eigenes Projekt',
  707.                         ],
  708.                     ],
  709.                 ],
  710.                 [
  711.                     'id' => 'b64b93d8b68f4c04a71359351d8c6258',
  712.                     'name' => 'wbfk_product_buy_price_subscription_24_months',
  713.                     'type' => CustomFieldTypes::TEXT,
  714.                     'config' => [
  715.                         'type' => CustomFieldTypes::TEXT,
  716.                         'componentName' => 'sw-field',
  717.                         'customFieldType' => 'textEditor',
  718.                         'customFieldPosition' => $position++,
  719.                         'label' => [
  720.                             'en-GB' => 'Buy price subscription 24 months',
  721.                             'de-DE' => 'Einkaufspreis Abo auf 24 Monate',
  722.                         ],
  723.                     ],
  724.                 ],
  725.                 [
  726.                     'id' => 'bfe48efbc51845f3924f10198baae0f9',
  727.                     'name' => 'wbfk_product_buy_price_subscription_12_months',
  728.                     'type' => CustomFieldTypes::TEXT,
  729.                     'config' => [
  730.                         'type' => CustomFieldTypes::TEXT,
  731.                         'componentName' => 'sw-field',
  732.                         'customFieldType' => 'textEditor',
  733.                         'customFieldPosition' => $position++,
  734.                         'label' => [
  735.                             'en-GB' => 'Buy price subscription 12 months',
  736.                             'de-DE' => 'Einkaufspreis Abo auf 12 Monate',
  737.                         ],
  738.                     ],
  739.                 ],
  740.                 [
  741.                     'id' => 'a490067d86ae4abd8ad3449c8ab9e90c',
  742.                     'name' => 'wbfk_product_buy_price_schools',
  743.                     'type' => CustomFieldTypes::TEXT,
  744.                     'config' => [
  745.                         'type' => CustomFieldTypes::TEXT,
  746.                         'componentName' => 'sw-field',
  747.                         'customFieldType' => 'textEditor',
  748.                         'customFieldPosition' => $position++,
  749.                         'label' => [
  750.                             'en-GB' => 'Buy price schools',
  751.                             'de-DE' => 'Einkaufspreis Schulen',
  752.                         ],
  753.                     ],
  754.                 ],
  755.                 [
  756.                     'id' => 'd5c93e6374e545a5acc3308e35e7d6bb',
  757.                     'name' => 'wbfk_product_buy_price_other',
  758.                     'type' => CustomFieldTypes::TEXT,
  759.                     'config' => [
  760.                         'type' => CustomFieldTypes::TEXT,
  761.                         'componentName' => 'sw-field',
  762.                         'customFieldType' => 'textEditor',
  763.                         'customFieldPosition' => $position++,
  764.                         'label' => [
  765.                             'en-GB' => 'Buy price other info',
  766.                             'de-DE' => 'Sonstige Hinweise für EK',
  767.                         ],
  768.                     ],
  769.                 ],
  770.                 [
  771.                     'id' => '3c6a05ee741c4e2dba279d9326a68a3e',
  772.                     'name' => 'wbfk_product_shipping_goods',
  773.                     'type' => CustomFieldTypes::BOOL,
  774.                     'config' => [
  775.                         'customFieldPosition' => $position++,
  776.                         'label' => [
  777.                             'en-GB' => 'Shipping goods',
  778.                             'de-DE' => 'Speditionsware',
  779.                         ],
  780.                     ],
  781.                 ],
  782.                 [
  783.                     'id' => '8d087bb680334011900870bdff37a2e9',
  784.                     'name' => 'wbfk_product_bulky_goods',
  785.                     'type' => CustomFieldTypes::BOOL,
  786.                     'config' => [
  787.                         'customFieldPosition' => $position++,
  788.                         'label' => [
  789.                             'en-GB' => 'Bulky goods',
  790.                             'de-DE' => 'Sperrgut',
  791.                         ],
  792.                     ],
  793.                 ],
  794.                 [
  795.                     'id' => '1e5624f80f854bbe8375abc1f9aa2c82',
  796.                     'name' => 'wbfk_product_stock_weighed',
  797.                     'type' => CustomFieldTypes::TEXT,
  798.                     'config' => [
  799.                         'customFieldPosition' => $position++,
  800.                         'label' => [
  801.                             'en-GB' => 'Stock weighed',
  802.                             'de-DE' => 'Lager gewogen',
  803.                         ],
  804.                     ],
  805.                 ],
  806.                 [
  807.                     'id' => 'f8cc821b1fbe84b24375aa2e569a5f80',
  808.                     'name' => 'wbfk_new_product_exported_jtl',
  809.                     'type' => CustomFieldTypes::BOOL,
  810.                     'config' => [
  811.                         'customFieldPosition' => $position,
  812.                         'label' => [
  813.                             'en-GB' => 'Product has been eported to JTL',
  814.                             'de-DE' => 'Produkt wurde zu JTL exportiert',
  815.                         ],
  816.                     ],
  817.                 ],
  818.             ],
  819.             'relations' => [
  820.                 [
  821.                     'id' => 'e18b8619d8844121bd88c7ca8d0cba92',
  822.                     'entityName' => 'product',
  823.                 ],
  824.             ],
  825.         ];
  826.         $position 10000;
  827.         $fieldsets[] = [
  828.             'id' => 'e060335a84d8490db198ef6f24a6a1a8',
  829.             'name' => 'wbfk_customer_data',
  830.             'active' => true,
  831.             'global' => false,
  832.             'config' => [
  833.                 'translated' => true,
  834.                 'label' => [
  835.                     'en-GB' => 'M24 - Customer Data',
  836.                     'de-DE' => 'M24 - Kundendaten',
  837.                 ],
  838.             ],
  839.             'customFields' => [
  840.                 [
  841.                     'id' => '9fc0d7fb9f624de09513e0902186bfbf',
  842.                     'name' => 'wbfk_customer_trade_license',
  843.                     'type' => CustomFieldTypes::TEXT,
  844.                     'config' => [
  845.                         'customFieldType' => CustomFieldTypes::MEDIA,
  846.                         'customFieldPosition' => $position++,
  847.                         'componentName' => 'sw-media-field',
  848.                         'label' => [
  849.                             'en-GB' => 'Trade license',
  850.                             'de-DE' => 'Gewerbeschein',
  851.                         ],
  852.                     ],
  853.                 ],
  854.             ],
  855.             'relations' => [
  856.                 [
  857.                     'id' => 'f48b8656d8844121bd88c7ca8d8cba78',
  858.                     'entityName' => 'customer',
  859.                 ],
  860.             ],
  861.         ];
  862.         $position 10000;
  863.         $fieldsets[] = [
  864.             'id' => '62150d4919d140d4bfaff184f315c494',
  865.             'name' => 'wbfk_property_group_configuration',
  866.             'active' => true,
  867.             'global' => false,
  868.             'config' => [
  869.                 'translated' => true,
  870.                 'label' => [
  871.                     'en-GB' => 'M24 - Property Group Configuration',
  872.                     'de-DE' => 'M24 - Eigenschaften Gruppen Konfiguration',
  873.                 ],
  874.             ],
  875.             'customFields' => [
  876.                 [
  877.                     'id' => '5f256e9e4a584a188754e39f3ef7cadc',
  878.                     'name' => 'wbfk_property_group_configuration_display_type',
  879.                     'type' => CustomFieldTypes::SELECT,
  880.                     'config' => [
  881.                         'customFieldType' => CustomFieldTypes::SELECT,
  882.                         'customFieldPosition' => $position++,
  883.                         'componentName' => 'sw-single-select',
  884.                         'options' => [
  885.                             [
  886.                                 'value' => 'one-value-min-max-selector',
  887.                                 'label' => [
  888.                                     'en-GB' => 'One Value, Min / Max Selector',
  889.                                     'de-DE' => 'One Value, Min / Max Selector',
  890.                                 ],
  891.                             ],
  892.                             [
  893.                                 'value' => 'two-values-two-min-selector',
  894.                                 'label' => [
  895.                                     'en-GB' => 'Two Values, two min Selector',
  896.                                     'de-DE' => 'Two Values, two min Selector',
  897.                                 ],
  898.                             ],
  899.                             [
  900.                                 'value' => 'one-value-min-selector',
  901.                                 'label' => [
  902.                                     'en-GB' => 'One Value, Min Selector',
  903.                                     'de-DE' => 'One Value, Min Selector',
  904.                                 ],
  905.                             ],
  906.                             [
  907.                                 'value' => 'one-value-max-selector',
  908.                                 'label' => [
  909.                                     'en-GB' => 'One Value, Max Selector',
  910.                                     'de-DE' => 'One Value, Max Selector',
  911.                                 ],
  912.                             ],
  913.                             [
  914.                                 'value' => 'range-single-value-selector',
  915.                                 'label' => [
  916.                                     'en-GB' => 'Range, Single Value Selector',
  917.                                     'de-DE' => 'Range, Single Value Selector',
  918.                                 ],
  919.                             ],
  920. // Deactivated till decision on how to proceed when no property is matched with slider selection, ideally this should empty result but shopware currently shows full result set.
  921. //                            [
  922. //                                'value' => 'range-contain-range-selector',
  923. //                                'label' => [
  924. //                                    'en-GB' => 'Range, Contain Range-Selector',
  925. //                                    'de-DE' => 'Range, Contain Range-Selector',
  926. //                                ],
  927. //                            ],
  928.                         ],
  929.                         'label' => [
  930.                             'en-GB' => 'Filter Display Type',
  931.                             'de-DE' => 'Filter Anzeige Typ',
  932.                         ],
  933.                     ],
  934.                 ],
  935.                 [
  936.                     'id' => 'e9ef0aa0fc2c401bb43bcccd2450a2e5',
  937.                     'name' => 'wbfk_property_group_configuration_value_type',
  938.                     'type' => CustomFieldTypes::SELECT,
  939.                     'config' => [
  940.                         'customFieldType' => CustomFieldTypes::SELECT,
  941.                         'customFieldPosition' => $position++,
  942.                         'componentName' => 'sw-single-select',
  943.                         'options' => [
  944.                             [
  945.                                 'value' => 'integer',
  946.                                 'label' => [
  947.                                     'en-GB' => 'Integer',
  948.                                     'de-DE' => 'Integer',
  949.                                 ],
  950.                             ],
  951.                             [
  952.                                 'value' => 'float',
  953.                                 'label' => [
  954.                                     'en-GB' => 'Float',
  955.                                     'de-DE' => 'Float',
  956.                                 ],
  957.                             ],
  958.                         ],
  959.                         'label' => [
  960.                             'en-GB' => 'Filter Value Type',
  961.                             'de-DE' => 'Filter Wert Typ',
  962.                         ],
  963.                         'helpText' => [
  964.                             'en-GB' => 'Used when the filter is a slider',
  965.                             'de-DE' => 'Wird verwendet, wenn der Filter ein Slider ist',
  966.                         ],
  967.                     ],
  968.                 ],
  969.                 [
  970.                     'id' => '1402140e9ba4419997a9b9e8179eabdb',
  971.                     'name' => 'wbfk_property_group_configuration_value_suffix',
  972.                     'type' => CustomFieldTypes::TEXT,
  973.                     'config' => [
  974.                         'customFieldPosition' => $position++,
  975.                         'label' => [
  976.                             'en-GB' => 'Filter Value Suffix',
  977.                             'de-DE' => 'Filter Wert Suffix',
  978.                         ],
  979.                         'helpText' => [
  980.                             'en-GB' => 'Used when the filter is a single slider',
  981.                             'de-DE' => 'Used when the filter is a single slider',
  982.                         ],
  983.                     ],
  984.                 ],
  985.                 [
  986.                     'id' => 'ecd887dc83164f03a3d6374ca41a7d09',
  987.                     'name' => 'wbfk_property_group_configuration_first_dimension_title',
  988.                     'type' => CustomFieldTypes::TEXT,
  989.                     'config' => [
  990.                         'customFieldPosition' => $position++,
  991.                         'label' => [
  992.                             'en-GB' => 'First Dimension Title',
  993.                             'de-DE' => 'Titel der ersten Dimension',
  994.                         ],
  995.                         'helpText' => [
  996.                             'en-GB' => 'Used when the filter is a two dimensional slider',
  997.                             'de-DE' => 'Wird verwendet, wenn der Filter ein zweidimensionaler Slider ist',
  998.                         ],
  999.                     ],
  1000.                 ],
  1001.                 [
  1002.                     'id' => 'dce6434a9c074fa9b102cfb1697a069a',
  1003.                     'name' => 'wbfk_property_group_configuration_second_dimension_title',
  1004.                     'type' => CustomFieldTypes::TEXT,
  1005.                     'config' => [
  1006.                         'customFieldPosition' => $position++,
  1007.                         'label' => [
  1008.                             'en-GB' => 'Second Dimension Title',
  1009.                             'de-DE' => 'Titel der zweiten Dimension',
  1010.                         ],
  1011.                         'helpText' => [
  1012.                             'en-GB' => 'Used when the filter is a two dimensional slider',
  1013.                             'de-DE' => 'Wird verwendet, wenn der Filter ein zweidimensionaler Slider ist',
  1014.                         ],
  1015.                     ],
  1016.                 ],
  1017.             ],
  1018.             'relations' => [
  1019.                 [
  1020.                     'id' => '514b0ad866dc483eaa35982568322a2c',
  1021.                     'entityName' => 'property_group',
  1022.                 ],
  1023.             ],
  1024.         ];
  1025.         return $fieldsets;
  1026.     }
  1027. }