# Versandkosten Modul SUM Formel

**URL:** <https://forum.shopware.com/t/versandkosten-modul-sum-formel/40004>\
**Category:** Programmierung\
**Created:** [21. September 2016 um 17:44 UTC](https://forum.shopware.com/t/versandkosten-modul-sum-formel/40004 "2016-09-21T17:44:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hemel](https://avatars.discourse-cdn.com/v4/letter/h/b3f665/32.png) [@Hemel](https://forum.shopware.com/u/Hemel)\
**Post date:** [21. September 2016 um 17:44 UTC](https://forum.shopware.com/t/versandkosten-modul-sum-formel/40004/1 "2016-09-21T17:44:12Z")

</div>

Hallo,  
ich versuche bei dem Versandkostenmodul die Abfrage zu erweitern. Hierzu soll eine Variable Sonderversand true werden, wenn bestimmte Attribute aktiviert sind, oder aber das Gewicht des Warenbkorb einen Wert übersteigt.  
Meine Formel sieht bisher so aus, aber ein Teil funktioniert nicht:

MAX(a.topseller) as has\_topseller, MAX(at.attr3) as has\_comment, MAX(b.esdarticle) as has\_esd, MAX( IF(at.attr4=‚true‘ OR at.attr5=‚true‘ OR at.attr6=‚true‘ OR at.attr7=‚true‘ OR at.attr7=‚true‘ OR at.attr8=‚true‘ _OR (IF SUM(d.weight\*b.quantity)\>30=‚true‘,1,0)_,1,0)) AS Sonderversand

Ich habe schon etliche Varianten von (IF SUM(d.weight\*b.quantity)\>30=‚true‘,1,0) ausprobiert, aber ich komme nicht auf die richtige Syntax.

Kann mir jemand helfen?  
Vielen Dank.

&nbsp;

&nbsp;
