<?php
namespace Plugin\RegionalShippingFee42;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Eccube\Event\TemplateEvent;
/**
* カートページを特定地域送料設定プラグイン用に差し替え
*/
class Event implements EventSubscriberInterface
{
public function __construct(\Twig\Environment $twig)
{
$this->twig = $twig;
}
/**
* @return array
*/
public static function getSubscribedEvents()
{
return [
'Cart/index.twig' => ['onTemplateCartIndex', 999999]
];
}
public function onTemplateCartIndex(TemplateEvent $event)
{
$source = $this->twig->getLoader()
->getSourceContext("@RegionalShippingFee42/default/Cart/index.twig")
->getCode();
$event->setSource($source);
}
}