-
How Did You Hear About Us? Referrals Mod [Support Thread]
http://www.zen-cart.com/downloads.php?do=file&id=90
Can't get "referrals " mod working
This is the error message" 1146 TABLE '[database_zc1.TABLE_SOURCES' does not exist
The error message shows up on the page where people register and it appears under how did you hear about us this should be a drop down menu
Checked databases we have zen_sources as a table
Please help
Regards
Martyn
website : www.beeunique.co.uk
We are not using the mod at the moment as when it is implemented it stops people creating new accounts due to the error.
Please let me know if you require more information to fix this.
All the tables in the database start zen_
-
Re: Can't get "referrals " mod working
As a matter of interest has anyone got this mod working on zencart 1.2.6.
I can see the mod for 1.3. I have searched through the other posts on this. If someone has the sql and the files that work with 1.2.6 please let me know. I really want to get this working and it is driving me crazy.
Regards
Martyn
-
Re: Can't get "referrals " mod working
you need to make sure that you have the extra_datafiles installed
you need to define TABLE_SOURCES
-
Re: Can't get "referrals " mod working
Hi, Thanks for your help so far.
I have the options working now ie options can be selected from the drop down menu...
I seem to have a problem the selected data in sources or data entered in other_sources does not seem to go anywhere.
Any ideas where this data is ment to go? and how admin can be altered to show per customer the referals information.
Regards
Martyn
-
Re: Can't get "referrals " mod working
I don't think I made myself clear in my last message. New customers can select the options , but when the new customer has been created the customers_heard_of_us_from field in zen_customers table is not updated i have tried this a few times.
Should this information be in zen_customers or another table?
Regards
Martyn
www.beeunique.co.uk
-
Re: Can't get "referrals " mod working
Can anyone who has this mod working please let me know where the source and other source data goes in the database.
Regards
Martyn
www.beeunique.co.uk
-
Re: Can't get "referrals " mod working
Martyn,
Have you had any luck with this? I'm running 1.3.1 and thought it all installed correctly - the customers can still select where they heard of us (and I can administer the choices) but I don't get the information - on my old version of Zen it used to appear in the "Customers" section of Admin.
Anyone else?
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by Bryony
Martyn,
Have you had any luck with this? I'm running 1.3.1 and thought it all installed correctly - the customers can still select where they heard of us (and I can administer the choices) but I don't get the information - on my old version of Zen it used to appear in the "Customers" section of Admin.
Anyone else?
Same problem here. Customers can select but the information is no where to be found.
Any resoultion?
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by Bryony
Martyn,
Have you had any luck with this? I'm running 1.3.1 and thought it all installed correctly - the customers can still select where they heard of us (and I can administer the choices) but I don't get the information - on my old version of Zen it used to appear in the "Customers" section of Admin.
Anyone else?
I just installed this a couple of days ago and it works fine...however the logged info shows up under extras/referral sources as well as in the customer section under "referred by" not sure if that will help you at all
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by cherylkemp
I just installed this a couple of days ago and it works fine...however the logged info shows up under extras/referral sources as well as in the customer section under "referred by" not sure if that will help you at all
Strange, I do see a "referred by" in Admin->Customers??, what version of zen cart are you using?
Can you post the exact link where you downloaded this contrib from?
-
Re: Can't get "referrals " mod working
Ok I reinstalled all the files and tried running "update_zen.sql and I get this message
ERROR: Cannot ADD column customers_info_source_id because it already exists.
Error ERROR: Cannot insert configuration_key "DISPLAY_REFERRAL_OTHER" because it already exists
Error ERROR: Cannot insert configuration_key "REFERRAL_REQUIRED" because it already exists
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by narsaw
Ok I reinstalled all the files and tried running "update_zen.sql and I get this message
ERROR: Cannot ADD column customers_info_source_id because it already exists.
Error ERROR: Cannot insert configuration_key "DISPLAY_REFERRAL_OTHER" because it already exists
Error ERROR: Cannot insert configuration_key "REFERRAL_REQUIRED" because it already exists
that might not be a big deal...just means they're already in the database. Still didn't work after that? Did you get any other message about any successful sql stuff in that same pass? you could change the references to "create" below to "replace and run it again to see if it is completely successful then. Not sure if that will solve your problem though.
Code:
DROP TABLE IF EXISTS sources;
CREATE TABLE sources (
sources_id int NOT NULL auto_increment,
sources_name varchar(64) NOT NULL,
PRIMARY KEY (sources_id),
KEY IDX_SOURCES_NAME (sources_name)
);
INSERT INTO sources VALUES (1, 'Google');
INSERT INTO sources VALUES (2, 'Yahoo!');
INSERT INTO sources VALUES (3, 'AOL');
INSERT INTO sources VALUES (4, 'MSN');
INSERT INTO sources VALUES (5, 'ZenCart');
DROP TABLE IF EXISTS sources_other;
CREATE TABLE sources_other (
customers_id int NOT NULL default '0',
sources_other_name varchar(64) NOT NULL,
PRIMARY KEY (customers_id)
);
ALTER TABLE customers_info ADD customers_info_source_id int NOT NULL AFTER customers_info_date_account_last_modified;
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require Referral', 'REFERRAL_REQUIRED', 'true', 'Require the Referral Source in account creation', '5', '6', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
-
Re: Can't get "referrals " mod working
Still same thing "Other" gets update no matter what the customer selects.
Here is what is looks like:
****Giant image deleted****
-
Re: Can't get "referrals " mod working
Referral Sources only show Other as a count. You have to look at Customers -> Customers to see what was entered as a "write-in" on an Other selection.
-
Re: Can't get "referrals " mod working
Here is a screen shot of Admin->Customers->Customers
http://www.pcappliances.com/referrals.JPG
I've personally created some of those ac****s and selected "Google, yahoo and Other (and typed in "friend", "word of mouth", etc
Quote:
Originally Posted by ranger_lp
Referral Sources only show Other as a count. You have to look at Customers -> Customers to see what was entered as a "write-in" on an Other selection.
-
Re: Can't get "referrals " mod working
**SOLVED**
Turns that I was using and 'override' (includes/modules/my_template/create_accoutns.php file which I neglected to update with the inclues/modules/create_account.php from the contribution. Works beautifully.
Special thanks to ranger_lp for his tireless work in helping me track down this problem.
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by narsaw
Strange, I do see a "referred by" in Admin->Customers??, what version of zen cart are you using?
Can you post the exact link where you downloaded this contrib from?
this link It was updated 6/30
-
Re: Can't get "referrals " mod working
Anybody know if this contribution is compatible with 1.3.6 of ZenCart.
I've compared a couple of the files and there seems to be a large numer of differences.
Craig
-
Re: Can't get "referrals " mod working
Yes, there are a lot of files that have changed. I tried to merge them and was only partly successful. The log in form works now just fine, but I do not see what customers selected in the admin. I guess I still miss something.
Did anybody come up with an updated file set for 1.3.6? I can't figure this out myself. :(
This contribution was really what I need to see how my new customers find me. How else can one know how people that register really learned about us and how the found us? This contribution seems to be a small one but is incredibly useful.
-
Re: Can't get "referrals " mod working
I GOT IT!
customers.php had a line missing. Now everything seems to work fine in 1.3.6. I would ranger_lp to look over my merged files and then they could be released as the updated mod. He did the last release and knows it a lot better than me. Also I did not put any comments anywhere like "real" programmers do. :) but it is working, did I say I am happy!! :))
-
Re: Can't get "referrals " mod working
I've also got a set of merged files that I worked on last week. I uploaded it up to my site and it all seems to be working fine.
I shall post a link to them here or maybe upload them in the downloads section.
Again I am not a programmer, and would like to have them checked over by somebody in the know.
I'll see if I can post again later today.
Danilo - if you want to compare files, let me know and pm me.
Craig
-
1 Attachment(s)
Re: Can't get "referrals " mod working
Hi again
Here is my update to this contribution:
how_did_you_hear_about_us_1.3.6_beta.zip
Again, please note I am no php or zen guru. If anyone would like to test it please feel free. Don't forget - BACKUP BACKUP BACKUP!!
If ranger_lp or an admin could give the files a once over that would be great too.
Once I am happy with it I will upload it to the download section.
Support as usual via this forum, feedback appreciated.
As they say - enjoy.
Craig
-
Re: Can't get "referrals " mod working
CES, we got a match. My files are identical. I guess this should be considered a good thing and I believe the files are good to go. My cart has been working great with it. Maybe Ranger wants to look the files over (he did the last update) and then we have an updated 1.3.6 mod. :)
-
Re: Can't get "referrals " mod working
Thanks Danilo
Great minds think alike... or something like that.
If anyone else can confirm this is good to go I will upload it to the download section.
Craig
-
Re: Can't get "referrals " mod working
I am having trouble getting the sql patch working.
This is the error I am getting:
1064 You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'true', 'false'), ', now())' at line 1
in:
[INSERT INTO zen135configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array('true', 'false'), ', now());]
Has anyone seen this problem?
-
Re: Can't get "referrals " mod working
Thanks folks for looking at. I'll take a look at the files and see if it's ok....
-
1 Attachment(s)
Re: Can't get "referrals " mod working
At first glance, looking like the merges are good (hey I'm just a php hacker too :-)).
I had added functionality to /admin/orders.php in the 1.3.5 version. A couple of lines were added/changed to the file in 1.3.6. I added this to the beta that was posted. This will display where the referral is from in the order page on the admin side...
Thanks for the help. Holidays have been too hectic for me. Business too! :-)
-
Re: Can't get "referrals " mod working
Hi Tony
Thanks for the thumbs up on the update.
I've merged your orders.php changes into my shops amended file and everything works great :-)
Do you want to upload 1.3.6 to the download section or shall I?
Craig
-
Re: Can't get "referrals " mod working
Please upload it Craig :-)
-
Re: Can't get "referrals " mod working
Latest version uploaded to the others section of the downloads.
Might take a couple of days to be reviewed by a team member but should be active after that.
Download Here
-
Re: Can't get "referrals " mod working
orders.php looks mighty different in v1.3.7, anyone try merging changes from 1.3.6 version? I don't have a clue.
-
Re: Can't get "referrals " mod working
Hi
I have not had a good look at 1.3.7 yet. As and when I get round to upgrading my site 'again' I shall look at it then. It will not be in the immediate future so if anyone wants to step up and have a go, feel free.
Craig
-
Re: Can't get "referrals " mod working
Did anybody get this to work for 1.3.7 by now? I plan to upgrade soon...
-
Re: Can't get "referrals " mod working
it's working for me, just merge orders.php carefully as the core file was touched in 1.3.7. Note that in 1.3.6 location of an include file was in the middle of the file but in 1.3.7 it was moved to the top of the file, make sure you remove the one in the middle in your modified orders.php otherwise you'll hit a fatal error trying to declare a class twice.
-
Re: Can't get "referrals " mod working
Thank you, I shall merge orders.php when I upgrade.
-
Re: Can't get "referrals " mod working
I'm having a problem with this mod on 1.3.7 in that although everything appears to be in the right place (files all uploaded and correctly merged/edited where relevant - I think! - and the database changes made successfully), the referral information chosen by the client at account creation is not reaching the database and the customer_info_source_id in customer_info table remains at 0 - so no output of source information.
Also, regardless of whether or not the option for the fields is set to Required, account can be created without filling in the data. However, the first issue is my main concern, and I'd welcome any ideas.
-
Re: Can't get "referrals " mod working
Just a general hint. I had problems too, when I upgraded to 1.3.6. The problem was with duplicate files in the over ride folders. Just compare one more time.
-
Re: Can't get "referrals " mod working
Ryk - Were your able to revise the files and make this work for 1.3.7?
Quote:
Originally Posted by
Ryk
I'm having a problem with this mod on 1.3.7 in that although everything appears to be in the right place (files all uploaded and correctly merged/edited where relevant - I think! - and the database changes made successfully), the referral information chosen by the client at account creation is not reaching the database and the customer_info_source_id in customer_info table remains at 0 - so no output of source information.
Also, regardless of whether or not the option for the fields is set to Required, account can be created without filling in the data. However, the first issue is my main concern, and I'd welcome any ideas.
-
Re: Can't get "referrals " mod working
I did - and I'm terribly sorry, but I can't remember how. The only clue I can give you is that I've just downloaded all the files for this mod from the site and run a comparison against a fresh download of the mod itself - and the fault did NOT lie within the module itself.
-
Re: Can't get "referrals " mod working
Thanks Ryk! I am using winmerge right now to see what the differences are in the customer.php and orders.php, etc files and will see if I can get it working too! :cool:
Quote:
Originally Posted by
Ryk
I did - and I'm terribly sorry, but I can't remember how. The only clue I can give you is that I've just downloaded all the files for this mod from the site and run a comparison against a fresh download of the mod itself - and the fault did NOT lie within the module itself.
-
Re: Can't get "referrals " mod working
For anyone that needs this mod updated to work for version 1.3.7 - I have modified all the necessary files and tested on two different websites.
Here is a link to the revised files: How Did You Hear About Us V1.3.7
Enjoy! :lamo:
Judy
-
Re: Can't get "referrals " mod working
Hmmm - wonder where I got my files from then? :unsure: There are quite some differences there that didn't show up for me.
Thanks for your work there - have you sent it to the downloads section as an update?
-
Re: Can't get "referrals " mod working
Did you have some mods already in affecting your admin/orders.php? Around your line 184?
I got an error
Code:
Parse error: syntax error, unexpected T_CASE in /home/.../orders.php on line 195
and when I looked it it, there is a chunk of code which appears to be something to do with editing orders rather than referrals, and which isn't in the original ZC1.3.7 file.
-
Re: Can't get "referrals " mod working
I just downloaded the 1.3.6 mod files and used winmerge to compare them... and copied anything that was different over to the parallel ZenCart v 1.3.7 files. I HOPE that was the right thing to do! :blush:
I will go send it to the downloads section just in case anyone else wants/needs it. :yes:
Quote:
Originally Posted by
Ryk
Hmmm - wonder where I got my files from then? :unsure: There are quite some differences there that didn't show up for me.
Thanks for your work there - have you sent it to the downloads section as an update?
-
Re: Can't get "referrals " mod working
I MAY have... let me go take a peek and reupload the files - is that the only error you got?
Quote:
Originally Posted by
Ryk
Did you have some mods already in affecting your admin/orders.php? Around your line 184?
I got an error
Code:
Parse error: syntax error, unexpected T_CASE in /home/.../orders.php on line 195
and when I looked it it, there is a chunk of code which appears to be something to do with editing orders rather than referrals, and which isn't in the original ZC1.3.7 file.
-
Re: Can't get "referrals " mod working
Disregard MOST of the above please...I think there's something odd happened at my end.
That was the only error, but I was replacing the files one at a time - I have differences between mine, yours and the original which don't add up!
-
Re: Can't get "referrals " mod working
Ryk,
In comparing the code I see that from line 181 to 194 in the MOD files there was a difference between the mod and zc 1.3.7.... (see below) which I copied over into the zencart file... is this what you are referring to?
*******************************
}
}
if (($action == 'edit') && isset($_GET['oID'])) {
$oID = zen_db_prepare_input($_GET['oID']);
$orders = $db->Execute("select orders_id from " . TABLE_ORDERS . "
where orders_id = '" . (int)$oID . "'");
$order_exists = true;
if ($orders->RecordCount() <= 0) {
$order_exists = false;
$messageStack->add(sprintf(ERROR_ORDER_DOES_NOT_EXIST, $oID), 'error');
****************************
Judy
Quote:
Originally Posted by
stellarweb
I MAY have... let me go take a peek and reupload the files - is that the only error you got?
-
Re: Can't get "referrals " mod working
Ok - now I am scared to submit it to the downloads section! :shocking:
This is my first time actually putting a revised mod link on here - although I have had to revise ALOT of them! :laugh:
Judy
Quote:
Originally Posted by
Ryk
Disregard MOST of the above please...I think there's something odd happened at my end.
That was the only error, but I was replacing the files one at a time - I have differences between mine, yours and the original which don't add up!
-
Re: Can't get "referrals " mod working
Yes - that's the section. I don't think it's to do with the referrals mod - but I may be wrong.
Unfortunately, I haven't got time to play with it right now, and as it's working on the site, I'll have to leave it be for a while.
-
Re: Can't get "referrals " mod working
Ok - yes, if that is the section - then that is definately a part of the 1.3.6 mod files that I downloaded.
Quote:
Originally Posted by
Ryk
Yes - that's the section. I don't think it's to do with the referrals mod - but I may be wrong.
Unfortunately, I haven't got time to play with it right now, and as it's working on the site, I'll have to leave it be for a while.
-
Re: Can't get "referrals " mod working
I also cannot get the modification working properly. I am having the orders.php problem (I even went back and tried deleted the second calling of the class at line 253, but that didn't help), but I am also having difficulty because the actual contribution won't show up on my create account page. I know it's supposed to go beneath the newsletter portion, but no table, drop down box or input fields show up. However, the code knows that it's there because if you press submit, it won't allow you to create an account, saying that you must select how you were referred. I've gone through and checked all of my overrides...is there something in the admin section that I need to turn on? I'm at a loss.
Thanks in advance!
-
Re: Can't get "referrals " mod working
sorry about the second part of that post; my override structure was out of whack. Just a newbie mistake. Thanks.
I'll keep up to date on the orders.php file solution when you get around to it, ryk. Thanks for the mod update, stellarweb!
-
Re: Can't get "referrals " mod working
Cam,
Glad you figured it out! Your site looks GREAT!!!
-
Re: Can't get "referrals " mod working
hi i am getting the same error as another poster from a while back. when i install the sql patch i get this return:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true', 'false'), ', now())' at line 1
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array('true', 'false'), ', now());]
then i dont get the configuration options in my admin>configuration>mystore and customer details.
-
Re: Can't get "referrals " mod working
How do I remove the other option?? Or make it so people have to type in where they found me?
-
Re: Can't get "referrals " mod working
okay i got the database working if anyone out there needs it here is what i did
in the last two insert lines of the sql file there is a piece at the end of both lines that goes
'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
it should read
'zen_cfg_select_option(\'true\', \'false\')', now());
WARNING:
this seems to have worked for me. however, i dont know squat about sql and am not sure why the array was a problem. i cant guarantee in anyway this fix.
but it worked. sometimes i get lucky.
MM
ps if anyone could explain this, both what i did and why it worked... or why it is a bad idea i would love to hear it. and learn something.
thanks!
-
Re: Can't get "referrals " mod working
To ryk and anyone that had the orders.php problem with the referrals mod:
I simply downloaded a fresh install of zen cart and uploaded the new 1.3.7 orders.php file to my admin/ directory. That stopped the error on line 195, and I'm still getting who referred in my customer list. In comparing the modified file and the new file, I can't see where referrals code from 1.3.6 would come into 1.3.7. But I'm no php wonder, either. It did work for me, and the mod's working fine.
Judy, any thoughts on this? I know you were the one who compared the files and compiled the 1.3.7 mod. And thanks for the compliment by the way. I really appreciate it.
To the general publilc: goodthingsglobal.com will be going truly live in the next couple days, and I'll post in the review corner for anyone who wants to rip me a new one. Please don't be afraid to hurt feelings either. I need all the help I can get.
Thanks again everyone!
-
Re: Can't get "referrals " mod working
Ok I am having difficulty getting the drop down to display the different referral options in Create Account. I am not sure where all the switches are to get this enabled. I am using 1.3.7
I do have the following switches set:
Admin/Config/My Store - Display "Other" Referral option TRUE
Admin/Config/Customer Details - Require Referral TRUE
Admin/Config/Customer Details - Customers Referral Status 2
Thanks Much in Advance.
-
Re: Can't get "referrals " mod working
question for you all - what happens if they make an error logging in? as it only seems to appear in the create account - not any error checking or login or edit details aftwards?
Admittedly I am using an old 1.2.6 version - but just compared to 1.3.7 version and the files location are identical meaning that no other files have been altered
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
RSprinkel
Ok I am having difficulty getting the drop down to display the different referral options in Create Account. I am not sure where all the switches are to get this enabled. I am using 1.3.7
I do have the following switches set:
Admin/Config/My Store - Display "Other" Referral option TRUE
Admin/Config/Customer Details - Require Referral TRUE
Admin/Config/Customer Details - Customers Referral Status 2
Thanks Much in Advance.
Ok I found my problem now. But I do have one question. I am also using the Captcha Mod with this mod and it seems it modifies the same files (mainly tpl_create_account.php) and one overwrites the other. I also tried to copy/paste the code needed for the Referrals under the Captcha info in the tpl_create_account.php and got errors.
Anyway of figuring this out as I would like to have both of these on this page?
Thanks much in Advance.
RSprinkel
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
ckunderd
To ryk and anyone that had the orders.php problem with the referrals mod:
I simply downloaded a fresh install of zen cart and uploaded the new 1.3.7 orders.php file to my admin/ directory. That stopped the error on line 195, and I'm still getting who referred in my customer list. ....
This did the trick for me as well. I wonder what the difference is but I do not have the time right now...it works and will have to do for now. Thank you for the tip.
:clap:
-
Re: Can't get "referrals " mod working
I'm getting ready to install this, and wanted to verify something.. Shouldn't I be creating an override for the create_account.php file for this contribution.
i.e.: includes/modules/my_template/create_account.php
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
Minnie Mouse
okay i got the database working if anyone out there needs it here is what i did
in the last two insert lines of the sql file there is a piece at the end of both lines that goes
'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
it should read
'zen_cfg_select_option(\'true\', \'false\')', now());
I too got the same SQL errors as was reported by a few folks in this thread.. My host is running MySQL 4.0, and I don't know if that is what the difference is or if this is just a syntax error in the contribution's script.. (I'll admit I only know enough SQL to be dangerous..) That said, the above fix did not work for me.. Here is the SQL that did work..
Find:
'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
Replace with:
'zen_cfg_select_option(array('true', 'false'),' now());
HTH..
-
Re: Can't get "referrals " mod working
I should add that even with the changes to the SQL, I still got the errors when I ran this using the SQL Patch installer.. I had to run the corrected insert statements using my MySQL manager..
Also thought that I should share this.. The array values are case sensitive.. Do not make the mistake I did of changing "true" to "True"..:oops:
-
Re: Can't get "referrals " mod working
I just did a clean install of the files that are currently in the downloads section to this site http://www.stellarsupplements.com/
I then copied and pasted the install_referrals.sql into the database in the admin section under tools/install sql patches... the code is pasted below.
The install went smoothly - and all worked well, with no changing of the files, so I am befuddled as to why you would have to change anything in the file in order to get it to work. I have installed this on several websites with the code intact, and it works fine on all of them.... BUT they were all on the same server with the same version of sql / php / etc running. Like you, I know enough sql to make me very dangerous :laugh: so wondering if the problem is different versions of sql or php??
DROP TABLE IF EXISTS sources;
CREATE TABLE sources (
sources_id int NOT NULL auto_increment,
sources_name varchar(64) NOT NULL,
PRIMARY KEY (sources_id),
KEY IDX_SOURCES_NAME (sources_name)
);
INSERT INTO sources VALUES (1, 'Google');
INSERT INTO sources VALUES (2, 'Yahoo!');
INSERT INTO sources VALUES (3, 'AOL');
INSERT INTO sources VALUES (4, 'MSN');
INSERT INTO sources VALUES (5, 'ZenCart');
DROP TABLE IF EXISTS sources_other;
CREATE TABLE sources_other (
customers_id int NOT NULL default '0',
sources_other_name varchar(64) NOT NULL,
PRIMARY KEY (customers_id)
);
ALTER TABLE customers_info ADD customers_info_source_id int NOT NULL AFTER customers_info_date_account_last_modified;
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require Referral', 'REFERRAL_REQUIRED', 'true', 'Require the Referral Source in account creation', '5', '6', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
Quote:
Originally Posted by
DivaVocals
I should add that even with the changes to the SQL, I still got the errors when I ran this using the SQL Patch installer.. I had to run the corrected insert statements using my MySQL manager..
Also thought that I should share this.. The array values are case sensitive.. Do not make the mistake I did of changing "true" to "True"..:oops:
-
Re: Can't get "referrals " mod working
PS...........
My php version is 4.4.6
SQL is 4.1.21 standard
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
stellarweb
I just did a clean install of the files that are currently in the downloads section to this site
http://www.stellarsupplements.com/
I then copied and pasted the install_referrals.sql into the database in the admin section under tools/install sql patches... the code is pasted below.
The install went smoothly - and all worked well, with no changing of the files, so I am befuddled as to why you would have to change anything in the file in order to get it to work. I have installed this on several websites with the code intact, and it works fine on all of them.... BUT they were all on the same server with the same version of sql / php / etc running. Like you, I know enough sql to make me very dangerous :laugh: so wondering if the problem is different versions of sql or php??
But there has to be some issue going on because reading through this thread at least three others (if I include myself) have reported having the EXACT same error that I got when installing this contribution..
Quote:
Originally Posted by
Minnie Mouse
hi i am getting the same error as another poster from a while back. when i install the sql patch i get this return:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true', 'false'), ', now())' at line 1
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array('true', 'false'), ', now());]
then i dont get the configuration options in my admin>configuration>mystore and customer details.
Please note that this error occurs exactly in the section I changed to get the insert statements to work.. I too did a fresh install when I was testing this contribution.. I wiped out my dev store and started over with a fresh Zen Cart install.. I still got the error when SQL Patch Admin Tool attempted to execute the last two lines of the SQL that comes with this contribution.. I then attempted to run only those lines using my host's MySQL manager, and got the EXACT SAME error.. I then made the change I posted previously, and the code ran successfully. Once I was able to execute the inserts, the contribution worked perfectly..
Please note there is a slight difference between the SQL I ran and the one that comes with the contribution which I believe makes a difference in getting the error or not.. (I've highlighted that difference below) I also believe that the error message indicates that some versions of MySQL will get this error without making the change I had to make..
Find:
'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
Replace with:
'zen_cfg_select_option(array('true', 'false'),'now());
Please note the difference between these two lines.. It really made the difference between getting an error and getting the correct entries into my configuration table and getting this contribution to work. Maybe one of the SQL gurus can chime in and explain why:smartalec:.. I'm pretty sure the answer lies in the differences in MySQL versions..
-
Re: Can't get "referrals " mod working
I posted this on another thread.. maybe someone reading this thread can help..
Quote:
Originally Posted by
DivaVocals
I wanted to test this, so I created a test customer and chose "Other" I then entered the appropriate data in the "Other" field.. I then went to Extras>Referral Sources and this is what I see:
Sources------------------------Referred
Other --------------------------19
Is the number I see under "Referred" supposed to be a count of how many referrals came from the "Other" referral source?? If so this count is wrong and I need to know how it calculated this count.... More importantly.. How do I fix this???
I've confirmed part of my original question..
The "19" definitely is supposed to represent the number of referrals that came from the "Other" referral source.. However, the count is incorrect. At the time I ran this report, I had only added ONE test customer with "Other" as a referral source in my testing.. I have since added a second customer using the "Other" referral source in order to test that the count is at least incrementing by 1 correctly.. (It is incrementing correctly, and now it shows a count of 20)
So I still need to know how do I correct this so that the count accurately reflects 2 instead of 20.
-
Re: Can't get "referrals " mod working
Do you by any chance have other customers that signed up BEFORE you installed this mod? To try to recreate what you are seeing, I just created another account using "other" as the referral - and the one I created before this I chose google.
However, when I look at the "other" count - it is grouping ALL the customers that signed up prior to me installing this mod this morning into that category.... The "google" count is accurate. Does that make sense what I am saying? :yes:
Quote:
Originally Posted by
DivaVocals
I posted this on another thread.. maybe someone reading this thread can help..
I've confirmed part of my original question..
The "19" definitely is supposed to represent the number of referrals that came from the "Other" referral source.. However, the count is incorrect. At the time I ran this report, I had only added ONE test customer with "Other" as a referral source in my testing.. I have since added a second customer using the "Other" referral source in order to test that the count is at least incrementing by 1 correctly.. (It is incrementing correctly, and now it shows a count of 20)
So I still need to know how do I correct this so that the count accurately reflects 2 instead of 20.
-
Re: Can't get "referrals " mod working
If I can get a feel for what versions of mysql and php are being used to see if that is the problem, I could add a new file to the contribution that specifies the versions ..... so if anyone that has had this problem can post those two statistics, we can see if there is a common denominator.......
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
stellarweb
Do you by any chance have other customers that signed up BEFORE you installed this mod? To try to recreate what you are seeing, I just created another account using "other" as the referral - and the one I created before this I chose google.
However, when I look at the "other" count - it is grouping ALL the customers that signed up prior to me installing this mod this morning into that category.... The "google" count is accurate. Does that make sense what I am saying? :yes:
Ahhhhh.... Yes this somewhat makes sense.. (though my previous customer count is "slightly" off by two) Dunno why I didn't think of this myself!:wacko: Despite that this is somewhat inaccurate ya know??? Especially since you can drill into the the report to get the details behind "Other", you wouldn't necessarily KNOW this, nor would you want to HAVE to factor out prior everytime you ran this report.... Seems to me there should be a better way to handle existing customers.. In the meantime I will manually update the sources_other table with data to make the previous customers a tad more meaningful when drilling into the "Other" source details..
-
Re: Can't get "referrals " mod working
I took a look at my customer_info table and figured out the customer count discrepancy. I updated the customer_info and sources_other tables and now the counts and reports reflect more accurate information.. (I created a generic "Other" source for all of the prior customers) I will make a note to myself that next time I use this contribution that I probably need to do it as part of a virgin install of Zen Cart so that the counts on the report are accurate from the very start..
-
Re: Can't get "referrals " mod working
Sounds like you have it all figured out!! :laugh::flex:
-
Re: Can't get "referrals " mod working
Hi, I have MySQL client version: 4.1.10 on phpMyAdmin - 2.9.0.2
I installed the sql patch for how_did_you_hear_about_us_1.3.6_beta, as I have zencart version Zen Cart 1.3.6
The error I get is below. I haven't a clue about sql, and I am not a programmer. Any way to resolve it?
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true', 'false'), ', now())' at line 1
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array('true', 'false'), ', now());]
-
Re: Can't get "referrals " mod working
Try Changing your
'zen_cfg_select_option(array('true', 'false'), ', now()); to
'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
and see if that helps.
Quote:
Originally Posted by
Wadi73
Hi, I have MySQL client version: 4.1.10 on phpMyAdmin - 2.9.0.2
I installed the sql patch for how_did_you_hear_about_us_1.3.6_beta, as I have zencart version Zen Cart 1.3.6
The error I get is below. I haven't a clue about sql, and I am not a programmer. Any way to resolve it?
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true', 'false'), ', now())' at line 1
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array('true', 'false'), ', now());]
-
Re: Can't get "referrals " mod working
How do I do that? :blush:
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
Wadi73
How do I do that? :blush:
You need to edit the contribution's SQL patch to include the suggested fix.. I am not a programmer either, but I do know from experience that if you are not familiar with your MySQL tools and/or if you do not know how to edit the SQL patch, then you will require assistance beyond the scope of this forum.. (Most of the team members assume/hope that you are at least familiar with how to use your MySQL tools)
From one newbie to another, my suggestion is that you read through this entire thread. There is a LOT of information in this thread.. (including a RECENT discussion of the very error you posted along with HOW to fix it) In general it's best to search through these forums first before posting a question. A lot of the answers are already here as others like you and me have run into similar issues.. HTH
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
stellarweb
Sounds like you have it all figured out!! :laugh::flex:
I feel so smart now!:smartalec: Thanks for your help!!!:clap:
-
Re: Can't get "referrals " mod working
Hi DivaVocals,
Thanks for your suggestion. I did read through the thread before posting, but although I saw the suggested code replacement, it doesn't actually say where in the sql table it is needed. I can replace the code if I know exactly where it is e.g. in phpmyadmin, I am at the zencart database. I am assuming, maybe wrongly lol that the needed coding is under the table entitled "configuration", but that has loads of values.
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
Wadi73
Hi DivaVocals,
Thanks for your suggestion. I did read through the thread before posting, but although I saw the suggested code replacement, it doesn't actually say where in the sql table it is needed. I can replace the code if I know exactly where it is e.g. in phpmyadmin, I am at the zencart database. I am assuming, maybe wrongly lol that the needed coding is under the table entitled "configuration", but that has loads of values.
You need to modify the SQL patch that is part of this contribution. (as per the suggestions in the previous posts) You can then either re-run the entire SQL patch again using the SQL patch tools or simply re-run the edited statements. Again you can use the SQL patch installer in the Zen Cart Admin or you can run these statements from your hosts SQL Admin tool. Or if you understand how to read the affected lines in the contribution SQL, you can use your MySQL tools to add the appropriate data to the configuration table..
-
Re: Can't get "referrals " mod working
Wow, well I finally overcame my fear of mysql and actually LOOKED at the coding. It does clearly tell you which table and values are being created.
Anyway, the code I had already was the modified version of 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
However.... I solved the problem :smile:
I had stupidly uploaded all the files in the folder Cart>admin>includes, BUT I had forgotten to do the ones for Cart>includes
As soon as they were uploaded (most are the same as the admin>includes files), it worked like a charm.
Thanks Diva Vocals, for all of your suggestions. When my programmer (!) husband comes home tonight I shall impress him by telling him that I know know how to find the values in a mysql table, how to delete and drop them etc. Maybe he will take me out to dinner :smile:
-
Re: Can't get "referrals " mod working
I'm glad you decided to give it a try, and that it all worked out for you.. Good luck with your site..
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
ttalk
it's working for me, just merge orders.php carefully as the core file was touched in 1.3.7. Note that in 1.3.6 location of an include file was in the middle of the file but in 1.3.7 it was moved to the top of the file, make sure you remove the one in the middle in your modified orders.php otherwise you'll hit a fatal error trying to declare a class twice.
I've run into this problem too, using the latest download on V1.3.7. I've made the changes as suggested -- no success. Any ideas??
-
Re: Can't get "referrals " mod working
What error exactly are you getting? Can you copy and paste the error here?
Also... you said you used the latest download and made changes... but the post you quoted I believe was referring to changes to the old files... so I guess we also need to know what changes you made..
Quote:
Originally Posted by
rnet
I've run into this problem too, using the latest download on V1.3.7. I've made the changes as suggested -- no success. Any ideas??
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
stellarweb
What error exactly are you getting? Can you copy and paste the error here?
Also... you said you used the latest download and made changes... but the post you quoted I believe was referring to changes to the old files... so I guess we also need to know what changes you made..
I'm using the latest download, but when selecting any order from admin - I get a blank page. I tried to make the orders.php edits listed in prior posts without success. If I substitute the original (stock) orders.php file, it works -- however I do not see the referrals listed, except in the column under admin>Customers (column title Referred By).
-
Re: Can't get "referrals " mod working
Ideally you should not have to edit the latest download at all - at least not the orders.php file.
A couple of things to do....
1. Make sure you are using the 1.3.7 version and you have not made any changes to it.
2. Make sure you are uploading the install referrals sql file via your admin area (Tools / Install SQL Patches)
3. Double check and make sure that you have all the files put in their proper order / folders, etc.
4. If all that fails, in the sql file try changing
'zen_cfg_select_option(array('true', 'false'), ', now()); to
'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
and see if that helps.
That is about all the advise I know to give. If you have modified your orders.php file with another mod.... that may be causing a problem ... you would have to use something like WinMerge to compare the two files.
Quote:
Originally Posted by
rnet
I'm using the latest download, but when selecting any order from admin - I get a blank page. I tried to make the orders.php edits listed in prior posts without success. If I substitute the original (stock) orders.php file, it works -- however I do not see the referrals listed, except in the column under admin>Customers (column title Referred By).
-
Re: Can't get "referrals " mod working
I've confirmed that I'm using the correct versions.
The LOG file shows: PHP Parse error: parse error, unexpected T_CASE in /var/www/html/admin/orders.php on line 195
Suggestions?
-
Re: Can't get "referrals " mod working
Hi,
I am on zencart v1.3.7 and have been trying to install the How Did You Hear About Us Version 1.3.7 mod -- I was also getting the 1064 SQL syntax error message. I tried several of the suggestions here with no luck through the zencart sql patch screen. So, I went to my phpmyadmin screen on my hosting site and pasted in:
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Require Referral', 'REFERRAL_REQUIRED', 'true', 'Require the Referral Source in account creation', '5', '6', 'zen_cfg_select_option(array(\'true\', \'false\'), ', now());
The error message that came up on their screen which said I needed to check the syntax indicated a difference in the word "now" just before the ()); and displayed that word in CAPS. Knowing nothing about SQL, I left everything else the same in the above sql patch, except I changed the "now" to "NOW" and submitted the sql again. I got a success message. I went back to my store, and now I have the two options showing up under the configuration for My Store and Customer Details. I just checked my "Online Catalog" and so far, the screen where customers can create an account looks correct with the "Other" option showing up as well as the text box where they can type.
-
Re: Can't get "referrals " mod working
I also get the error:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true', 'false'),'now())' at line 1
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array('true', 'false'),'now());]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
when i import the SQL file i get this error:
Error
SQL query:
ALTER TABLE customers_info ADD customers_info_source_id int NOT NULL AFTER customers_info_date_account_last_modified;
MySQL said: http://209.85.82.130:2082/3rdparty/p...img/b_help.png
#1060 - Duplicate column name 'customers_info_source_id'
Here is some info:
Server version: 4.1.22-standard-log
phpMyAdmin - 2.10.0.2
I have modified the code 'zen_cfg_select_option(array('true', 'false'),'now());
and changed it several different ways. and no luck. Is there another solution?
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
rnet
I've confirmed that I'm using the correct versions.
The LOG file shows: PHP Parse error: parse error, unexpected T_CASE in /var/www/html/admin/orders.php on line 195
Suggestions?
I get the same error too . I have a suspicion that the Paypal updates may muck it up. as when i installed this Paypal stoped working ! may be coincedence.
Hope someone can suggest a fix.
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
cowboyfred
I also get the error:
1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'true', 'false'),'now())' at line 1
in:
[INSERT INTO configuration (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) VALUES ('Display "Other" Referral option', 'DISPLAY_REFERRAL_OTHER', 'true', 'Display "Other - please specify" with text box in referral source in account creation', '1', '22', 'zen_cfg_select_option(array('true', 'false'),'now());]
If you were entering information, press the BACK button in your browser and re-check the information you had entered to be sure you left no blank fields.
when i import the SQL file i get this error:
Error
SQL query:
ALTER TABLE customers_info ADD customers_info_source_id int NOT NULL AFTER customers_info_date_account_last_modified;
MySQL said: http://209.85.82.130:2082/3rdparty/p...img/b_help.png
#1060 - Duplicate column name 'customers_info_source_id'
Here is some info:
Server version: 4.1.22-standard-log
phpMyAdmin - 2.10.0.2
I have modified the code 'zen_cfg_select_option(array('true', 'false'),'now());
and changed it several different ways. and no luck. Is there another solution?
This post was from awhile ago and i don't remember how i fixed it. However, i am running the most current version of Zen-Cart and everything is humming along just great.
-
Re: Can't get "referrals " mod working
i'm "hacking" for better terms as trying to get this mod installed on an oldver of Zen, I guess it is a 1.3x version.
I can see the TABLE_HEADING_REFERRED_BY showing up through the Admin-Customers section
What field names are suppose to be added to the database?
-
Re: Can't get "referrals " mod working
If you will look in the install_referrals.sql file - it will tell you the tables that get added to the database. :D
Quote:
Originally Posted by
gogolf
i'm "hacking" for better terms as trying to get this mod installed on an oldver of Zen, I guess it is a 1.3x version.
I can see the TABLE_HEADING_REFERRED_BY showing up through the Admin-Customers section
What field names are suppose to be added to the database?
-
Re: Can't get "referrals " mod working
Stellar, I appreciate your input. This is a great forum.
However being a newbie to sql , php, etc, I am trying to understand this.
I'm looking at my database in php and trying to confirm if the database was properly updated with the sql patch (since we all seem to have had problems with it).
When I plug in the patch for 1.3.6 I get the following message:
12 statements processed.
Error ERROR: Cannot ADD column customers_info_source_id because it already exists.
Error ERROR: Cannot insert configuration_key "DISPLAY_REFERRAL_OTHER" because it already exists
Error ERROR: Cannot insert configuration_key "REFERRAL_REQUIRED" because it already exists
Warning Note: 3 statements ignored. See "upgrade_exceptions" table for additional details.
So can I assume that the proper tables were inserted or updated?
Quote:
Originally Posted by
stellarweb
If you will look in the install_referrals.sql file - it will tell you the tables that get added to the database. :D
-
Re: Can't get "referrals " mod working
Yes, that is a safe assumption. :yes:
Quote:
Originally Posted by
gogolf
Stellar, I appreciate your input. This is a great forum.
However being a newbie to sql , php, etc, I am trying to understand this.
I'm looking at my database in php and trying to confirm if the database was properly updated with the sql patch (since we all seem to have had problems with it).
When I plug in the patch for 1.3.6 I get the following message:
12 statements processed.
Error ERROR: Cannot ADD column customers_info_source_id because it already exists.
Error ERROR: Cannot insert configuration_key "DISPLAY_REFERRAL_OTHER" because it already exists
Error ERROR: Cannot insert configuration_key "REFERRAL_REQUIRED" because it already exists
Warning Note: 3 statements ignored. See "upgrade_exceptions" table for additional details.
So can I assume that the proper tables were inserted or updated?
-
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
stellarweb
Yes, that is a safe assumption. :yes:
OK. So we can assume all the tables are now correct.
My next problem is I can't see the referral choices or drop down on the Login page under the Options, what could cause that though I have updated all the other files to the store site?
-
Re: Can't get "referrals " mod working
Do you have a link I can take a peek at?
Quote:
Originally Posted by
gogolf
OK. So we can assume all the tables are now correct.
My next problem is I can't see the referral choices or drop down on the Login page under the Options, what could cause that though I have updated all the other files to the store site?
-
Re: Can't get "referrals " mod working
-
Re: Can't get "referrals " mod working
Got it - and just sent you a reply. Hope it helps a little bit! :yes:
Quote:
Originally Posted by
gogolf
pm sent
-
Re: Can't get "referrals " mod working
Well know that I know I'm (cough) using version 1.2.6 WE know that the Referral mod won't work "easily". Thanks for the tips Stellar. It seems I have to either trade in my wood for a graphite shaft or hack away with 1.3.7.