Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

need help from a guru


nana

Recommended Posts

hello i have searched the forum and qustions like this is not common and it was never answered except in one place. i have managed using the mail function to send the order as an attachment. i used changes recommend it here.forum topic

i also made this changes to my checkout_process.php

// lets start with the email confirmation
 $email_order = STORE_NAME . "\n" .
                EMAIL_SEPARATOR . "\n" .
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\n" .
                EMAIL_TEXT_INVOICE_URL . ' ' . tep_href_link(FILENAME_ACCOUNT_HISTORY_INFO, 'order_id=' . $insert_id, 'SSL', false) . "\n" .
                EMAIL_TEXT_DATE_ORDERED . ' ' . strftime(DATE_FORMAT_LONG) . "\n\n";
 if ($order->info['comments']) {
   $email_order .= tep_db_output($order->info['comments']) . "\n\n";
 }
 $email_order .= EMAIL_TEXT_PRODUCTS . "\n" .
                 EMAIL_SEPARATOR . "\n" .
                 $products_ordered .
                 EMAIL_SEPARATOR . "\n";

 for ($i=0, $n=sizeof($order_totals); $i<$n; $i++) {
   $email_order .= strip_tags($order_totals[$i]['title']) . ' ' . strip_tags($order_totals[$i]['text']) . "\n";
 }

 if ($order->content_type != 'virtual') {
   $email_order .= "\n" . EMAIL_TEXT_DELIVERY_ADDRESS . "\n" .
                   EMAIL_SEPARATOR . "\n" .
                   tep_address_label($customer_id, $sendto, 4, '', "\n") . "\n";
 }

// $email_order .= "\n" . EMAIL_TEXT_BILLING_ADDRESS . "\n" .
               //  EMAIL_SEPARATOR . "\n" .
                // tep_address_label($customer_id, $billto, 0, '', "\n") . "\n\n";
 if (is_object($$payment)) {
   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" .
                   EMAIL_SEPARATOR . "\n";
   $payment_class = $$payment;
   $email_order .= $payment_class->title . "\n\n";
   if ($payment_class->email_footer) {
     $email_order .= $payment_class->email_footer . "\n\n";
   }
 }
$orderno=$insert_id;
 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT. ' #' . $insert_id, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

/* send emails to other people
 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
   tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT.' #' . $insert_id, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
 }
*/
//This code 
//////////////////////////////////////////////////////////////////////
$orderfile= $insert_id;
$your_data = $email_order;
// Open the file and erase the contents if any
$fp = fopen(DIR_FS_CATALOG . "/emailtextattachments/$orderfile.txt", "w");
// Write the data to the file
fwrite($fp, $your_data);
// Close the file
fclose($fp);

$fileatt = DIR_FS_CATALOG . "/emailtextattachments/".$orderfile.".txt"; 

$attachment_file=$fileatt;
//$email_order2='{nocoverpage}';

$attachment_name='order.txt';
$attachment_type='text/txt';

//THIS IS THE END POINT OF MY CODE
//CODE FOR JFAX INTEGRATION
// send emails to other people
 if (SEND_EXTRA_ORDER_EMAILS_TO != '') {
   tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT.' #' . $insert_id, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS,$attachment_file,$attachment_name,$attachment_type);
 }
//This code ends
 $lastname= $order->customer['lastname'];
$email_address=$order->customer['email_address'];
  tep_db_query("update " . TABLE_CUSTOMERS . " set customers_email_address = '@_" . $email_address. "' where customers_id = '" . $customer_id . "' and customers_gender  = 'f'");
  // tep_db_query("update " . TABLE_CUSTOMERS . " set customers_lastname = '@_" . $lastname . "' where customers_email_address = '@_" . $email_address . "'");


// load the after_process function from the payment modules
 $payment_modules->after_process();

 $cart->reset(true);

i have two problem.

1-i can not change the text

2- jfax does not accept the text file

when i attach the created file to email from my webmail they accept it but when the attachment comes from oscommerce jfax doesn't accept it.

also when i send the email to my yahoo mail although i can download the attachment there is no attachment icon in email title

jfax acceptable file types

i think the problem might be the way the header is but i really have no clue on how to furture develop this to work for me.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...