app/Plugin/EccubePaymentLite4/EventListener/EventSubscriber/Front/Shopping/ChangeButtonTextSubscriber.php line 19

Open in your IDE?
  1. <?php
  2. namespace Plugin\EccubePaymentLite4\EventListener\EventSubscriber\Front\Shopping;
  3. use Eccube\Event\TemplateEvent;
  4. use Plugin\EccubePaymentLite4\Service\Method\Credit;
  5. use Plugin\EccubePaymentLite4\Service\Method\Deferred;
  6. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  7. class ChangeButtonTextSubscriber implements EventSubscriberInterface
  8. {
  9.     public static function getSubscribedEvents()
  10.     {
  11.         return [
  12.             'Shopping/confirm.twig' => 'confirm',
  13.         ];
  14.     }
  15.     public function confirm(TemplateEvent $event)
  16.     {
  17.         $PaymentMethod $event->getParameter('Order')->getPayment()->getMethodClass();
  18.         $event->setParameter('buttonText''注文する');
  19.         if ($PaymentMethod === Credit::class ||
  20.             $PaymentMethod === Deferred::class) {
  21.             $event->setParameter('buttonText''次へ');
  22.         }
  23.     }
  24. }