| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Adding a "How Did You Hear About Us" ?? | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Adding a "How Did You Hear About Us" ??
I would like to add a text input field on the registration page that displays with the user information. I would like it to be a "How Did You Hear About Us" textarea input multiline. Will someone please give me an example of code to edit and if I need to add a field to my database? I use phpAdmin and I'm pretty good with the database part, just a complete newbie who is eager to learn when it comes to the smarty template. I have a feeling I will add the text input to the register.tpl, then edit some file that writes to the database, probably a php file and then edit a php file that does the query from the database with a display. I have the concept, but I can't afford to mess up the variables. Any help would be greatly appreciated. Thank you.
Chris |
|||||||
#2
|
|||||||
|
|||||||
I DID IT!!!
This post is kinda wide?
Wow, my first successful edit..I searched for a post and found this: Quote:
Code:
And here is my includes/register.php code: Code:
I have one problem, I can't get the input box to display as multiline. I tried changing the input to "textarea" and putting rows=5, but no luck. I guess it doesn't matter. If anyone sees any problems, please let me know. Thanks, Chris |
|||||||
#3
|
|||||||||
|
|||||||||
This line was added in 3.3.5 in the original register.php file (v 1.60.2.4) for anti-hacking. If you use the mod from this post, also put in this snippet at line 53:
Code:
...also, because it looks like your version of the register.tpl file has the language variables stripped out, I just added this to my version (just above where they commented out the Social Security fields around line 87): Code:
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
#4
|
|||||||||
|
|||||||||
Ok - I found a problem with the register.php mods - the "hear" field is not updated when the user or admin modifies the profile. I fixed this.
So - This is the entire final include/register.php for this mod: Code:
...and here is the complete main/register.tpl file with the appropriate mods: Code:
The only other things to remember to do is: - Add the field hear to the xcart_customers table - Add the lbl_how_heard variable to the languages
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
#5
|
|||||||
|
|||||||
You the man.
Thanks for the help, I sure hope we helped some others. What is your site you are working on, mines is http://www.pfgpromotionals.com.
Have a nice day. Chris |
|||||||
#6
|
|||||||||
|
|||||||||
Quote:
I'll post my project info in the Member Websites area with details when it is completed. Your site looks awesome! Excellent job! Is this your business or a client?
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
#7
|
|||||||
|
|||||||
Thanks.
Thanks, the site is for a client. I can't take too much credit, I am a designer and my home site right now, just to be a place holder is http://www.iexweb.com. The pfgpromotionals.com was a template that I modified a great deal and had x-cart implement the design. I do not usually use templates, but this one just struck my eye and I figure I have a business, so its the best work I can provide at the lowest cost and still make my margins. Your point b site is really professional. My new site I am working on will be more professional and what I have had in mind the whole time, its just now coming out of me. Thanks for your help.
Chris |
|||||||
#8
|
|||||||
|
|||||||
Okay, this is very cool and is exactly what I am looking for. Thanks for supplying this! I do have one problem...
Quote:
I had no problem adding the lbl_how_heard variable to the languages, but I am still super new to other parts. So new in fact, that I have no idea how to add the "hear" field to the "xcart_customers" table. Would someone mind helping me out with how to do this? It would be very much appreciated! Jason |
|||||||
#9
|
|||||||||
|
|||||||||
You can use the phpMyAdmin interface to add a field or 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:
That should do it!
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
#10
|
|||||||
|
|||||||
Quote:
I used the Patch/Upgrade area of xcart admin (I know nothing about phpmyadmin) and when I went to test my store, I get a connection refused error on step 2 of the checkout process after selecting credit card and clicking continue. This was copying the code exactly from your post. I restored my database and tried to enter the code again, but this time changing the Code:
ALTER TABLE `xcart_customers` ADD `hear` VARCHAR(255) NOT NULL; TO ALTER TABLE 'xcart_customers' ADD 'hear' VARCHAR(255) NOT NULL; I did thins thinking thios message board software converted some of the characters when displaying a post. In doing that, I get an error: Quote:
Remember how I said I am new at this? Any idea what I am doing wrong? Jason |
|||||||
|
|||
X-Cart forums © 2001-2020
|