Jump to content
kymation

Request Product Reviews

Recommended Posts

$path_rel is set correctly if you are not getting any error messages when you run automatic/review_mail.php manually. From the information you gave, I don't believe that this is the problem.

 

The link to product_reviews_write.php is in the variable $link_server (see lines 57-61 of automatic/review_mail.php.) This is set by either HTTP_SERVER or HTTPS_SERVER from your catalog/includes/configure.php or catalog/includes/local/configure.php. I suspect that HTTPS_SERVER is incorrectly set. Fixing the config file settings is a pain, but you are likely to see other problems with your store if you don't get those settings right.

 

As a quick hack, you can just change line 131 to

			$products_string .= '  ' . $link_server . '/catalog/product_reviews_write.php?products_id=' . $products_array['products_id'] . "\n";

This is a poor long-term solution. It will not work if you change your store settings in the future, and will not work if you use this code on a store that is set up differently.

 

Regards

Jim

 

Jim,

 

I really appreciate the quick response!! For the time being I will implement the quick fix. As far as a long term solution, HTTP_SERVER or HTTPS_SERVER from catalog/includes/configure.php is set as seen below. What exactly is set wrong and what shouls I change it to?

 

define('HTTP_SERVER', 'http://mystore.com'); // eg, http://localhost - should not be empty for productive servers

 

define('HTTPS_SERVER', 'https://mystore.com'); // eg, https://localhost - should not be empty for productive servers

 

define('ENABLE_SSL', true); // secure webserver for checkout procedure?

 

define('HTTP_COOKIE_DOMAIN', 'mystore.com');

 

define('HTTPS_COOKIE_DOMAIN', 'mystore.com');

 

define('HTTP_COOKIE_PATH', '/catalog/');

 

define('HTTPS_COOKIE_PATH', '/catalog/');

 

define('DIR_WS_HTTP_CATALOG', '/catalog/');

 

define('DIR_WS_HTTPS_CATALOG', '/catalog/');

Share this post


Link to post
Share on other sites
Jim,

 

I really appreciate the quick response!! For the time being I will implement the quick fix. As far as a long term solution, HTTP_SERVER or HTTPS_SERVER from catalog/includes/configure.php is set as seen below. What exactly is set wrong and what shouls I change it to?

<code snipped>

Oops. I goofed. Your config is entirely correct; don't change it. Line 131 should be

			$products_string .= '  ' . $link_server . DIR_WS_HTTPS_CATALOG . '/product_reviews_write.php?products_id=' . $products_array['products_id'] . "\n";

Sorry about the error. I'll post an updated copy to the contribution page shortly.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi,

I'm using three different languages. How do I make it so that a customer who ordered from my Norwegian part of the shop also gets a review mail in Norwegian, etc?

Share this post


Link to post
Share on other sites
Hi,

I'm using three different languages. How do I make it so that a customer who ordered from my Norwegian part of the shop also gets a review mail in Norwegian, etc?

 

Jim,

 

Love the contribution. thanks for writing it! It works great...

 

I have one issue that I'm working to reproduce. When sending more than three emails, it sends blank emails to my customers for some reason. I'll get back with you as I'm able to reproduce it. I know it happened because on one day, all 4 customers that were sent emails responded to us asking why the email was blank.

 

Thanks!

 

Scott

Share this post


Link to post
Share on other sites

Chris: That will not be simple. The osCommerce database does not store the customer's language. You would need to add a field (to the orders table, perhaps) to record the language_id. That could then be used to select a template in the appropriate language. I don't have time to do this right now, so feel free to experiment if you wish.

 

Scott: That's ... very unusual. The only thing I can think of is that the script got hung up while processing an email, but that should only happen once. Four times is just too much. Please check your error logs for any errors the script may have generated. If you can get this to repeat, you might want to add some information to the email that is sent to the store owner.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Thanks for answering!

 

I think it's some very good thinking behind this script, very useful! :)

 

I don't think I have the knowledge required to make it multi-lang capable, not yet.

 

This worked the first time I tried it locally. But on my remote server I got this msg:

 

The www.domain.se review reminder script finished execution on

19 Feb 2008 16:29:28

 

0 email messages were sent.

 

But I don't know if it was a one-timer, because the ISP had some email issues today.

Share this post


Link to post
Share on other sites
Thanks for answering!

 

I think it's some very good thinking behind this script, very useful! :)

 

I don't think I have the knowledge required to make it multi-lang capable, not yet.

 

This worked the first time I tried it locally. But on my remote server I got this msg:

 

The www.domain.se review reminder script finished execution on

19 Feb 2008 16:29:28

 

0 email messages were sent.

 

But I don't know if it was a one-timer, because the ISP had some email issues today.

It could be that there were no orders in the allotted time window. This script will only send email if the order has been shipped more than the set number of days ago and is not already marked sent. The setup will mark all old orders as sent at the time you run the setup so as to not email people who ordered a long time ago. Wait until the timeout period has passed (default is 10 days) and you should start seeing some emails go out.

 

The multi-language version is on the wish list. I'll work on it when I can, but don't hold your breath.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
Scott: That's ... very unusual. The only thing I can think of is that the script got hung up while processing an email, but that should only happen once. Four times is just too much. Please check your error logs for any errors the script may have generated. If you can get this to repeat, you might want to add some information to the email that is sent to the store owner.

 

Regards

Jim

 

Jim,

 

thanks for the info. I'll check that out. I had an idea - I don't know if it is possible... to include a script where if there is more than 1 email to be sent, it delays each email by a set number of seconds. 1st email - wait 5 seconds, 2nd email - wait 5 seconds, 3rd email - wait 5 seconds, etc...

 

thanks for the great addon Jim.

 

Scott

Share this post


Link to post
Share on other sites
Jim,

 

thanks for the info. I'll check that out. I had an idea - I don't know if it is possible... to include a script where if there is more than 1 email to be sent, it delays each email by a set number of seconds. 1st email - wait 5 seconds, 2nd email - wait 5 seconds, 3rd email - wait 5 seconds, etc...

 

thanks for the great addon Jim.

 

Scott

You can use sleep() to delay a given number of seconds. I don't know if that would do any good, but you could certainly try it. Keep in mind that the entire script has to complete within a certain time (usually set to 30 seconds) or the server will kill it. If you get too many emails this could be a problem.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi,

 

great marketing tool.

one problem, when i run it manualy everything is OK, when i do it through a cronjob the email is blanc.

 

iv'e tried many things but nothing works >_<

 

anyone the same problem with a solution?

 

kind regards.

Jan


Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites

:-" This contribution is not working if you have downloads controller installed. ( and nicely installed)

I have make many try since yesterday and nothing can be set.. I have always the same error <_<

 

#!/usr/local/bin/php 
Warning: main(includes/functions/downloads_controller.php) [function.main]: failed to open stream: No such file or directory in /home/WwwBSD/*****/DSPH/includes/functions/general.php on line 1622

Warning: main(includes/functions/downloads_controller.php) [function.main]: failed to open stream: No such file or directory in /home/WwwBSD/*****/DSPH/includes/functions/general.php on line 1622

Fatal error: main() [function.require]: Failed opening required 'includes/functions/downloads_controller.php' (include_path='.:/usr/share/pear') in /home/WwwBSD/*****/DSPH/includes/functions/general.php on line 1622

 

 

When i chek the line 1622 on thee general.php i see :

// BOF: WebMakers.com Added: Downloads Controller
require(DIR_WS_FUNCTIONS . 'downloads_controller.php');
// EOF: WebMakers.com Added: Downloads Controller

 

and when i look the file downloads_controller.php i have :

<?php
/*

 WebMakers.com Added: Downloads Controller Functions
 NOTE: Some function may already exist in other Add-Ons I have created.

*/
?>
<?php

////
// BOF: WebMakers.com Added: configuration key value lookup
 function tep_get_configuration_key_value($lookup) {
$configuration_query_raw= tep_db_query("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key='" . $lookup . "'");
$configuration_query= tep_db_fetch_array($configuration_query_raw);
$lookup_value= $configuration_query['configuration_value'];
return $lookup_value;
 }
// EOF: WebMakers.com Added: configuration key value lookup

?>

xavier

Edited by xavkick

Share this post


Link to post
Share on other sites

Ok but i don't use downloads controller and i have the same problem :blink:


Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites
Ok but i don't use downloads controller and i have the same problem :blink:

 

On my web site, when I comment this line( in the general.php) the contrib work well .

Share this post


Link to post
Share on other sites

sorry, i misunderstand you.

i try it out

 

i only have 1337 lines in my general.php

Edited by jan64

Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites
sorry, i misunderstand you.

i try it out

 

witch line exacly?


Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites
this line

 

require(DIR_WS_FUNCTIONS . 'downloads_controller.php');

 

this must be a contribution, because i don't have that line in includes/functions/general.php


Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites
this must be a contribution, because i don't have that line in includes/functions/general.php

 

 

yes i know it s a contribution called downloads_controller but i still don't know why this contribution put request review in error.

 

Can you write me your message error please and the line in error

Edited by xavkick

Share this post


Link to post
Share on other sites

Thats the strange thing, there are no errors.

 

when it's a cronjob i get one email with txt:

The review reminder script finished execution on

20 Feb 2008 16:11:01

 

1 email messages were sent.

 

thats OK, but there is no txt in the customers email.

 

no error log file's, everything is fine except the missing txt.

 

But when i paste the url manually in my browser, than is there the txt in the customers email :o


Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites

I'm seeing two separate issues here:

 

The Downloads Controller is causing problems with this contribution. I'm not familiar with the Downloads Controller, but the code posted here doesn't appear to be anything that would cause a problem. I can think of two possible solutions, and I would like for those of you seeing this problem to try them out.

 

1. Cut the following code from catalog/includes/functions/general.php

// BOF: WebMakers.com Added: Downloads Controller
require(DIR_WS_FUNCTIONS . 'downloads_controller.php');
// EOF: WebMakers.com Added: Downloads Controller

Then find the following code in catalog/includes/application_top.php

// define general functions used application-wide
 require(DIR_WS_FUNCTIONS . 'general.php');

and paste the code you removed from general.php just below that code. Run review_mail.php manually and see if it now works.

 

2. If that doesn't work, remove the code in the first block above and copy the code from catalog/includes/functions/downloads_controller.php and paste it into the bottom of catalog/includes/functions/general.php, just before the last ?>. Now run review_mail.php manually and see if it now works.

 

The second issue is sending blank emails to customers when run as a CRON job. I'm still a bit puzzled by this one as well. Here's some test code that may help find the problem. Find the following at line 101 of review_mail.php:

	$orders_count = 0;
while ($orders_array = tep_db_fetch_array ($orders_query) ) { // Step through the orders

and add just before those lines

	$message_test = '';

Now find the following at Line 166:

		// Send email message
	tep_mail ($customers_name, $customers_email_address, $subject, $message, STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS);

Add the following just after those lines:

		$message_test .= "\n" . '----------------------------------------------------------------------' . "\n" . 
					 $customers_name . "\n" . 
					 $customers_email_address . "\n" . 
					 $subject . "\n" . 
					 $message . "\n\n";

Now find the following at Line 183:

// Email the admin when the script has run
 if ($send_notification) {

and add the following just after those lines:

	$notice_message .= $message_test;

That will send a copy of the customer emails to the Admin when the script runs. Please let us know what you get when this runs.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites

Hi Jim,

 

thanks for your help.

 

I have made the changes and this are the results.

 

i got an email with suburb: review email run

and txt:

 

The review reminder script finished execution on

20 Feb 2008 21:10:01

 

 

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

jan swart

xxxxxx@xxxxxxx.nl

Your recent TEST SHOP order

 

 

 

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

jan swart

xxxxxx@xxxxxxx.nl

Your recent TEST SHOP order

 

 

2 email messages were sent.

 

thats all, the mail to the customer was totaly empty


Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites
Hi Jim,

 

<snipped>

thats all, the mail to the customer was totaly empty

That tells me there could be a problem with the data from the template. This could be a permissions issue, if CRON is operating under tighter restrictions than the web server. What do you have the file permissions set to? If they are not already, try setting the permissions on review_mail.php, review_mail.tpl, and the automatic folder to 777.

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

Share this post


Link to post
Share on other sites
That tells me there could be a problem with the data from the template. This could be a permissions issue, if CRON is operating under tighter restrictions than the web server. What do you have the file permissions set to? If they are not already, try setting the permissions on review_mail.php, review_mail.tpl, and the automatic folder to 777.

 

Regards

Jim

 

it makes no difference with this permissions

Edited by jan64

Dreams can come true, if you help them a littlebit

Share this post


Link to post
Share on other sites
it makes no difference with this permissions

One more possibility down. Let's take a look at the data from the template. Find this code that we added on line 185:

	$notice_message .= $message_test;

and add this line just after it:

	$notice_message .= "\n" . '----------------------------------------------------------------------' . "\n" . 
$notice_message .= $file_string;
$notice_message .= "\n" . '----------------------------------------------------------------------' . "\n" . 
$notice_message .= $message;
$notice_message .= "\n" . '----------------------------------------------------------------------' . "\n" .

 

Regards

Jim


See my profile for a list of my addons and ways to get support.

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

×