Re: Can't get "referrals " mod working
Another what will appear to be a long thread of updates from this newbie trying to figure out why the customer's referral is not appearing in the Admin/Customers or the Admin/Reports/Customers Referral Report.
I went into the database table for customers_info and looked at the field name
customers_info_source_id and saw that for the five test customers I setup each had a value of "0".
I then edited four of the five test customers to have a value other than 0, such as "1". I then went back to the admin/customers and saw that the four customers now had a referral appearing (finally) under the TABLE_HEADING_REFERRED_BY and the one customer I did not edit had "none" which appears to be what "0" will do.
When I ran the Admin/Reports/Customer's Referral the report showed nothing.
However when I explored Admin/Extra's/Referral Sources what appeared was a count of each of the referral names. So at least now I know that the database will report something on the admin side but for some reason the referral is not being posted in the database when the customer account is created.
Re: Can't get "referrals " mod working
We are having the same exact problem. The database is not storing the referral information when creating test customers... but if I go into the database and manually change the values, then the associated referral sources show up in the admin reports.
So, as far as I can tell, the main problem here is - why is the database not getting passed the referral info in the create_account page? HELP - if anyone knows how to troubleshoot this, it'll solve both mine and gogolf's problems.
In case anyone can eyeball this code and see what the problem is, I believe the problem lies somewhere in this code from tpl_module_create_account.php
PHP Code:
<!-- //rmh referral start -->
<fieldset>
<legend><?php echo TABLE_HEADING_REFERRAL_DETAILS; ?></legend>
<!--<?php echo zen_draw_separator('pixel_trans.gif', '100%', '10'); ?> -->
<!-- <?php echo CATEGORY_SOURCE; ?> -->
<?php echo zen_get_source_list('sources', (DISPLAY_REFERRAL_OTHER == 'true' ? true : false)) . ' ' . (zen_not_null(ENTRY_SOURCE_TEXT) ? '<span class="inputRequirement">' . ENTRY_SOURCE_TEXT . '</span>': ''); ?><?php echo ENTRY_SOURCE; ?>
<br class="clearBoth" />
<?php
if (DISPLAY_REFERRAL_OTHER == 'true') {
?>
<?php echo zen_draw_input_field('source_other', '', 'id="sources_other_name" size="26"') . (zen_not_null(ENTRY_SOURCE_OTHER_TEXT) ? '<span class="inputRequirement">' . ENTRY_SOURCE_OTHER_TEXT . '</span>': ''); ?> <?php echo ENTRY_SOURCE_OTHER; ?>
<br class="clearBoth" />
</fieldset>
<?php
}
?>
<!-- //rmh referral end -->
All the other fields on tpl_module_create_account.php pass info to the Customers table while this data is supposed to be stored in Customers_Info. Could this be the problem?
BTW, AFAICT, Admin/Reports/Customer's Referral is for a totally different report unrelated to this mod.
Re: Can't get "referrals " mod working
I dug into the Module code for this, and wondering if the problem is here. Note, my customers_info table is receiving the other data (ID, 0, Now) but not the source ( (int)$source ).
Code:
values ('" . (int)$_SESSION['customer_id'] . "', '0', now(), '" . (int)$source . "')";
From the mod:
PHP Code:
//rmh referral start
$query_insert= "insert into " . TABLE_CUSTOMERS_INFO . "
(customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id)
values ('" . (int)$_SESSION['customer_id'] . "', '0', now(), '" . (int)$source . "')";
$db->Execute($query_insert);
$db->Execute($sql);
if ($source == '9999') {
zen_db_perform(TABLE_SOURCES_OTHER, array('customers_id' => $_SESSION['customer_id'], 'sources_other_name' => $source_other));
}
// $sql = "insert into " . TABLE_CUSTOMERS_INFO . "
// (customers_info_id, customers_info_number_of_logons,
// customers_info_date_account_created)
// values ('" . (int)$_SESSION['customer_id'] . "', '0', now())";
//
// $db->Execute($sql);
//rmh referral end
Re: Can't get "referrals " mod working
MyGreyGoose,
Yeah. I'm starting to wonder where the problem is with this great mod. And its a shame not to solve the riddle because tracking where your customers come from is common sense. I'm super- prized that this mod was not in 1.3.7 !
What is most puzzling is that there seems to be an array of users here who all have the same problem yet some have solved it with different approaches.
....... yet I'll have to assume some have probably quit too early and gave up.
So where are the experts when we need them?
I think its worth a cup of coffee!
Re: Can't get "referrals " mod working
Just as an FYI - after a PM from MyGreyGoose this afternoon .... I did an install of this mod onto a working 1.3.7 zencart.... and the results were again the same as when I have installed it on other websites for my clients - works perfectly.
I created a new account after installing the mod.... used google as the referral source and the report under Extras > Referral Sources now shows:
Referral Sources
Sources Referred
Google 1
Other 9
(the ones in the "other column" are existing customer accounts - it automatically throws them there)
Again... all I did was take the files from the zip file..... put them all in the corresponding directories.... went into my zencart admin and copied and pasted the install_referrals.sql info under tools.... install sql patches..... and everything works peachy keen. :blink:
A couple of things that MAY help to double check yourself on ......
1. Make sure you install the patch via your zencart admin
2. Make sure that the file under the Templates folder is put into your specific CUSTOM directory folder... per the installation instructions (\includes\templates\YOUR-TEMPLATE\templates\tpl_modules_create_account.php)
3. Remember that the definition of insanity is... "doing the same thing over and over again and expecting different results!" :smile:
I know that probably doesnt help.... but I just wanted to put in my $.05 cents worth (inflation.....) :)
Quote:
Originally Posted by
gogolf
MyGreyGoose,
Yeah. I'm starting to wonder where the problem is with this great mod. And its a shame not to solve the riddle because tracking where your customers come from is common sense. I'm super- prized that this mod was not in 1.3.7 !
What is most puzzling is that there seems to be an array of users here who all have the same problem yet some have solved it with different approaches.
....... yet I'll have to assume some have probably quit too early and gave up.
So where are the experts when we need them?
I think its worth a cup of coffee!
Re: Can't get "referrals " mod working
Hello again,
I'm getting worried as I'll be going live very soon and the referrals helps me pay out a commission to my sales rep as well as bonuses for magazine referrals...
I've merged the files, reinstalled them, rechecked.....etc. At this point can someone take a look at my orders, customers, create account files if you have a couple minutes. I've merged them but something tells me it might lie within another mod conflict. Out of all the mods I've used, this one has got me stumped
TIA,
Tatiana
Re: Can't get "referrals " mod working
Judy,
I guess I can now qualify for the Insanity Award because I've read all your comments several times, tried all the suggestions posted in this thread several times. Now I want to go for the Neurotic Award because its all grey to me know
My store is a fresh install. The only mods are creating a custom template, yes I tried putting all the files mentioned its directory, and I added the Ask A Question About This Product mod.
A few questions for you:
1) Do KNOW if the Ask a Question About This Product mod is the problem?
2) Have you ever had a problem with the Referral mod?
3) What are the specific scripts or php's that direct the referral into the tables field (what is the path or flow)?
I look forward to you help.
Re: Can't get "referrals " mod working
And just to make sure I'm insane I installed another new Zen Cart, followed the instructions and got following error running the SQL patch:
1064,,,,, yada yada yada,. (you know the rest).
So. Did some say they have a cast call for a remake of One Flew Over the CucKoo's Nest?
And HERES Johnny!
Re: Can't get "referrals " mod working
Quote:
Originally Posted by
gogolf
And just to make sure I'm insane I installed another new Zen Cart, followed the instructions and got following error running the SQL patch:
1064,,,,, yada yada yada,. (you know the rest).
Did you copy-and-paste the SQL contents into the SQL Patch window, or did you Browse to the file and click Send?
Sometimes the copy/paste works better.
Re: Can't get "referrals " mod working
Hi Dr. Byte,
Thanks for your help on this. Gogolf and I have been in touch and are having the same problem, although he can answer your q specifically. I think Tatiana is having the same prob.
For me, when I first did the sql patch, I tried uploading it. I got an error. I investigated, and all the first statements seemed to take hold. Not the last two (related to the configuration table). I copied and pasted those in. AFAICT, the table modifications and row inserts took hold as desired.
To me, it seems like everything in the mod was set up correctly, it looks great in my shop, but that when you click submit to create an account, everything gets submitted to the tables EXCEPT for the customers_info_source_id. I wonder if it has anything to do with the fact that all the other fields on create_account go into the customers table instead of customers_info.
I tried pinpointing the problem. I substituted an integer for the code that produces the customers_info_source_id value, but that did not go into customers_info either. So, I wonder if it's even deeper in the code?