public function onOrderPreUpdateEvent(ResourceEvent $event) { $order = $event->getResource(); if ($order instanceof OrderInterface) { $this->removeTotals($order); $this->recalculateShippingTotal($order); $this->traverseOrder($order); } }
public function onClientPostCreate(ResourceEvent $event) { $client = $event->getResource(); if ($client instanceof ClientInterface) { $email = $client->getContactDetails()->getEmail(); $title = $this->getTranslatorHelper()->trans('client.email.heading.register'); $body = $this->getEmailBody($client); $shop = $client->getShop(); $this->getMailerHelper()->sendEmail($email, $title, $body, $shop->getMailerConfiguration()); } }
/** * Sets resource settings fetched from fieldset corresponding to selected box type * * @param ResourceEvent $event */ public function onLayoutBoxResourceSave(ResourceEvent $event) { $settings = $this->getBoxSettingsFromRequest($event->getRequest()); $resource = $event->getResource(); $resource->setSettings($settings); }
public function onCartChangedEvent(ResourceEvent $event) { $this->cartVisitorTraverser->traverse($event->getResource()); }