TAILIEUCHUNG - Beginning PHP and Postgre SQL E-Commerce From Novice to Professional phần 8

Điều này có nghĩa rằng nếu bạn muốn thay đổi phương pháp mã hóa, bạn chỉ cần phải sửa đổi mã ở đây, để lại lớp SecureCard bị ảnh hưởng. Chúng tôi sẽ nhìn vào mã băm đầu tiên, tiếp theo là mã hóa. Thực hiện chức năng Băm trong kinh doanh | 420 CHAPTER 11 MANAGING CUSTOMER DETAILS 9. Now everything is in its place and you can see the results. Log in to your site add some products to your shopping cart and then click the Checkout button on your shopping cart page. Your page will look something like Figure 11-9 shown earlier. How It Works The checkout info Componentized Template In the init method of the Checkoutinfo class you start by checking whether the customer clicked the Place Order button. If so you save the order into the database and redirect the customer to the home page If the Place Order button was clicked save the order to database if this- _mPlaceOrder 1 order_id ShoppingCart CreateOrder Redirect to redirect_link http . getenv SERVER_NAME If HTTP_SERVER_PORT is defined and different than default if defined HTTP_SERVER_PORT HTTP_SERVER_PORT 80 Append server port red irect_link . . HTTP_SERVER_PORT redirect_link . VIRTUAL_LOCATION . header Location . redirect_link exit You then need to set up some variables for the template to use Set members for use in the Smarty template this- mCartItems ShoppingCart GetCartProducts GET_CART_PRODUCTS this- mTotalAmountLabel ShoppingCart GetTotalAmount this- mContinueShopping _SESSION page_link this- mCustomerData Customer Get If the customer didn t enter credit card information or a shipping address yet a notice is displayed and the Place Order button is disabled. If credit card information exists for the customer you decrypt it and prepare to display the credit card type and the last four digits of its number We allow placing orders only if we have complete customer details if empty this- mCustomerData credit_card this- mOrderButtonVisible disabled disabled this- mNoCreditCard yes CHAPTER 11 MANAGING CUSTOMER DETAILS 421 else this- mPlainCreditCard Customer DecryptCreditCard this- mCustomerData credit_card this- mCreditCardNote Credit card to use . this- mPlainCreditCard card_type br Card number . this- mPlainCreditCard card_number if

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.