'ps_stock_ok.php';
require_once BUSINESS_DIR . 'ps_take_payment.php';
require_once BUSINESS_DIR . 'ps_ship_goods.php';
require_once BUSINESS_DIR . 'ps_ship_ok.php';
require_once BUSINESS_DIR . 'ps_final_notification.php';
3. Now, add the highlighted lines in the index.php file:
require_once BUSINESS_DIR . 'customer.php';
require_once BUSINESS_DIR . 'orders.php';
require_once BUSINESS_DIR . 'i_pipeline_section.php';
require_once BUSINESS_DIR . 'order_processor.php';
require_once BUSINESS_DIR . 'ps_initial_notification.php';
require_once BUSINESS_DIR . 'ps_check_funds.php';
require_once BUSINESS_DIR . 'ps_check_stock.php';
4. Modify the code of the _GetCurrentPipelineSection() method in OrderProcessor (inside business/
order_processor.php) as follows:
// Gets current pipeline section
private function _GetCurrentPipelineSection()
{
switch($this->mOrderInfo['status'])
{
case 0:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsInitialNotification();
break;
case 1:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsCheckFunds();
break;
case 2:
$this->_mOrderProcessStage = $this->mOrderInfo['status'];
$this->_mCurrentPipelineSection = new PsCheckStock();
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 603
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:
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722