'The following products have been shipped:';
$body .= "\n\n";
$body .= $this->_mProcessor->GetOrderAsString(false);
$body .= "\n\n";
$body .= 'Your order has been shipped to:';
$body .= "\n\n";
$body .= $this->_mProcessor->GetCustomerAddressAsString();
$body .= "\n\n";
$body .= 'Order reference number: ';
$body .= $this->_mProcessor->mOrderInfo['order_id'];
$body .= "\n\n";
$body .= 'Thank you for shopping at ' . STORE_NAME . '!';
return $body;
}
}
?>
When this pipeline section finishes, the order status is changed to 8, which represents
a completed order. Further attempts to process the order using OrderProcessor will result in
an exception being thrown.
Testing the Pipeline
Now, let??™s do a simple test to make sure the code we just wrote is working as expected.
CHAPTER 19 ?– IMPLEMENTING THE ORDER PIPELINE: PART 2 602
Exercise: Testing the Pipeline
1. First, add the STORE_NAME constant to the include/config.php file:
// Store name
define('STORE_NAME', 'TShirtShop');
2. Add the following highlighted lines in the admin.php file (also feel free to remove the reference to
ps_dummy.php, which is no longer required).
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';
require_once BUSINESS_DIR .
Pages:
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721