在上個步驟中,我們透過 ajax 把客戶的資料 post 到遠端資料庫。之後,網站會將顧客帶往 checkout 的付款頁面。此時,網頁上會顯示顧客的訂單內容(即訂購的品項)與方才表單填入的相關個人資料。網址的部分則會帶上這筆訂單的 id。
格式通常會是這樣:/一串沒有意義的數字字母組合
這個頁面的目的在於讓顧客確認自己的訂單內容。再確定之後,才將顧客帶往付款的頁面。
在顧客確認付款後,頁面在沒有更換網址的狀態下,「尚未付款」字樣更改為「完成付款」。當我們從網路商店管理者的頁面查看該訂單的狀態,也會發現付款的狀態也被更改玩「完成付款」。
這是由於當顧客按下「確認付款」時,網頁也同時發出 ajax 請求,於資料庫中修改顧客的訂單狀態後,並取得這筆訂單修改後的狀態,即時的顯現於畫面上。
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing