# Alle Länder einfügen

**URL:** <https://forum.shopware.com/t/alle-laender-einfuegen/88114>\
**Category:** Shopware 6 (German)\
**Created:** [4. Juni 2021 um 10:18 UTC](https://forum.shopware.com/t/alle-laender-einfuegen/88114 "2021-06-04T10:18:58Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![area-net-gmbh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/area-net-gmbh/32/21995_2.png) [@area-net-gmbh](https://forum.shopware.com/u/area-net-gmbh)\
**Post date:** [5. Juli 2023 um 20:35 UTC](https://forum.shopware.com/t/alle-laender-einfuegen/88114/21 "2023-07-05T20:35:24Z")

</div>

Falls es noch jemand benötigt. Folgendes SQL-Statement weist alle EU-Länder dem Verkaufskanal zu - Achtung SALES\_CHANNEL\_ID\_EINSETZEN entsprechend ersetzen:

```auto
INSERT IGNORE INTO sales_channel_country 
(sales_channel_id, country_id)
SELECT UNHEX('SALES_CHANNEL_ID_EINSETZEN'), id FROM country WHERE iso IN('BE','BG','DK','DE','EE','FI','FR','GR','IE','IT','HR','LV','LT','LU','MT','NL','AT','PL','PT','RO','SE','SK','SI','ES','CZ','HU','CY')

```

Und mit folgendem Statement wird der Versand in alle EU-Länder (außer Deutschland) deaktiviert:

```auto
UPDATE country SET shipping_available = 0
WHERE iso IN('BE','BG','DK','EE','FI','FR','GR','IE','IT','HR','LV','LT','LU','MT','NL','AT','PL','PT','RO','SE','SK','SI','ES','CZ','HU','CY')

```

Damit ist der Verordnung genüge getan. Kann dann natürlich nach Belieben angepasst werden und z.B. bestimmte Länder ergänzt oder für der Versand freigegeben werden.

---

<div class="post-metadata">

**Author:** ![great2gether](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/great2gether/32/12887_2.png) [@great2gether](https://forum.shopware.com/u/great2gether)\
**Post date:** [26. Februar 2024 um 00:52 UTC](https://forum.shopware.com/t/alle-laender-einfuegen/88114/22 "2024-02-26T00:52:19Z")

</div>

Danke, das hat mir geholfen! Vorher musste ich nur die 249 unnötigen Länder erst einmal entfernen:

```auto
DELETE FROM sales_channel_country

WHERE sales_channel_id = UNHEX('018ddcfed9d5716eb84002847b5cf34b')

AND country_id IN (SELECT id FROM country WHERE iso != 'DE');

```

---

<div class="post-metadata">

**Author:** ![area-net-gmbh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/area-net-gmbh/32/21995_2.png) [@area-net-gmbh](https://forum.shopware.com/u/area-net-gmbh)\
**Post date:** [26. Februar 2024 um 07:06 UTC](https://forum.shopware.com/t/alle-laender-einfuegen/88114/23 "2024-02-26T07:06:46Z")

</div>

> [@great2gether](#):
>
> `AND country_id IN (SELECT id FROM country WHERE iso != 'DE')`

Hättest du auch weglassen können, DE wird ja wieder im obigen Befehl hinzugefügt.

---

<div class="post-metadata">

**Author:** ![great2gether](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/great2gether/32/12887_2.png) [@great2gether](https://forum.shopware.com/u/great2gether)\
**Post date:** [26. Februar 2024 um 15:16 UTC](https://forum.shopware.com/t/alle-laender-einfuegen/88114/24 "2024-02-26T15:16:07Z")

</div>

Viele Wege führen nach Rom. Man könnte auch einfach nur die nicht EU-Länder löschen. DE habe ich aber drin gelassen, weil mindestens ein Land drin sein muss.

---

<div class="post-metadata">

**Author:** ![elw-automobile](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/elw-automobile/32/13097_2.png) [@elw-automobile](https://forum.shopware.com/u/elw-automobile)\
**Post date:** [4. Februar 2025 um 12:15 UTC](https://forum.shopware.com/t/alle-laender-einfuegen/88114/25 "2025-02-04T12:15:57Z")

</div>

Hat super funktioniert. Danke.

[Vorherige Seite](https://forum.shopware.com/t/alle-laender-einfuegen/88114.md?page=1)
