chrometweaks.org

Question about iPage web hosting plan?

Click Here To View All Answers...


First question I have is Question about iPage web hosting plan? Thanks in advance for any answer. Another quick question... I followed some simple instructions to put add some information to confirmation emails sent out. Basically you had to define some text in the language for checkout_process.php and then add the code to the checkout_process.php..

I'd also like to add the fax number, but it's not working. The info is being pulled from the orders table through /includes/classes/order.php and doesn't have the customers fax in the table..

What would be the best way to go about doing this? I have two ideas, please tell me if they'll work and how (I'm hoping this will be simple)..

#1 - add the fax information from the customers table in the $order_query on line 35 of the order.php file and define it further somewhere in lines 66-78. Then I can call it in checkout_process.php. I'm thinking I can add it in the query with some kind of JOIN, but I'm not sure of the syntax..

#2 - add the column to the orders table in the database. how would you get it to duplicate the information from the customers table?.

Thanks in advance for any help!..

Comments (16)

I'm stumped. I'm not so sure what is the answer. I'll do some Googling and get back to you if I find an useful answer. You should email the people at iPage as they probably could give you help..

Comment #1

In checkout_process.php there is already an array with the customer's info, you just need to expand it..

Look for.

$sql_data_array = array('customers_id' => $customer_id,.

In that file and add the fax into that array after.

'customers_telephone' => $order->customer['telephone'],.

This post has been edited by.

GORF.

: 16 September 2004, 00:16..

Comment #2

Brissygal, here is the contribution I used..

Http://www.oscommerc...ributions,2002/.

Gork, you can't expand it. It's getting that information from a query to the orders table from order.php in the classes folder. The orders table doesn't have customer fax in it. At least that's how I'm reading it..

Here is the error message I'm getting.

1054 - Unknown column 'customers_fax' in 'field list'.

Insert into orders (customers_id, customers_name, customers_company, customers_street_address, customers_suburb, customers_city, customers_postcode, customers_state, customers_country, customers_telephone, customers_fax, customers_email_address, customers_address_format_id, delivery_name, delivery_company, delivery_street_address, delivery_suburb, delivery_city, delivery_postcode, delivery_state, delivery_country, delivery_address_format_id, billing_name, billing_company, billing_street_address, billing_suburb, billing_city, billing_postcode, billing_state, billing_country, billing_address_format_id, payment_method, cc_type, cc_owner, cc_number, cc_expires, date_purchased, orders_status, currency, currency_value) values ('1', 'John doe', 'ACME Inc.', '1 Way Street', '', 'NeverNever', '12345', 'California', 'United States', '12345', '', 'root@localhost', '2', 'John Doe', 'ACME Inc.', '1 Way Street', '', 'NeverNever', '12345', 'California', 'United States', '2', ' ', '', '', '', '', '', '', '', '', '', '', '', '', '', now(), '1', 'USD', '1.00000000').

[TEP STOP]..

Comment #3

Maybe I'm thinking about this wrong. Can I add the customer fax field to the ORDERS table, then put the information in there somehow so I can pull it back out in the includes/classes/orders.php file?.

Where do I do this?.

Someone please help..

Comment #4

David,.

Do you mind me asking, why do you need to include the customer's own fax number in their order email?.

Don't they know their own fax number?.

Not trying to seem sarcastic, just trying to understand...

Comment #5

Because a copy of the confirmation email will go to sales, and if they have the fax number they can answer more quickly(so they tell me)..

I'm working on making a "Quoting" Cart System, and have modified OSC to this extent, with help from many on this forum.

So, I've gotten prices out, been able to put attributes in, gotten the checkout procedure to work for quoting, and other stuff. Now I'm trying to get the email in a format that the salesperson can easily read it and respond quickly. They really want the fax number (if the customer provides it)...

Comment #6

Got it.

I'll see what I can do tomorrow and let you know...

Comment #7

1/2 way done..

I got the query built right..

Working on incorporating the fax into the email..

Won't be till the weekend...too much to do.

This post has been edited by.

GORF.

: 24 September 2004, 12:27..

Comment #8

Here we go.

In includes/classes/order.php.

Find.

     $customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from "TABLE_CUSTOMERS" c, "TABLE_ADDRESS_BOOK" ab left join "TABLE_ZONES" z on (ab.entry_zone_id = z.zone_id) left join "TABLE_COUNTRIES" co on (ab.entry_country_id = co.countries_id) where c.customers_id = '"(int)$customer_id"' and ab.customers_id = '"(int)$customer_id"' and c.customers_default_address_id = ab.address_book_id");.

Change to.

     $customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone,.

C.customers_fax, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode,.

Ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2,.

Co.countries_iso_code_3, co.address_format_id, ab.entry_state from "TABLE_CUSTOMERS" c, "TABLE_ADDRESS_BOOK.

" ab left join "TABLE_ZONES" z on (ab.entry_zone_id = z.zone_id) left join "TABLE_COUNTRIES" co on.

(ab.entry_country_id = co.countries_id) where c.customers_id = '"(int)$customer_id"' and ab.customers_id = '"(int)$customer_id.

"' and c.customers_default_address_id = ab.address_book_id");.

