public function after_checkout($order_id, $suppress_output = true)
{
if ($suppress_output == true) {
ob_start();
}
if ($order_id == false or trim($order_id) == '') {
return array('error' => 'Invalid order ID');
}
$ord_data = $this->app->shop_manager->get_orders('one=1&id=' . $order_id);
if (is_array($ord_data)) {
$ord = $order_id;
$notification = array();
$notification['module'] = 'shop';
$notification['rel_type'] = 'cart_orders';
$notification['rel_id'] = $ord;
$notification['title'] = 'You have new order';
$notification['description'] = 'New order is placed from ' . $this->app->url_manager->current(1);
$notification['content'] = 'New order in the online shop. Order id: ' . $ord;
$this->app->notifications_manager->save($notification);
$this->app->log_manager->save($notification);
$this->confirm_email_send($order_id);
}
if ($suppress_output == true) {
ob_end_clean();
}
}