Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Adding new field to display in orders.php and email confirmation


Recommended Posts



I need to add a yes/no choice for the customers to make (whether they're members of a certain organization) to be inputted when they create an account and have it sent to the owner of the store after they make a purchase.


Instead of starting from scratch, to add the field, I just used the customer_gender field and changed the language files so they would show "member" instead of "male," etc. Worked pretty good. I believe the my changes made in create_account.php affect the customers table.


BUT, I also want that new info. to show up in the e-mail that goes to the owner. I used the help from here to modify checkout_process.php: http://www.oscommerce.com/forums/index.php?sho...il+confirmation (I found some typos, so maybe it's something in there?) - I'll post it below, too.


When I check the database, I see gender registered in the customers table ("customers_gender"), but the e-mail is generated from the orders table.


How do I get the gender info. from the customers table over to the e-mail on checkout_process.php?


It does work fine on the customers page in admin, just not the orders page or on the e-mail...


Obviously, I don't know much php or I could handle this myself. I have tried ALL DAY, though!!!


Thanks so much for your help!!



The e-mail change so far:

//-old order process e-mail --- tep_mail($order->customer['firstname'] . ' ' . $order->customer['lastname'], $order->customer['email_address'], EMAIL_TEXT_SUBJECT, $email_order, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

// send emails to other people

// WebMakers.com Added: Wholesaler - Include Order # in subject

// Add additional info to top of email


// WebMakers.com Added: Wholesaler - Modify Email for easier reading.

  $email_order= $order->customer['firstname'] . ' ' . $order->customer['lastname'] . "\n" .  "Telephone: " . $order->customer['telephone'] . "\n" .  $order->customer['email_address'] . "\n" .  "R-Calf Member: " .  $order->customer['gender']  . "\n\n" .  $email_order;

  tep_mail('', SEND_EXTRA_ORDER_EMAILS_TO, EMAIL_TEXT_SUBJECT . ' #' . $insert_id, nl2br($email_order), STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, '');


Link to comment
Share on other sites


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

  • Create New...