# Maximalabnahme idiotensicher machen

**URL:** <https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193>\
**Category:** Shopware 6 (German)\
**Created:** [1. Januar 2025 um 16:41 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193 "2025-01-01T16:41:47Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [1. Januar 2025 um 16:41 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/1 "2025-01-01T16:41:47Z")

</div>

Hi,  
ich habe einen Kollegen, wo der Button „in den Warenkorb“ nicht erschient.  
Es stellte sich heraus, das er in Maximalabnahme eine „0“ hatte.  
Kann bitte das Feld so machen, das 0 als wert nicht erlaubt ist?  
Danke.

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/shopware/original/3X/2/3/234feae061f335d8b12507b635c1ca6bd96f1b56.png)

---

<div class="post-metadata">

**Author:** ![frip-tech.de](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/frip-tech.de/32/24453_2.png) [@frip-tech.de](https://forum.shopware.com/u/frip-tech.de)\
**Post date:** [1. Januar 2025 um 17:06 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/2 "2025-01-01T17:06:55Z")

</div>

ist ohne größere Eingriffe nicht möglich.

---

<div class="post-metadata">

**Author:** ![raymond-de](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@raymond-de](https://forum.shopware.com/u/raymond-de)\
**Post date:** [1. Januar 2025 um 18:26 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/3 "2025-01-01T18:26:20Z")

</div>

Bitte mal hier vorschlagen: [Shopware 6 - Product Feedback & Ideas: Hot (1110 ideas) – Have an idea? Share it!](https://feedback.shopware.com/forums/942607-shopware-6-product-feedback-ideas)

Ich vermute jedoch, dass es eine geringe Prio haben wird.

Mindestabnahme und Staffelung sollte hier dann auch eine 0 nicht erlauben.

---

<div class="post-metadata">

**Author:** ![Anotherone](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Anotherone](https://forum.shopware.com/u/Anotherone)\
**Post date:** [2. Januar 2025 um 09:50 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/4 "2025-01-02T09:50:45Z")

</div>

Problem ist, das dies meist nicht von Hand, sondern bei der Migration (eventuell auch beim Import?) auf 0 gesetzt wird.

---

<div class="post-metadata">

**Author:** ![raymond-de](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@raymond-de](https://forum.shopware.com/u/raymond-de)\
**Post date:** [2. Januar 2025 um 10:09 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/5 "2025-01-02T10:09:28Z")

</div>

Dann ist aber beim Mapping was falsch gelaufen.

---

<div class="post-metadata">

**Author:** ![matthiasewald](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/matthiasewald/32/21341_2.png) [@matthiasewald](https://forum.shopware.com/u/matthiasewald)\
**Post date:** [2. Januar 2025 um 10:25 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/6 "2025-01-02T10:25:54Z")

</div>

Moin,

bei der Migration hatten wir auch häufig schon den Fall. In SW5 konnte das Feld meine ich leer sein und es wurde als 0 migriert, wenn ich es richtig in Erinnerung habe. Wir haben bisher nach einer Migration direkt in der DB die Werte anschließend korrigiert. Ansonsten kann es eigentlich nur durch falsche Datenpflege passieren.

Grüße  
Matthias

---

<div class="post-metadata">

**Author:** ![Anotherone](https://avatars.discourse-cdn.com/v4/letter/a/6de8d8/32.png) [@Anotherone](https://forum.shopware.com/u/Anotherone)\
**Post date:** [2. Januar 2025 um 11:50 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/7 "2025-01-02T11:50:56Z")

</div>

Nein, da man das nicht mappen kann, sondern im Code ist das wie folgt angelegt:

```auto
        $this->convertValue($converted, 'maxPurchase', $data['detail'], 'maxpurchase', self::TYPE_INTEGER);

```

D.h. es erfolgt ein expliziter Cast auf Int, somit wird aus NULL eben 0.

Nachtrag: Bzw. wenn Du das interne Mapping meinst, dann ja, das ist falsch gelaufen.

---

<div class="post-metadata">

**Author:** ![frip-tech.de](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/frip-tech.de/32/24453_2.png) [@frip-tech.de](https://forum.shopware.com/u/frip-tech.de)\
**Post date:** [2. Januar 2025 um 12:04 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/8 "2025-01-02T12:04:37Z")

</div>

ist einfach ein Standard-Bug der Migration.

---

<div class="post-metadata">

**Author:** ![raymond-de](https://avatars.discourse-cdn.com/v4/letter/r/7feea3/32.png) [@raymond-de](https://forum.shopware.com/u/raymond-de)\
**Post date:** [2. Januar 2025 um 12:50 UTC](https://forum.shopware.com/t/maximalabnahme-idiotensicher-machen/106193/9 "2025-01-02T12:50:50Z")

</div>

Ah okay. Macht das Sinn dies bei Shopware zu melden?
