custom/static-plugins/GlobusSW6/src/GlobusSW6.php line 30

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace GlobusSW6;
  3. use Doctrine\DBAL\Connection;
  4. use GlobusSW6\Core\Content\CheckoutSpecialCase\CheckoutSpecialCaseDefinition;
  5. use GlobusSW6\Core\Content\ProtectedNames\ProtectedNamesDefinition;
  6. use GlobusSW6\Service\PaymentMethods\AbholungPayment;
  7. use GlobusSW6\Service\PaymentMethods\KauflandPayment;
  8. use Shopware\Core\Checkout\Payment\PaymentMethodEntity;
  9. use Shopware\Core\Content\MailTemplate\Aggregate\MailTemplateType\MailTemplateTypeEntity;
  10. use Shopware\Core\Content\MailTemplate\MailTemplateEntity;
  11. use Shopware\Core\Defaults;
  12. use Shopware\Core\Framework\DataAbstractionLayer\EntityRepositoryInterface;
  13. use Shopware\Core\Framework\DataAbstractionLayer\Search\Criteria;
  14. use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsAnyFilter;
  15. use Shopware\Core\Framework\DataAbstractionLayer\Search\Filter\EqualsFilter;
  16. use Shopware\Core\Framework\Plugin;
  17. use Shopware\Core\Framework\Plugin\Context\InstallContext;
  18. use Shopware\Core\Framework\Plugin\Context\UninstallContext;
  19. use Shopware\Core\Framework\Plugin\Context\UpdateContext;
  20. use Shopware\Core\Framework\Context;
  21. use Shopware\Core\Framework\Plugin\Util\PluginIdProvider;
  22. use Shopware\Core\Framework\Uuid\Uuid;
  23. use Symfony\Component\Finder\Finder;
  24. use GlobusSW6\Core\IaneoDefaults;
  25. class GlobusSW6 extends Plugin
  26. {
  27.     const MAIL_TEMPLATE_PROTECTED_NAMES_NAME 'system.protected_names';
  28.     public function install(InstallContext $installContext): void
  29.     {
  30.         $shopwareContext $installContext->getContext();
  31.         //$this->addCustomFields($shopwareContext);
  32.         /*
  33.         $this->connection = $this->container->get('Doctrine\DBAL\Connection');
  34.         $this->snippetRepository = $this->container->get('snippet.repository');
  35.         $this->setSnippets('visibilityAusgeschaltet', 'Das Produkt ist ausgeschaltet.', 'de-DE');
  36.         $this->setSnippets('visibilityBestellwareDispomarker', 'Bei dem Produkt handelt es sich um Bestellware, welche weder den Dispo-Marker G oder K enthält', 'de-DE');
  37.         $this->setSnippets('visibilityDeactivated', 'Das Produkt ist deaktiviert.', 'de-DE');
  38.         $this->setSnippets('visibilityInactive', 'Das Produkt ist inaktiv.', 'de-DE');
  39.         $this->setSnippets('visibilityMeterware', 'Das Produkt ist Meterware mit dem Dispomarker R.', 'de-DE');
  40.         $this->setSnippets('visibilityProductExtraordinaire', 'Das Produkt befindet sich im Globus Hitseller Sales Channel und enthält keine Checkout Attributes', 'de-DE');
  41.         $this->setSnippets('visibilityProtectedNames', 'Das Produkt enthält geschützte Namen.', 'de-DE');
  42.         $this->setSnippets('visibilitySperrkennzeichen', 'Das Produkt ist mit einem Sperrkennzeichen markiert.', 'de-DE');
  43.         $this->setSnippets('visibilityStreckenartikel', 'Das Produkt ist ein Streckenartikel ohne Dispomarker G oder K.', 'de-DE');
  44.         */
  45.         $this->installProtectedNames($installContext);
  46.         $this->installCheckoutSpecialCases();
  47.         $this->installAvailabilitySnippets();
  48.         $this->installCheckoutSnippets();
  49.         parent::install($installContext);
  50.     }
  51.     public function update(UpdateContext $updateContext): void
  52.     {
  53.         $shopwareContext $updateContext->getContext();
  54.         //$this->addCustomFields($shopwareContext);
  55.         //$this->installPaymentMethods($updateContext);
  56.         parent::update($updateContext);
  57.     }
  58.     public function uninstall(UninstallContext $uninstallContext): void
  59.     {
  60.         $shopwareContext $uninstallContext->getContext();
  61.         //$this->removeCustomFields($shopwareContext);
  62.         if ($uninstallContext->keepUserData()) {
  63.             return;
  64.         }
  65.         $this->uninstallProtectedNames($uninstallContext);
  66.         $this->uninstallCheckoutSpecialCases();
  67.         $this->uninstallAvailabilitySnippets();
  68.         $this->uninstallCheckoutSnippets();
  69.         parent::uninstall($uninstallContext); // TODO: Change the autogenerated stub
  70.     }
  71.     /**
  72.      * @param string $key : the translation key/technical name of the snippet
  73.      * @param string $value : the value of the snippet
  74.      * @param string $set : the iso of the snippet_set to use (e.g. de-DE or en-GB)
  75.      * @return bool
  76.      */
  77.     private function setSnippets(string $keystring $valuestring $set) : bool
  78.     {
  79.         $connection $this->container->get('Doctrine\DBAL\Connection');
  80.         $snippetRepository $this->container->get('snippet.repository');
  81.         $snippetSetId $connection->fetchColumn('
  82.                 SELECT id
  83.                 FROM snippet_set
  84.                 WHERE iso =?
  85.             ', [$set]);
  86.         if (!$snippetSetId) {
  87.             throw new \InvalidArgumentException('Iso ' $set ' not found.');
  88.         }
  89.         // Check if id already exists
  90.         $snippetId $connection->fetchColumn('
  91.                 SELECT LOWER(HEX(id))
  92.                 FROM snippet
  93.                 WHERE translation_key =? AND snippet_set_id =?
  94.             ', [$key$snippetSetId]);
  95.         if ($snippetId) {
  96.             return false;
  97.         }
  98.         $snippetRepository->upsert([
  99.             [
  100.                 'id' => Uuid::randomHex(),
  101.                 'translationKey' => $key,
  102.                 'value' => $value,
  103.                 'setId' => Uuid::fromBytesToHex($snippetSetId),
  104.                 'author' => 'user/admin',
  105.                 'origin' => null
  106.             ]
  107.         ], Context::createDefaultContext() );
  108.         return true;
  109.     }
  110.     /*
  111.      * @param string $filenamedelete field
  112.      *
  113.      * @return string|null
  114.      */
  115.     protected function getMailTemplate(string $filename): ?string
  116.     {
  117.         $finder = new Finder();
  118.         // find all files in the current directory
  119.         $finder->files()->in(__DIR__ '/Resources/views/mail/templates');
  120.         foreach ($finder as $file) {
  121.             if ($filename === $file->getFilenameWithoutExtension()) {
  122.                 return $file->getContents();
  123.             }
  124.         }
  125.         return null;
  126.     }
  127.     private function installProtectedNames(InstallContext $installContext)
  128.     {
  129.         $mailTemplateRepository $this->container->get('mail_template.repository');
  130.         $mailTemplateTypeRepository $this->container->get('mail_template_type.repository');
  131.         $criteria = new Criteria();
  132.         $criteria->addFilter(new EqualsFilter('technicalName'self::MAIL_TEMPLATE_PROTECTED_NAMES_NAME));
  133.         $templateType $mailTemplateTypeRepository->search($criteria$installContext->getContext())->first();
  134.         if ($templateType instanceof MailTemplateTypeEntity) {
  135.             return;
  136.         }
  137.         $mailTemplateRepository->create([
  138.             [
  139.                 'systemDefault' => false,
  140.                 'translations' => [
  141.                     [
  142.                         'languageId' => Defaults::LANGUAGE_SYSTEM,
  143.                         'subject' => 'Geschützte Begriffe',
  144.                         'description' => 'Infomail wenn geschützte Begriffe in Artikleberschreibung genutzt wurden',
  145.                         'senderName' => '{{ salesChannel.name }}',
  146.                         'contentPlain' => $this->getMailTemplate('protected_names_notification.txt'),
  147.                         'contentHtml' => $this->getMailTemplate('protected_names_notification.html'),
  148.                     ],
  149.                 ],
  150.                 'mailTemplateType' => [
  151.                     'technicalName' => self::MAIL_TEMPLATE_PROTECTED_NAMES_NAME,
  152.                     'availableEntities' => [
  153.                         'protectedNames' => 'protected_names',
  154.                         'salesChannel' => 'sales_channel',
  155.                     ],
  156.                     'translations' => [
  157.                         [
  158.                             'languageId' => Defaults::LANGUAGE_SYSTEM,
  159.                             'name' => 'Protected names',
  160.                         ],
  161.                     ],
  162.                 ],
  163.             ],
  164.         ], $installContext->getContext());
  165.     }
  166.     private function uninstallProtectedNames(UninstallContext $uninstallContext)
  167.     {
  168.         $connection $this->container->get('Doctrine\DBAL\Connection');
  169.         $protectedNamesTable ProtectedNamesDefinition::ENTITY_NAME;
  170.         $connection->exec("DROP TABLE IF EXISTS $protectedNamesTable");
  171.         $mailTemplateRepository $this->container->get('mail_template.repository');
  172.         $mailTemplateTypeRepository $this->container->get('mail_template_type.repository');
  173.         $criteria = new Criteria();
  174.         $criteria->addAssociation('mailTemplateType');
  175.         $criteria->addFilter(new EqualsFilter('mailTemplateType.technicalName',
  176.             self::MAIL_TEMPLATE_PROTECTED_NAMES_NAME));
  177.         $templates $mailTemplateRepository->search($criteria$uninstallContext->getContext());
  178.         if ($templates->count() <= 0) {
  179.             return;
  180.         }
  181.         $mailTemplateIds = [];
  182.         $mailTemplateTypeIds = [];
  183.         /** @var MailTemplateEntity $mailTemplate */
  184.         foreach ($templates->getElements() as $mailTemplate) {
  185.             $mailTemplateIds[] = ['id' => $mailTemplate->getId()];
  186.             if (!in_array($mailTemplate->getMailTemplateTypeId(), $mailTemplateTypeIds)) {
  187.                 $mailTemplateTypeIds[] = ['id' => $mailTemplate->getMailTemplateTypeId()];
  188.             }
  189.         }
  190.         if (!empty($mailTemplateIds)) {
  191.             $mailTemplateRepository->delete($mailTemplateIds$uninstallContext->getContext());
  192.         }
  193.         if (!empty($mailTemplateTypeIds)) {
  194.             $mailTemplateTypeRepository->delete($mailTemplateTypeIds$uninstallContext->getContext());
  195.         }
  196.         // @todo: wieder entfernen?
  197. //        $connection->exec("DROP TABLE IF EXISTS ianeo_category_attributes");
  198. //        $connection->exec("DROP TABLE IF EXISTS ianeo_category_attributes_translation");
  199. //        $connection->exec("DROP TABLE IF EXISTS ianeo_product_attributes");
  200. //        $connection->exec("DROP TABLE IF EXISTS ianeo_product_attributes_translation");
  201. //
  202. //        $connection->exec("
  203. //                    ALTER TABLE `category`            DROP COLUMN `ianeoAttributes`;
  204. //                    ALTER TABLE `product`             DROP COLUMN `ianeoAttributes`;
  205. //                    ALTER TABLE `customer`            DROP COLUMN `ianeoAttributes`;
  206. //                    ALTER TABLE `order`               DROP COLUMN `ianeoAttributes`;
  207. //                    ALTER TABLE `customer_group`      DROP COLUMN `ianeoAttributes`;
  208. //        ");
  209.     }
  210.     private function installCheckoutSpecialCases(){
  211.         $this->setSnippets('deliveryInformation.OnlyBuyAtPlace''Kann nur im Markt vor Ort erworben werden''de-DE');
  212.         $this->setSnippets('deliveryInformation.OnlyBuyAtPlace''Kann nur im Markt vor Ort erworben werden''en-GB');
  213.         $this->setSnippets('deliveryInformation.deliveryTime''ca. %min% - %max% Werktage Lieferzeit''de-DE');
  214.         $this->setSnippets('deliveryInformation.deliveryTime''ca. %min% - %max% Werktage Lieferzeit''en-GB');
  215.         $this->setSnippets('deliveryInformation.readyForPickup''In %pickuptime% Stunden abholbereit''de-DE');
  216.         $this->setSnippets('deliveryInformation.readyForPickup''In %pickuptime% Stunden abholbereit''en-GB');
  217.         $this->setSnippets('reserveInStore.noSelectedStore''IM MARKT RESERVIEREN: MARKT SUCHEN''de-DE');
  218.         $this->setSnippets('reserveInStore.noSelectedStore''IM MARKT RESERVIEREN: MARKT SUCHEN''en-GB');
  219.         $this->setSnippets('reserveInStore.articleNotAvailable''ARTIKEL IM GEWÄHLTEN MARKT NICHT LIEFERBAR! VERFÜGBARKEIT IN ANDEREM MARKT PRÜFEN''de-DE');
  220.         $this->setSnippets('reserveInStore.articleNotAvailable''ARTIKEL IM GEWÄHLTEN MARKT NICHT LIEFERBAR! VERFÜGBARKEIT IN ANDEREM MARKT PRÜFEN''en-GB');
  221.         $this->setSnippets('reserveInStore.articleAvailable''IM MARKT RESERVIEREN: ''de-DE');
  222.         $this->setSnippets('reserveInStore.articleAvailable''IM MARKT RESERVIEREN: ''en-GB');
  223.         $this->setSnippets('reserveInStore.reservationText.articleNotAvailable''nicht verfügbar''de-DE');
  224.         $this->setSnippets('reserveInStore.reservationText.articleNotAvailable''EN_ nicht verfügbar''en-GB');
  225.         $this->setSnippets('checkoutSpecialCase.NotAvailable.Header''Artikel nicht verfügbar:''de-DE');
  226.         $this->setSnippets('checkoutSpecialCase.NotAvailable.Header''Artikel nicht verfügbar:''en-GB');
  227.         $this->setSnippets('checkoutSpecialCase.NotAvailable.Message''Dieser Artikel ist aktuell nicht bestellbar, wird aber in Kürze wieder verfügbar sein.''de-DE');
  228.         $this->setSnippets('checkoutSpecialCase.NotAvailable.Message''Dieser Artikel ist aktuell nicht bestellbar, wird aber in Kürze wieder verfügbar sein.''en-GB');
  229.         $this->setSnippets('deliveryInformation.manufacturer.text'"Lieferung durch <a href='%link%'>Hersteller</a>"'de-DE');
  230.         $this->setSnippets('deliveryInformation.manufacturer.text'"Delivery by <a href='%link%'>manufacturer</a>"'en-GB');
  231.         $this->setSnippets('hvc.notice''<b>Hinweis:</b> Die Installation nicht steckerfertiger Geräte ist vom jeweiligen Netzbetreiber oder von einem eingetragenen Fachbetrieb vorzunehmen.''de-DE');
  232.         $this->setSnippets('hvc.notice''<b>Hinweis:</b> Die Installation nicht steckerfertiger Geräte ist vom jeweiligen Netzbetreiber oder von einem eingetragenen Fachbetrieb vorzunehmen.''en-GB');
  233.         $this->setSnippets('puFoam.notice''Entsorgungshinweis: Gebrauchte PU-Schaumdosen gelten als Sonderabfall und dürfen daher nicht über den Restmüll, „Gelben Sack“, Weißblechcontainer oder Baumischabfall entsorgt werden. Gebrauchte PU-Schaumdosen können innerhalb unserer Öffnungszeiten in unseren Märkten vor Ort kostenlos zurückgegeben oder mit dem im Paket beigelegten Retourenlabel zurückgesendet werden. Zudem können PU-Schaumdosen über <a href=\"https://www.pdr.de/pu-schaumdosen-recycling/plz-suche-rueckgabestellen-in-meiner-naehe-finden/\" target=\"_blank\" rel=\"nofollow\"><u>Rückgabestellen in Ihrer Nähe</u></a> kostenfrei entsorgt werden.''de-DE');
  234.         $this->setSnippets('puFoam.notice''Entsorgungshinweis: Gebrauchte PU-Schaumdosen gelten als Sonderabfall und dürfen daher nicht über den Restmüll, „Gelben Sack“, Weißblechcontainer oder Baumischabfall entsorgt werden. Gebrauchte PU-Schaumdosen können innerhalb unserer Öffnungszeiten in unseren Märkten vor Ort kostenlos zurückgegeben oder mit dem im Paket beigelegten Retourenlabel zurückgesendet werden. Zudem können PU-Schaumdosen über <a href=\"https://www.pdr.de/pu-schaumdosen-recycling/plz-suche-rueckgabestellen-in-meiner-naehe-finden/\" target=\"_blank\" rel=\"nofollow\"><u>Rückgabestellen in Ihrer Nähe</u></a> kostenfrei entsorgt werden.''en-GB');
  235.         $this->setSnippets('biocidal.notice''Hinweis: Biozidprodukte vorsichtig verwenden. Vor Gebrauch stets Etikett und Produktinformation lesen.''de-DE');
  236.         $this->setSnippets('biocidal.notice''Hinweis: Biozidprodukte vorsichtig verwenden. Vor Gebrauch stets Etikett und Produktinformation lesen.''en-GB');
  237.         $this->setSnippets('mixedCart.Modal.p1''Bitte beachten Sie, dass Sie einen Artikel zur Reservierung im Markt und zur Online-Bestellung nicht gleichzeitig in Ihren Warenkorb legen können.''de-DE');
  238.         $this->setSnippets('mixedCart.Modal.p1''Bitte beachten Sie, dass Sie einen Artikel zur Reservierung im Markt und zur Online-Bestellung nicht gleichzeitig in Ihren Warenkorb legen können.''en-GB');
  239.         $this->setSnippets('mixedCart.Modal.p2''Lösen Sie hierfür bitte eine separate Bestellung aus.''de-DE');
  240.         $this->setSnippets('mixedCart.Modal.p2''Lösen Sie hierfür bitte eine separate Bestellung aus.''en-GB');
  241.         $this->setSnippets('desiredAmountNotAvailable.Modal.h1''Leider ist die gewünschte Menge aktuell nicht verfügbar.''de-DE');
  242.         $this->setSnippets('desiredAmountNotAvailable.Modal.h1''Leider ist die gewünschte Menge aktuell nicht verfügbar.''en-GB');
  243.         $this->setSnippets('desiredAmountNotAvailable.Modal.p1a''Die verbleibende Menge von ''de-DE');
  244.         $this->setSnippets('desiredAmountNotAvailable.Modal.p1a''Die verbleibende Menge von ''en-GB');
  245.         $this->setSnippets('desiredAmountNotAvailable.Modal.p1b'' Stück wurde Ihrem Warenkorb automatisch hinzugefügt. Alternativ hilft Ihnen unser Kundenservice weiter: ''de-DE');
  246.         $this->setSnippets('desiredAmountNotAvailable.Modal.p1b'' Stück wurde Ihrem Warenkorb automatisch hinzugefügt. Alternativ hilft Ihnen unser Kundenservice weiter: ''en-GB');
  247.         $this->setSnippets('desiredAmountNotAvailable.Modal.p2''+49 6898/ 515880 oder E-Mail an onlineshop@globus-baumarkt.de''de-DE');
  248.         $this->setSnippets('desiredAmountNotAvailable.Modal.p2''+49 6898/ 515880 oder E-Mail an onlineshop@globus-baumarkt.de''en-GB');
  249.         $this->setSnippets('desiredAmountNotAvailable.Modal.p2.hitseller''+49 6898/ 515800 oder E-Mail an info@hitseller.de''de-DE');
  250.         $this->setSnippets('desiredAmountNotAvailable.Modal.p2.hitseller''+49 6898/ 515800 oder E-Mail an info@hitseller.de''en-GB');
  251.         $this->setSnippets('desiredAmountNotAvailable.OffcanvasModal.p1''Bitte beachten Sie, dass die maximale Bestellmenge für diesen Artikel %maxPurchase% Stück beträgt.''de-DE');
  252.         $this->setSnippets('desiredAmountNotAvailable.OffcanvasModal.p1''Bitte beachten Sie, dass die maximale Bestellmenge für diesen Artikel %maxPurchase% Stück beträgt.''en-GB');
  253.         $this->setSnippets('desiredAmountNotAvailable.OffcanvasModal.storePurchase.p1''Bitte beachten Sie, dass die maximale Bestellmenge für diesen Artikel im gewählten Store %maxPurchase% Stück beträgt.''de-DE');
  254.         $this->setSnippets('desiredAmountNotAvailable.OffcanvasModal.storePurchase.p1''Bitte beachten Sie, dass die maximale Bestellmenge für diesen Artikel im gewählten Store %maxPurchase% Stück beträgt.''en-GB');
  255.         $this->setSnippets('klimasplit.Modal.p1''Der Kunde wurde darüber informiert, dass das oben genannte Klimagerät gemäß zwingender rechtlicher Vorgaben (§ 9 Abs. 3 Chemikalien-Klimaschutzverordnung) nur von zertifizierten Fachbetrieben installiert werden darf. Der Verkauf erfolgt ausschließlich unter der Voraussetzung, dass der Kunde die Installation entsprechend beauftragt.''de-DE');
  256.         $this->setSnippets('klimasplit.Modal.p1''Der Kunde wurde darüber informiert, dass das oben genannte Klimagerät gemäß zwingender rechtlicher Vorgaben (§ 9 Abs. 3 Chemikalien-Klimaschutzverordnung) nur von zertifizierten Fachbetrieben installiert werden darf. Der Verkauf erfolgt ausschließlich unter der Voraussetzung, dass der Kunde die Installation entsprechend beauftragt.''en-GB');
  257.         $this->setSnippets('klimasplit.Modal.p2''Der Kunde sichert hiermit verbindlich zu, dies zu tun. Die Wahl des zertifizierten Unternehmens steht dem Kunden frei. Er wird darauf hingewiesen, dass folgendes Unternehmen, der Hersteller des gegenständlichen Gerätes, das erforderliche Zertifikat besitzt und einen Installationsservice anbietet:''de-DE');
  258.         $this->setSnippets('klimasplit.Modal.p2''Der Kunde sichert hiermit verbindlich zu, dies zu tun. Die Wahl des zertifizierten Unternehmens steht dem Kunden frei. Er wird darauf hingewiesen, dass folgendes Unternehmen, der Hersteller des gegenständlichen Gerätes, das erforderliche Zertifikat besitzt und einen Installationsservice anbietet:''en-GB');
  259.         $this->setSnippets('klimasplit.Modal.p3''MIDEA Europe GmbH br
  260.                     Ludwig-Erhard-Str. 14 br
  261.                     65760 Eschborn br
  262.                     Telefon: 06196 - 90 20-0 br
  263.                     E-Mail: info-meg@midea.com''de-DE');
  264.         $this->setSnippets('klimasplit.Modal.p3''MIDEA Europe GmbH br
  265.                     Ludwig-Erhard-Str. 14 br
  266.                     65760 Eschborn br
  267.                     Telefon: 06196 - 90 20-0 br
  268.                     E-Mail: info-meg@midea.com''en-GB');
  269.         $this->setSnippets('klimasplit.Modal.p4''Die MIDEA Europe GmbH handelt im eigenen Namen und ist rechtlich unabhängig von der GLOBUS Fachmärkte GmbH & Co. KG. Ein Vertrag zur Installation des Gerätes kommt ggf. ausschließlich zwischen MIDEA und dem Kunden zu Stande.''de-DE');
  270.         $this->setSnippets('klimasplit.Modal.p4''Die MIDEA Europe GmbH handelt im eigenen Namen und ist rechtlich unabhängig von der GLOBUS Fachmärkte GmbH & Co. KG. Ein Vertrag zur Installation des Gerätes kommt ggf. ausschließlich zwischen MIDEA und dem Kunden zu Stande.''en-GB');
  271.         $this->setSnippets('klimasplit.Modal.p5''Gemäß der oben genannten Regelung ist die GLOBUS Fachmärkte GmbH & Co. KG im Falle einer behördlichen Überprüfung verpflichtet, schriftlich nachzuweisen, dass die oben genannten Bedingungen eingehalten wurden. Auf Grundlage des Art. 6 Abs. 1 lit. c EU-DSGVO speichert die GLOBUS Fachmärkte GmbH & Co. KG daher das vorliegende Dokument, um es ggf. der zuständigen Behörde vorlegen zu können. Weitere Hinweise zum Datenschutz entnehmen Sie bitte den ausliegenden Datenschutzhinweisen für Kunden im Markt und unter <a href="https://www.globus-baumarkt.de/datenschutz" target="_blank">https://www.globus-baumarkt.de/datenschutz</a>.''de-DE');
  272.         $this->setSnippets('klimasplit.Modal.p5''Gemäß der oben genannten Regelung ist die GLOBUS Fachmärkte GmbH & Co. KG im Falle einer behördlichen Überprüfung verpflichtet, schriftlich nachzuweisen, dass die oben genannten Bedingungen eingehalten wurden. Auf Grundlage des Art. 6 Abs. 1 lit. c EU-DSGVO speichert die GLOBUS Fachmärkte GmbH & Co. KG daher das vorliegende Dokument, um es ggf. der zuständigen Behörde vorlegen zu können. Weitere Hinweise zum Datenschutz entnehmen Sie bitte den ausliegenden Datenschutzhinweisen für Kunden im Markt und unter <a href="https://www.globus-baumarkt.de/datenschutz" target="_blank">https://www.globus-baumarkt.de/datenschutz</a>.''en-GB');
  273.         $this->setSnippets('general.shippingInfoFree''Versandkostenfrei''de-DE');
  274.         $this->setSnippets('general.shippingInfoFree''Free Shipping''en-GB');
  275.         $this->setSnippets('general.shippingInfoNotFree''zzgl. Versandkosten''de-DE');
  276.         $this->setSnippets('general.shippingInfoNotFree''plus Shipping costs''en-GB');
  277.         $this->setSnippets('general.shippingTextVat''inkl. gesetzl. MwSt.''de-DE');
  278.         $this->setSnippets('general.shippingTextVat''incl. VAT''en-GB');
  279.         $this->setSnippets('general.shippingTextLink''/Online-Shop/Versand-Zahlung/''de-DE');
  280.         $this->setSnippets('general.shippingTextLink''/Online-Shop/Versand-Zahlung/''en-GB');
  281.         $this->setSnippets('textil.animalParts','Enthält nichttextile Teile tierischen Ursprungs.','de-DE');
  282.         $this->setSnippets('textil.animalParts','Enthält nichttextile Teile tierischen Ursprungs.','en-GB');
  283.         $this->setSnippets('orderRepeat.productnotavailable''Dieser Artikel kann nicht mehr bestellt werden!','de-DE');
  284.         $this->setSnippets('orderRepeat.productnotavailable''Dieser Artikel kann nicht mehr bestellt werden!','en-GB');
  285.         // TODO-NGS could try to insert values here - or keep this logic in defaultDataservice
  286.     }
  287.     private function uninstallCheckoutSpecialCases(){
  288.         // drop both tables
  289.         $connection $this->container->get('Doctrine\DBAL\Connection');
  290.         $coSpclCsTbl CheckoutSpecialCaseDefinition::ENTITY_NAME;
  291.         $connection->exec("DROP TABLE IF EXISTS $coSpclCsTbl");
  292.         $connection->exec("DROP TABLE IF EXISTS ianeo_storage_indicator");
  293.         // remove snippets
  294.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "deliveryInformation.OnlyBuyAtPlace"');
  295.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "deliveryInformation.deliveryTime"');
  296.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "deliveryInformation.readyForPickup"');
  297.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "reserveInStore.noSelectedStore"');
  298.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "reserveInStore.articleNotAvailable"');
  299.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "reserveInStore.articleAvailable"');
  300.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "checkoutSpecialCase.NotAvailable.Header"');
  301.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "checkoutSpecialCase.NotAvailable.Message"');
  302.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "deliveryInformation.manufacturer.text"');
  303.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "hvc.notice"');
  304.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "puFoam.notice"');
  305.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "biocidal.notice"');
  306.     }
  307.     private function installAvailabilitySnippets(){
  308.         $this->setSnippets('store.product.available''alle Produkte verfügbar''de-DE');
  309.         $this->setSnippets('store.product.available''alle Produkte verfügbar''en-GB');
  310.         $this->setSnippets('store.product.partiallyAvailable''%share% von %total% Produkten verfügbar''de-DE');
  311.         $this->setSnippets('store.product.partiallyAvailable''%share% von %total% Produkten verfügbar''en-GB');
  312.         $this->setSnippets('store.product.unavailable''nicht verfügbar''de-DE');
  313.         $this->setSnippets('store.product.unavailable''nicht verfügbar''en-GB');
  314.     }
  315.     private function uninstallAvailabilitySnippets(){
  316.         // remove snippets
  317.         $connection $this->container->get('Doctrine\DBAL\Connection');
  318.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "store.product.available"');
  319.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "store.product.partiallyAvailable"');
  320.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "store.product.unavailable"');
  321.     }
  322.     private function installCheckoutSnippets(){
  323.         $this->setSnippets('switchStore.switchedAll''Reservierte Produkte wurden für den ausgewählten Store in den Warenkorb gelegt.''de-DE');
  324.         $this->setSnippets('switchStore.switchedAll''EN_ Reservierte Produkte wurden für den ausgewählten Store in den Warenkorb gelegt.''en-GB');
  325.         $this->setSnippets('switchStore.removedAll''Alle reservierten Produkte wurden aus dem Warenkorb entfernt.''de-DE');
  326.         $this->setSnippets('switchStore.removedAll''EN_ Alle reservierten Produkte wurden aus dem Warenkorb entfernt.''en-GB');
  327.         $this->setSnippets('switchStore.switchedPartially''Verfügbare reservierte Produkte wurden im ausgewählten Store in den Warenkorb gelegt.''de-DE');
  328.         $this->setSnippets('switchStore.switchedPartially''EN_ Verfügbare reservierte Produkte wurden im ausgewählten Store in den Warenkorb gelegt.''en-GB');
  329.     }
  330.     private function uninstallCheckoutSnippets(){
  331.         $connection $this->container->get('Doctrine\DBAL\Connection');
  332.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "switchStore.switchedAll"');
  333.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "switchStore.removedAll"');
  334.         $connection->executeUpdate('DELETE FROM `snippet` WHERE translation_key= "switchStore.switchedPartially"');
  335.     }
  336.     private function installPaymentMethods(InstallContext $installContext)
  337.     {
  338.         $context $installContext->getContext();
  339.         $paymentRepository $this->container->get('payment_method.repository');
  340.         /** @var PluginIdProvider $pluginIdProvider */
  341.         $pluginIdProvider $this->container->get(PluginIdProvider::class);
  342.         $pluginId $pluginIdProvider->getPluginIdByBaseClass(get_class($this), $context);
  343.         $criteria = new Criteria();
  344.         $criteria->addFilter(new EqualsFilter('id'IaneoDefaults::PAYMENT_METHOD_ABHOLUNG_ID));
  345.         $paymentMethod $paymentRepository->search($criteria$context)->first();
  346.         if ( $paymentMethod instanceof PaymentMethodEntity) {
  347.             return;
  348.         }
  349.         $paymentRepository->create(
  350.             [
  351.                 [
  352.                     'id'                => IaneoDefaults::PAYMENT_METHOD_ABHOLUNG_ID,
  353.                     'handlerIdentifier' => AbholungPayment::class,
  354.                     'translations'      => [
  355.                         'de-DE' => [
  356.                             'name'        => IaneoDefaults::PAYMENT_METHOD_ABHOLUNG_NAME,
  357.                             'description' => '',
  358.                         ],
  359.                         'en-GB' => [
  360.                             'name'        => IaneoDefaults::PAYMENT_METHOD_ABHOLUNG_NAME,
  361.                             'description' => '',
  362.                         ],
  363.                     ],
  364.                     'pluginId' => $pluginId,
  365.                     'active' => true
  366.                 ],
  367.         ], $context);
  368.         $criteria = new Criteria();
  369.         $criteria->addFilter(new EqualsFilter('id'IaneoDefaults::PAYMENT_METHOD_KAUFLAND_ID));
  370.         $paymentMethod $paymentRepository->search($criteria$context)->first();
  371.         if ( $paymentMethod instanceof PaymentMethodEntity) {
  372.             return;
  373.         }
  374.         $paymentRepository->create(
  375.             [
  376.                 [
  377.                     'id'                => IaneoDefaults::PAYMENT_METHOD_KAUFLAND_ID,
  378.                     'handlerIdentifier' => KauflandPayment::class,
  379.                     'translations'      => [
  380.                         'de-DE' => [
  381.                             'name'        => IaneoDefaults::PAYMENT_METHOD_KAUFLAND_NAME,
  382.                             'description' => '',
  383.                         ],
  384.                         'en-GB' => [
  385.                             'name'        => IaneoDefaults::PAYMENT_METHOD_ABHOLUNG_NAME,
  386.                             'description' => '',
  387.                         ],
  388.                     ],
  389.                     'pluginId' => $pluginId,
  390.                     'active' => true
  391.                 ],
  392.             ], $context);
  393.     }
  394. }