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

Adding a "How Did You Hear About Us" ??

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 08-19-2003, 09:26 PM
 
dawing dawing is offline
 

Member
  
Join Date: Aug 2003
Posts: 15
 

Default Drop Down

Has anyone added a drop down box to this?

Thanks!
Reply With Quote
  #22  
Old 02-15-2006, 05:40 AM
 
neroag neroag is offline
 

Senior Member
  
Join Date: May 2005
Location: UK
Posts: 171
 

Default

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:
kpriest wrote:
use the Patch/Upgrade area of your xcart admin - at the bottom of the screen, paste this code into the Query box and click Apply:
Code:
ALTER TABLE `xcart_customers` ADD `hear` VARCHAR(255) NOT NULL;

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'");
Change to..
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'");
Find ..
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')");
Change to..
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')");
Find ..
Code:
$profile_modified_data[$user] = $userinfo;
add directly below it ..
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]'"); $hearabout = $ha_result ["hear"]; $mail_smarty->assign("hearabout",$hearabout);

in skin1/customer/main/

Find ..
Code:
{include file="main/register_personal_info.tpl" userinfo=$userinfo}

Directly below it add..
Code:
{* Added How Heard Here *} <tr valign=middle> <td align=right>{$lng.lbl_how_heard}</td> <td></td> <td nowrap> <input type=text name=hear size=32 maxlength=255 value="{$userinfo.hear}"> </td> </tr> {*----------------------*}

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
__________________
X-cart Gold - 4.0.18 - 4.1.9 - 4.1.10 - 4.3.0
Reply With Quote
  #23  
Old 02-15-2006, 06:25 AM
  B00MER's Avatar 
B00MER B00MER is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Keller, TX (Cart-Lab.com)
Posts: 3,165
 

Default

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.
__________________
Cart-Lab - 100+ Social Bookmarks for X-Cart.
Reply With Quote
  #24  
Old 02-15-2006, 07:07 AM
 
neroag neroag is offline
 

Senior Member
  
Join Date: May 2005
Location: UK
Posts: 171
 

Default

Thanx BOOMER, Errmmm Yup that would have been a simpler solution , lol
__________________
X-cart Gold - 4.0.18 - 4.1.9 - 4.1.10 - 4.3.0
Reply With Quote
  #25  
Old 02-23-2006, 06:18 PM
 
Lionel Lionel is offline
 

Senior Member
  
Join Date: Dec 2005
Posts: 199
 

Default

Please how to make those extra fields bi lingual?
__________________
X-Cart Gold 4.0.17 [unix]
X-Cart Gold 4.0.18 [unix]
Reply With Quote
  #26  
Old 04-24-2007, 02:07 AM
 
hamid hamid is offline
 

Senior Member
  
Join Date: Apr 2004
Posts: 107
 

Default 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.
__________________
X-Cart Gold v4.6.5
Reply With Quote
  #27  
Old 04-27-2007, 07:17 PM
 
Hayles Hayles is offline
 

Member
  
Join Date: Apr 2007
Posts: 10
 

Default Re: Adding a "How Did You Hear About Us" ??

Done now, thanks.
__________________
Version 4.0.19
Reply With Quote
  #28  
Old 09-25-2007, 12:36 AM
 
sunset sunset is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 94
 

Default 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
__________________
Sunset
X-Cart Gold v4.1.8
Reply With Quote
  #29  
Old 09-25-2007, 02:50 AM
  mitash's Avatar 
mitash mitash is offline
 

X-Adept
  
Join Date: Jan 2006
Location: Australia
Posts: 450
 

Default 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..?
__________________
eCommerce - Strategy / Design / Development / Marketing / Maintenance

Call within Australia:
Phone: 1300 648 274 | Mobile: 0417 241 950
Call outside Australia:
+61 417 241 950 |

Email:
results@mitash.com | Skype: mitashau | Web: www.mitash.com
Reply With Quote
  #30  
Old 09-25-2007, 03:22 AM
 
sunset sunset is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 94
 

Default 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?
__________________
Sunset
X-Cart Gold v4.1.8
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



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 09:10 PM.

   

 
X-Cart forums © 2001-2020