',
20402);
// Update order status
$processor->UpdateOrderStatus(5);
// Continue processing
$processor->mContinueNow = true;
// Audit
$processor->CreateAudit('PsTakePayment finished.', 20401);
}
}
?>
When this pipeline stage finishes, processing moves straight on to PsShipGoods.
PsShipGoods
This pipeline section is remarkably similar to PsCheckStock, as it sends an e-mail to the supplier
and stops the pipeline until the supplier has confirmed that stock has shipped. This time,
however, we do need customer information, because the supplier needs to know where to
ship the order! Add the following code to a new file in the business folder named
ps_ship_goods.php:
class PsShipGoods implements IPipelineSection
{
private $_mProcessor;
public function Process($processor)
{
// Set processor reference
$this->_mProcessor = $processor;
// Audit
$processor->CreateAudit('PsShipGoods started.', 20500);
// Send mail to supplier
$processor->MailSupplier(STORE_NAME . ' ship goods.',
$this->GetMailBody());
// Audit
$processor->CreateAudit('Ship goods e-mail sent to supplier.', 20502);
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 599
// Update order status
$processor->UpdateOrderStatus(6);
// Audit
$processor->CreateAudit('PsShipGoods finished.', 20501);
}
As before, a private method called GetMailBody() is used to build the message body for
the e-mail sent to the supplier:
private function GetMailBody()
{
$body = 'Payment has been received for the following goods:';
$body.
Pages:
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718