The "Transaction Summary" email that gets sent to the site admin contains sections to display Shipping and Billing addresses, however the address variables that populate those sections don't actually contain any data.

The code is located in /ecommerce/store/store.module

Line 132    $shipping_to = store_format_address($data, 'shipping', 'text');
Line 133    $billing_to = store_format_address($data, 'billing', 'text');

The reason for this appears to be that there is no mention of an SQL query to pull in data from the {ec_transaction_address} table within the entire store_cron() function.

My temporary fix was to swipe the following code from the store_transaction_load() function, modify variable names, and place it above the two lines mentioned above:

// Load Addressess
$addr_result = db_query('SELECT sta.* FROM {ec_transaction_address} sta WHERE sta.txnid = %d', $data->txnid);
while ($misc = db_fetch_object($addr_result)) {
  $data->address[$misc->type] = $misc;
}

If there's a better fix for this, please let us know.

Comments

budda’s picture

Status: Needs review » Reviewed & tested by the community

I too just noticed this bug.

Your fix worked a treat. It could probably be done neater with a table join. But then a lot of the ecommerce system could probably be done neater in the long run!

This is a suitable short term fix for me - and probably others who have noticed this error in ecommerce 3.4