X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Adding a "How Did You Hear About Us" ?? (https://forum.x-cart.com/showthread.php?t=2279)

kpriest 05-13-2003 07:48 AM

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.

jdebler 05-13-2003 08:24 AM

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. :oops: :oops:

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

poboy 05-13-2003 02:50 PM

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.

jdebler 05-16-2003 06:06 AM

Hoo boy...I hate being a newbie. :oops:

eleven 08-07-2003 08:06 AM

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?

shan 08-07-2003 10:50 AM

try {$userinfo.hear}

eleven 08-07-2003 12:30 PM

no luck. thanks anyway.

eleven 08-07-2003 08:06 PM

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.

DataViking 08-09-2003 12:35 PM

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

Mad 08-19-2003 08:14 AM

All examples (including e-mail) work fine for me here. Great mod, thanks!


All times are GMT -8. The time now is 04:23 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.