In checkout_process.php.

Find.

 $email_order .= "\n"EMAIL_TEXT_BILLING_ADDRESS"\n" ..

                 EMAIL_SEPARATOR"\n" ..

                 tep_address_label($customer_id, $billto, 0, '', "\n")"\n\n";.

Change to.

 $email_order .= "\n"EMAIL_TEXT_BILLING_ADDRESS"\n" ..

                 EMAIL_SEPARATOR"\n" ..

                 tep_address_label($customer_id, $billto, 0, '', "\n")"\n\n";.

 $email_order .= "Fax:""\n"tep_db_output($order->customer['fax'])"\n\n";.

The query was already there - just needed the field added..

Enjoy!..

Comment #9

No lesson, just finding the right things in the right places - I had to look like anyone else.

Did you get a chance to try it out?..

Comment #10

Yes I did and it works well! I understand the structure better and am going to try and rearrange some things to get it in the order I want, but the information needed is showing up!.

Thanks again!..

Comment #11

You know, I spoke too soon. I was using the test account that comes with the standard installation and it doesn't have a fax number..

Stupid me, I thought that since it showed "Fax :" then everything was ok..

I'm not getting any errors (that I know of), but it's not showing the fax number when I tried it with another account I set up..

I found some code where I'd tried to add it from the Orders table query, when I took that out it gives a blank page..

Does it need to be defined somewhere, like.

'customer_fax' = $order->['customers_fax'].

Should I put something like that in this? Lines 174-186 in my order.php.

$this->customer = array('firstname' => $customer_address['customers_firstname'],.

                             'lastname' => $customer_address['customers_lastname'],.

                             'company' => $customer_address['entry_company'],.

                             'street_address' => $customer_address['entry_street_address'],.

                             'suburb' => $customer_address['entry_suburb'],.

                             'city' => $customer_address['entry_city'],.

                             'postcode' => $customer_address['entry_postcode'],.

                             'state' => ((tep_not_null($customer_address['entry_state'])) ? $customer_address['entry_state'] : $customer_address['zone_name']),.

                             'zone_id' => $customer_address['entry_zone_id'],.

                             'country' => array('id' => $customer_address['countries_id'], 'title' => $customer_address['countries_name'], 'iso_code_2' => $customer_address['countries_iso_code_2'], 'iso_code_3' => $customer_address['countries_iso_code_3']),.

                             'format_id' => $customer_address['address_format_id'],.

                             'telephone' => $customer_address['customers_telephone'],.

                             'email_address' => $customer_address['customers_email_address']);.

Sorry I spoke too soon....

But I feel closer to a solution that I did before!..

Comment #12

