Jump to content
Sign in to follow this  
Soundman01

Customer Survey

Recommended Posts

Hello,

 

I just installed this contribution yesterday and there is something wrong with it. The survey.php page shows nothing but broken page. And admin/stats_survey.php gives a bunch of warnings:

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 452

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 453

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 454

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 456

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 457

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 458

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 459

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 462

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 463

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 464

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 465

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 468

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 469

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 470

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 474

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 475

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 476

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 477

 

Warning: Division by zero in /var/www/shop/admin/stats_survey.php on line 478

It seems like very easy to install contribution but so far I don't know what might be wrong. Can anybody please advise?

 

Thanks.

Share this post


Link to post
Share on other sites
Hello,

 

I just installed this contribution yesterday and there is something wrong with it. The survey.php page shows nothing but broken page. And admin/stats_survey.php gives a bunch of warnings:

 

It seems like very easy to install contribution but so far I don't know what might be wrong. Can anybody please advise?

 

Thanks.

 

Hey sorry to worry you about that, as a result of it's average calculation you will get that till someone has taken the survey and it has something to calculate. (I should have added that to the instructions)

 

enjoy

Brandon

Share this post


Link to post
Share on other sites
Hey sorry to worry you about that, as a result of it's average calculation you will get that till someone has taken the survey and it has something to calculate. (I should have added that to the instructions)

 

enjoy

Brandon

Ok..., but how can I send anybody a link to take a survey if the survey.php page is blank with nothing in there? It can be a really useful contribution when I'll figure out how to use it. Is there anything else that I should know about the contribution that is not included in the instructions?

 

Thanks.

Edited by Irin

Share this post


Link to post
Share on other sites
Ok..., but how can I send anybody a link to take a survey if the survey.php page is blank with nothing in there? It can be a really useful contribution when I'll figure out how to use it. Is there anything else that I should know about the contribution that is not included in the instructions?

 

Thanks.

First of all there is a problem with the survey.php page layout, some excessive html tags are present that cause page to break apart. I somehow figured that out. Also, there is something wrong with putting the "if" statements, especially double "==". The page is blank unless I remove a second "=" from each "if" statement. However, with only single "=" all the "if" statements are visible on the page. Unfortunately, I can't find the solution to this problem. Any advise would be appreciated.

 

Thanks.

Share this post


Link to post
Share on other sites
First of all there is a problem with the survey.php page layout, some excessive html tags are present that cause page to break apart. I somehow figured that out. Also, there is something wrong with putting the "if" statements, especially double "==". The page is blank unless I remove a second "=" from each "if" statement. However, with only single "=" all the "if" statements are visible on the page. Unfortunately, I can't find the solution to this problem. Any advise would be appreciated.

 

Thanks.

 

Ok first off, the exact copy of what I put in the contribution is running just fine on my site. second I can't quite tell from your statement what is going on. If you want PM me a link to your survey page and I'll see if I can tell any thing or just give me some more info.

 

Brandon

Share this post


Link to post
Share on other sites

Hi Soundman,

 

I just installed this contribution (what great timing you have!). I am not sure if I've done something wrong, but when I go to the admin/orders page and check the "Just Email Survey" or the "Append" checkboxes, and hit update, I get a new row that checks Requested Survey, but I don't get an email with a link.

 

Not sure if that is what is supposed to happen, or if there is something else to be configured that I've missed? I'm hoping to get this contribution up and running as it is exactly what my client requested.

 

Thanks!

Janet

Share this post


Link to post
Share on other sites
Hi Soundman,

 

I just installed this contribution (what great timing you have!). I am not sure if I've done something wrong, but when I go to the admin/orders page and check the "Just Email Survey" or the "Append" checkboxes, and hit update, I get a new row that checks Requested Survey, but I don't get an email with a link.

 

Not sure if that is what is supposed to happen, or if there is something else to be configured that I've missed? I'm hoping to get this contribution up and running as it is exactly what my client requested.

 

Thanks!

Janet

 

Just a thought, "Notify Customer:" has to be checked or it won't send the email. If that doesn't help I need more info.

 

Brandon

Share this post


Link to post
Share on other sites
Just a thought, "Notify Customer:" has to be checked or it won't send the email. If that doesn't help I need more info.

 

Brandon

 

Hi Brandon, thanks for your reply... I tested that and still didn't get an email (I did receive the regular receipt email, so I believe the configuration for emailing is set correctly). This is a heavily modified store, however none of the pages your contribution alter are altered from other contributions. I've gone over the additions from the instructions a number of times and all looks correct. The admin page loads correctly, so I'm just stumped on how to test for where the problem might be? Any ideas or if there's any info I can send you, please let me know. I'm really hoping to get this contribution working!

 

Thanks for your help!

Janet

Share this post


Link to post
Share on other sites
Hi Brandon, thanks for your reply... I tested that and still didn't get an email (I did receive the regular receipt email, so I believe the configuration for emailing is set correctly). This is a heavily modified store, however none of the pages your contribution alter are altered from other contributions. I've gone over the additions from the instructions a number of times and all looks correct. The admin page loads correctly, so I'm just stumped on how to test for where the problem might be? Any ideas or if there's any info I can send you, please let me know. I'm really hoping to get this contribution working!

 

Thanks for your help!

Janet

 

Well you have me a bit confused also. (it does work fine on my server). I've looked at the code again, and it simply inserts an "if" statement that if "Just Email Survey (no comments)" is selected it replaces the normal email format with it's own. Please confirm that "Add Survey Request to Comments" is adding comments to the bottom of the email. that might tell us something.

 

Brandon

Share this post


Link to post
Share on other sites
Hello,

 

I just installed this contribution yesterday and there is something wrong with it. The survey.php page shows nothing but broken page. And admin/stats_survey.php gives a bunch of warnings:

 

It seems like very easy to install contribution but so far I don't know what might be wrong. Can anybody please advise?

 

Thanks.

Share this post


Link to post
Share on other sites

I have the same problem as the person a couple spaces up.

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 452

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 453

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 454

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 456

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 457

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 458

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 459

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 462

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 463

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 464

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 465

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 468

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 469

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 470

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 474

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 475

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 476

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 477

 

Warning: Division by zero in /usr/www/users/titan/titanmailorder/catalog/admin/stats_survey.php on line 478

 

 

and then it shows the form with zeros in every row...

 

I tried everything and my install was correct. Please let me know how to add a survey result to get rid of these zeros. If I send myself an email thru the admin to link to the survey I get an email with no link! it sais click here to go to survey but there is nothing to click. There is no way to add values except maybe Ill go into the database now and try that. You shouldnt have to do that.

Share this post


Link to post
Share on other sites
Well you have me a bit confused also. (it does work fine on my server). I've looked at the code again, and it simply inserts an "if" statement that if "Just Email Survey (no comments)" is selected it replaces the normal email format with it's own. Please confirm that "Add Survey Request to Comments" is adding comments to the bottom of the email. that might tell us something.

 

Brandon

 

Hi Brandon, In the admin interface, the orders page has Add Survey Request to Comments and Just Email Survey... neither of these are checked by default, so when the order is placed, the email receipt doesn't included a link to the survey. Is there a place to check one of them so it defaults?

 

If I go in after the order is placed and check off either Add Survey Request to Comments or Just Email Survey, and then Update, I get a new table row with Requested Survey checked in green, but I don't get another email.

 

Perhaps some instructions on how to configure and use the contribution once it is installed would help?

 

Thanks,

Janet

Share this post


Link to post
Share on other sites
Hi Brandon, In the admin interface, the orders page has Add Survey Request to Comments and Just Email Survey... neither of these are checked by default, so when the order is placed, the email receipt doesn't included a link to the survey. Is there a place to check one of them so it defaults?

 

If I go in after the order is placed and check off either Add Survey Request to Comments or Just Email Survey, and then Update, I get a new table row with Requested Survey checked in green, but I don't get another email.

 

Perhaps some instructions on how to configure and use the contribution once it is installed would help?

 

Thanks,

Janet

 

I get the email but there is no link in the email. I have to check the boxes like she sais in order to even get the email. I guess you could go to every order and check the boxes for each order to send an email to that person with a LINK in the email. However there is no link no matter what I do. just an email that looks like this=

 

osCommerce

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

Order Number: 55

 

We thank you for your recent order! As part of our desire to

continually improve our service we would appreciate you taking a moment to

complete our survey at the following link. Thank You!

 

Click here to go to survey

 

 

CLICK WHERE?!?!?

 

Seems like a great contribution but my client is just thinking about using X-cart. Here's why=

 

x-cart survey

 

seems alot cheaper than time=money trying to figure this out. :(

 

wish somebody had the solution

Share this post


Link to post
Share on other sites
I get the email but there is no link in the email. I have to check the boxes like she sais in order to even get the email. I guess you could go to every order and check the boxes for each order to send an email to that person with a LINK in the email. However there is no link no matter what I do. just an email that looks like this=

 

osCommerce

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

Order Number: 55

 

We thank you for your recent order! As part of our desire to

continually improve our service we would appreciate you taking a moment to

complete our survey at the following link. Thank You!

 

Click here to go to survey

CLICK WHERE?!?!?

 

Seems like a great contribution but my client is just thinking about using X-cart. Here's why=

 

x-cart survey

 

seems alot cheaper than time=money trying to figure this out. :(

 

wish somebody had the solution

There may be a couple of problems why you're not getting a link in the email. First of all make sure that you modified your admin/includes/languages/english/orders.php and added all the required definitions especially "define('SURVEY_LOCATION', HTTP_SERVER . DIR_WS_CATALOG . 'survey.php?')"; this is what definies the path to your survey.php page. Also, make sure the path is correctly set in your admin/configure.php where HTTP_SERVER is your full http:// address (ex.: http://mystore.com) and DIR_WS_CATALOG should be '/'.

 

Also, make sure that you modified your admin/orders.php according to the install instructions. There is a part that is required in order to get the survey text and link added to the email sent to the customer:

$survey_email = EMAIL_SEPARATOR . "\n" . SURVEY_COMMENT2 . "\n\n" . '<a href="' . SURVEY_LOCATION . '&email=' . $check_status['customers_email_address'] . '&order_num=' . $oID . '">' . SURVEY_TEXT_LINK . '</a>' . "\n\n" . EMAIL_SEPARATOR . "\n\n" ;

and you also must add previously defined $survey_email to the $email part which constructs the actual email. Below is how I modified my code in admin/orders to include the Survey modifications. I changed the original code a little bit to suit my needs (don't copy it because mine might be absolutely different from yours). The idea is that if only 'Just Email Survey (no comments)' box is checked, there is one email sent, otherwise the regular email sent.

 

$order_updated = false;
	$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
	$check_status = tep_db_fetch_array($check_status_query);
/* Survey*/
	if ( ($check_status['orders_status'] != $status) || tep_not_null($comments) || ($HTTP_POST_VARS['notify_survey'] == 'on') || ($HTTP_POST_VARS['notify_just_survey'] == 'on')) {
	  tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR) where orders_id = '" . (int)$oID . "'");

	  if (($HTTP_POST_VARS['notify_survey'] == 'on') || ($HTTP_POST_VARS['notify_just_survey'] == 'on')) {  // Survey
	  tep_db_query("update " . TABLE_ORDERS . " set order_surveyed = '1', last_modified = date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR) where orders_id = '" . (int)$oID . "'");  }

	  $customer_notified = '0';
	  if ($HTTP_POST_VARS['notify'] == 'on') {
		$notify_comments = '';

		 if ($HTTP_POST_VARS['notify_survey'] == 'on') {  //Survey
		  $survey_email = SURVEY_COMMENT2 . "\n\n<br><br>" . '<a href="' . SURVEY_LOCATION . '&email=' . $check_status['customers_email_address'] . '&order_num=' . $oID . '">' . SURVEY_TEXT_LINK . '</a>' . "\n\n<br><br>";   //Survey
		  $customer_surveyed = '1';
		}

		if ($HTTP_POST_VARS['notify_comments'] == 'on') {
		  $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n";
		  if ($comments == null)
			$notify_comments = '';
		}

		if ($HTTP_POST_VARS['notify_just_survey'] == 'on') {   //Survey
		  $survey_email = SURVEY_COMMENT1 . "\n\n<br><br>" . '<a href="' . SURVEY_LOCATION . '&email=' . $check_status['customers_email_address'] . '&order_num=' . $oID . '">' . SURVEY_TEXT_LINK . '</a>' . "\n\n<br><br>";   //Survey
		  $customer_surveyed = '1';   //Survey

		  $email = 'Dear ' . $check_status['customers_name'] . ',' . "\n<br><br>" . EMAIL_SEPARATOR . "\n<br>" . STORE_NAME . ' ' . EMAIL_TEXT_ORDER_NUMBER . ' ' . (int)$oID . "\n<br>" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n<br>" . EMAIL_SEPARATOR . "\n\n\n<br><br>" . $survey_email . "\n\n" . EMAIL_END1;   //Survey

  tep_mail($check_status['customers_name'], $check_status['customers_email_address'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT, $email, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);

		  } else {	 //Survey

		$email = 'Dear ' . $check_status['customers_name'] . ',' . "\n<br><br>" . EMAIL_SEPARATOR . "\n<br>" . STORE_NAME . ' ' . EMAIL_TEXT_ORDER_NUMBER . ' ' . (int)$oID . "\n<br>" . EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . (int)$oID, 'SSL') . "'>" .  'order_id=' . (int)$oID . "</a>\n<br>" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n<br>" . EMAIL_SEPARATOR . "\n\n\n<br><br>" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . "\n<br>" . $survey_email . EMAIL_END . "\n<br><br>" . EMAIL_TEXT_ORDER_STATUS . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY, 'order_id=' . $oID, 'SSL') . "'>" . (EMAIL_TEXT_ORDER_STATUS_LINK) . "</a> \n\n<br>";

	   tep_mail($check_status['customers_name'], $check_status['customers_email_address'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1. (int)$oID . EMAIL_TEXT_SUBJECT_2 . $orders_status_array[$status], $email, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);
}

	   $customer_notified = '1';
	  tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, customer_surveyed) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "', '" .  tep_db_input($customer_surveyed) . "')");

I hope it helps.

Share this post


Link to post
Share on other sites
There may be a couple of problems why you're not getting a link in the email. First of all make sure that you modified your admin/includes/languages/english/orders.php and added all the required definitions especially "define('SURVEY_LOCATION', HTTP_SERVER . DIR_WS_CATALOG . 'survey.php?')"; this is what definies the path to your survey.php page. Also, make sure the path is correctly set in your admin/configure.php where HTTP_SERVER is your full http:// address (ex.: http://mystore.com) and DIR_WS_CATALOG should be '/'.

 

Also, make sure that you modified your admin/orders.php according to the install instructions. There is a part that is required in order to get the survey text and link added to the email sent to the customer:

$survey_email = EMAIL_SEPARATOR . "\n" . SURVEY_COMMENT2 . "\n\n" . '<a href="' . SURVEY_LOCATION . '&email=' . $check_status['customers_email_address'] . '&order_num=' . $oID . '">' . SURVEY_TEXT_LINK . '</a>' . "\n\n" . EMAIL_SEPARATOR . "\n\n";

and you also must add previously defined $survey_email to the $email part which constructs the actual email. Below is how I modified my code in admin/orders to include the Survey modifications. I changed the original code a little bit to suit my needs (don't copy it because mine might be absolutely different from yours). The idea is that if only 'Just Email Survey (no comments)' box is checked, there is one email sent, otherwise the regular email sent.

 

$order_updated = false;
	$check_status_query = tep_db_query("select customers_name, customers_email_address, orders_status, date_purchased from " . TABLE_ORDERS . " where orders_id = '" . (int)$oID . "'");
	$check_status = tep_db_fetch_array($check_status_query);
/* Survey*/
	if ( ($check_status['orders_status'] != $status) || tep_not_null($comments) || ($HTTP_POST_VARS['notify_survey'] == 'on') || ($HTTP_POST_VARS['notify_just_survey'] == 'on')) {
	  tep_db_query("update " . TABLE_ORDERS . " set orders_status = '" . tep_db_input($status) . "', last_modified = date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR) where orders_id = '" . (int)$oID . "'");

	  if (($HTTP_POST_VARS['notify_survey'] == 'on') || ($HTTP_POST_VARS['notify_just_survey'] == 'on')) {  // Survey
	  tep_db_query("update " . TABLE_ORDERS . " set order_surveyed = '1', last_modified = date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR) where orders_id = '" . (int)$oID . "'");  }

	  $customer_notified = '0';
	  if ($HTTP_POST_VARS['notify'] == 'on') {
		$notify_comments = '';

		 if ($HTTP_POST_VARS['notify_survey'] == 'on') {  //Survey
		  $survey_email = SURVEY_COMMENT2 . "\n\n<br><br>" . '<a href="' . SURVEY_LOCATION . '&email=' . $check_status['customers_email_address'] . '&order_num=' . $oID . '">' . SURVEY_TEXT_LINK . '</a>' . "\n\n<br><br>";   //Survey
		  $customer_surveyed = '1';
		}

		if ($HTTP_POST_VARS['notify_comments'] == 'on') {
		  $notify_comments = sprintf(EMAIL_TEXT_COMMENTS_UPDATE, $comments) . "\n";
		  if ($comments == null)
			$notify_comments = '';
		}

		if ($HTTP_POST_VARS['notify_just_survey'] == 'on') {   //Survey
		  $survey_email = SURVEY_COMMENT1 . "\n\n<br><br>" . '<a href="' . SURVEY_LOCATION . '&email=' . $check_status['customers_email_address'] . '&order_num=' . $oID . '">' . SURVEY_TEXT_LINK . '</a>' . "\n\n<br><br>";   //Survey
		  $customer_surveyed = '1';   //Survey

		  $email = 'Dear ' . $check_status['customers_name'] . ',' . "\n<br><br>" . EMAIL_SEPARATOR . "\n<br>" . STORE_NAME . ' ' . EMAIL_TEXT_ORDER_NUMBER . ' ' . (int)$oID . "\n<br>" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n<br>" . EMAIL_SEPARATOR . "\n\n\n<br><br>" . $survey_email . "\n\n" . EMAIL_END1;   //Survey

  tep_mail($check_status['customers_name'], $check_status['customers_email_address'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT, $email, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);

		  } else {	 //Survey

		$email = 'Dear ' . $check_status['customers_name'] . ',' . "\n<br><br>" . EMAIL_SEPARATOR . "\n<br>" . STORE_NAME . ' ' . EMAIL_TEXT_ORDER_NUMBER . ' ' . (int)$oID . "\n<br>" . EMAIL_TEXT_INVOICE_URL . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY_INFO, 'order_id=' . (int)$oID, 'SSL') . "'>" .  'order_id=' . (int)$oID . "</a>\n<br>" . EMAIL_TEXT_DATE_ORDERED . ' ' . tep_date_long($check_status['date_purchased']) . "\n<br>" . EMAIL_SEPARATOR . "\n\n\n<br><br>" . $notify_comments . sprintf(EMAIL_TEXT_STATUS_UPDATE, $orders_status_array[$status]) . "\n<br>" . $survey_email . EMAIL_END . "\n<br><br>" . EMAIL_TEXT_ORDER_STATUS . ' ' . "<a HREF='" . tep_catalog_href_link(FILENAME_CATALOG_ACCOUNT_HISTORY, 'order_id=' . $oID, 'SSL') . "'>" . (EMAIL_TEXT_ORDER_STATUS_LINK) . "</a> \n\n<br>";

	   tep_mail($check_status['customers_name'], $check_status['customers_email_address'], STORE_NAME . ' ' . EMAIL_TEXT_SUBJECT_1. (int)$oID . EMAIL_TEXT_SUBJECT_2 . $orders_status_array[$status], $email, STORE_NAME, STORE_OWNER_EMAIL_ADDRESS);
}

	   $customer_notified = '1';
	  tep_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments, customer_surveyed) values ('" . (int)$oID . "', '" . tep_db_input($status) . "', date_add(now(), INTERVAL " . TIME_ZONE_OFFSET . " HOUR), '" . tep_db_input($customer_notified) . "', '" . tep_db_input($comments)  . "', '" .  tep_db_input($customer_surveyed) . "')");

I hope it helps.

 

thanks for your time and effort, however I cannot figure it out. I have no coding background and it is difficult to understand what you are talking about. I usually just follow instructions and have added many contributions to my clients store, including -easy populate, header tag controller, and many more. I am a graphic designer by trade, but I have adapted to using oscommerce as a development tool. I understood the first part of your text, where it said to check my install to make sure this and that were installed properly- I used "find" in a text editor and the used a compore and merge program to double check my files with the raw ones you provided in the contribution. I dont understand the code very well, and I dont understand this line=

 

"and you also must add previously defined $survey_email to the $email part which constructs the actual email. Below is how I modified my code in admin/orders to include the Survey modifications. I changed the original code a little bit to suit my needs (don't copy it because mine might be absolutely different from yours). The idea is that if only 'Just Email Survey (no comments)' box is checked, there is one email sent, otherwise the regular email sent."

 

I am sorry if I am frustrating you! I have been working on this all day and after getting nowhere I feel pretty run down. It would be a big boost of confidence to see it working.

 

Thanks for previous reply! :]

Share this post


Link to post
Share on other sites
thanks for your time and effort, however I cannot figure it out. I have no coding background and it is difficult to understand what you are talking about. I usually just follow instructions and have added many contributions to my clients store, including -easy populate, header tag controller, and many more. I am a graphic designer by trade, but I have adapted to using oscommerce as a development tool. I understood the first part of your text, where it said to check my install to make sure this and that were installed properly- I used "find" in a text editor and the used a compore and merge program to double check my files with the raw ones you provided in the contribution. I dont understand the code very well, and I dont understand this line=

 

"and you also must add previously defined $survey_email to the $email part which constructs the actual email. Below is how I modified my code in admin/orders to include the Survey modifications. I changed the original code a little bit to suit my needs (don't copy it because mine might be absolutely different from yours). The idea is that if only 'Just Email Survey (no comments)' box is checked, there is one email sent, otherwise the regular email sent."

 

I am sorry if I am frustrating you! I have been working on this all day and after getting nowhere I feel pretty run down. It would be a big boost of confidence to see it working.

 

Thanks for previous reply! :]

All I tried to say by that is that you need to make sure you followed all the steps carefully when adding the Survey contribution, because if you missed anything it won't work properly. As an example I posted my modified code. Just like you, I added this contribution and after some difficulties I finally got it to work.

Share this post


Link to post
Share on other sites
All I tried to say by that is that you need to make sure you followed all the steps carefully when adding the Survey contribution, because if you missed anything it won't work properly. As an example I posted my modified code. Just like you, I added this contribution and after some difficulties I finally got it to work.

Tried it all over again- didnt work. triple checked everything.

 

I even used compare and merge to compare the php files provided in this contribution with my own. all were identical except for a small change adding 3 digit security code for credit cards. This was so small and only took up 3 lines. so basically this contribution doesnt work for me. My client is going with x-cart.

Share this post


Link to post
Share on other sites

I was having trouble getting the "Click here to go to survey" in the email to actually work as a link. It was appearing, but as another poster kept repeating, nothing was linking. After a little thought, I realized that under my Configuration -> Email Options -> Use MIME HTML When Sending Emails was set to FALSE. Once I changed this to true, then everything worked fine.

 

Took awhile to make this work with a tracking contribution too, but think I figured it out. Had been hoping someone would have time to write good Survey script. Thanks!!!!!

Share this post


Link to post
Share on other sites
I was having trouble getting the "Click here to go to survey" in the email to actually work as a link. It was appearing, but as another poster kept repeating, nothing was linking. After a little thought, I realized that under my Configuration -> Email Options -> Use MIME HTML When Sending Emails was set to FALSE. Once I changed this to true, then everything worked fine.

 

Took awhile to make this work with a tracking contribution too, but think I figured it out. Had been hoping someone would have time to write good Survey script. Thanks!!!!!

Thanks!- it works now. You saved me!

 

Now If I could figure out a way to email it to customers who havent ordered off the website but over the phone. Maybe someone will write a new version that does this.

Share this post


Link to post
Share on other sites

Thanks Bradon, this is a very useful contribution.

 

I've had success installing and configuring it so far; I have one tiny issue that I can't seem to weed out... the survey status icon on the orders page does not seem to be detecting $orders['order_surveyed'] value.

 

Here's the stock unchanged code (around line 500 depending on your other contributions) from admin/orders.php which performs the test:

 

<?php if ($orders['order_surveyed'] == '1') {   ?>
				<td class="main" align="center" width="3%"><?php echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10); ?></td>
<!-- BOF SURVEY -->   <?php } else { ?>
				<td class="main" align="center" width="3%"><?php echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_GREEN, 10, 10); ?></td>  <?php }  ?>  <!--  EOF SURVEY -->

 

I checked my database and can see the value of $orders['order_surveyed'] is "1" for orders which I have requested a survey and the survey is completed yet my icons are all red. I changed the code swapping the icon_status_green.gif for icon_status_red.gif and my orders.php page did respond accordingly so I know it's testing the value, there jsut sems to be something wrong with the value of =='1'.

 

I think this is something simple but can't put my finger on it, can anyone point out the obvious for me?

 

Thanks!!!!

Share this post


Link to post
Share on other sites
I get the email but there is no link in the email. I have to check the boxes like she sais in order to even get the email. I guess you could go to every order and check the boxes for each order to send an email to that person with a LINK in the email. However there is no link no matter what I do. just an email that looks like this=

 

osCommerce

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

Order Number: 55

 

We thank you for your recent order! As part of our desire to

continually improve our service we would appreciate you taking a moment to

complete our survey at the following link. Thank You!

 

Click here to go to survey

CLICK WHERE?!?!?

 

Seems like a great contribution but my client is just thinking about using X-cart. Here's why=

 

x-cart survey

 

seems alot cheaper than time=money trying to figure this out. :(

 

wish somebody had the solution

 

 

Turn on "Use MIME HTML When Sending Emails" under "E-Mail Options"

Share this post


Link to post
Share on other sites
Thanks Bradon, this is a very useful contribution.

 

I've had success installing and configuring it so far; I have one tiny issue that I can't seem to weed out... the survey status icon on the orders page does not seem to be detecting $orders['order_surveyed'] value.

 

Here's the stock unchanged code (around line 500 depending on your other contributions) from admin/orders.php which performs the test:

 

<?php if ($orders['order_surveyed'] == '1') {   ?>
				<td class="main" align="center" width="3%"><?php echo tep_image(DIR_WS_IMAGES . 'icon_status_green.gif', IMAGE_ICON_STATUS_GREEN, 10, 10); ?></td>
<!-- BOF SURVEY -->   <?php } else { ?>
				<td class="main" align="center" width="3%"><?php echo tep_image(DIR_WS_IMAGES . 'icon_status_red.gif', IMAGE_ICON_STATUS_GREEN, 10, 10); ?></td>  <?php }  ?>  <!--  EOF SURVEY -->

 

I checked my database and can see the value of $orders['order_surveyed'] is "1" for orders which I have requested a survey and the survey is completed yet my icons are all red. I changed the code swapping the icon_status_green.gif for icon_status_red.gif and my orders.php page did respond accordingly so I know it's testing the value, there jsut sems to be something wrong with the value of =='1'.

 

I think this is something simple but can't put my finger on it, can anyone point out the obvious for me?

 

Thanks!!!!

 

Check your code for this looking to make sure you have "customer_surveyed" in it. line 288 of supplied orders.php

 

$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, customer_surveyed, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_history_query)) {

while ($orders_history = tep_db_fetch_array($orders_history_query)) {

 

let me know.

Brandon

Share this post


Link to post
Share on other sites
Check your code for this looking to make sure you have "customer_surveyed" in it. line 288 of supplied orders.php

 

$orders_history_query = tep_db_query("select orders_status_id, date_added, customer_notified, customer_surveyed, comments from " . TABLE_ORDERS_STATUS_HISTORY . " where orders_id = '" . tep_db_input($oID) . "' order by date_added");

if (tep_db_num_rows($orders_history_query)) {

while ($orders_history = tep_db_fetch_array($orders_history_query)) {

 

let me know.

Brandon

 

Thanks Brandon!!! I was missing that and all the queries for "o.orders_id" on lines 384-392.Now my status shows :) My site is pretty modified now so I have to use winmerge for new contributions and avoid breaking others, I knew it was smacking me in the face.

 

<?php
if (isset($HTTP_GET_VARS['cID'])) {
  $cID = tep_db_prepare_input($HTTP_GET_VARS['cID']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.customers_id, o.order_surveyed, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.customers_id = '" . (int)$cID . "' and o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by orders_id DESC";
} elseif (isset($HTTP_GET_VARS['status'])) {
  $status = tep_db_prepare_input($HTTP_GET_VARS['status']);
  $orders_query_raw = "select o.orders_id, o.customers_name, o.order_surveyed, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by o.orders_id DESC";
} else {
  $orders_query_raw = "select o.orders_id, o.customers_name, o.order_surveyed, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and ot.class = 'ot_total' order by o.orders_id DESC";

 

This is great, thanks Brandon!!!

Share this post


Link to post
Share on other sites
Thanks!- it works now. You saved me!

 

Now If I could figure out a way to email it to customers who haven't ordered off the website but over the phone. Maybe someone will write a new version that does this.

 

 

If I'm not mistaken, there is at least one contribution already available that allows you to manually create a customer and/or an order. If you're taking orders over the phone, this is extra work for you, but it allows you to send the survey.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×