app/Customize/Event/CustomizeRelatedProductEvent.php line 35

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of EC-CUBE
  4.  *
  5.  * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
  6.  *
  7.  * http://www.ec-cube.co.jp/
  8.  *
  9.  * For the full copyright and license information, please view the LICENSE
  10.  * file that was distributed with this source code.
  11.  */
  12. namespace Customize\Event;
  13. use Eccube\Event\TemplateEvent;
  14. use Plugin\RelatedProduct4\RelatedProductEvent;
  15. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  16. class CustomizeRelatedProductEvent extends RelatedProductEvent
  17. {
  18.     public static function getSubscribedEvents()
  19.     {
  20.         return [
  21.             'Product/detail.twig' => 'onRenderProductDetail',
  22.             'Product/detail_slug.twig' => 'onRenderProductDetailSlug',
  23.         ];
  24.     }
  25.     /**
  26.      * フロント:商品詳細画面に関連商品を表示する.
  27.      *
  28.      * @param TemplateEvent $event
  29.      */
  30.     public function onRenderProductDetail(TemplateEvent $event)
  31.     {
  32.         $event->addSnippet('Block/related_product.twig');
  33.     }
  34.     /**
  35.      * フロント:商品詳細画面(slug)に関連商品を表示する.
  36.      *
  37.      * @param TemplateEvent $event
  38.      */
  39.     public function onRenderProductDetailSlug(TemplateEvent $event)
  40.     {
  41.         $event->addSnippet('Block/related_product.twig');
  42.     }
  43. }