Hallo Zusammen,
ich stehe vor folgenden Problem und zwar möchte ich zur Reply Adresse den entsprechenden Namen des Kunden hinzufügen.
Dazu hab ich versucht die function commitForm() mit einem Plugin zu überschreiben um den entsprechenden effekt zu erhalten.
Leider kriege ich diesen Error:
[2017-02-02 23:46:01] core.ERROR: exception 'Enlight_Exception' with message 'Property "_elements" not found failure' in D:\xampp56\htdocs\shopware2\engine\Shopware\Plugins\Local\Frontend\MailReplayWithName\Bootstrap.php:36 Stack trace: #0 D:\xampp56\htdocs\shopware2\engine\Shopware\Plugins\Local\Frontend\MailReplayWithName\Bootstrap.php(36): Enlight_Class->__get('_elements') #1 D:\xampp56\htdocs\shopware2\engine\Library\Enlight\Event\Handler\Plugin.php(149): Shopware_Plugins_Frontend_MailReplayWithName_Bootstrap->replaceCommitForm(Object(Enlight_Hook_HookArgs)) #2 D:\xampp56\htdocs\shopware2\engine\Library\Enlight\Event\EventManager.php(214): Enlight_Event_Handler_Plugin->execute(Object(Enlight_Hook_HookArgs)) #3 D:\xampp56\htdocs\shopware2\engine\Library\Enlight\Hook\HookManager.php(182): Enlight_Event_EventManager->notify('Shopware_Contro...', Object(Enlight_Hook_HookArgs)) #4 D:\xampp56\htdocs\shopware2\var\cache\production_201701241633\proxies\ShopwareControllersFrontendFormsProxy.php(18): Enlight_Hook_HookManager->executeHooks(Object(Shopware_Proxies_ShopwareControllersFrontendFormsProxy), 'commitForm', Array) #5 D:\xampp56\htdocs\shopware2\engine\Shopware\Controllers\Frontend\Forms.php(95): Shopware_Proxies_ShopwareControllersFrontendFormsProxy->commitForm() #6 D:\xampp56\htdocs\shopware2\engine\Shopware\Controllers\Frontend\Forms.php(81): Shopware_Controllers_Frontend_Forms->handleFormPost('5') #7 D:\xampp56\htdocs\shopware2\engine\Library\Enlight\Controller\Action.php(159): Shopware_Controllers_Frontend_Forms->indexAction() #8 D:\xampp56\htdocs\shopware2\engine\Library\Enlight\Controller\Dispatcher\Default.php(523): Enlight_Controller_Action->dispatch('indexAction') #9 D:\xampp56\htdocs\shopware2\engine\Library\Enlight\Controller\Front.php(223): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp)) #10 D:\xampp56\htdocs\shopware2\engine\Shopware\Kernel.php(179): Enlight_Controller_Front->dispatch() #11 D:\xampp56\htdocs\shopware2\vendor\symfony\http-kernel\HttpCache\HttpCache.php(487): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #12 D:\xampp56\htdocs\shopware2\engine\Shopware\Components\HttpCache\AppCache.php(255): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL) #13 D:\xampp56\htdocs\shopware2\vendor\symfony\http-kernel\HttpCache\HttpCache.php(258): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true) #14 D:\xampp56\htdocs\shopware2\vendor\symfony\http-kernel\HttpCache\HttpCache.php(275): Symfony\Component\HttpKernel\HttpCache\HttpCache->pass(Object(Symfony\Component\HttpFoundation\Request), true) #15 D:\xampp56\htdocs\shopware2\engine\Shopware\Components\HttpCache\AppCache.php(133): Symfony\Component\HttpKernel\HttpCache\HttpCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true) #16 D:\xampp56\htdocs\shopware2\vendor\symfony\http-kernel\HttpCache\HttpCache.php(206): Shopware\Components\HttpCache\AppCache->invalidate(Object(Symfony\Component\HttpFoundation\Request), true) #17 D:\xampp56\htdocs\shopware2\engine\Shopware\Components\HttpCache\AppCache.php(114): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true) #18 D:\xampp56\htdocs\shopware2\shopware.php(117): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request)) #19 {main} [] {"uid":"f03b986"}
In meiner Function steht der Part wo _elements verwendet wird noch genau so drin.
//Email field available check
foreach ($this->_elements as $element) {
if ($element['typ'] == 'email') {
$postEmail = $this->_postData[$element['id']];
$postEmail = trim($postEmail);
}
}
Liegt es vllt daran das die Variable nicht Public ist? Wie komme ich an den Inhalt der Variable?
Sorry bin recht neu in der Shopware Plugin entwicklung.
Viele Grüße
Joni