I think you have modified core file app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php
Please check showCustomerInfo() function near line 130. It should be:
public function showCustomerInfo()
{
$adapter = $this->getConnection();
$customer = Mage::getModel('customer/customer');
$firstname = $customer->getAttribute('firstname');
$lastname = $customer->getAttribute('lastname');
$this->getSelect()
->joinLeft(
array('customer_lastname_table'=>$lastname->getBackend()->getTable()),
$adapter->quoteInto('customer_lastname_table.entity_id=main_table.customer_id
AND customer_lastname_table.attribute_id = ?', (int)$lastname->getAttributeId()),
array('customer_lastname'=>'value')
)
->joinLeft(
array('customer_firstname_table'=>$firstname->getBackend()->getTable()),
$adapter->quoteInto('customer_firstname_table.entity_id=main_table.customer_id
AND customer_firstname_table.attribute_id = ?', (int)$firstname->getAttributeId()),
array('customer_firstname'=>'value')
);
return $this;
}
Why I think so?
Your error log show what no any 3rd party extensions or Mage/local files are involved.
Standard SQL query for this Magento action don't have 'main_table.data, main_table.lifetime, main_table.expire, main_table.priority,' part.
You have a comma spare in your $orderQuery
just before the closing )
:
...
`shipping_address_country_id`,
)
VALUES (:order_id, :order_number, ....
Than one comma needs to be removed:
$orderQuery = "insert into `neonandmore_timeclock`.`nam_orders` (
`order_id` ,
`order_number` ,
`order_type` ,
`customer_id` ,
`sugarcrm_qms_id` ,
`date_created` ,
`date_modified` ,
`order_status` ,
`total_item_count` ,
`order_shipping_price` ,
`order_tax_price` ,
`order_items_price` ,
`order_grand_total_price` ,
`order_shipping_tracking` ,
`order_shipping_ship_date` ,
`order_notes`,
`billing_address_firstname`,
`billing_address_lastname`,
`billing_address_telephone`,
`billing_address_email`,
`billing_address_street`,
`billing_address_city`,
`billing_address_region`,
`billing_address_postcode`,
`billing_address_country_id`,
`shipping_address_firstname`,
`shipping_address_lastname`,
`shipping_address_telephone`,
`shipping_address_email`,
`shipping_address_street`,
`shipping_address_city`,
`shipping_address_region`,
`shipping_address_postcode`,
`shipping_address_country_id`
)
VALUES (:order_id, :order_number, :order_type, :customer_id, :sugarcrm_qms_id, :date_created, :date_modified, :order_status, :total_item_count, :order_shipping_price, :order_tax_price, :order_items_price, :order_grand_total_price, :order_shipping_tracking, :order_shipping_ship_date, :order_notes, :billing_address_firstname, :billing_address_lastname, :billing_address_telephone, :billing_address_email, :billing_address_street, :billing_address_city, :billing_address_region, :billing_address_postcode, :billing_address_country_id, :shipping_address_firstname, :shipping_address_lastname, :shipping_address_telephone, :shipping_address_email, :shipping_address_street, :shipping_address_city, :shipping_address_region, :shipping_address_postcode, :shipping_address_country_id)";
Best Answer
The following should give you the values for the attributes description and url key plus the categories for each product attached to an order.
Note it does assume that attribute_id 72 is the description and attribute_id 98 is the url_key which is the case for the default attributes