/** * @param OrderEvent $event * * @throws \Exception if the message cannot be loaded. */ public function sendConfirmationEmail(OrderEvent $event) { if (Atos::getConfigValue('send_confirmation_message_only_if_paid')) { // We send the order confirmation email only if the order is paid $order = $event->getOrder(); if (!$order->isPaid() && $order->getPaymentModuleId() == Atos::getModuleId()) { $event->stopPropagation(); } } }
/** * @param \Thelia\Core\Event\Order\OrderEvent $event */ public function testFreePostage(OrderEvent $event) { $order = $event->getOrder(); if ($this->couponManager->isCouponRemovingPostage($order)) { $order->setPostage(0); $event->setOrder($order); $event->stopPropagation(); } }
/** * Send the confirmation message only if the order is paid. * * @param OrderEvent $event */ public function checkSendOrderConfirmationMessageToCustomer(OrderEvent $event) { if (Paybox::getConfigValue('send_confirmation_email_on_successful_payment', false)) { $paybox = new Paybox(); if ($paybox->isPaymentModuleFor($event->getOrder())) { if (!$event->getOrder()->isPaid()) { $event->stopPropagation(); } } } }