Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with checkout_process.php


gevans

Recommended Posts

I want to add an extra line to the order email. I know where to do this but I don't know how to get the data in there that I want displayed. I've modified the customers table by adding a customers_rep field and also created the table 'rep' with rep_name and rep_id fields.

 

What I want to happen is for checkout_process.php to lookup the customer and grab the associated customers_rep id# and then check the rep table and match the id# to a rep name and then print the rep name in the order email.

 

So far I have it doing the first step (lookup up customer and grab associated customers_rep id# but how do I get it to lookup and display the correct rep_name field?

 

This is what I have so far:

 

$account_query = tep_db_query("select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_zone_id, a.entry_state, a.entry_country_id, c.customers_rep, c.customers_telephone, c.customers_fax, c.customers_newsletter from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " a where c.customers_id = '" . $customer_id . "' and a.customers_id = c.customers_id and a.address_book_id = '" . $customer_default_address_id . "'");



 $account = tep_db_fetch_array($account_query);

 $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" .

                EMAIL_TEXT_SALES_REP . ' ' . $account['customers_rep'] . "nn";

 

Thanks.

Link to comment
Share on other sites

  • 8 years later...

I want to add an extra line to the order email. I know where to do this but I don't know how to get the data in there that I want displayed. I've modified the customers table by adding a customers_rep field and also created the table 'rep' with rep_name and rep_id fields.

 

What I want to happen is for checkout_process.php to lookup the customer and grab the associated customers_rep id# and then check the rep table and match the id# to a rep name and then print the rep name in the order email.

 

So far I have it doing the first step (lookup up customer and grab associated customers_rep id# but how do I get it to lookup and display the correct rep_name field?

 

This is what I have so far:

 

$account_query = tep_db_query("select c.customers_gender, c.customers_firstname, c.customers_lastname, c.customers_dob, c.customers_email_address, a.entry_company, a.entry_street_address, a.entry_suburb, a.entry_postcode, a.entry_city, a.entry_zone_id, a.entry_state, a.entry_country_id, c.customers_rep, c.customers_telephone, c.customers_fax, c.customers_newsletter from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " a where c.customers_id = '" . $customer_id . "' and a.customers_id = c.customers_id and a.address_book_id = '" . $customer_default_address_id . "'");



 $account = tep_db_fetch_array($account_query);

 $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" .

                EMAIL_TEXT_SALES_REP . ' ' . $account['customers_rep'] . "nn";

 

Thanks.

 

 

If you have the reps id showing, then you need it to link to the reps database lookup the rep id and and return the reps name, if you look in the products_info.php you will see how the products_id is linked to the products_decsription table and recalls values from it.

 

Then apply this to the above and you should be able to get the reps_name rather than the id showing. wouldnt be surprised if theres a mod for this in the add onsd section.

Getting better with mods but no programmer am I.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...