Prev | Current Page 548 | Next

Emilian Balanescu and Cristian Darie

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


'&cancel_return=' . PAYPAL_CANCEL_RETURN_URL;
// Redirection to the payment page
header('Location: ' . $redirect);
exit();
}
// Get shopping cart products
$this->mCartProducts =
ShoppingCart::GetCartProducts(GET_CART_PRODUCTS);
CHAPTER 14 ?–  ACCEPTING CUSTOMER ORDERS 441
6. Your Place Order button is fully functional! Test it by adding some products to your cart and clicking Place
Order. Your shopping cart should be cleared, and you should be forwarded to a PayPal payment page like the
one shown in Figure 14-4.
Figure 14-4. The PayPal payment page
How It Works: Placing Orders
When a visitor clicks the Place Order button, two important actions happen. First, the order is created in the database
by calling the CreateOrder method of the ShoppingCart class. This function calls the shopping_cart_create_
order database stored procedure to create a new order with the products in the shopping cart and returns the ID
of the new order:
// Create the order and get the order ID
$order_id = ShoppingCart::CreateOrder();
Second, the visitor is redirected to the payment page, which requests payment for an item named ???TShirtShop Order
nnn??? with a value that amounts to the total value of the order.
Administering Orders
Your visitor just placed an order. Now what?
After giving visitors the option to pay for your products, you need to make sure they actually
get what they paid for.


Pages:
536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560
Pozycjonowanie kontrola dostępu angielski online owerloki muay thai