/** * Format OrderItem to CSV format * * @param \Extcode\Cart\Domain\Model\Order\Item $orderItem Order Item * @param string $delim Delimiter * @param string $quote Quote Style * * @return string */ public function render(\Extcode\Cart\Domain\Model\Order\Item $orderItem, $delim = ',', $quote = '"') { $orderItemArr = []; $orderItemArr[] = $orderItem->getBillingAddress()->getSalutation(); $orderItemArr[] = $orderItem->getBillingAddress()->getTitle(); $orderItemArr[] = $orderItem->getBillingAddress()->getFirstName(); $orderItemArr[] = $orderItem->getBillingAddress()->getLastName(); $orderItemArr[] = $orderItem->getOrderNumber(); $orderItemArr[] = $orderItem->getInvoiceNumber(); return \TYPO3\CMS\Core\Utility\GeneralUtility::csvValues($orderItemArr, $delim, $quote); }
/** * Send Mails * * @param \Extcode\Cart\Domain\Model\Order\Item $orderItem * @paran string $type * @param string $class * @param string $function * * @return void */ protected function sendMails(\Extcode\Cart\Domain\Model\Order\Item $orderItem, $type, $class, $function) { $billingAddress = $orderItem->getBillingAddress()->_loadRealInstance(); $shippingAddress = null; if ($orderItem->getShippingAddress()) { $shippingAddress = $orderItem->getShippingAddress()->_loadRealInstance(); } $data = ['orderItem' => $orderItem, 'cart' => $this->cart, 'billingAddress' => $billingAddress, 'shippingAddress' => $shippingAddress]; $signalSlotDispatcher = $this->objectManager->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher'); $signalSlotDispatcher->dispatch($class, $function . 'AfterUpdatePaymentAndBefore' . ucfirst($type) . 'Mail', $data); $paymentId = $orderItem->getPayment()->getServiceId(); $paymentStatus = $orderItem->getPayment()->getStatus(); if (intval($this->pluginSettings['payments']['options'][$paymentId]['sendBuyerEmail'][$paymentStatus]) == 1) { $this->sendBuyerMail($orderItem, $billingAddress, $shippingAddress); } if (intval($this->pluginSettings['payments']['options'][$paymentId]['sendSellerEmail'][$paymentStatus]) == 1) { $this->sendSellerMail($orderItem, $billingAddress, $shippingAddress); } $signalSlotDispatcher = $this->objectManager->get('TYPO3\\CMS\\Extbase\\SignalSlot\\Dispatcher'); $signalSlotDispatcher->dispatch($class, $function . 'AfterUpdatePaymentAndAfter' . ucfirst($type) . 'Mail', $data); }