Problem bei Auswahl der Versandkosten entsprechend der Artikel im Warenkorb.

Es gibt zwei Standartversandarten, „ Standard “ und „ 24H-Lieferung “. Derzeit beide im Warenkorb wählbar.
Ziel: Liegt der Artikel XXX im Warenkorb, soll „24H-Lieferung“ verwendet werden, andernfalls „Standard“.
Einstellungen > Versandkosten > Erweiterte Einstellungen

Also zum Handbuch: (https://docs.shopware.com/de/shopware-5-de/versand-und-zahlungsarten/versandkosten#erweiterte-einstellungen).
Hier wird man auf Beispiele (https://docs.shopware.com/de/shopware-5-de/versand-und-zahlungsarten/individuelle-versandkosten#eigene-bedingungen) verwiesen.
Dort heißt es jedoch: „Für die eigene Bedingung muss oft unter Einstellungen > Grundeinstellungen > Storefront > Versandkosten-Modul die „Erweiterte SQL-Abfrage“ erweitert werden.“

Folgendes Beispiel sieht passend aus:
MAX(a.topseller) AS has_topseller, MAX(at.attr3) AS has_comment, MAX(b.esdarticle) AS has_esd, MIN(IF(d.ordernumber LIKE ‚%XXX%‘ OR b.modus <> 0,1,0)) AS artikel
Verstehe aber nicht was es bewirken sollte, weil da ja keine Versandart angesprochen wird. Es passiert (wie erwartet) nichts.

Logischer schiene mir „MIN(IF(d.ordernumber LIKE ‚%XXX%‘ OR b.modus <> 0,1,0)) AS artikel” in Einstellungen > Versandkosten > Erweiterte Einstellungen unterzubringen.
Doch da hängt sich der Warenkorb auf im System Log kommt ein Fehler (siehe unten).

Worin könnte mein Denkfehler bestehen?

THX vorab!

 

Fehler aus dem System Log:

PDOException: SQLSTATE(42000): Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‚AS artikel))) GROUP BY d.id ORDER BY d.position, d.name ASC‘ at line 13 in /vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php:907 Stack trace:

#0 /vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(907): PDOStatement->execute()

#1 /vendor/doctrine/dbal/lib/Doctrine/DBAL/Query/QueryBuilder.php(206): Doctrine\DBAL\Connection->executeQuery(‚SELECT d.id as …‘, Array, Array)

#2 /engine/Shopware/Core/sAdmin.php(2789): Doctrine\DBAL\Query\QueryBuilder->execute()

#3 /engine/Shopware/Controllers/Frontend/Checkout.php(1590): sAdmin->sGetPremiumDispatches(‚2‘, NULL, NULL)

#4 /engine/Shopware/Controllers/Frontend/Checkout.php(1724): Shopware_Controllers_Frontend_Checkout->getSelectedDispatch()

#5 /engine/Library/Enlight/Controller/Action.php(192): Shopware_Controllers_Frontend_Checkout->ajaxCartAction()

#6 /engine/Library/Enlight/Controller/Dispatcher/Default.php(478): Enlight_Controller_Action->dispatch(‚ajaxCartAction‘)

#7 /engine/Library/Enlight/Controller/Front.php(228): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))

#8 /engine/Shopware/Kernel.php(185): Enlight_Controller_Front->dispatch()

#9 /vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)

#10 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(448): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true)

#11 /engine/Shopware/Components/HttpCache/AppCache.php(256): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)

#12 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(420): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)

#13 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(317): Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(Object(Symfony\Component\HttpFoundation\Request), true)

#14 /engine/Shopware/Components/HttpCache/AppCache.php(183): Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true)

#15 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(192): Shopware\Components\HttpCache\AppCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true)

#16 /engine/Shopware/Components/HttpCache/AppCache.php(110): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) …

An exception occurred while executing

