Guten Abend!
Ich versuche eine eigene Berechnung im Versandmodul zu erstellen und mit einem eigenen Freitextfeld zu berechnen. Leider klappt das nicht, ich bekommen einen Fehler:
An exception occurred while executing 'SELECT MIN(d.instock>=b.quantity) as instock, MIN(d.instock>=(b.quantity+d.stockmin)) as stockmin, MIN(a.laststock) as laststock, SUM(d.weight*b.quantity) as weight, SUM(IF(a.id,b.quantity,0)) as count_article, MAX(b.shippingfree) as shippingfree, SUM(IF(b.modus=0,b.quantity*CAST(b.price as DECIMAL(10,2))/b.currencyFactor,0)) as amount, SUM(IF(b.modus=0,b.quantity*ROUND(CAST(b.price as DECIMAL(10,2))/(100+t.tax)*100,2)/b.currencyFactor,0)) as amount_net, SUM(CAST(b.price as DECIMAL(10,2))*b.quantity) as amount_display, MAX(d.length) as `length`, MAX(d.height) as height, MAX(d.width) as width, u.id as userID, MAX(a.topseller) as has_topseller, MAX(at.attr3) as has_comment, MAX(b.esdarticle) as has_esd, SUM(d.weight) as artikelgewicht, (IF(ub.attributes.text1 >'1',SUM(d.weight*b.quantity),'0')) as calculation_value_49 FROM s_order_basket b LEFT JOIN s_articles a ON b.articleID = a.id AND b.modus = 0 AND b.esdarticle = 0 LEFT JOIN s_user u ON u.id = ? AND u.active = 1 LEFT JOIN s_articles_details d ON (d.ordernumber = b.ordernumber) AND d.articleID = a.id LEFT JOIN s_core_tax t ON t.id = a.taxID LEFT JOIN s_articles_attributes at ON at.articledetailsID = d.id LEFT JOIN s_user_addresses ub ON ub.user_id = u.id AND ub.id = ? LEFT JOIN s_user_addresses us ON us.user_id = u.id AND us.id = ? WHERE b.sessionID = ? GROUP BY b.sessionID' with params [3578, 6549, 6578, "5js9ukvm0622hkghlgfrfq4pap"]: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'ub.attributes.text1' in 'field list' in vendor/doctrine/dbal/lib/Doctrine/DBAL/DBALException.php on line 179
So sieht der Code aus:
IF(ub.attributes.text1 >'1',SUM(d.weight*b.quantity),'0')
Mit z.B. lastname gibt es keine Probleme
IF(ub.lastname >'1',SUM(d.weight*b.quantity),'0')
Muss ich vielleicht mein eigenes Freitextfeld anders übergeben?
Beste Grüße