<?php
/*
* This file is part of the CouponPro42 Plugin
*
* Copyright (C) 2022 Diezon.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\CouponPro42;
use Eccube\Event\TemplateEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class CouponEvent implements EventSubscriberInterface
{
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'Mypage/index.twig' => 'onDefaultMypageNaviTwig',
'Mypage/history.twig' => [['onDefaultMypageNaviTwig'],['onDefaultMypageHistoryNaviTwig']],
'Mypage/favorite.twig' => 'onDefaultMypageNaviTwig',
'Mypage/change.twig' => 'onDefaultMypageNaviTwig',
'Mypage/change_complete.twig' => 'onDefaultMypageNaviTwig',
'Mypage/delivery.twig' => 'onDefaultMypageNaviTwig',
'Mypage/delivery_edit.twig' => 'onDefaultMypageNaviTwig',
'Mypage/withdraw.twig' => 'onDefaultMypageNaviTwig',
'Mypage/coupon_list.twig' => 'onDefaultMypageNaviTwig',
'Product/detail.twig' => 'onDefaultProductNaviTwig',
'Shopping/index.twig' => 'onDefaultShoppingIndexNaviTwig',
'Shopping/confirm.twig' => 'onDefaultShoppingConfirmNaviTwig',
];
}
/**
* @param TemplateEvent $event
*/
public function onDefaultMypageNaviTwig(TemplateEvent $event)
{
$event->addSnippet('@CouponPro42/front/Mypage/navi.twig');
}
/**
* @param TemplateEvent $event
*/
public function onDefaultProductNaviTwig(TemplateEvent $event)
{
$event->addSnippet('@CouponPro42/front/Product/detail.twig');
}
/**
* @param TemplateEvent $event
*/
public function onDefaultShoppingIndexNaviTwig(TemplateEvent $event)
{
$event->addSnippet('@CouponPro42/front/Shopping/coupon_list.twig');
}
/**
* @param TemplateEvent $event
*/
public function onDefaultShoppingConfirmNaviTwig(TemplateEvent $event)
{
$event->addSnippet('@CouponPro42/front/Shopping/confirm_coupon.twig');
}
/**
* @param TemplateEvent $event
*/
public function onDefaultOrderEditNaviTwig(TemplateEvent $event)
{
$event->addSnippet('@CouponPro42/admin/Order/coupon.twig');
}
/**
* @param TemplateEvent $event
*/
public function onDefaultMypageHistoryNaviTwig(TemplateEvent $event)
{
$event->addSnippet('@CouponPro42/front/History/coupon.twig');
}
}