Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

More Address fields in 3.5.9 and displaying them in orders

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-22-2004, 11:00 AM
 
ian_fs ian_fs is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: Norwich, UK
Posts: 86
 

Default More Address fields in 3.5.9 and displaying them in orders

Using X-Cart 3.5.9

I have added the necessary database fields and address fields in the registration page to have 3 address line fields. I have got the registration side succesfully completed, however I now want to have the address lines to be shown in invoices and customer notifications emails.

I have looked into the mail templates and added the code from the original address line thinking that it would get the data for the further to fields. However this does not happen, I have since tried to find the necessary PHP files which will have the code which gets the customers address data from the database to change but I cannot find the file(s) which handle the orders and sends the emails.

If someone could tell me the files which do this I would be grateful. I have looked through the following files and have found nothing relating to it, but I may have glanced over something.

(I do not know which is the ordinary payment script in X-Cart as the shop Im developing X-Cart for manually process the orders).

auth.php
cart.php
order.php
orders.php
include/func.php
include/orders.php
include/payment_method.php
payment/payment_cc.php
payment/payment_ccend.php

Maybe I have been looking in the wrong files or the correct files and not noticed. Any pointers on where to make changes for:-

order emails
invoices
(plus on a side not how to add two extra address lines to gift certificates)
and anything else that relates to customer address's.

My only alternative would be changing the address textbox into a textarea so customers could type addresses in the following manner:

123 Smith Street -address 1
Smithville - address 2
Marylebone - address 3

then city
then county
etc


Cheers

JeZ
Reply With Quote
  #2  
Old 07-22-2004, 03:20 PM
 
willirl willirl is offline
 

eXpert
  
Join Date: Mar 2004
Location: OHIO
Posts: 271
 

Default more address lines

I was going to print a list here of all the files but thought better of it. There are a BUNCH of them. Instead I'll give you the command to get a list of files that you want.

Code:
find . -iname "*.php" | xargs grep "b_address" -l

You will need to be in the top directory of your store and it will recursively search through all the subdirectories from where you are.

This command will show only the PHP files and you probably also want to do one for "*.tpl" to get the templates as well.

The "-l" at the end suppresses the output of the matching text so you can remove that if you want to see the output.

Hope this helps. -I also would like to have JUST ONE MORE address line!!!

Regards,
Richard
Reply With Quote
  #3  
Old 07-23-2004, 02:14 AM
 
ian_fs ian_fs is offline
 

Advanced Member
  
Join Date: Apr 2004
Location: Norwich, UK
Posts: 86
 

Default

Thank you for that piece of code there, I searched the include folder and found round about line 2345 in func.php the necessary code that enters data into the orders database.

Code:
db_query("insert into $sql_tbl[orders] (login, membership, total, giftcert_discount, giftcert_ids, subtotal, shipping_cost, shippingid, tax, tax_gst, tax_pst, total_vat, taxes_applyed, discount, coupon, coupon_discount, date, status, payment_method, flag, details, title, firstname, lastname, company, b_title, b_firstname, b_lastname, b_address, b_address2, b_address3, b_city, b_state, b_country, b_zipcode, s_title, s_firstname, s_lastname, s_address, s_address2, s_address3, s_city, s_state, s_country, s_zipcode, phone, fax, email, url, reg_numbers, vat_applied) values ('".addslashes($userinfo["login"])."', '".addslashes($userinfo["membership"])."', '$current_order[total_cost]', '$giftcert_discount', '".@$giftcert_str."', '$current_order[subtotal]','$current_order[shipping_cost]', '$cart[shippingid]', '$current_order[tax_cost]', '$current_order[tax_gst]', '$current_order[tax_pst]', '$current_order[total_vat]', '$taxes_applyed', '$current_order[discount]', '".addslashes(@$current_order["coupon"])."', '$current_order[coupon_discount]', '".time()."', '$order_status', '".addslashes($payment_method)."', 'N', '".addslashes(text_crypt($order_details))."', '".addslashes($userinfo["title"])."', '".addslashes($userinfo["firstname"])."', '".addslashes($userinfo["lastname"])."', '".addslashes($userinfo["company"])."', '".addslashes($userinfo["b_title"])."', '".addslashes($userinfo["b_firstname"])."', '".addslashes($userinfo["b_lastname"])."', '".addslashes($userinfo["b_address"])."', '".addslashes($userinfo["b_address2"])."', '".addslashes($userinfo["b_address3"])."', '".addslashes($userinfo["b_city"])."', '".addslashes($userinfo["b_state"])."', '".addslashes($userinfo["b_country"])."', '".addslashes($userinfo["b_zipcode"])."', '".addslashes($userinfo["s_title"])."', '".addslashes($userinfo["s_firstname"])."', '".addslashes($userinfo["s_lastname"])."', '".addslashes($userinfo["s_address"])."', '".addslashes($userinfo["s_address2"])."', '".addslashes($userinfo["s_address3"])."', '".addslashes($userinfo["s_city"])."', '".addslashes($userinfo["s_state"])."', '".addslashes($userinfo["s_country"])."', '".addslashes($userinfo["s_zipcode"])."', '".addslashes($userinfo["phone"])."', '".addslashes($userinfo["fax"])."', '$userinfo[email]', '".addslashes($userinfo["url"])."', '$reg_numbers', '$current_order[vat_applied]')");

Well cheers for that, that's a really helpful piece of code and I shall be using it more often now I think, far easier than having to manually look through all the files.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 02:45 PM.

   

 
X-Cart forums © 2001-2020