Messages not sent

Permalink Browser Info Environment
One of our clients was having an issue where the special instructions were not being sent. Looking at the error logs on the server, it pointed me to the follow section in
packages/core_commerce_special_instructions/models/special_instructions.php
around line 61

$mh->to($order->getOrderEmail(), $ui->getAttribute('billing_first_name') . ' ' . $ui->getAttribute('billing_last_name')); // get order email to information


if $ui is not passed in for whatever reason, the email will not be sent. I changed this to

if (is_object($ui)) {
    $mh->to($order->getOrderEmail(), $ui->getAttribute('billing_first_name') . ' ' . $ui->getAttribute('billing_last_name')); // get order email to information
} else {
    $mh->to($order->getOrderEmail());
}


which seems to have solved the problem. I'm not sure if the c5 ecommerce module changed the way it fires the Event recently, but if the user was not signed in, then the $ui variable was not an object.

Just thought I would share this in case anyone else runs into this as well.

Type: Discussion
Status: New
triplei
View Replies:
aghouseh replied on at Permalink Reply
aghouseh
Ahh nice find. I guess the presumption was that the user would always be logged in to purchase something, but I suppose that's not the case. Thanks for the heads up! I'll update as soon as I get a free moment.

Thanks!
Andrew

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.