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
  #11  
Old 05-13-2003, 07:48 AM
  kpriest's Avatar 
kpriest kpriest is offline
 

eXpert
  
Join Date: Apr 2003
Location: Seattle, WA
Posts: 263
 

Default

It worked fine for me as originally posted. The "connection refused" error would have nothing to do with adding the field anyway and when you modified the SQL and ran it the second time and got the "SQL PATCH FAILED..." message - this is probably because the field is already there.

The problem with the "Connection Refused" issue at checkout could be related to using HTTPS if you have that setup in the credit card processing.
__________________
-Ken
X-Cart User / Developer Since April 2003
(Varying versions, multiple client sites, 3.x through 4.4.x)
www.pointbweb.com
Reply With Quote
  #12  
Old 05-13-2003, 08:24 AM
 
jdebler jdebler is offline
 

Member
  
Join Date: Apr 2003
Posts: 26
 

Default

Quote:
Originally Posted by kpriest
It worked fine for me as originally posted. The "connection refused" error would have nothing to do with adding the field ...

I am sorry for wasting your time with my last post. It turned out there was a firewall issue that was not letting me get to our secure server. It worked just fine when testing outside of our network.

Now for another twist...

Is there an easy way to make that "hear" variable to be passed into the order? Our order department needs that information.

Jason
Reply With Quote
  #13  
Old 05-13-2003, 02:50 PM
 
poboy poboy is offline
 

Advanced Member
  
Join Date: Mar 2003
Posts: 59
 

Default Yes

I am not sure if you need the exact code, but you will need to add a field to the table, " xcart_orders" that represents the variable that you are using for your "how did you hear about us" input field. Then you will have to change a php file that writes to the database, its mentioned earlier in this post I think. Maybe some of our friends here can help. Not sure if this helps, but it will get you started, which if you are like me and do not know what to do most of the time, is useless.
Reply With Quote
  #14  
Old 05-16-2003, 06:06 AM
 
jdebler jdebler is offline
 

Member
  
Join Date: Apr 2003
Posts: 26
 

Default

Hoo boy...I hate being a newbie.
Reply With Quote
  #15  
Old 08-07-2003, 08:06 AM
 
eleven eleven is offline
 

Senior Member
  
Join Date: Nov 2002
Location: Charlotte, NC, USA
Posts: 118
 

Default Adding the new field to the admin email

I got the mod to work. Thanks. I'd like to add the field to the email that is sent to the administrator. I added this line to the order_notification_admin:
Code:
{$lng.lbl_how_heard}: {$order.hear}

Of course the $lng.lbl_how_heard shows up, but the value isn't there (it was just a shot in the dark). Does anyone know how I can refer to this variable? Am I missing a step somewhere?
__________________
|| E L E V E N ||
Reply With Quote
  #16  
Old 08-07-2003, 10:50 AM
  shan's Avatar 
shan shan is offline
 

X-Guru
  
Join Date: Sep 2002
Location: Birmingham, UK
Posts: 6,163
 

Default

try {$userinfo.hear}
__________________
Looking for a reliable X-cart host ?
You wont go wrong with either of these.

EWD Hosting
Hands On Hosting
Reply With Quote
  #17  
Old 08-07-2003, 12:30 PM
 
eleven eleven is offline
 

Senior Member
  
Join Date: Nov 2002
Location: Charlotte, NC, USA
Posts: 118
 

Default

no luck. thanks anyway.
__________________
|| E L E V E N ||
Reply With Quote
  #18  
Old 08-07-2003, 08:06 PM
 
eleven eleven is offline
 

Senior Member
  
Join Date: Nov 2002
Location: Charlotte, NC, USA
Posts: 118
 

Default In case anyone else is interested...

This is how I added the extra field to the admin email. There's probably a better way to do it, but this works.

[skin]/mail/order_notification_admin.tpl - add the following line wherever you want the extra field to show up in the email:
Code:
{$lng.lbl_how_heard}: {$hearabout}
include/func.php - in the function func_place_order add the following:
Code:
$ha_result = func_query_first ("SELECT hear FROM xcart_customers WHERE login='$userinfo[login]'"); $hearabout = $ha_result ["hear"]; $mail_smarty->assign("hearabout",$hearabout);
I added it before the line:
Code:
$prefix = ($order_status=="I"?"init_":"");

I never imagined that adding a field to the checkout form could be so complicated! I really shouldn't be.
__________________
|| E L E V E N ||
Reply With Quote
  #19  
Old 08-09-2003, 12:35 PM
  DataViking's Avatar 
DataViking DataViking is offline
 

eXpert
  
Join Date: Jan 2003
Location: Las Vegas, NV
Posts: 361
 

Default I try

I try both examples with no sucess

Quote:
eleven
I got the mod to work. Thanks. I'd like to add the field to the email that is sent to the administrator. I added this line to the order_notification_admin:
Code:
{$lng.lbl_how_heard}: {$order.hear}

and

Quote:
eleven
This is how I added the extra field to the admin email. There's probably a better way to do it, but this works.

[skin]/mail/order_notification_admin.tpl - add the following line wherever you want the extra field to show up in the email:
Code:
{$lng.lbl_how_heard}: {$hearabout}

include/func.php - in the function func_place_order add the following:
Code:
$ha_result = func_query_first ("SELECT hear FROM xcart_customers WHERE login='$userinfo[login]'");
$hearabout = $ha_result ["hear"];
$mail_smarty->assign("hearabout",$hearabout);

I added it before the line:
Code:
$prefix = ($order_status=="I"?"init_":"");

can someone help me. the field shows up in the register.php
but it won't send the data to mysql and I don't see it on the register email

my site is:
http://www.wildshopping.com

thanks in advance
Reply With Quote
  #20  
Old 08-19-2003, 08:14 AM
 
Mad Mad is offline
 

Advanced Member
  
Join Date: Jul 2003
Location: Brooklyn, NY
Posts: 60
 

Default

All examples (including e-mail) work fine for me here. Great mod, thanks!
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 12:26 AM.

   

 
X-Cart forums © 2001-2020