Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change position of payment method in order emails


Guest

Recommended Posts

Posted

I was wondering if someone can help me with this one, I would like to move the position of “Payment Method” in the order confirmation emails that the customer and site owner receive. The position is currently at the top of the email under the billing address (standard oscommerce):

 

Billing Address

------------------------------------------------------

someones name

Address line 1

Address line 2

Postcode

 

Payment Method

------------------------------------------------------

PayPal

 

 

I want to move it up near the top so it appears under Date Ordered. Also I would like the actual payment method i.e. Paypal, to appear on the same line as the words “Payment Method”. See below for example:

 

Order Number: 1234

Detailed Invoice: URL

Date Ordered: Monday 30 September, 2010

Payment Method: Paypal

 

Products

------------------------------------------------------

1 x product = £10.99

------------------------------------------------------

Sub-Total: £79.81

Free delivery via Royal Mail 1st class: £0.00

VAT Rate 17.5%: £11.89

Total: £79.81

 

Below is the code I believe controls the confirmation emails (taken from my catalog/checkout_process.php file). If someone could tell me where I need to put what it would be greatly appreciated;

 

//lets start with the email confirmation
// DDB - 041103 - Add test for PWA : no display of invoice URL if PWA customer
if (!tep_session_is_registered('noaccount')) 
{
 $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, strtotime($date_time)) . "\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";
} else {
 $email_order = STORE_NAME . "\n" . 
                EMAIL_SEPARATOR . "\n" . 
                EMAIL_TEXT_ORDER_NUMBER . ' ' . $insert_id . "\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, 0, '', "\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";
   }
 }
 tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);
//end PWA

Posted

Really nobody knows how to do this?

 

I have managed to move the payment method up to the top by moving:

 

if (is_object($$payment)) {
   $email_order .= EMAIL_TEXT_PAYMENT_METHOD . "\n" . 
                   EMAIL_SEPARATOR . "\n";
   $payment_class = $$payment;
   $email_order .= $payment_class->title . "\n\n";

 

 

However it seams to have had a weird effect, in that sometimes the payment method appears in the emails and sometimes it doesn't. Also I haven’t been able to work out how to get the payment method on one line. Any help greatly appreciated.

Archived

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

×
×
  • Create New...