function _sendOrderNotifycationToCustomer( $orderID, &$smarty_mail, $email, $login,
$payment_email_comments_text, $shipping_email_comments_text, $tax )
{
$order = _getOrderById( $orderID );
$smarty_mail->assign('order_status_url',str_replace('{URL}',CONF_FULL_SHOP_URL.'index.php?ukey=order_status&orderID='.$orderID.'&code='.base64_encode($order['customer_email']),translate('lbl_order_status_history_url')));
$smarty_mail->assign( "customer_firstname", $order["customer_firstname"] );
$smarty_mail->assign( "order", $order );
$smarty_mail->assign( "discount", $order["order_discount"]>0?
($order["currency_code"]." ".
RoundFloatValueStr($order["currency_value"]*$order["order_discount"])):'' );
$shippinginfo = $order["shipping_type"];
if (strlen($order["shippingServiceInfo"])>0) $shippinginfo .= " (".$order["shippingServiceInfo"].")";
$smarty_mail->assign( "shipping_type", $shippinginfo );
$smarty_mail->assign( "shipping_type", $order["shipping_type"] );
$smarty_mail->assign( "shipping_firstname", $order["shipping_firstname"] );
$smarty_mail->assign( "shipping_lastname", $order["shipping_lastname"] );
$smarty_mail->assign( "shipping_country", $order["shipping_country"] );
$smarty_mail->assign( "shipping_state", $order["shipping_state"] );
$smarty_mail->assign( "shipping_zip", $order["shipping_zip"] );
$smarty_mail->assign( "shipping_city", $order["shipping_city"] );
$smarty_mail->assign( "shipping_address", $order["shipping_address"] );
$smarty_mail->assign( "shipping_cost",
$order["currency_code"]." ".
RoundFloatValueStr($order["currency_value"]*$order["shipping_cost"]) );
$smarty_mail->assign( "payment_type", $order["payment_type"] );
$smarty_mail->assign( "billing_firstname", $order["billing_firstname"] );
$smarty_mail->assign( "billing_lastname", $order["billing_lastname"] );
$smarty_mail->assign( "billing_country", $order["billing_country"] );
$smarty_mail->assign( "billing_state", $order["billing_state"] );
$smarty_mail->assign( "billing_zip", $order["billing_zip"] );
$smarty_mail->assign( "billing_city", $order["billing_city"] );
$smarty_mail->assign( "billing_address", $order["billing_address"] );
$smarty_mail->assign( "order_amount",
$order["currency_code"]." ".
RoundFloatValueStr($order["currency_value"]*$order["order_amount"]) );
$smarty_mail->assign( "payment_comments", $payment_email_comments_text );
$smarty_mail->assign( "shipping_comments", $shipping_email_comments_text );
$smarty_mail->assign( "order_total_tax", $order["currency_code"]." ".
RoundFloatValueStr($order["currency_value"]*$tax) );
//additional reg fields
$addregfields = GetRegFieldsValuesByOrderID( $orderID );
$smarty_mail->assign("customer_add_fields", $addregfields);
$content = ordGetOrderContent( $orderID );
for( $i=0; $i<count($content); $i++ )
{
$productID = GetProductIdByItemId( $content[$i]["itemID"] );
if ( $productID == null || trim($productID) == "" )
continue;
$sql = "SELECT ".LanguagesManager::sql_prepareField('name')." AS name, product_code";
$sql .= ", eproduct_filename, eproduct_available_days, eproduct_download_times";
$sql .= " FROM ?#PRODUCTS_TABLE WHERE productID=?";
$product = db_phquery_fetch(DBRFETCH_ASSOC, $sql, $productID);
$content[$i]["product_code"] = $product["product_code"];
$variants = GetConfigurationByItemId( $content[$i]["itemID"] );
$options = GetStrOptions( $variants );
if ( $options != "" ){
$content[$i]["name"] = $product["name"]."(".$options.")";
}else
{
$content[$i]["name"] = $product["name"];
}
$content[$i]["Price"] = $order["currency_code"]." ".(
RoundFloatValueStr($order["currency_value"]*$content[$i]["Price"]) );
if ( strlen($product["eproduct_filename"])>0 && file_exists("product_files/".$product["eproduct_filename"]) )
{
if ($login != null)
$customerID = regGetIdByLogin( $login );
else
$customerID = -1;
$content[$i]["eproduct_filename"] = $product["eproduct_filename"];
$content[$i]["eproduct_available_days"] = $product["eproduct_available_days"];
$content[$i]["eproduct_download_times"] = $product["eproduct_download_times"];
$content[$i]["file_size"] = filesize( DIR_PRODUCTS_FILES."/".$product["eproduct_filename"] );
$content[$i]["file_size_str"] = getDisplayFileSize($content[$i]["file_size"], 'B');
$content[$i]["getFileParam"] =
"orderID=".$order["orderID"]."&".
"productID=".$productID."&".
"customerID=".$customerID;
//additional security for non authorized customers
if ($customerID == -1)
{
$content[$i]["getFileParam"] .= "&order_time=".base64_encode($order["order_time"]);
}
$content[$i]["getFileParam"] =
cryptFileParamCrypt( $content[$i]["getFileParam"], null );
}
}
/*@var $smarty_mail View */
$smarty_mail->assign( "content", $content );
$html = $smarty_mail->fetch( "order_notification.txt" );
$res = ss_mail( $email, translate('ordr_id')." ".$order['orderID_view'], $html, true);
}