Prev | Current Page 704 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

', 20200);
Mail is sent in a similar way to PsInitialNotification, using a private method to build
the body:
// Send mail to supplier
$processor->MailSupplier(STORE_NAME . ' stock check.',
$this->GetMailBody());
As before, we finish by auditing and updating the status, although this time, we don??™t tell
the order processor to continue straight away:
// Audit
$processor->CreateAudit('Notification email sent to supplier.', 20202);
// Update order status
$processor->UpdateOrderStatus(3);
// Audit
$processor->CreateAudit('PsCheckStock finished.', 20201);
}
The code for building the message body is simple; it just lists the items in the order and
tells the supplier to confirm via the TShirtShop web site (using the order administration page,
which we??™ll modify later):
private function GetMailBody()
{
$body = 'The following goods have been ordered:';
$body .= "\n\n";
$body .= $this->_mProcessor->GetOrderAsString(false);
$body .= "\n\n";
$body .= 'Please check availability and confirm via ' .
Link::ToAdmin();
$body .= "\n\n";
$body .= 'Order reference number: ';
$body .= $this->_mProcessor->mOrderInfo['order_id'];
return $body;
}
}
?>
CHAPTER 19 ?–  IMPLEMENTING THE ORDER PIPELINE: PART 2 597
When this pipeline stage finishes, processing pauses. Later, when the supplier confirms
that stock is available, processing moves on to PsStockOk.


Pages:
692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716
www.books61.hobbitstory.com tanie noclegi międzyzdroje pokoje windsurfing Władysławowo noclegi e-lady