Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How Did You Hear About Us - Support


Recommended Posts

  • Replies 318
  • Created
  • Last Reply

Top Posters In This Topic

i think the original contributor of this disappeared, so i will try to answer your questions :)

there are language strings missing.

open up admin/includes/languages/english/referrals..php

 

and add the missing lines, like so:

define('TABLE_HEADING_REFERRALS', 'Referrals');

 

note the bold text. remove that and make it say WHATS_MISSING and for Referrals, do the same (but replace referrals with whatever you want it to say)

i'm not very experienced with mysql / sql errors, so i'm going to take a guess and say add those lines to the english file and see if it helps. i don't recall running into this error when i first installed it to my shop, so likely if you go over the instructions a second time you'll probably notice you missed a , or something stupid like that. happens to me all the time :)

 

Thanks for the help. I finally worked out that there must be a missing language file "stats_referral_sources.php" and it wasn't distributed with the original module.

 

To fix the first problem I just opened" admin>stats_referral_sources.php" and added

 

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_STATS_REFERRAL_SOURCES);

 

Directly AFTER the code below

 

---------------------------------------------------------------------------

 

<?php

/*

$Id: stats_referral_sources.php,v 1.5 2006-05-11 rmh Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright ? 2004 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

$action = (isset($HTTP_GET_VARS['action']) ? $HTTP_GET_VARS['action'] : '');

if ($action == 'display_other') {

$referrals_query_raw = "select count(ci.customers_info_source_id) as no_referrals, so.customers_id, ci.customers_info_date_account_created, so.sources_other_name as sources_name from " . TABLE_CUSTOMERS_INFO . " ci, " . TABLE_SOURCES_OTHER . " so where ci.customers_info_source_id = '9999' and so.customers_id = ci.customers_info_id group by so.sources_other_name order by no_referrals DESC";

} else {

$referrals_query_raw = "select count(ci.customers_info_source_id) as no_referrals, s.sources_name, s.sources_id from " . TABLE_CUSTOMERS_INFO . " ci LEFT JOIN " . TABLE_SOURCES . " s ON s.sources_id = ci.customers_info_source_id group by s.sources_id order by ci.customers_info_source_id DESC";

}

 

------------------------------------------------------------------

 

Next I duplicated admin>english>referrals.php and renamed it to "stats_referral_sources.php" then changed the DEFINE tags to match the missing DEFINE data. I then uploaded the file to admin>english directory.

 

This has fixed that problem but I am still getting the database error when I click on the Other Referrals Link.

 

Funkym

Edited by FunkyM
Link to comment
Share on other sites

  • 3 weeks later...

I posted the following update to the contribution.

 

(Disclaimer: This is my first post as a contribution -- I usually just post code in a forum message when I've made a change I thought someone might find useful.)

 

 

 

------------------###############---------------------

Instructions below provided by: Walkman

 

 

UPDATE:

 

This is an update to the referral sources report that is part of the 1.4 release.

 

This report adds

1) date selection

2) drill down capability on individual referral codes

This shows the monthly referrals for a particular source code

within the date range selected

 

 

 

Note: the referral source date is based on the creation date of the account

 

 

 

 

Sorry, that this is not against the 1.5 version - but we didn't need those features and we had

 

already heavily modified the 1.4 release to fit our needs.

 

 

 

I also apologize if this doesn't work for you. I think it works with the standard release but we

 

have a heavily modified version of OSC and I don't have time to produce a commercial quality

 

release. It should be easy for you to test since it's just a report. Or modify using a good file

 

comparison program to spot the changes.

 

 

 

BTW: we modified the 1.4 version because we did not want to require the user to select from a

 

long pull-down list of sources. We were afraid they would just skip it. So instead we give

 

them a blank text field to write what ever the want. When we process the order using "orders.php"

 

we display what they entered and then we make the actuall selection from the pull-down list at the time we update the status of the order to "shipped".

 

We think this gives us a higher response rate (currently 75-80%) and more accurate data since it

 

is reviewed.

 

Therefore we don't need all of the "other" logic in the standard release.

Link to comment
Share on other sites

  • 2 weeks later...

Hello, I installed V 1.4 and it works great when someone creates an account!!

 

Thanks for this contribution!

 

I also have "purchase without an account 1.1.2" installed. I have been working on the code in "create_account.php" for two days to include this contribution.

 

Would anybody know the code and where to insert it in create_account so this will work with PWA?

 

Thank you in advance for your help!

Edited by papawmike
Link to comment
Share on other sites

Hi all!

 

I've installed V 1.4 and works great... but something's missing: multi-language support.

 

I would be useful for each "sources_id" to have as many "sources_name" as languages... just as "categories_description" or "order_status" in database.

 

Then, in admin section, we would enter the name, in each language available, for each Referral.

 

The file /admin/order_status.php and /admin/referrals.php are quite similar... so maybe it would be possible to use this as reference for multi-language part.

 

It shouldn't be too complicated to modify, but I need advices!

 

Thanks in advance,

 

Plascual

Link to comment
Share on other sites

  • 3 weeks later...
  • 3 weeks later...

Hi,

I installed the 1.5v but i still get this:

 

The requested URL /catalog/admin/FILENAME_STATS_REFERRAL_SOURCES was not found on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request

 

I installed everything by the book. Everything else seems to work fine. Its just in admin when i try to go to referral sources. I get that. I noticed there seems to be updates etc to 1.4 thats why i used 1.5v

 

can someone help me please?

Link to comment
Share on other sites

Sorry for bombarding this topic. But there is 2 little steps that are not in the 1.5v contribution.

 

In catalog/admin/includes/filenames.php

 

ADD

define('FILENAME_REFERRALS', 'referrals.php');

define('FILENAME_STATS_REFERRAL_SOURCES', 'stats_referral_sources.php');

before the final ?>

 

Hope this helps, as i didnt see it in the instructions.

Link to comment
Share on other sites

  • 2 weeks later...

Hi team, I need some help here because for the last 7 1/2 hours I have been going crazy, not being able to fix an issue i have with this awesome referals contrib.

 

I have installed, re-installed and re-installed the contribute 1.5 as per the instructions.

 

Heres the issues:

 

create new account and click ok comes up with error on a blank page saying:

 

 

(when referal is from MSN)

 

0 - 

insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('0', '0', now(), '2')

[TEP STOP]

 

(when referal is from other>text written in:

 

0 - 

insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('0', '0', now(), '9999')

[TEP STOP]

 

At this point - I look into the admin - customers section and the customer has been made - however, the Account Created date is blank and reffered by is "--none--" on the main screen, and the last logged in, how many log in's etc are all blank aswell.

 

Further more I would try to delete these "almost" customers and I would get this error:

 

Warning: reset(): Passed variable is not an array or object in /home/megaphone/domains/xxx.co.nz/public_html/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/megaphone/domains/xxx.co.nz/public_html/admin/includes/classes/object_info.php on line 18

 

Its freaking me out! - the reporting and customer referals section seem to be working fiine and recording the data.

 

I have checked my vreate_account.php with a fine tooth comb and as the instructions say I have check to see if TABLE_CUSTOMERS_INFO featured more than twice and I doesn't.

 

I can 't really hazard a guess at where the issue lies, I have checked each changed file and there does not seem to be any problems>>??

 

Can someone please help me out - maybe I've just been looking at this too long. I look forward to your reply, Kind Regards,

 

Mitchell

Link to comment
Share on other sites

  • 2 weeks later...
Hi team, I need some help here because for the last 7 1/2 hours I have been going crazy, not being able to fix an issue i have with this awesome referals contrib.

 

I have installed, re-installed and re-installed the contribute 1.5 as per the instructions.

 

Heres the issues:

 

create new account and click ok comes up with error on a blank page saying:

(when referal is from MSN)

 

0 - 

insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('0', '0', now(), '2')

[TEP STOP]

 

(when referal is from other>text written in:

 

0 - 

insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('0', '0', now(), '9999')

[TEP STOP]

 

At this point - I look into the admin - customers section and the customer has been made - however, the Account Created date is blank and reffered by is "--none--" on the main screen, and the last logged in, how many log in's etc are all blank aswell.

 

Further more I would try to delete these "almost" customers and I would get this error:

 

Warning: reset(): Passed variable is not an array or object in /home/megaphone/domains/xxx.co.nz/public_html/admin/includes/classes/object_info.php on line 17

Warning: Variable passed to each() is not an array or object in /home/megaphone/domains/xxx.co.nz/public_html/admin/includes/classes/object_info.php on line 18

 

Its freaking me out! - the reporting and customer referals section seem to be working fiine and recording the data.

 

I have checked my vreate_account.php with a fine tooth comb and as the instructions say I have check to see if TABLE_CUSTOMERS_INFO featured more than twice and I doesn't.

 

I can 't really hazard a guess at where the issue lies, I have checked each changed file and there does not seem to be any problems>>??

 

Can someone please help me out - maybe I've just been looking at this too long. I look forward to your reply, Kind Regards,

 

Mitchell

 

Hey can someone give me a hand here please, Ryan/Hobbzilla are you still there? - I have read through this topic, page 9 had a similar issue to mine but it seems that noone answered him either.

 

Can some one please tell me what I'm doing wrong? - i really want to get this one to work.

 

Thanks in advance,

 

Mitchell :thumbsup:

Link to comment
Share on other sites

Hello,

 

Is anybody else having a problem viewing "Other" sorces in admin/stats_referral_sources.php using the "Report - Date & Drill Down" by walkman? I'm getting the following SQL error just when I click on "Other":

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 'WHERE ci.customers_info_date_account_created BETWEEN '2006-01-01' AND '2006-11-1' at line 1

 

select count(ci.customers_info_source_id) as no_referrals, so.sources_other_name as sources_name from customers_info ci LEFT JOIN sources_other so WHERE ci.customers_info_date_account_created BETWEEN '2006-01-01' AND '2006-11-11 23:59:59' AND ci.customers_info_source_id = '9999' and so.customers_id = ci.customers_info_id group by so.sources_other_name ORDER BY so.sources_other_name DESC

Here is the query from the admin/stats_referral_sources.php for the $action == 'display_other':

if ($action == 'display_other') {

$referrals_query_raw = "select count(ci.customers_info_source_id) as no_referrals, so.sources_other_name as sources_name from " . TABLE_CUSTOMERS_INFO . " ci LEFT JOIN " . TABLE_SOURCES_OTHER . " so WHERE ci.customers_info_date_account_created BETWEEN '" . $start_date . "' AND '" . $end_date . " 23:59:59' AND ci.customers_info_source_id = '9999' and so.customers_id = ci.customers_info_id group by so.sources_other_name ORDER BY so.sources_other_name DESC ";

May be somebody can help me to get it working properly. Any help would be appreciated.

 

Thanks.

Link to comment
Share on other sites

Hello,

 

For those with the error in headings in the stats - indeed the admin/language/english/stats_referral_sources.php is missing from version 1.5; however, it IS in the "If on clean osC version" version - so, get it there.

 

For those of you who desire to be able to control the order of the dropdown boxes from within the admin, (ie. list the referral source by sources_id rather than sources_name) - here is the code to change.

 

includes/functions/general.php

 

find this:

	  $sources = tep_db_query("select sources_id, sources_name from " . TABLE_SOURCES . " order by sources_name");

 

replace with this:

	  $sources = tep_db_query("select sources_id, sources_name from " . TABLE_SOURCES . " order by sources_id");

 

 

admin/referrals.php

 

find this:

  $sources_query_raw = "select sources_id, sources_name from " . TABLE_SOURCES . " order by sources_name";

 

replace with this:

  $sources_query_raw = "select sources_id, sources_name from " . TABLE_SOURCES . " order by sources_id";

 

hope this helps... Scott

Link to comment
Share on other sites

I am tired, I have a teething 19 month old and I just don't have the time to read through 13 pages to see if my question has been asked so I am going to ask it anyway... apologies if I am repeating someone else.

 

I would like to be able to see who referred specific sources. I can see that X has been referred 10 times but short of going through the list of all of my customers I can't find out who those 10 customers are. Ideally I would like to be able to click somewhere and have the list present itself.

 

I would also like to be able to edit a source. Currently I have to delete one source and replace it with another which means that the customers who referred the original source are no longer linked to a source.

 

Can anyone help me?

 

Laura

Link to comment
Share on other sites

  • 2 weeks later...

Oh Help! I'm in trouble.

I've just installed this contribution but when I try to create a new account I get a page with the following error:

 

1062 - Duplicate entry '126' for key 1

 

insert into customers_info (customers_info_id, customers_info_number_of_logons, customers_info_date_account_created, customers_info_source_id) values ('126', '0', now(), '1')

 

[TEP STOP]

 

Suspect that its a database problem but my knowledge is sorely lacking. I do hope someone can help. The site concerned is www.jupiterandsuns.co.uk

Link to comment
Share on other sites

It's Ok I fixed that by trawling through some of these posts. They looked a bit scary at first and I was worried that I'd misunderstand and screw things up even more.

 

HOWEVER, I also have another issue. when I log in to admin and customers I get this:-

 

fatal error: Call to undefined function: tep_get_sources_name() in /home/961/jupiter2/www.jupiterandsuns.co.uk/public_html/admin/customers.php in line 749

 

Help??

Link to comment
Share on other sites

It's Ok I fixed that by trawling through some of these posts. They looked a bit scary at first and I was worried that I'd misunderstand and screw things up even more.

 

HOWEVER, I also have another issue. when I log in to admin and customers I get this:-

 

fatal error: Call to undefined function: tep_get_sources_name() in /home/961/jupiter2/www.jupiterandsuns.co.uk/public_html/admin/customers.php in line 749

 

Help??

 

Look at that line, there is obviously something missing like / ; hard to know without seeing the code.. Look true it., iTs something small.

Link to comment
Share on other sites

Here's the offending line of code - admin/customers.php line 749

 

	  $entry_referral = tep_get_sources_name($source['customers_info_source_id'], $customers['customers_id']);

 

I can't see anything wrong at all. The whole contribution is ineffectual without this bit working. Any ideas?

Link to comment
Share on other sites

Here's the offending line of code - admin/customers.php line 749

 

	  $entry_referral = tep_get_sources_name($source['customers_info_source_id'], $customers['customers_id']);

 

I can't see anything wrong at all. The whole contribution is ineffectual without this bit working. Any ideas?

 

I am having the exact same problem, I have however been running this contrib for a while, and now I am getting this error, I have dropped all DB entries relating to this contrib and the reinstalled them. i have checked my files and all are present and seem correct.

 

Anyone got any ideas?

Link to comment
Share on other sites

High2K ... try this.

 

Make sure you have this code in admin/includes/functions/general.php

 

////

// Heard About Us Mod

function tep_get_sources_name($source_id, $customers_id) {

 

if ($source_id == '9999') {

$sources_query = tep_db_query("select sources_other_name as sources_name from " . TABLE_SOURCES_OTHER . " where customers_id = '" . (int)$customers_id . "'");

} else {

$sources_query = tep_db_query("select sources_name from " . TABLE_SOURCES . " where sources_id = '" . (int)$source_id . "'");

}

 

if (!tep_db_num_rows($sources_query)) {

if ($source_id == '9999') {

return TEXT_OTHER;

} else {

return TEXT_NONE;

}

} else {

$sources = tep_db_fetch_array($sources_query);

return $sources['sources_name'];

}

}

 

/// BEGIN added for admin create customers

// Returns an array with sources

// TABLES: sources

function tep_get_sources($sources_id = '') {

$sources_array = array();

if (tep_not_null($sources_id)) {

$sources = tep_db_query("select sources_name from " . TABLE_SOURCES . " where sources_id = '" . (int)$sources_id . "'");

$sources_values = tep_db_fetch_array($sources);

$sources_array = array('sources_name' => $sources_values['sources_name']);

} else {

$sources = tep_db_query("select sources_id, sources_name from " . TABLE_SOURCES . " order by sources_name");

while ($sources_values = tep_db_fetch_array($sources)) {

$sources_array[] = array('sources_id' => $sources_values['sources_id'],

'sources_name' => $sources_values['sources_name']);

}

}

 

return $sources_array;

}

// END added for admin create customers

// END heard about us

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...