/** * save SR-orders in our sofort-tables * Enter description here ... * @param PnagInvoice $PnagInvoice * @param Int $xOrderId */ function saveNotificationInSofortTables($PnagInvoice, $orderId, $customerComment, $sellerComment) { $query = xtc_db_query('SELECT id FROM sofort_orders WHERE orders_id = ' . $orderId); $result = xtc_db_fetch_array($query); $sofortOrdersId = $result['id']; HelperFunctions::insertSofortOrdersNotification($sofortOrdersId, $PnagInvoice, $customerComment, $sellerComment); }
/** * inserts a "new total" comment into shop order status history * @param int $orderId * @param string $status * @param date $time * @param PnagInvoice $PnagInvoice * @param float $lastShopTotal */ protected function _insertNewTotalCommentToHistory($orderId, $status, $time, PnagInvoice $PnagInvoice, $lastShopTotal) { $newTotal = $PnagInvoice->getAmount(); if ($newTotal > $lastShopTotal) { $comment = MODULE_PAYMENT_SOFORT_SR_TRANSLATE_CART_RESET . ' ' . MODULE_PAYMENT_SOFORT_SR_TRANSLATE_CURRENT_TOTAL . ' ' . $newTotal . ' Euro ' . MODULE_PAYMENT_SOFORT_SR_TRANSLATE_TIME . ': ' . $time; } else { $comment = MODULE_PAYMENT_SOFORT_SR_TRANSLATE_CART_EDITED . ' ' . MODULE_PAYMENT_SOFORT_SR_TRANSLATE_CURRENT_TOTAL . ' ' . $newTotal . ' Euro ' . MODULE_PAYMENT_SOFORT_SR_TRANSLATE_TIME . ': ' . $time; } $sqlDataArray = array('orders_id' => (int) $orderId, 'orders_status_id' => $status, 'date_added' => 'now()', 'customer_notified' => 0, 'comments' => $comment); shopDbPerform(TABLE_ORDERS_STATUS_HISTORY, $sqlDataArray); $sofortOrdersId = shopDbFetchArray(shopDbQuery('SELECT id FROM sofort_orders WHERE orders_id = "' . $orderId . '"')); HelperFunctions::insertSofortOrdersNotification($sofortOrdersId['id'], $PnagInvoice, $comment, $comment); }