DragonflyCMS Projects > Storez > [done] Add user email address to receipt > Community Forums > Phoenix Netology
Forum Index > eCommerce > Storez

[done] Add user email address to receipt Reply to topic


The Admin could find user email useful, and it is at least as meaningful as user_id.

modules/Storez/mail/receipts.php around line 113:

if ($orderInfo['userType'] == 'user') {

// layingback - add email - start

$result = $db->sql_query("select user_id, username, email from ".$prefix."_cart_users

WHERE user_id='$orderInfo[userID]'");

list($user_id, $username, $email) = $db->sql_fetchrow($result);

$mailMessage .= _STOREZ_RECEIPTS_USERTYPE.": User\n";

$mailMessage .= _STOREZ_RECEIPTS_USERNAME.": $username [$user_id] [$email]\n\n";

// layingback - add email - end

Initiated by Bugger (Original Entry) - Comments Here Please.

Please enter your server specs in your user profile! 😢


This works better since guest email is usually collected. $result = $db->sql_query("SELECT user_id, username, email FROM {$prefix}_cart_users WHERE user_id='$orderInfo[userID]'"); list($user_id, $username, $email) = $db->sql_fetchrow($result); if ($orderInfo['userType'] == 'user') { $mailMessage .= _STOREZ_RECEIPTS_USERTYPE.": User\n"; $mailMessage .= _STOREZ_RECEIPTS_USERNAME.": $username [$user_id]\n"; $mailMessage .= _STOREZ_RECEIPTS_USEREMAIL.": $email\n\n"; } elseif ($orderInfo['userType'] == 'guest') { $mailMessage .= _STOREZ_RECEIPTS_USERTYPE.": Guest\n\n"; $mailMessage .= _STOREZ_RECEIPTS_USEREMAIL.": $email\n\n"; }

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):

All times are Australia/Adelaide


Jump to: