Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Review Reminder Email

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #31  
Old 02-21-2013, 06:57 AM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: Review Reminder Email

Hi Karina,

I've checked the functions that you identified in post #27 and in both the $sql_tbl array has been defined.

I've also added the require get_language.php mod that you have prescribed and still get the SQL error if the interval is set for 9 days, but I know this change was required for the subject line fault, which I had noticed in customers' emails that had been rejected by their mail service and bounced back to me.

Just an observation: Running send_review_reminders.php with the above mod found 487 emails to send that were not found yesterday!! Would you have expected this or should I take a closer look at my SQL problem?
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote
  #32  
Old 02-21-2013, 07:21 AM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: Review Reminder Email

Here is an example of what the subject line looks like thanks to a customer using a waitlist:


Quote:
Dear sender,

Yourmessage "=?UTF-8?B?RGVhciBLYXRoZXJpbmUsIHlvdXIgb3BpbmlvbiBtYXR0ZX JzIHRvIERhbmNlbWFuaWEgRGFuY2V3ZWFy?="to me was waitlisted.

Get your message to my inbox by clicking the following link.



This was generated after I had included the above mod.
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote
  #33  
Old 02-21-2013, 07:54 AM
  karina's Avatar 
karina karina is offline
 

X-Cart team
  
Join Date: Jul 2009
Posts: 123
 

Default Re: Review Reminder Email

Quote:
Originally Posted by DavyMac
Hi Karina,

I've checked the functions that you identified in post #27 and in both the $sql_tbl array has been defined.

I've also added the require get_language.php mod that you have prescribed and still get the SQL error if the interval is set for 9 days, but I know this change was required for the subject line fault, which I had noticed in customers' emails that had been rejected by their mail service and bounced back to me.


Below is investigation about possible reason of SQL error.

1. The mentioned SQL-error is from include/func/func.order.php, 3144:
SQL query : SELECT product, descr, fulldescr FROM WHERE productid = '2404' LIMIT 1

/home/xxx/public_html/include/func/func.order.php:3144

Let's have a look at this line of code:
PHP Code:
$local func_query_first("SELECT product, descr, fulldescr FROM {$sql_tbl['products_lng_' $code]} WHERE productid = '$pid'"); 

This is the 'func_translate_products()' function. It's used for every type of emails to customer in X-Cart.

2. From SQL error we can make a conclusion that '$sql_tbl['products_lng_' . $code]' is not set. It means that $code contains some language code that is not presented in the store.

The $code is taken from 'language' column of 'xcart_orders' table.

So the possible reason is: there are some orders with language that don't have assosiated tables in database. But I cannot say exactly why. May be there was some language and later it was removed?

Check your 'xcart_orders' table with MySQL query:
Code:
select distinct(language) from xcart_orders;
And check that tables for these languages are presented:
Code:
show tables like 'xcart_products_lng_%' ;


Quote:
Originally Posted by DavyMac
Just an observation: Running send_review_reminders.php with the above mod found 487 emails to send that were not found yesterday!! Would you have expected this or should I take a closer look at my SQL problem?

I'm not sure that SQL-error and number of emails are connected.

It can be caused by the limitation in the 'send_review_reminders.php':
PHP Code:
define('ORDERS_PER_LAUNCH'500);   // How much orders should be handled by script per launch. 
It means that only 500 orders will be checked by script per launch. This limitation was added to prevent high loading. Do not worry, all emails will be sent to completed orders gradually.
__________________
Karina Lipnyagova

The "Advanced Customer Reviews", "Root Categories" and "Pop-up Anywhere" author
Reply With Quote

The following user thanks karina for this useful post:
DavyMac (02-21-2013)
  #34  
Old 02-21-2013, 09:26 AM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: Review Reminder Email

Hi Karina, I think you've solved my problem

The xcart_orders table had a mix of languages, 'en' and 'US' - and for us the correct language is 'en', for which we have products_lng_en table but we don't have a 'products_lng_US table.

Clearly the mix-up occurred during database upgrade and syncing because new orders since going live have language = 'en'.

It all makes perfect sense, because when I set the delay period to 3 days I set the first order number to be since the upgraded site went live, so language would have been 'en' and no SQL error raised. So you are right that 9 days or 3 days made no difference. When I used 9 days I set first order to be from the "old" site.

I shall update the xcart_orders table to set all orders to 'en' and report back. At the risk of being premature - thank you very much

I hear what you say about only 500 orders being checked at a time - that's good.
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote
  #35  
Old 02-21-2013, 12:41 PM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: Review Reminder Email

Karina,

Updating my xcart_orders.language column has fixed my SQL error. Thank you.

But, I'm still not seeing a sensible subject line in the outgoing email reminder, I'm seeing things like:

Subject:=?UTF-8?B?RGVhciBUcmFjeSwgeW91ciBvcGluaW9uIG1hdHRlcnMgdG 8gRGFuY2VtYW5pYSBEYW5jZXdlYXI=?=
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote
  #36  
Old 02-22-2013, 03:42 AM
  karina's Avatar 
karina karina is offline
 

X-Cart team
  
Join Date: Jul 2009
Posts: 123
 

Default Re: Review Reminder Email

Quote:
Originally Posted by DavyMac
Karina,

Updating my xcart_orders.language column has fixed my SQL error. Thank you.

But, I'm still not seeing a sensible subject line in the outgoing email reminder, I'm seeing things like:

Subject:=?UTF-8?B?RGVhciBUcmFjeSwgeW91ciBvcGluaW9uIG1hdHRlcnMgdG 8gRGFuY2VtYW5pYSBEYW5jZXdlYXI=?=

Please check your file 'modules/Advanced_Customer_Reviews/func.php'. There is the function func_acr_send_review_reminder(). Two global variables are responsible for right encoding, $to_customer and $all_languages. These variables should be presented in the function. Please, check if they are there.

The code is below:
PHP Code:
function func_acr_send_review_reminder($userinfo$products$test_email '') {
    global 
$sql_tbl$config$mail_smarty$to_customer$all_languages;

    if (
        (!isset(
$products) || !is_array($products)) 

Let me know about results.
__________________
Karina Lipnyagova

The "Advanced Customer Reviews", "Root Categories" and "Pop-up Anywhere" author
Reply With Quote
  #37  
Old 02-22-2013, 04:01 AM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: Review Reminder Email

Hi Karina,

No, they are both abscent: $to_customer, $all_languages are not declared as global.
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote
  #38  
Old 02-22-2013, 05:04 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default Re: Review Reminder Email

Quote:
Originally Posted by karina
These variables should be presented in the function. Please, check if they are there.

The code is below:
PHP Code:
function func_acr_send_review_reminder($userinfo$products$test_email '') {
    global 
$sql_tbl$config$mail_smarty$to_customer$all_languages;

    if (
        (!isset(
$products) || !is_array($products)) 

Let me know about results.

Karina,

FYI, this is absent from my installation as well.
My ACR came with 4.5.4 gold plus distribution.
I can confirm that the file that came in 4.5.4 goldplus, looks like this:

line 467
PHP Code:
function func_acr_send_review_reminder($userinfo$products$test_email '') {
    global 
$sql_tbl$config$mail_smarty

But I don't think I am having the same problem. At least my customers have not said anything and I am sending many review reminders daily. I don't recall seeing this issue during testing.

???
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #39  
Old 02-25-2013, 10:15 AM
 
DavyMac DavyMac is offline
 

eXpert
  
Join Date: Apr 2007
Location: Poole, UK
Posts: 333
 

Default Re: Review Reminder Email

Karina,

I added $to_customer and $all_languages to the Global declarations and the subject line is still not correct.

Interestingly, when in Test Mode the subject is correct.
__________________
X-Cart GOLD Plus v4.5.4
CDSEO Pro
ewdhosting Dedicated Server
Dedicated SSL
Stone Edge OM
Reply With Quote
  #40  
Old 02-26-2013, 05:04 AM
  karina's Avatar 
karina karina is offline
 

X-Cart team
  
Join Date: Jul 2009
Posts: 123
 

Default Re: Review Reminder Email

To summarize up:
=================
"How to fix wrong encoding in review reminder email?"

1. Open your '<xcart_dir>/send_review_reminders.php' file and found this part of code:

PHP Code:
define('SKIP_CHECK_REQUIREMENTS.PHP'true);

require 
'./init.php'
 
$argv $_SERVER['argv']; 

and replace it with:
PHP Code:
define('SKIP_CHECK_REQUIREMENTS.PHP'true);

require 
'./init.php'
require 
'./include/get_language.php';
 
$argv $_SERVER['argv']; 

2. Open your '<xcart_dir>/modules/Advanced_Customer_Reviews/func.php' file and found this part of code:
PHP Code:
function func_acr_send_review_reminder($userinfo$products$test_email '') {
    global 
$sql_tbl$config$mail_smarty;

    if (
        (!isset(
$products) || !is_array($products)) 

and replace it with:
PHP Code:
function func_acr_send_review_reminder($userinfo$products$test_email '') {
     global 
$sql_tbl$config$mail_smarty$all_languages$to_customer;
 
     if (
         (!isset(
$products) || !is_array($products)) 


3. In the '<xcart_dir>/modules/Advanced_Customer_Reviews/func.php' file found this part of code:
PHP Code:
$result func_send_mail($email'mail/acr_review_reminder_subj.tpl''mail/acr_review_reminder.tpl'$config['Company']['site_administrator'], true); 

and replace it with:
PHP Code:
$result func_send_mail($email,  'mail/acr_review_reminder_subj.tpl''mail/acr_review_reminder.tpl',  $config['Company']['site_administrator'], false); 

=================
__________________
Karina Lipnyagova

The "Advanced Customer Reviews", "Root Categories" and "Pop-up Anywhere" author
Reply With Quote

The following user thanks karina for this useful post:
carpeperdiem (05-23-2013)
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 08:25 AM.

   

 
X-Cart forums © 2001-2020