View Single Post
  #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