![]() |
Drop Down
Has anyone added a drop down box to this?
Thanks! |
Useful little mod but copying the files doesnt work in 4.0.13 so if its useful to anyone these are the mods for 4.0.13.
Quote:
Add the lbl_how_heard variable to the languages in include/register.php Find .. Code:
db_query("UPDATE $sql_tbl[customers] SET password='$crypted', password_hint='$password_hint', password_hint_answer='$password_hint_answer', title='$title', firstname='$firstname', lastname='$lastname', company='$company', b_address='".$b_address."\n".$b_address_2."', b_city='$b_city', b_county='".(@$b_county)."', b_state='$b_state', b_country='$b_country', b_zipcode='$b_zipcode', s_address='".$s_address."\n".$s_address_2."', s_city='$s_city', s_county='".(@$s_county)."', s_state='$s_state', s_country='$s_country', s_zipcode='$s_zipcode', phone='$phone', email='$email', fax='$fax', url='$url', card_name='$card_name', card_type='$card_type', card_number='".addslashes(text_crypt($card_number))."', card_expire='$card_expire', card_cvv2='$card_cvv2', pending_membership='$pending_membership', ssn='$ssn', change_password='$change_password', parent = '$parent', pending_plan_id = '$pending_plan_id' WHERE login='$login' AND usertype='$login_type'"); Code:
db_query("UPDATE $sql_tbl[customers] SET password='$crypted', password_hint='$password_hint', password_hint_answer='$password_hint_answer', title='$title', firstname='$firstname', lastname='$lastname', company='$company', b_address='".$b_address."\n".$b_address_2."', b_city='$b_city', b_county='".(@$b_county)."', b_state='$b_state', b_country='$b_country', b_zipcode='$b_zipcode', s_address='".$s_address."\n".$s_address_2."', s_city='$s_city', s_county='".(@$s_county)."', s_state='$s_state', s_country='$s_country', s_zipcode='$s_zipcode', phone='$phone', email='$email', fax='$fax', url='$url', card_name='$card_name', card_type='$card_type', card_number='".addslashes(text_crypt($card_number))."', card_expire='$card_expire', card_cvv2='$card_cvv2', pending_membership='$pending_membership', ssn='$ssn', change_password='$change_password', parent = '$parent', pending_plan_id = '$pending_plan_id', hear='$hear' WHERE login='$login' AND usertype='$login_type'"); Code:
db_query("INSERT INTO $sql_tbl[customers] (login,usertype,password,password_hint,password_hint_answer,title,firstname,lastname,company,b_address,b_city,b_county,b_state,b_country,b_zipcode,s_address,s_city,s_county,s_state,s_country,s_zipcode,phone,email,fax,url,card_name,card_type,card_number,card_expire,card_cvv2,first_login,status,referer,pending_membership,ssn,parent,pending_plan_id,change_password) VALUES ('$uname','$usertype','$crypted','".@$password_hint."','".@$password_hint_answer."','$title','$firstname','$lastname','$company','".$b_address."\n".$b_address_2."','$b_city','".(@$b_county)."','$b_state','$b_country','$b_zipcode','".$s_address."\n".$s_address_2."','$s_city','".(@$s_county)."','$s_state','$s_country','$s_zipcode','$phone','$email','$fax','$url','".@$card_name."','".@$card_type."','".addslashes(text_crypt(@$card_number))."','".@$card_expire."','".@$card_cvv2."','".time()."','Y','".@$RefererCookie."','".@$pending_membership."','".@$ssn."', '$parent', '$pending_plan_id','$change_password')"); Code:
db_query("INSERT INTO $sql_tbl[customers] (login,usertype,password,password_hint,password_hint_answer,title,firstname,lastname,company,b_address,b_city,b_county,b_state,b_country,b_zipcode,s_address,s_city,s_county,s_state,s_country,s_zipcode,phone,email,fax,url,card_name,card_type,card_number,card_expire,card_cvv2,first_login,status,referer,pending_membership,ssn,parent,pending_plan_id,change_password,hear) VALUES ('$uname','$usertype','$crypted','".@$password_hint."','".@$password_hint_answer."','$title','$firstname','$lastname','$company','".$b_address."\n".$b_address_2."','$b_city','".(@$b_county)."','$b_state','$b_country','$b_zipcode','".$s_address."\n".$s_address_2."','$s_city','".(@$s_county)."','$s_state','$s_country','$s_zipcode','$phone','$email','$fax','$url','".@$card_name."','".@$card_type."','".addslashes(text_crypt(@$card_number))."','".@$card_expire."','".@$card_cvv2."','".time()."','Y','".@$RefererCookie."','".@$pending_membership."','".@$ssn."', '$parent', '$pending_plan_id','$change_password','$hear')"); Code:
$profile_modified_data[$user] = $userinfo; Code:
$userinfo[hear]=stripslashes($hear); in include/func.php Find.. Code:
$mail_smarty->assign("userinfo",$order_data["userinfo"]); Directly below it add.. Code:
$ha_result = func_query_first ("SELECT hear FROM xcart_customers WHERE login='$userinfo[login]'"); in skin1/customer/main/ Find .. Code:
{include file="main/register_personal_info.tpl" userinfo=$userinfo} Directly below it add.. Code:
{* Added How Heard Here *} Thats the mod completed, if you want it to appear on the admin email received after a sale add the following .. in skin1/mail/order_notification_subj.tpl After line .. Code:
{config_load file="$skin_config"}{ $config.Company.company_name }: {$lng.lbl_order} #{$order.orderid} {$lng.eml_notification} Add.. Code:
{$lng.lbl_how_heard}: {$hearabout} I take no credit for this mod i just made it work on Version4.0.13, thanx to you guys that made it |
:!: Just wanted to note that this can now be done with the custom fields that are built-in in version 4.0.x of X-Cart. You can find it in General Settings->User Profile options. :wink:
|
:oops: Thanx BOOMER, Errmmm Yup that would have been a simpler solution 8O, lol
|
Please how to make those extra fields bi lingual?
|
Re: Adding a "How Did You Hear About Us" ??
Just a quick update to this.
After you add the custom fields using General Settings > User Profile Options, you may want it to appear on your order pages (admin side) so that you can see where customers have come from when you come to process the orders. Open: skin1/main/history_order.tpl Find: {if $usertype eq "A"} {$lng.lbl_status}: {include file="main/order_status.tpl" status=$order.status mode="select" name="status"} <P> Change it to: {if $usertype eq "A"} {$lng.lbl_status}: {include file="main/order_status.tpl" status=$order.status mode="select" name="status"} <br><br> {foreach from=$customer.additional_fields item=v} {if $v.section eq 'A'} {if $is_header ne 'Y'} {/if} {$v.value} {/if} {/foreach} <P> That's it! Now, when a new customer registers and places an order you will be able to see where that customer has come from when you view their order in the admin section. (It appears underneath the dropdown menu called 'Status', and above the 'Tracking Number' text box) This was tested on 4.0.16, but should be fine with other versions too. |
Re: Adding a "How Did You Hear About Us" ??
Done now, thanks.
|
Re: Adding a "How Did You Hear About Us" ??
Thanks for this info.
I have version 4.1.8. I looked in the file skin1/main/history_order.tpl but couldnt quite see the same information. Is there any chance that i could have the "how did you hear about us" script for my version. Cheers |
Re: Adding a "How Did You Hear About Us" ??
you don't need a script ...why don't u just add an extra field and have a select box with the options..?
|
Re: Adding a "How Did You Hear About Us" ??
Thanks Mitash, i think i have figured it now via your method.
Is there any way that we can pull this information received from customers, into statistics? |
All times are GMT -8. The time now is 08:09 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.