DOAH!! And I posted too soon.

Yes, you need to define it's existence in the array in order.php!.

     $this->customer = array('firstname' => $customer_address['customers_firstname'],.

                             'lastname' => $customer_address['customers_lastname'],.

                             'company' => $customer_address['entry_company'],.

                             'street_address' => $customer_address['entry_street_address'],.

                             'suburb' => $customer_address['entry_suburb'],.

                             'city' => $customer_address['entry_city'],.

                             'postcode' => $customer_address['entry_postcode'],.

                             'state' => ((tep_not_null($customer_address['entry_state'])) ? $customer_address['entry_state'] : $customer_address['zone_name']),.

                             'zone_id' => $customer_address['entry_zone_id'],.

                             'country' => array('id' => $customer_address['countries_id'], 'title' => $customer_address['countries_name'], 'iso_code_2' => $customer_address['countries_iso_code_2'], 'iso_code_3' => $customer_address['countries_iso_code_3']),.

                             'format_id' => $customer_address['address_format_id'],.

                             'telephone' => $customer_address['customers_telephone'],.

                             'fax' => $customer_address['customers_fax'],.

                             'email_address' => $customer_address['customers_email_address']);.

Let me know.....

Comment #13

It works great! All the info is coming over, I tested it completely. Very cool!.

Thanks again!..

Comment #14

So to tap onto your thread, I want to do a similar thing, except have the customers phone number in the emails that are sent out. where do I add the code..

Cheers aron...

Comment #15

David,.

Sweet!.

[A-Team].

Aron,.

Only one change in one file as the info is already passed to it..

In checkout_process.php.

Find.

$email_order .= "\n"EMAIL_TEXT_BILLING_ADDRESS"\n" ..

EMAIL_SEPARATOR"\n" ..

Tep_address_label($customer_id, $billto, 0, '', "\n")"\n\n";.

Change to.

$email_order .= "\n"EMAIL_TEXT_BILLING_ADDRESS"\n" ..

EMAIL_SEPARATOR"\n" ..

Tep_address_label($customer_id, $billto, 0, '', "\n")"\n\n";.

$email_order .= "Phone:""\n"tep_db_output($order->customer['telephone'])"\n\n";.

This post has been edited by.

GORF.

: 29 September 2004, 01:54..

Comment #16

Realy appreciate your help. but mine dosent look anything like what you have shown...

<?php.

/*.

 $Id: checkout_process.php,v 1.26 2002/11/01 04:22:05 hpdl Exp $.

 osCommerce, Open Source E-Commerce Solutions.

 http://www.oscommerce.com.

 Copyright (c) 2002 osCommerce.

 Released under the GNU General Public License.

*/.

Define('EMAIL_TEXT_SUBJECT', 'Order Process');.

Define('EMAIL_TEXT_ORDER_NUMBER', 'Order Number:');.

Define('EMAIL_TEXT_INVOICE_URL', 'Detailed Invoice:');.

Define('EMAIL_TEXT_DATE_ORDERED', 'Date Ordered:');.

Define('EMAIL_TEXT_PRODUCTS', 'Products');.

Define('EMAIL_TEXT_SUBTOTAL', 'Sub-Total:');.

Define('EMAIL_TEXT_TAX', 'Tax:        ');.

Define('EMAIL_TEXT_SHIPPING', 'Shipping: ');.

Define('EMAIL_TEXT_TOTAL', 'Total including GST:    ');.

Define('EMAIL_TEXT_DELIVERY_ADDRESS', 'Delivery Address');.

Define('EMAIL_TEXT_BILLING_ADDRESS', 'Billing Address');.

Define('EMAIL_TEXT_PAYMENT_METHOD', 'Payment Method');.

Define('EMAIL_SEPARATOR', '');.

Define('TEXT_EMAIL_VIA', 'via');.

?>.

Cheers aron...

Comment #17


This question was taken from a support group/message board and re-posted here so others can learn from it.