Problem mit Sperrgut

Hi, wir haben versucht einen Perrgutzuschlag in unser Shopware zu integrieren, wie in diesem Video erläutert:

Leider funktioniert nun der Warenkobrb nicht und wir erhalten folgende Fehler:

exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' MAX(at.attr16="true") AS sperrgut, ('') as calculation_value_20
            FRO' at line 15' in shopware/engine/Library/Zend/Db/Statement/Pdo.php:228

#0 shopware/engine/Library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 shopware/engine/Library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array)
#2 shopware/engine/Library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 shopware/engine/Library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('\n SE...', Array)
#4 shopware/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->query('\n SE...', Array)
#5 shopware/engine/Library/Zend/Db/Adapter/Abstract.php(756): Enlight_Components_Db_Adapter_Pdo_Mysql->query('\n SE...', Array)
#6 shopware/engine/Shopware/Core/sAdmin.php(2636): Zend_Db_Adapter_Abstract->fetchRow('\n SE...', Array)
#7 shopware/engine/Shopware/Core/sAdmin.php(3064): sAdmin->sGetDispatchBasket('2')
#8 shopware/engine/Shopware/Controllers/Frontend/Checkout.php(945): sAdmin->sGetPremiumShippingcosts(Array)
#9 shopware/engine/Shopware/Controllers/Frontend/Checkout.php(959): Shopware_Controllers_Frontend_Checkout->getShippingCosts()
#10 shopware/engine/Shopware/Controllers/Frontend/Checkout.php(1509): Shopware_Controllers_Frontend_Checkout->getBasket()
#11 shopware/engine/Library/Enlight/Controller/Action.php(159): Shopware_Controllers_Frontend_Checkout->ajaxCartAction()
#12 shopware/engine/Library/Enlight/Controller/Dispatcher/Default.php(523): Enlight_Controller_Action->dispatch('ajaxCartAction')
#13 shopware/engine/Library/Enlight/Controller/Front.php(223): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#14 shopware/engine/Shopware/Kernel.php(180): Enlight_Controller_Front->dispatch()
#15 shopware/vendor/symfony/http-kernel/HttpCache/HttpCache.php(487): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 shopware/engine/Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#17 shopware/vendor/symfony/http-kernel/HttpCache/HttpCache.php(444): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#18 shopware/vendor/symfony/http-kernel/HttpCache/HttpCache.php(344): Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(Object(Symfony\Component\HttpFoundation\Request), true)
#19 shopware/engine/Shopware/Components/HttpCache/AppCache.php(178): Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true)
#20 shopware/vendor/symfony/http-kernel/HttpCache/HttpCache.php(210): Shopware\Components\HttpCache\AppCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true)
#21 shopware/engine/Shopware/Components/HttpCache/AppCache.php(114): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#22 shopware/shopware.php(117): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#23 {main}

Next exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' MAX(at.attr16="true") AS sperrgut, ('') as calculation_value_20, ('') as calcul' at line 15' in shopware/engine/Library/Zend/Db/Statement/Pdo.php:234
Stack trace:
#0 shopware/engine/Library/Zend/Db/Statement.php(303): Zend_Db_Statement_Pdo->_execute(Array)
#1 shopware/engine/Library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#2 shopware/engine/Library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('\n SE...', Array)
#3 shopware/engine/Library/Enlight/Components/Db/Adapter/Pdo/Mysql.php(96): Zend_Db_Adapter_Pdo_Abstract->query('\n SE...', Array)
#4 shopware/engine/Library/Zend/Db/Adapter/Abstract.php(756): Enlight_Components_Db_Adapter_Pdo_Mysql->query('\n SE...', Array)
#5 shopware/engine/Shopware/Core/sAdmin.php(2636): Zend_Db_Adapter_Abstract->fetchRow('\n SE...', Array)
#6 shopware/engine/Shopware/Core/sAdmin.php(3064): sAdmin->sGetDispatchBasket('2')
#7 shopware/engine/Shopware/Controllers/Frontend/Checkout.php(945): sAdmin->sGetPremiumShippingcosts(Array)
#8 shopware/engine/Shopware/Controllers/Frontend/Checkout.php(959): Shopware_Controllers_Frontend_Checkout->getShippingCosts()
#9 shopware/engine/Shopware/Controllers/Frontend/Checkout.php(1509): Shopware_Controllers_Frontend_Checkout->getBasket()
#10 shopware/engine/Library/Enlight/Controller/Action.php(159): Shopware_Controllers_Frontend_Checkout->ajaxCartAction()
#11 shopware/engine/Library/Enlight/Controller/Dispatcher/Default.php(523): Enlight_Controller_Action->dispatch('ajaxCartAction')
#12 shopware/engine/Library/Enlight/Controller/Front.php(223): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#13 shopware/engine/Shopware/Kernel.php(180): Enlight_Controller_Front->dispatch()
#14 shopware/vendor/symfony/http-kernel/HttpCache/HttpCache.php(487): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#15 shopware/engine/Shopware/Components/HttpCache/AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#16 shopware/vendor/symfony/http-kernel/HttpCache/HttpCache.php(444): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#17 shopware/vendor/symfony/http-kernel/HttpCache/HttpCache.php(344): Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(Object(Symfony\Component\HttpFoundation\Request), true)
#18 shopware/engine/Shopware/Components/HttpCache/AppCache.php(178): Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true)
#19 shopware/vendor/symfony/http-kernel/HttpCache/HttpCache.php(210): Shopware\Components\HttpCache\AppCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true)
#20 shopware/engine/Shopware/Components/HttpCache/AppCache.php(114): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#21 shopware/shopware.php(117): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#22 {main}

 

 

Hallo,

ich würde dir eher die offiziellen Dokumentationen von Shopware empfehlen anstatt die von Drittanbietern: http://community.shopware.com/_detail_1933.html#Einfache_Bedingung_anhand_von_Freitextfeld_1 . So wie es in der offiziellen Dokumentationen von Shopware beschrieben ist, funktioniert es auch. Dort steht nämlich auch, das man ab Shopware 5.2 statt MAX(at.attr16=„true“) eher MAX(at.attr16=„1“) nutzen muss.

Ebenso ist der Wert „(’’) as calculation_value_20“ auch nicht im Standard von Shopware enthalten und wird wohl den Fehler verursachen.

Beste Grüße

Sebastian

Hallo Sebastian, Danke  Thumb-Up