local/modules/StockAlert/Hook/StockAlertHook.php line 37

  1. <?php
  2. /*************************************************************************************/
  3. /*      This file is part of the Thelia package.                                     */
  4. /*                                                                                   */
  5. /*      Copyright (c) OpenStudio                                                     */
  6. /*      email : dev@thelia.net                                                       */
  7. /*      web : http://www.thelia.net                                                  */
  8. /*                                                                                   */
  9. /*      For the full copyright and license information, please view the LICENSE.txt  */
  10. /*      file that was distributed with this source code.                             */
  11. /*************************************************************************************/
  12. namespace StockAlert\Hook;
  13. use StockAlert\StockAlert;
  14. use Thelia\Core\Event\Hook\HookRenderEvent;
  15. use Thelia\Core\Hook\BaseHook;
  16. /**
  17.  * Class StockAlertHook
  18.  * @package StockAlert\Hook
  19.  * @author Julien Chanséaume <julien@thelia.net>
  20.  */
  21. class StockAlertHook extends BaseHook
  22. {
  23.     public function onProductDetailsBottom(HookRenderEvent $event)
  24.     {
  25.         $event->add(
  26.             $this->render(
  27.                 "product-details-bottom.html"
  28.             )
  29.         );
  30.     }
  31.     public function onProductJavascriptInitialization(HookRenderEvent $event)
  32.     {
  33.         $event->add(
  34.             $this->render(
  35.                 "product.javascript-initialization.html"
  36.             )
  37.         );
  38.     }
  39.     public function onModuleConfiguration(HookRenderEvent $event)
  40.     {
  41.         $moduleId $this->getModule()->getModuleId();
  42.         $config StockAlert::getConfig();
  43.         $event->add(
  44.             $this->render(
  45.                 "configuration.html",
  46.                 [
  47.                     'module_id' => $moduleId,
  48.                     'config' => $config
  49.                 ]
  50.             )
  51.         );
  52.     }
  53. }