??? Add tax and shipping charges.
In the next chapter, we??™ll start to implement a more sophisticated order system, and the
code we??™ll write in this chapter will facilitate that. Therefore, we??™ll be making some modifications
that won??™t seem necessary at this stage, but they??™ll make your life easier later on.
Adding Orders to Customer Accounts
To enable customers to place orders, we need to make several modifications to our current
order placing mechanism. Right now, the orders we store in our database aren??™t associated
with our existing customers. In this section, we??™ll update TShirtShop to enable our customers
to place orders through their accounts (which they can now create).
First, we??™ll modify the database to make it ready to hold information about customer
orders. We??™ll first modify the orders table and then the shopping_cart_create_order stored
procedure.
543
C H A P T E R 1 7
?– Caution The new orders table will not be compatible with the data you currently have in this table, and
you??™ll be required to delete all the existing data. If the orders data you currently have in your database is
important to you, be sure to back up your database before proceeding.
More specifically, these are the changes we??™ll make to the orders table:
??? Clear all the existing data.
??? Remove the customer_name, shipping_address, and customer_email fields.
Pages:
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654