13. Check your supplier e-mail for the e-mail requesting the shipment of the goods (see Figure 19-3).
Figure 19-3. An e-mail requesting the shipment of goods
14. Continue processing in the administration order details page by clicking Process Order and calling the
Process() method of the OrderProcessor class for the third and last time.
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 607
15. Check your e-mail for the shipping confirmation message (see Figure 19-4).
Figure 19-4. Customer shipping notification e-mail (dispatched.tif)
16. Examine the new audit entries for the order; audit entries are shown in Figure 19-5.
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 608
Figure 19-5. Audit entries for completed order
How It Works: The Order Pipeline
We??™ve covered how the order pipeline works, so now we need to explain only the new code added to
OrderProcessor. We changed the code in the _GetCurrentPipelineSection() method, which is
responsible for selecting the pipeline section that needs to be executed.
The change is simply a switch block that assigns a pipeline section to the $_mCurrentPipelineSection member:
// Gets current pipeline section
private function _GetCurrentPipelineSection()
{
switch($this->mOrderInfo['status'])
{
case 0:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsInitialNotification();
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 609
break;
case 1:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsCheckFunds();
break;
case 2:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsCheckStock();
break;
case 3:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsStockOk();
break;
case 4:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsTakePayment();
break;
case 5:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsShipGoods();
break;
case 6:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsShipOk();
break;
case 7:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsFinalNotification();
break;
case 8:
$this->_mOrderProcessStage = 100;
throw new Exception('Order already been completed.
Pages:
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725