custom/plugins/EnetPickupDate/src/EnetPickupDate.php line 8

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace EnetPickupDate;
  3. use Shopware\Core\Framework\Plugin;
  4. use Shopware\Core\System\CustomField\CustomFieldTypes;
  5. class EnetPickupDate extends Plugin
  6. {
  7.     public function install(Plugin\Context\InstallContext $context): void
  8.     {
  9.         $customFieldSetRepository $this->container->get('custom_field_set.repository');
  10.         $customFieldSetRepository->create(
  11.             [
  12.                 [
  13.                     'name' => 'enet_pickupdate',
  14.                     'config' => [
  15.                         'label' => [
  16.                             'en-GB' => 'Pickup Date',
  17.                             'de-DE' => 'Abholdatum',
  18.                         ],
  19.                     ],
  20.                     'customFields' => [
  21.                         [
  22.                             'name' => 'enet_pickupdate',
  23.                             'type' => CustomFieldTypes::TEXT,
  24.                             'config' => [
  25.                                 'componentName' => 'sw-field',
  26.                                 'customFieldType' => 'text',
  27.                                 'label' => [
  28.                                     'en-GB' => 'Pickup Date',
  29.                                     'de-DE' => 'Abholzeitraum'
  30.                                 ]
  31.                             ],
  32.                             'active' => true
  33.                         ]
  34.                     ],
  35.                     'relations' => [
  36.                         ['entityName' => 'order']
  37.                     ]
  38.                 ]
  39.             ],
  40.             $context->getContext()
  41.         );
  42.     }
  43. }