Prev | Current Page 539 | Next

Emilian Balanescu and Cristian Darie

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

Storing customer data in the orders table (in the
customer_name, shipping_address, and customer_email fields) is optional. The site administrator can use
this feature if it helps with order management tasks, but at this stage, who placed the order doesn??™t really matter,
only what products have been sold. In the Phase III of development (see Chapter 16), we??™ll move to a full professional
implementation and store customer information in its own data table.
The field names are self-explanatory. order_id is the primary key of the table. total_amount stores the total
value of the order. created_on and shipped_on specify when the order was created and shipped (the latter
supports NULL values, which just means the order hasn??™t been shipped yet).
CHAPTER 14 ?–  ACCEPTING CUSTOMER ORDERS 434
The status field contains an integer that can have these values:
??? 0: The order has been placed. This is the initial status of an order after the Place Order button is clicked in
the shopping cart.
??? 1: The order is verified. The administrator marks the order as verified after the payment was confirmed.
??? 2: The order is completed. The administrator marks the order as completed after the products have been
shipped. At the same time, the shipped_on field is also populated.
??? 3: The order is canceled. Typically, the administrator marks the order as canceled if the order has been
placed (by clicking the Place Order button) but the payment wasn??™t processed, or in other scenarios that
require canceling the order.


Pages:
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551
drzwiowe hosting hotele londyn xiden.bosten.pl rozrywka i hobby