Prev | Current Page 715 | Next

Emilian Balanescu and Cristian Darie

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

php by
removing the code that redirects to PayPal and replacing it with the highlighted code:
// Create the order and get the order ID
$order_id = ShoppingCart::CreateOrder(
$this->mCustomerData['customer_id'],
(int)$_POST['shipping'], $tax_id);
// On success head to an order successful page
$redirect_to = Link::ToOrderDone();
CHAPTER 19 ?–  IMPLEMENTING THE ORDER PIPELINE: PART 2 611
// Create new OrderProcessor instance
$processor = new OrderProcessor($order_id);
try
{
$processor->Process();
}
catch (Exception $e)
{
// If an error occurs, head to an error page
$redirect_to = Link::ToOrderError();
}
// Redirection to the order processing result page
header('Location: ' . $redirect_to);
exit();
}
...
2. Create a new file named order_done.tpl in the presentation/templates folder, and add the following
code to its body:
{* order_done.tpl *}

Thank you for your order!



A confirmation of your order will be sent to your registered email address.


3. If an error occurs when ordering, we need to redirect the customer to another page. Create presentation/
templates/order_error.tpl with the following in it:
{* order_error.tpl *}

An error has occurred during the processing of your order.



If you have an inquiry regarding this message please email
703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727

Kąty Rybackie noclegi trener nlp ceny żywca leczenie alkoholizmu Kołobrzeg