Đang chuẩn bị liên kết để tải về tài liệu:
Beginning PHP and MySQL E-Commerce From Novice to Professional phần 9
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Trả lại quay trở lại trả lời kết quả;} test_datacash.php hành vi tập tin như thế này: Khi chúng ta nạp trong trình duyệt, kịch bản làm cho một yêu cầu preauthentication và yêu cầu thực hiện và sau đó lưu các yêu cầu preauthentication, phản ứng, và thực hiện dữ liệu XML trong phiên: | Simpo PDF Merge and Split Unregistered Version - http www.simpopdf.com CHAPTER 17 STORING CUSTOMER ORDERS 563 WHERE order_id orderld WHERE order_id orderld -- Clear the shopping cart CALL shopping_cart_empty inCartId -- Return the Order ID SELECT orderId END 9. Modify the orders_get_order_info stored procedure by deleting the old version and creating a new one don t forget to set the delimiter to -- Drop orders_get_order_info stored procedure DROP PROCEDURE orders_get_order_info -- Create orders_get_order_info stored procedure CREATE PROCEDURE orders_get_order_info IN inOrderId INT BEGIN SELECT o.order_id o.total_amount o.created_on o.shipped_on o.status o.comments o.customer_id o.auth_code o.reference o.shipping_id s.shipping_type s.shipping_cost o.tax_id t.tax_type t.tax_percentage FROM orders o INNER JOIN tax t ON t.tax_id o.tax_id INNER JOIN shipping s ON s.shipping_id o.shipping_id WHERE o.order_id inOrderId END 10. Execute this code which adds the orders_get_shipping_info stored procedure to the tshirtshop database -- Create orders_get_shipping_info stored procedure CREATE PROCEDURE orders_get_shipping_info IN inShippingRegionId INT BEGIN SELECT shipping_id shipping_type shipping_cost shipping_region_id FROM shipping WHERE shipping_region_id inShippingRegionId END Modifying the Business Tier To work with the new database tables and stored procedures we need to make several changes to business shopping_cart.php. We must modify CreateOrder in ShoppingCart to configure tax and shipping for new orders as well. Simpo PDF Merge and Split Unregistered Version - http www.simpopdf.com 564 CHAPTER 17 STORING CUSTOMER ORDERS Exercise Updating the Business Tier 1. Modify the CreateOrder method in business shopping_cart.phpas follows Create a new order public static function CreateOrder customerId shippingId taxId Build SQL query sql CALL shopping_cart_create_order cart_id customer_id shipping_id tax_id Build the parameters array params array cart_id self GetCartId .