Quantcast
Channel: Programmierung - Shopware Community Forum
Viewing all articles
Browse latest Browse all 2871

Problem mit hooks

$
0
0

Hallo,

 

Ich habe eine Frage in Bezug auf die folgenden Artikel:

https://developers.shopware.com/blog/2015/06/09/understanding-the-shopware-hook-system/

https://developers.shopware.com/developers-guide/event-guide/

 

In shopware ist es möglich, Hooks für public and protected Functions für Controllers, Core Classes und Repositories zu cachen, allerdings habe ich Probleme, folgenden Event Hook zu cachen:

$this->subscribeEvent(

'Shopware_Controllers_Frontend_Register :: saveRegisterAction :: after',    

          'onFrontendPostDispatch'

      );

 

Für den Class Name habe ich folgende Optionen ohne Erfolg versucht

\Shopware\Controllers\Frontend\Register

Shopware\Controllers\Frontend\Register

Enlight_Controller_Action_PreDispatch_Frontend_Register

Register

 'Shopware_Controllers_Frontend_Register::saveRegister::before'

 

Meine Funktion lautet:

 

  public function onFrontendPostDispatch(Enlight_Hook_HookArgs $arguments)

  {

      $basketID = $arguments->getReturn();

      /** @var \Enlight_Controller_Action $controller */

      Shopware()->PluginLogger()->info("override method");

      $string = "2012-06-13T09:34:09+0200";

      $dateTime = new DateTime($string);

      $now = new DateTime();

      $string = $now->format('Y-m-d');    // MySQL datetime format

      Shopware()->PluginLogger()->info($string);

 

      return $basketID;

}

 

 

Ich bin relativ neu in Shopware unterwegs und wäre über jede Hilfe dankbar!

 

Viele Grüße,

Nemanja


Viewing all articles
Browse latest Browse all 2871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>