‚SELECT d.id as key, d.id, d.name, d.description, d.calculation, d.status_link, b.* FROM s_premium_dispatch d INNER JOIN (SELECT ‚1‘ as instock,‚1‘ as stockmin,‚0‘ as laststock,‘’ as weight,‚2‘ as count_article,‚0‘ as shippingfree,‚2099.8‘ as amount,‚1764.54‘ as amount_net,‚2099.80‘ as amount_display,’’ as length,’’ as height,’’ as width,‚1‘ as userID,‚0‘ as has_topseller,’’ as has_comment,‚0‘ as has_esd,‚0‘ as artikel,‚19‘ as max_tax,‚0‘ as basketStateId,‚2‘ as countryID,‚5‘ as paymentID,‚1‘ as customergroupID,‚1‘ as multishopID,‚pe6krlfiaavrd86ivdcd6i6pn8‘ as sessionID) b ON 1=1 INNER JOIN s_premium_dispatch_countries dc ON d.id = dc.dispatchID AND dc.countryID=b.countryID INNER JOIN s_premium_dispatch_paymentmeans dp ON d.id = dp.dispatchID AND dp.paymentID=b.paymentID LEFT JOIN s_premium_holidays h ON h.date = CURDATE() LEFT JOIN s_premium_dispatch_holidays dh ON d.id=dh.dispatchID AND h.id=dh.holidayID LEFT JOIN (SELECT dc.dispatchID FROM s_order_basket b INNER JOIN s_articles_categories_ro ac ON ac.articleID = b.articleID INNER JOIN s_premium_dispatch_categories dc ON dc.categoryID = ac.categoryID WHERE (b.modus = 0) AND (b.sessionID = ?) GROUP BY dc.dispatchID) dk ON dk.dispatchID=d.id LEFT JOIN s_user u ON  u.id=b.userID AND u.active=1 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 (d.active = 1) AND ((                 (bind_time_from IS NULL AND bind_time_to IS NULL)                 OR                 (IFNULL(bind_time_from,0) <= IFNULL(bind_time_to,86400) AND TIME_TO_SEC(DATE_FORMAT(NOW(),"%H:%i:00")) BETWEEN IFNULL(bind_time_from,0) AND IFNULL(bind_time_to,86400))                 OR                 (bind_time_from > bind_time_to AND TIME_TO_SEC(DATE_FORMAT(NOW(),"%H:%i:00")) NOT BETWEEN bind_time_to AND bind_time_from)             )) AND ((                 (bind_weekday_from IS NULL AND bind_weekday_to IS NULL)                 OR                 (IFNULL(bind_weekday_from,1) <= IFNULL(bind_weekday_to,7) AND WEEKDAY(NOW())+1 BETWEEN IFNULL(bind_weekday_from,1) AND IFNULL(bind_weekday_to,7))                 OR                 (bind_weekday_from > bind_weekday_to AND WEEKDAY(NOW())+1 NOT BETWEEN bind_weekday_to AND bind_weekday_from)             )) AND ((bind_weight_from IS NULL OR bind_weight_from <= b.weight)) AND ((bind_weight_to IS NULL OR bind_weight_to >= b.weight)) AND ((bind_price_from IS NULL OR bind_price_from <= b.amount)) AND ((bind_price_to IS NULL OR bind_price_to >= b.amount)) AND ((bind_instock=0 OR bind_instock IS NULL OR (bind_instock=1 AND b.instock) OR (bind_instock=2 AND b.stockmin))) AND ((bind_laststock=0 OR (bind_laststock=1 AND b.laststock))) AND ((bind_shippingfree!=1 OR NOT b.shippingfree)) AND (dh.holidayID IS NULL) AND ((d.multishopID IS NULL OR d.multishopID=b.multishopID)) AND ((d.customergroupID IS NULL OR d.customergroupID=b.customergroupID)) AND (dk.dispatchID IS NULL) AND (d.type IN (0)) AND ((d.id != 15 OR (MIN(IF(d.ordernumber LIKE ‚%ZUS%‘ OR b.modus <> 0,0,1)) AS artikel))) GROUP BY d.id ORDER BY d.position, d.name ASC’ with params („pe6krlfiaavrd86ivdcd6i6pn8“, 1, 1): 

SQLSTATE(42000): Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‚AS artikel))) GROUP BY d.id ORDER BY d.position, d.name ASC‘ at line 13