custom/plugins/DreiwmBrandstetterPlugin/src/DreiwmBrandstetterPlugin.php line 19

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace DreiwmBrandstetterPlugin;
  3. use Exception;
  4. use Shopware\Core\Defaults;
  5. use Shopware\Core\Framework\Context;
  6. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
  7. use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
  8. use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
  9. use Shopware\Core\Framework\Plugin;
  10. use Shopware\Core\Framework\Plugin\Context\ActivateContext;
  11. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  12. use Shopware\Core\System\CustomField\Aggregate\CustomFieldSet\CustomFieldSetDefinition;
  13. use Shopware\Core\System\CustomField\Aggregate\CustomFieldSet\CustomFieldSetEntity;
  14. use Shopware\Core\System\CustomField\CustomFieldTypes;
  15. use Shopware\Storefront\Framework\ThemeInterface;
  16. class DreiwmBrandstetterPlugin extends Plugin implements ThemeInterface
  17. {
  18.     public const PROPERTY_GROUP_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a5d';
  19.     public const STD 'STD';
  20.     public const VARIANT_NAME_STD 'std';
  21.     public const VARIANT_ID_STD 'c6a5d1be343d4376ac440d82f838c8f0';
  22.     public const VARIANT_NAME_MON 'mon';
  23.     public const VARIANT_ID_MON '82ca30fe41504de5bbfd3161401e3813';
  24.     public const VARIANT_NAME_TUE 'tue';
  25.     public const VARIANT_ID_TUE '957270d5f121426d9a0b2eb3ce63a39a';
  26.     public const VARIANT_NAME_WED 'wed';
  27.     public const VARIANT_ID_WED '2aee8f873a484a36a1fd0ef366bb8f02';
  28.     public const VARIANT_NAME_THU 'thu';
  29.     public const VARIANT_ID_THU 'ede038e7681e48308faa05152be6b880';
  30.     public const VARIANT_NAME_FRI 'fri';
  31.     public const VARIANT_ID_FRI 'b3fc7149574d4db48e15588788efad63';
  32.     public const VARIANT_NAME_SAT 'sat';
  33.     public const VARIANT_ID_SAT 'f00e21d744ba4290bb8c1a4f26410a03';
  34.     public const VARIANT_NAME_SUN 'sun';
  35.     public const VARIANT_ID_SUN 'bcdcc40a36114067ba79e6bb0187f838';
  36.     public const MAXIMUM_FREE_LOCKER 20;
  37.     public const ALLERGENE_SW_NAME 'enthaltene Allergene';
  38.     public const ALLERGENS_PROPERTY_GROUP_ID '584624366d4a4ccdac467c1215630aa6';
  39.     public const ZUSATZSTOFFE_SW_NAME 'Zusatzstoffe';
  40.     public const ZUSATZSTOFFE_ID '17d768315c2d4fb8bf3a3eeaadb11f88';
  41.     public const SPUREN_VON_ALLERGENEN_SW_NAME 'kann Spuren von folgenden Allergenen enthalten';
  42.     public const SPUREN_VON_ALLERGENEN_ID 'f36da04f7da24034b48615b56c7ea951';
  43.     public const ERNAEHRUNGSFORM_SW_NAME 'Ernährungsform';
  44.     public const ERNAEHRUNGSFORM_ID '152bdcea1b6546808a67d9b4abe741db';
  45.     public const LIEFERART_NAME 'Lieferart';
  46.     public const LIEFERART_ID 'ac610cedc9364216b01ee06a4bc442b2';
  47.     public const LIEFERART_POST_ID self::POST_ID;
  48.     public const LIEFERART_RADBOTEN_ID self::RADBOTEN_ID;
  49.     public const LIEFERART_RADBOTEN_PLZ_97070_NAME 'Radboten, PLZ 97070';
  50.     public const LIEFERART_RADBOTEN_PLZ_97070_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a5d';
  51.     public const LIEFERART_RADBOTEN_PLZ_97070_EXPRESS_NAME 'Radboten Express, PLZ 97070';
  52.     public const LIEFERART_RADBOTEN_PLZ_97070_EXPRESS_ID 'e0823808e86f41b89b2f07ad9cb3340e';
  53.     public const LIEFERART_RADBOTEN_PLZ_97070_SUNDAY_NAME 'Radboten Express Sonntag, PLZ 97070';
  54.     public const LIEFERART_RADBOTEN_PLZ_97070_SUNDAY_ID 'c6a468edf5fd43e5bb9c711673486fe8';
  55.     public const LIEFERART_RADBOTEN_PLZ_97072_NAME 'Radboten, PLZ 97072';
  56.     public const LIEFERART_RADBOTEN_PLZ_97072_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a5e';
  57.     public const LIEFERART_RADBOTEN_PLZ_97072_EXPRESS_NAME 'Radboten Express, PLZ 97072';
  58.     public const LIEFERART_RADBOTEN_PLZ_97072_EXPRESS_ID '35f8d4f21a8b46658229b0fba6daa909';
  59.     public const LIEFERART_RADBOTEN_PLZ_97072_SUNDAY_NAME 'Radboten Express Sonntag, PLZ 97072';
  60.     public const LIEFERART_RADBOTEN_PLZ_97072_SUNDAY_ID 'a1c6f2fb26dc45c6b09824f6fd657d96';
  61.     public const LIEFERART_RADBOTEN_PLZ_97074_NAME 'Radboten, PLZ 97074';
  62.     public const LIEFERART_RADBOTEN_PLZ_97074_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a5f';
  63.     public const LIEFERART_RADBOTEN_PLZ_97074_EXPRESS_NAME 'Radboten Express, PLZ 97074';
  64.     public const LIEFERART_RADBOTEN_PLZ_97074_EXPRESS_ID '73894e97e95b48219f0c47fc3fc781f0';
  65.     public const LIEFERART_RADBOTEN_PLZ_97074_SUNDAY_NAME 'Radboten Express Sonntag, PLZ 97074';
  66.     public const LIEFERART_RADBOTEN_PLZ_97074_SUNDAY_ID '1da4629edb1a4a54856cc93f308bfb4b';
  67.     public const LIEFERART_RADBOTEN_PLZ_97076_NAME 'Radboten, PLZ 97076';
  68.     public const LIEFERART_RADBOTEN_PLZ_97076_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a60';
  69.     public const LIEFERART_RADBOTEN_PLZ_97076_EXPRESS_NAME 'Radboten Express, PLZ 97076';
  70.     public const LIEFERART_RADBOTEN_PLZ_97076_EXPRESS_ID '7fa8a41112cf49dcb87d4f1b830f458e';
  71.     public const LIEFERART_RADBOTEN_PLZ_97076_SUNDAY_NAME 'Radboten Express Sonntag, PLZ 97076';
  72.     public const LIEFERART_RADBOTEN_PLZ_97076_SUNDAY_ID 'e931c0fdc2434ddf9e8e0f5b6fbfa4f4';
  73.     public const LIEFERART_RADBOTEN_PLZ_97078_NAME 'Radboten, PLZ 97078';
  74.     public const LIEFERART_RADBOTEN_PLZ_97078_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a61';
  75.     public const LIEFERART_RADBOTEN_PLZ_97078_EXPRESS_NAME 'Radboten Express, PLZ 97078';
  76.     public const LIEFERART_RADBOTEN_PLZ_97078_EXPRESS_ID '5205cc7facec45d89e0ffe82ac4014e2';
  77.     public const LIEFERART_RADBOTEN_PLZ_97078_SUNDAY_NAME 'Radboten Express Sonntag, PLZ 97078';
  78.     public const LIEFERART_RADBOTEN_PLZ_97078_SUNDAY_ID 'c316dc1a63334c4e9f9ab0683ae3534b';
  79.     public const LIEFERART_RADBOTEN_PLZ_97080_NAME 'Radboten, PLZ 97080';
  80.     public const LIEFERART_RADBOTEN_PLZ_97080_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a62';
  81.     public const LIEFERART_RADBOTEN_PLZ_97080_EXPRESS_NAME 'Radboten Express, PLZ 97080';
  82.     public const LIEFERART_RADBOTEN_PLZ_97080_EXPRESS_ID '58393edb9a0b4328bae68801f28a73f9';
  83.     public const LIEFERART_RADBOTEN_PLZ_97080_SUNDAY_NAME 'Radboten Express Sonntag, PLZ 97080';
  84.     public const LIEFERART_RADBOTEN_PLZ_97080_SUNDAY_ID '3a269ee49b484cb49dacb9191c1e3e91';
  85.     public const LIEFERART_RADBOTEN_PLZ_97082_NAME 'Radboten, PLZ 97082';
  86.     public const LIEFERART_RADBOTEN_PLZ_97082_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a63';
  87.     public const LIEFERART_RADBOTEN_PLZ_97082_EXPRESS_NAME 'Radboten Express, PLZ 97082';
  88.     public const LIEFERART_RADBOTEN_PLZ_97082_EXPRESS_ID 'd6ce8df5d0304b5c830749897d9781c1';
  89.     public const LIEFERART_RADBOTEN_PLZ_97082_SUNDAY_NAME 'Radboten Express Sonntag, PLZ 97082';
  90.     public const LIEFERART_RADBOTEN_PLZ_97082_SUNDAY_ID '1662f6023e5947b3894738ee175e4a34';
  91.     public const LIEFERART_RADBOTEN_PLZ_97084_NAME 'Radboten, PLZ 97084';
  92.     public const LIEFERART_RADBOTEN_PLZ_97084_ID 'f9a9a3a3a3a34f6c9a7e0d2c2f8a1a64';
  93.     public const LIEFERART_RADBOTEN_PLZ_97084_EXPRESS_NAME 'Radboten Express, PLZ 97084';
  94.     public const LIEFERART_RADBOTEN_PLZ_97084_EXPRESS_ID 'c92312a3a1c148f6b8d6450dad5ebbd7';
  95.     public const LIEFERART_RADBOTEN_PLZ_97084_SUNDAY_NAME 'Radboten Express Sonntag, PLZ 97084';
  96.     public const LIEFERART_RADBOTEN_PLZ_97084_SUNDAY_ID '52b2f0a567374de5bd78d95ab395b80f';
  97.     public const LIEFERART_ABHOLUNG_ID self::ABHOLUNG_ID;
  98.     public const LIEFERART_PAKETSTATION_ID self::PAKETSTATION_ID;
  99.     public const ZUTATEN_NAME 'Deklaration / Zutaten';
  100.     public const ZUTATEN_ID '7ff79d6c69624d4fabea55f2664d7d7e';
  101.     public const ABHOLUNG_ID 'a3ad016852174f80a82c267ccbe01ef7';
  102.     public const ABHOLUNG_NAME 'Abholung in Hauptfiliale';
  103.     public const PAKETSTATION_ID '4917dec202424ba8987b3972c77e7b89';
  104.     public const PAKETSTATION_NAME 'Packstation';
  105.     public const POST_ID '980b558c95dd4f8086840954d5b149c3';
  106.     public const POST_NAME 'Post';
  107.     public const RADBOTEN_ID '53a70404aeac4a3c8296f13a148c6c53';
  108.     public const RADBOTEN_NAME 'Radboten';
  109.     public const DELIVERYTIME_ID 'eab6ae6cfc344fddbe44cab068802fb5';
  110.     const MAIL_TEMPLATE_ID '0abc616a2bc941a9b12cdcc51dae9e18';
  111.     public const SPUREN_VON_ALLERGENEN_CSV_NAME 'Spuren v.Allergenen';
  112.     public const BRENNWERT_KJ_PROPERTY_GROUP_ID 'eb85dfd0cb194998b342cc573cfca29e';
  113.     public const SPUREN_ALLERGENE_PROPERTY_GROUP_ID '6f0472a9d6824bf2a14b05a17842a517';
  114.     public const BRENNWERT_IN_KCAL_CSV 'KCal / Fertig';
  115.     public const FETT_PROPERTY_GROUP_ID '8265b24ec12c4207a9b68a6b595455d4';
  116.     public const ZUSATZSTOFFE_PROPERTY_GROUP_ID '6f95893400b441808c5859768e708e11';
  117.     public const DZUCKER_CSV_NAME 'DZucker / Fertig';
  118.     public const BRENNWERT_IN_KJ_CSV_NAME 'KJ / Fertig';
  119.     public const KCAL_CSV_NAME 'KCal / Fertig';
  120.     public const DZUCKER_PROPERTY_ID 'a02b6739ede6415883b727256c8cfbb9';
  121.     public const KOHLENHYDRATE_PROPERTY_ID '5b2c3355dd8f4a5fb0a77181334e7074';
  122.     public const KH_CSV_NAME 'KH / Fertig';
  123.     public const EISWEISS_PROPERTY_ID '90c4c7238b704aa5bd23ea617ba868b8';
  124.     public const GES_FETT_CSV_NAME 'Ges.Fett / Fertig';
  125.     public const FERTIGGEWICHT_CSV_NAME 'Fertiggewicht';
  126.     public const KCAL_SW_NAME 'kcal';
  127.     public const BRENNWERT_IN_KCAL_PROPERTY_GROUP_ID '7affa9d53b824e419f90e48cba2d9f88';
  128.     public const FETT_CSV_NAME 'Fett / Fertig';
  129.     public const EISWEISS_CSV_NAME 'Eiweiss / Fertig';
  130.     public const GES_FETT_PROPERTY_GROUP_ID '883ea3f0a87f44f9996209fe07e8331a';
  131.     public const ALLERGENE_CSV_NAME 'Allergene';
  132.     const ERNAEHRUNGSFORM_PROPERTY_GROUP_ID '106be7de8500446d9dfc05506dd8c143';
  133.     const KJ_SW_NAME 'kj';
  134.     const FETT_SW_NAME 'Fett';
  135.     const GES_FETT_SW_NAME 'davon gesättigte Fettsäuren';
  136.     const KH_SW_NAME 'Kohlenhydrate';
  137.     const DZUCKER_SW_NAME 'davon Zucker';
  138.     const EISWEISS_SW_NAME 'Eiweiß';
  139.     const SALZ_PROPERTY_ID 'bf9798bc50f34ba8befeea4b1e3c753c';
  140.     const SALZ_SW_NAME 'Salz';
  141.     const SALZ_CSV_NAME 'Salz / Fertig';
  142.     const UNIT_KG_ID '3565027a088a4406b0ea7a496b782237';
  143.     const BACKTAGE_PROPERTY_ID '2b5bfb9ebdb948bfbd13b9bdf79c67ed';
  144.     const BACKTAGE_PROPERTY_NAME 'Backtage';
  145.     public function install(Plugin\Context\InstallContext $installContext): void
  146.     {
  147.         // hole SystemConfigContainer um Einstellungen zu setzen
  148.         $services $this->container->get('Shopware\Core\System\SystemConfig\SystemConfigService');
  149.         // definiere Captchas
  150.         $basicCaptcha = [
  151.             'honeypot' => ['name' => 'honeypot''isActive' => true],
  152.             'basicCaptcha' => ['name' => 'basicCaptcha''isActive' => true],
  153.             'googleReCaptchaV2' => ['name' => 'googleReCaptchaV2''isActive' => false],
  154.             'googleReCaptchaV3' => [
  155.                 'name' => 'googleReCaptchaV3',
  156.                 'isActive' => false,
  157.                 'siteKey' => '',
  158.                 'secretKey' => '',
  159.                 'threshold' => 0.5
  160.             ],
  161.         ];
  162.         // setze Captchas
  163.         $services->set('core.basicInformation.activeCaptchasV2'$basicCaptcha);
  164.         // setze familienfreundlicher Shop auf true
  165.         $services->set('core.basicInformation.familyFriendly'true);
  166.         // setze Produktbewertungen auf false. Geht aber leider nicht. Weiß nicht warum.
  167.         $services->set('core.productReviews.isActive'false);
  168.         // Zusatzfelder installieren
  169.         $this->createOrUpdateCustomFields();
  170.         try {
  171.             // Lieferzeiten installieren
  172.             $this->createDeliveryTime();
  173.         } catch (Exception $exception) {
  174.             // No, we've already installed the fields, it's fine.
  175.         }
  176.         try {
  177.             // Eigenschaften installieren
  178.             $this->createPropertiesOld();
  179.         } catch (Exception $exception) {
  180.             // No, we've already installed the fields, it's fine.
  181.         }
  182.         try {
  183.             // Lieferzeiten installieren
  184.             $this->createShippingMethod(self::ABHOLUNG_IDself::ABHOLUNG_NAME);
  185.         } catch (Exception $exception) {
  186.             // No, we've already installed the fields, it's fine.
  187.         }
  188.         try {
  189.             // Lieferzeiten installieren
  190.             $this->createShippingMethod(self::PAKETSTATION_IDself::PAKETSTATION_NAME);
  191.         } catch (Exception $exception) {
  192.             // No, we've already installed the fields, it's fine.
  193.         }
  194.         $this->initializeShippingMethods();
  195.     }
  196.     /**
  197.      * Erstellt neue Lieferarten
  198.      * @param array $shippingMethods Array mit den Lieferarten
  199.      * @return void
  200.      */
  201.     private function createMultipleShippingMethods(array $shippingMethods): void
  202.     {
  203.         foreach ($shippingMethods as $method) {
  204.             $this->createShippingMethod($method['id'], $method['name']);
  205.         }
  206.     }
  207.     public function update(UpdateContext $updateContext): void
  208.     {
  209.         parent::update($updateContext);
  210.         if (version_compare($updateContext->getCurrentPluginVersion(), '1.4.0''<')) {
  211.             /** @var EntityRepositoryInterface $customFieldSetRepository */
  212.             $customFieldSetRepository $this->container->get('custom_field_set.repository');
  213.             $customFieldSetRepository->upsert([
  214.                 [
  215.                     // Bestehendes Custom-Field-Set
  216.                     'id' => '1035f6fe82db4caea82ccc0e8491edae',
  217.                     'customFields' => [
  218.                         [
  219.                             'name' => 'baking_days',
  220.                             'type' => CustomFieldTypes::TEXT,
  221.                             'config' => [
  222.                                 'componentName' => 'sw-field',
  223.                                 'customFieldType' => 'text',
  224.                                 'customFieldPosition' => 7,
  225.                                 'label' => [
  226.                                     'de-DE' => 'Backtage',
  227.                                     'en-GB' => 'Baking Days',
  228.                                 ],
  229.                                 'helpText' => [
  230.                                     'de-DE' => 'Backtage. Wenn leer, dann wird an allen Tagen gebacken.',
  231.                                     'en-GB' => 'Baking Days',
  232.                                 ],
  233.                             ],
  234.                         ],
  235.                     ],
  236.                 ],
  237.             ], Context::createDefaultContext());
  238.         }
  239. //        if (version_compare($updateContext->getCurrentPluginVersion(), '1.2.0', '<')) {
  240. //            $this->createPropertyOption(self::LIEFERART_ID, self::LIEFERART_NAME,
  241. //                self::LIEFERART_RADBOTEN_PLZ_97070_SUNDAY_ID, self::LIEFERART_RADBOTEN_PLZ_97070_SUNDAY_NAME);
  242. //            $this->createPropertyOption(self::LIEFERART_ID, self::LIEFERART_NAME,
  243. //                self::LIEFERART_RADBOTEN_PLZ_97072_SUNDAY_ID, self::LIEFERART_RADBOTEN_PLZ_97072_SUNDAY_NAME);
  244. //            $this->createPropertyOption(self::LIEFERART_ID, self::LIEFERART_NAME,
  245. //                self::LIEFERART_RADBOTEN_PLZ_97074_SUNDAY_ID, self::LIEFERART_RADBOTEN_PLZ_97074_SUNDAY_NAME);
  246. //            $this->createPropertyOption(self::LIEFERART_ID, self::LIEFERART_NAME,
  247. //                self::LIEFERART_RADBOTEN_PLZ_97076_SUNDAY_ID,
  248. //                self::LIEFERART_RADBOTEN_PLZ_97076_SUNDAY_NAME);
  249. //            $this->createPropertyOption(self::LIEFERART_ID, self::LIEFERART_NAME,
  250. //                self::LIEFERART_RADBOTEN_PLZ_97078_SUNDAY_ID,
  251. //                self::LIEFERART_RADBOTEN_PLZ_97078_SUNDAY_NAME);
  252. //            $this->createPropertyOption(self::LIEFERART_ID, self::LIEFERART_NAME,
  253. //                self::LIEFERART_RADBOTEN_PLZ_97080_SUNDAY_ID,
  254. //                self::LIEFERART_RADBOTEN_PLZ_97080_SUNDAY_NAME);
  255. //            $this->createPropertyOption(self::LIEFERART_ID, self::LIEFERART_NAME,
  256. //                self::LIEFERART_RADBOTEN_PLZ_97082_SUNDAY_ID,
  257. //                self::LIEFERART_RADBOTEN_PLZ_97082_SUNDAY_NAME);
  258. //            $this->createPropertyOption(self::LIEFERART_ID, self::LIEFERART_NAME,
  259. //                self::LIEFERART_RADBOTEN_PLZ_97084_SUNDAY_ID, self::LIEFERART_RADBOTEN_PLZ_97084_SUNDAY_NAME);
  260. //        }
  261.     }
  262.     /**
  263.      * Initialisiert die Lieferarten
  264.      * @return void
  265.      */
  266.     private function initializeShippingMethods(): void
  267.     {
  268.         $shippingMethods = [
  269.             [
  270.                 'id' => self::PAKETSTATION_ID,
  271.                 'name' => self::PAKETSTATION_NAME
  272.             ],
  273.             [
  274.                 'id' => self::POST_ID,
  275.                 'name' => self::POST_NAME
  276.             ],
  277.             [
  278.                 'id' => self::RADBOTEN_ID,
  279.                 'name' => self::RADBOTEN_NAME
  280.             ],
  281.             [
  282.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97070_ID,
  283.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97070_NAME
  284.             ],
  285.             [
  286.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97070_EXPRESS_ID,
  287.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97070_EXPRESS_NAME
  288.             ],
  289.             [
  290.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97070_SUNDAY_ID,
  291.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97070_SUNDAY_NAME
  292.             ],
  293.             [
  294.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97072_ID,
  295.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97072_NAME
  296.             ],
  297.             [
  298.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97072_EXPRESS_ID,
  299.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97072_EXPRESS_NAME
  300.             ],
  301.             [
  302.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97072_SUNDAY_ID,
  303.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97072_SUNDAY_NAME
  304.             ],
  305.             [
  306.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97074_ID,
  307.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97074_NAME
  308.             ],
  309.             [
  310.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97074_EXPRESS_ID,
  311.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97074_EXPRESS_NAME
  312.             ],
  313.             [
  314.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97074_SUNDAY_ID,
  315.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97074_SUNDAY_NAME
  316.             ],
  317.             [
  318.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97076_ID,
  319.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97076_NAME
  320.             ],
  321.             [
  322.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97076_EXPRESS_ID,
  323.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97076_EXPRESS_NAME
  324.             ],
  325.             [
  326.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97076_SUNDAY_ID,
  327.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97076_SUNDAY_NAME
  328.             ],
  329.             [
  330.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97078_ID,
  331.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97078_NAME
  332.             ],
  333.             [
  334.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97078_EXPRESS_ID,
  335.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97078_EXPRESS_NAME
  336.             ],
  337.             [
  338.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97078_SUNDAY_ID,
  339.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97078_SUNDAY_NAME
  340.             ],
  341.             [
  342.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97080_ID,
  343.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97080_NAME
  344.             ],
  345.             [
  346.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97080_EXPRESS_ID,
  347.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97080_EXPRESS_NAME
  348.             ],
  349.             [
  350.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97080_SUNDAY_ID,
  351.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97080_SUNDAY_NAME
  352.             ],
  353.             [
  354.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97082_ID,
  355.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97082_NAME
  356.             ],
  357.             [
  358.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97082_EXPRESS_ID,
  359.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97082_EXPRESS_NAME
  360.             ],
  361.             [
  362.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97082_SUNDAY_ID,
  363.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97082_SUNDAY_NAME
  364.             ],
  365.             [
  366.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97084_ID,
  367.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97084_NAME
  368.             ],
  369.             [
  370.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97084_EXPRESS_ID,
  371.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97084_EXPRESS_NAME
  372.             ],
  373.             [
  374.                 'id' => self::LIEFERART_RADBOTEN_PLZ_97084_SUNDAY_ID,
  375.                 'name' => self::LIEFERART_RADBOTEN_PLZ_97084_SUNDAY_NAME
  376.             ]
  377.         ];
  378.         $this->createMultipleShippingMethods($shippingMethods);
  379.     }
  380.     /**
  381.      * Beim Aktivieren des Plugins wird das Installationsdatum auf einen festen Wert, der weit in der
  382.      * Vergangenheit liegt gesetzt. Dies ist notwendig, damit das 3WM-Plugin immer als erstes geladen wird und andere
  383.      * Plugins das 3WM-Plugin nicht überschreiben.
  384.      * @param ActivateContext $activateContext
  385.      * @return void
  386.      */
  387.     public function activate(ActivateContext $activateContext): void
  388.     {
  389.         // Aufruf der Eltern-Methode um das Plugin zu aktivieren
  390.         parent::activate($activateContext);
  391.     }
  392.     /**
  393.      * Diese Methode erstellt eine neue Lieferzeit und weist diese den vom Plugin erstellen Lieferarten zu,
  394.      * da Shopware die Lieferzeit braucht, um eine Versandart zu erstellen.
  395.      * Es wird eine neue Lieferzeit erstellt, da man keinen Marker für bestehende Lieferzeiten hat
  396.      */
  397.     private function createDeliveryTime(): void
  398.     {
  399.         /** @var EntityRepositoryInterface $deliveryTimeRepository */
  400.         // hole das delivery_time.repository
  401.         $deliveryTimeRepository $this->container->get('delivery_time.repository');
  402.         $deliveryTimeRepository->upsert([
  403.             [
  404.                 'id' => self::DELIVERYTIME_ID,
  405.                 'min' => 1,
  406.                 'max' => 2,
  407.                 'unit' => 'day',
  408.                 'translations' => [
  409.                     [
  410.                         'languageId' => Defaults::LANGUAGE_SYSTEM,
  411.                         'name' => '1-2 Tage',
  412.                     ],
  413.                 ],
  414.             ]
  415.         ], Context::createDefaultContext());
  416.     }
  417.     private function getDefaultRuleIdForShippingMethod(): ?string
  418.     {
  419.         // get a Rule
  420.         $criteria = new Criteria();
  421.         /** @var EntityRepositoryInterface $ruleRepository */
  422.         // hole das rule.repository
  423.         $ruleRepository $this->container->get('rule.repository');
  424.         // suche nach dem Namen 'Always valid (Default)' in der Spalte 'name'
  425.         $criteria->addFilter(new EqualsFilter('name''Always valid (Default)'));
  426.         return $ruleRepository->searchIds($criteriaContext::createDefaultContext())->firstId();
  427.     }
  428.     private function createShippingMethod(string $shippingMethodId$shippingMethodName): void
  429.     {
  430.         /** @var EntityRepositoryInterface $shippingMethodRepository */
  431.         // hole das custom_field_set.repository
  432.         $shippingMethodRepository $this->container->get('shipping_method.repository');
  433.         // Produkte-Zusatzfelder
  434.         $shippingMethodData = [
  435.             [
  436.                 'id' => $shippingMethodId,
  437.                 'active' => true,
  438.                 'translations' => [
  439.                     [
  440.                         'languageId' => Defaults::LANGUAGE_SYSTEM,
  441.                         'name' => $shippingMethodName,
  442.                     ],
  443.                 ],
  444.                 'deliveryTimeId' => self::DELIVERYTIME_ID,
  445.                 'availabilityRuleId' => $this->getDefaultRuleIdForShippingMethod(),
  446.             ]
  447.         ];
  448.         try {
  449.             $shippingMethodRepository->upsert($shippingMethodDataContext::createDefaultContext());
  450.         } catch (Exception $exception) {
  451.             // No, we've already installed the fields, it's fine.
  452.         }
  453.     }
  454.     /**
  455.      * Erstellt die Zusatzfelder
  456.      * @return void
  457.      */
  458.     private function createOrUpdateCustomFields(): void
  459.     {
  460.         /** @var EntityRepositoryInterface $customFieldSetRepository */
  461.         // hole das custom_field_set.repository
  462.         $customFieldSetRepository $this->container->get('custom_field_set.repository');
  463.         // Produkte-Zusatzfelder
  464.         $customFieldSetRepository->upsert([
  465.             [
  466.                 'name' => 'brandstetterProducts',
  467.                 'id' => '1035f6fe82db4caea82ccc0e8491edae',
  468.                 'config' => [
  469.                     'label' => [
  470.                         'de-DE' => 'Brandstetter-Produkte',
  471.                     ],
  472.                 ],
  473.                 'customFields' => [
  474.                     [
  475.                         'name' => 'kontingent',
  476.                         'type' => CustomFieldTypes::TEXT,
  477.                         'config' => [
  478.                             'componentName' => 'sw-field',
  479.                             'customFieldType' => 'number',
  480.                             'customFieldPosition' => 1,
  481.                             'label' => [
  482.                                 'de-DE' => 'Kontingent',
  483.                             ],
  484.                         ],
  485.                     ],
  486.                     [
  487.                         'name' => 'packstationMultiplier',
  488.                         'type' => CustomFieldTypes::FLOAT,
  489.                         'config' => [
  490.                             'componentName' => 'sw-field',
  491.                             'customFieldType' => 'number',
  492.                             'customFieldPosition' => 2,
  493.                             'label' => [
  494.                                 'de-DE' => 'Packstation-Multiplikator',
  495.                             ],
  496.                         ],
  497.                     ],
  498.                     [
  499.                         'name' => 'zutaten',
  500.                         'type' => CustomFieldTypes::TEXT,
  501.                         'config' => [
  502.                             'componentName' => 'sw-field',
  503.                             'customFieldType' => 'text',
  504.                             'customFieldPosition' => 3,
  505.                             'label' => [
  506.                                 'de-DE' => 'Deklaration / Zutaten',
  507.                             ],
  508.                         ],
  509.                     ],
  510.                     [
  511.                         'name' => 'product_availability_constraints',
  512.                         'type' => CustomFieldTypes::TEXT,
  513.                         'config' => [
  514.                             'componentName' => 'sw-field',
  515.                             'customFieldType' => 'text',
  516.                             'customFieldPosition' => 4,
  517.                             'label' => [
  518.                                 'de-DE' => 'Verfügbarkeitsbeschränkungen',
  519.                             ],
  520.                             'description' => [
  521.                                 'de-DE' => 'Hier werden die Verfügbarkeitsbeschränkungen für das Produkt aus BIT aus dem Feld "Freigabe" übernommen.',
  522.                             ]
  523.                         ],
  524.                     ],
  525.                     [
  526.                         'name' => 'product_available_from',
  527.                         'type' => CustomFieldTypes::DATETIME,
  528.                         'config' => [
  529.                             'componentName' => 'sw-field',
  530.                             'customFieldType' => 'date',
  531.                             'customFieldPosition' => 5,
  532.                             'label' => [
  533.                                 'de-DE' => 'Produkt verfügbar ab',
  534.                             ],
  535.                             'description' => [
  536.                                 'de-DE' => 'Interpretiertes Feld aus availability_constraints',
  537.                             ],
  538.                             'dateType' => 'datetime',
  539.                             'config' => [
  540.                                 'time_24hr' => true,
  541.                             ],
  542.                             'type' => 'date',
  543.                         ],
  544.                     ],
  545.                     [
  546.                         'name' => 'product_available_until',
  547.                         'type' => CustomFieldTypes::DATETIME,
  548.                         'config' => [
  549.                             'componentName' => 'sw-field',
  550.                             'customFieldType' => 'date',
  551.                             'customFieldPosition' => 6,
  552.                             'label' => [
  553.                                 'de-DE' => 'Produkt verfügbar bis',
  554.                             ],
  555.                             'description' => [
  556.                                 'de-DE' => 'Interpretiertes Feld aus availability_constraints',
  557.                             ],
  558.                             'dateType' => 'datetime',
  559.                             'config' => [
  560.                                 'time_24hr' => true,
  561.                             ],
  562.                             'type' => 'date',
  563.                         ],
  564.                     ],
  565.                     [
  566.                         'name' => 'baking_days',
  567.                         'type' => CustomFieldTypes::TEXT,
  568.                         'config' => [
  569.                             'componentName' => 'sw-field',
  570.                             'customFieldType' => 'text',
  571.                             'customFieldPosition' => 7,
  572.                             'label' => [
  573.                                 'de-DE' => 'Backtage',
  574.                                 'en-GB' => 'Baking Days',
  575.                             ],
  576.                             'helpText' => [
  577.                                 'de-DE' => 'Backtage. Wenn leer, werden alle Tage als Backtage angenommen.',
  578.                             ],
  579.                         ],
  580.                     ],
  581.                 ],
  582.                 'relations' => [
  583.                     [
  584.                         'entityName' => 'product',
  585.                     ],
  586.                 ],
  587.             ],
  588.         ], Context::createDefaultContext());
  589.         // Bestellungen-Zusatzfelder
  590.         $customFieldSetRepository->upsert([
  591.             [
  592.                 'name' => 'brandstetter_orders',
  593.                 'id' => '1035f6fe82db4caea82ccc0e8491edaf',
  594.                 'config' => [
  595.                     'label' => [
  596.                         'de-DE' => 'Brandstetter-Bestellungen',
  597.                     ],
  598.                 ],
  599.                 'customFields' => [
  600.                     [
  601.                         'name' => 'brandstetter_orders_desired_delivery_date',
  602.                         'type' => CustomFieldTypes::DATETIME,
  603.                         'config' => [
  604.                             'componentName' => 'sw-field',
  605.                             'customFieldType' => 'date',
  606.                             'customFieldPosition' => 1,
  607.                             'label' => [
  608.                                 'de-DE' => 'Gewünschtes Lieferdatum',
  609.                             ],
  610.                             'dateType' => 'datetime',
  611.                             'config' => [
  612.                                 'time_24hr' => true,
  613.                             ],
  614.                             'type' => 'date',
  615.                         ],
  616.                     ],
  617.                     [
  618.                         'name' => 'brandstetter_orders_customer_pin',
  619.                         'type' => CustomFieldTypes::TEXT,
  620.                         'config' => [
  621.                             'componentName' => 'sw-field',
  622.                             'customFieldType' => 'text',
  623.                             'customFieldPosition' => 2,
  624.                             'label' => [
  625.                                 'de-DE' => 'Kunden-PIN',
  626.                             ],
  627.                         ],
  628.                     ],
  629.                     [
  630.                         'name' => 'brandstetter_orders_merchant_pin',
  631.                         'type' => CustomFieldTypes::TEXT,
  632.                         'config' => [
  633.                             'componentName' => 'sw-field',
  634.                             'customFieldType' => 'text',
  635.                             'customFieldPosition' => 3,
  636.                             'label' => [
  637.                                 'de-DE' => 'Händler-PIN',
  638.                             ],
  639.                         ],
  640.                     ],
  641.                     [
  642.                         'name' => 'brandstetter_orders_desired_delivery_timeRange_radboten',
  643.                         'type' => CustomFieldTypes::TEXT,
  644.                         'config' => [
  645.                             'componentName' => 'sw-field',
  646.                             'customFieldType' => 'text',
  647.                             'customFieldPosition' => 3,
  648.                             'label' => [
  649.                                 'de-DE' => 'Gewünschte Lieferzeit (Radboten)',
  650.                             ],
  651.                         ],
  652.                     ],
  653.                     [
  654.                         'name' => 'brandstetter_orders_desired_dropoff_location',
  655.                         'type' => CustomFieldTypes::TEXT,
  656.                         'config' => [
  657.                             'componentName' => 'sw-field',
  658.                             'customFieldType' => 'text',
  659.                             'customFieldPosition' => 4,
  660.                             'label' => [
  661.                                 'de-DE' => 'Gewünschter Ablageort',
  662.                             ],
  663.                         ],
  664.                     ]
  665.                 ],
  666.                 'relations' => [
  667.                     [
  668.                         'entityName' => 'order',
  669.                     ],
  670.                 ],
  671.             ],
  672.         ], Context::createDefaultContext());
  673.     }
  674.     /**
  675.      * Erstellt die Eigenschaften für die Lieferzeit
  676.      * @return void
  677.      */
  678.     private function createPropertiesOld(): void
  679.     {
  680.         // Context erstellen
  681.         $context Context::createDefaultContext();
  682.         // Ids werden festgelegt, damit diese in allen Umgebungen gleich sind und überall darauf zugegriffen werden kann
  683.         $propertyGroup = [
  684.             'name' => 'Kontingenttag',
  685.             'id' => self::PROPERTY_GROUP_ID,
  686.             'displayType' => 'text',
  687.             'sortingType' => 'numeric',
  688.             'options' => [
  689.                 [
  690.                     'id' => self::VARIANT_ID_MON,
  691.                     'name' => self::VARIANT_NAME_MON,
  692.                     'position' => 1,
  693.                 ],
  694.                 [
  695.                     'id' => self::VARIANT_ID_TUE,
  696.                     'name' => self::VARIANT_NAME_TUE,
  697.                     'position' => 2,
  698.                 ],
  699.                 [
  700.                     'id' => self::VARIANT_ID_WED,
  701.                     'name' => self::VARIANT_NAME_WED,
  702.                     'position' => 3,
  703.                 ],
  704.                 [
  705.                     'id' => self::VARIANT_ID_THU,
  706.                     'name' => self::VARIANT_NAME_THU,
  707.                     'position' => 4,
  708.                 ],
  709.                 [
  710.                     'id' => self::VARIANT_ID_FRI,
  711.                     'name' => self::VARIANT_NAME_FRI,
  712.                     'position' => 5,
  713.                 ],
  714.                 [
  715.                     'id' => self::VARIANT_ID_SAT,
  716.                     'name' => self::VARIANT_NAME_SAT,
  717.                     'position' => 6,
  718.                 ],
  719.                 [
  720.                     'id' => self::VARIANT_ID_SUN,
  721.                     'name' => self::VARIANT_NAME_SUN,
  722.                     'position' => 7,
  723.                 ],
  724.                 [
  725.                     'id' => self::VARIANT_ID_STD,
  726.                     'name' => self::VARIANT_NAME_STD,
  727.                     'position' => 8,
  728.                 ]
  729.             ]
  730.         ];
  731.         // Eigenschafts-Gruppe erstellen oder aktualisieren
  732.         $this->container->get('property_group.repository')->upsert([$propertyGroup], $context);
  733.     }
  734.     /**
  735.      * @param string $propertyId ID der Eigenschaft
  736.      * @param string $propertyName Name der Eigenschaft
  737.      * @param null $optionId
  738.      * @param null $optionName
  739.      * @return void
  740.      */
  741.     private function createPropertyOption(
  742.         string $propertyId,
  743.         string $propertyName,
  744.         $optionId null,
  745.         $optionName null
  746.     ): void {
  747.         // Context erstellen
  748.         $context Context::createDefaultContext();
  749.         // prüfe ob optionId und optionName gesetzt sind. Wenn ja, dann wird die Option mit der ID und dem Namen erstellt
  750.         if ($optionId && $optionName) {
  751.             $propertyGroup = [
  752.                 'id' => $propertyId,
  753.                 'name' => $propertyName,
  754.                 'displayType' => 'text',
  755.                 'sortingType' => 'alphanumeric',
  756.                 'options' => [
  757.                     [
  758.                         'id' => $optionId,
  759.                         'name' => $optionName,
  760.                         'position' => 1,
  761.                     ]
  762.                 ]
  763.             ];
  764.         } else {
  765.             // wenn nicht, dann wird nur die Eigenschaft erstellt
  766.             $propertyGroup = [
  767.                 'id' => $propertyId,
  768.                 'name' => $propertyName,
  769.                 'displayType' => 'text',
  770.                 'sortingType' => 'alphanumeric',
  771.                 'filterable' => false
  772.             ];
  773.         }
  774.         // Ids werden festgelegt, damit diese in allen Umgebungen gleich sind und überall darauf zugegriffen werden kann
  775. //        dd($propertyGroup);
  776.         // Eigenschafts-Gruppe erstellen oder aktualisieren
  777.         $this->container->get('property_group.repository')->upsert([$propertyGroup], $context);
  778.     }
  779.     private function createUnit(string $shortCodestring $unitName): void
  780.     {
  781.         $unitRepository $this->container->get('unit.repository');
  782.         $unitRepository->upsert([
  783.             [
  784.                 'id' => self::UNIT_KG_ID,
  785.                 'name' => $unitName,
  786.                 'shortCode' => $shortCode,
  787.                 'unitTranslation' => [
  788.                     [
  789.                         'unitId' => self::UNIT_KG_ID,
  790.                         'languageId' => Defaults::LANGUAGE_SYSTEM,
  791.                         'shortCode' => $shortCode,
  792.                         'unitName' => $unitName
  793.                     ]
  794.                 ]
  795.             ]
  796.         ], Context::createDefaultContext());
  797.     }
  798.     private function createSaisonalCustomFieldSetForProducts(): void
  799.     {
  800.         /** @var EntityRepositoryInterface $customFieldSetRepository */
  801.         // hole das custom_field_set.repository
  802.         $customFieldSetRepository $this->container->get('custom_field_set.repository');
  803.         // Inserte das CustomFieldSet für die saisonalen Produkte in brandstetterProducts
  804.         $customFieldSetRepository->upsert([
  805.             [
  806.                 'name' => 'brandstetterProducts',
  807.                 'id' => '1035f6fe82db4caea82ccc0e8491edae',
  808.                 'config' => [
  809.                     'label' => [
  810.                         'de-DE' => 'Brandstetter-Produkte',
  811.                     ],
  812.                 ],
  813.                 'customFields' => [
  814.                     [
  815.                         'name' => 'product_availability_constraints',
  816.                         'type' => CustomFieldTypes::TEXT,
  817.                         'config' => [
  818.                             'componentName' => 'sw-field',
  819.                             'customFieldType' => 'text',
  820.                             'customFieldPosition' => 4,
  821.                             'label' => [
  822.                                 'de-DE' => 'Verfügbarkeitsbeschränkungen',
  823.                             ],
  824.                             'description' => [
  825.                                 'de-DE' => 'Hier werden die Verfügbarkeitsbeschränkungen für das Produkt aus BIT aus dem Feld "Freigabe" übernommen.',
  826.                             ]
  827.                         ],
  828.                     ],
  829.                     [
  830.                         'name' => 'product_available_from',
  831.                         'type' => CustomFieldTypes::DATETIME,
  832.                         'config' => [
  833.                             'componentName' => 'sw-field',
  834.                             'customFieldType' => 'date',
  835.                             'customFieldPosition' => 5,
  836.                             'label' => [
  837.                                 'de-DE' => 'Produkt verfügbar ab',
  838.                             ],
  839.                             'description' => [
  840.                                 'de-DE' => 'Interpretiertes Feld aus availability_constraints',
  841.                             ],
  842.                             'dateType' => 'datetime',
  843.                             'config' => [
  844.                                 'time_24hr' => true,
  845.                             ],
  846.                             'type' => 'date',
  847.                         ],
  848.                     ],
  849.                     [
  850.                         'name' => 'product_available_until',
  851.                         'type' => CustomFieldTypes::DATETIME,
  852.                         'config' => [
  853.                             'componentName' => 'sw-field',
  854.                             'customFieldType' => 'date',
  855.                             'customFieldPosition' => 6,
  856.                             'label' => [
  857.                                 'de-DE' => 'Produkt verfügbar bis',
  858.                             ],
  859.                             'description' => [
  860.                                 'de-DE' => 'Interpretiertes Feld aus availability_constraints',
  861.                             ],
  862.                             'dateType' => 'datetime',
  863.                             'config' => [
  864.                                 'time_24hr' => true,
  865.                             ],
  866.                             'type' => 'date',
  867.                         ],
  868.                     ],
  869.                 ],
  870.             ],
  871.         ], Context::createDefaultContext());
  872.     }
  873.     private function createLockerNumberCustomFieldSet(): void
  874.     {
  875.         $context Context::createDefaultContext();
  876.         /** @var EntityRepositoryInterface $customFieldRepository */
  877.         // hole das custom_field_set.repository
  878.         $customFieldRepository $this->container->get('custom_field.repository');
  879.         // Custom Field Set existiert, ID abrufen
  880.         // Custom Field Set aktualisieren
  881.         // dd($customFieldRepository->search(new Criteria(), $context));
  882.         $customFieldRepository->upsert([
  883.             [
  884.                 'id' => \Shopware\Core\Framework\Uuid\Uuid::randomHex(),
  885.                 'name' => 'brandstetter_orders_box_name',
  886.                 'type' => CustomFieldTypes::TEXT,
  887.                 'config' => [
  888.                     'componentName' => 'sw-field',
  889.                     'customFieldType' => 'text',
  890.                     'customFieldPosition' => 5,
  891.                     'label' => [
  892.                         'de-DE' => 'Fachname',
  893.                     ],
  894.                     'description' => [
  895.                         'de-DE' => 'Fachname der Abholstation',
  896.                     ]
  897.                 ],
  898.                 'customFieldSetId' => '1035f6fe82db4caea82ccc0e8491edaf',
  899.             ]
  900.         ], $context);
  901.         // Inserte das CustomFieldSet für die saisonalen Produkte in brandstetterProducts
  902. //        $customFieldSetRepository->upsert([
  903. //            [
  904. //                'id' => '1035f6fe82db4caea82ccc0e8491edaf',
  905. //                'name' => 'brandstetter_orders',
  906. //                'config' => [
  907. //                    'label' => [
  908. //                        'de-DE' => 'Brandstetter-Bestellungen',
  909. //                    ],
  910. //                ],
  911. //                'customFields' => [
  912. //                    [
  913. //                        'name' => 'brandstetter_orders_order_locker_number',
  914. //                        'type' => CustomFieldTypes::TEXT,
  915. //                        'config' => [
  916. //                            'componentName' => 'sw-field',
  917. //                            'customFieldType' => 'text',
  918. //                            'customFieldPosition' => 5,
  919. //                            'label' => [
  920. //                                'de-DE' => 'Fachnummer',
  921. //                            ],
  922. //                            'description' => [
  923. //                                'de-DE' => 'Fachnummer der Abholstation',
  924. //                            ]
  925. //                        ],
  926. //                    ],
  927. //                ],
  928. //                'relations' => [
  929. //                    [
  930. //                        'entityName' => 'order',
  931. //                    ]
  932. //                ],
  933. //            ]
  934. //        ], Context::createDefaultContext());
  935.     }
  936. }