Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Drupal\ilr_registrations\EventSubscriber;
- use Symfony\Component\EventDispatcher\EventSubscriberInterface;
- use Symfony\Component\EventDispatcher\Event;
- use Drupal\commerce_product\Event\ProductEvents;
- use Drupal\commerce_product\Event\FilterVariationsEvent;
- /**
- * Class ClassFilterSubscriber.
- */
- class ClassFilterSubscriber implements EventSubscriberInterface {
- /**
- * Constructs a new ClassFilterSubscriber object.
- */
- public function __construct() {
- }
- /**
- * {@inheritdoc}
- */
- static function getSubscribedEvents() {
- $events[ProductEvents::FILTER_VARIATIONS] = 'onClassFilter';
- return $events;
- }
- /**
- * Code to run before a migration has been imported.
- */
- public function onClassFilter(FilterVariationsEvent $event) {
- dump($event);
- // foreach ($event['#variations'] as $variation) {
- // dump($variation);
- // }
- }
- }
Add Comment
Please, Sign In to add comment