# Thanh toán

### Các nội dung cơ bản của trang thanh toán

Trang thanh toán là trang cung cấp dịch vụ thanh toán cho đơn hàng đã được người dùng chọn vào giỏ hàng trước đó. Thanh toán là bước xác nhận cuối cùng để người dùng có thể thành công đặt được sản phẩm mình đã chọn mua.

### Các thẻ meta

```
{% extends layout_empty %}
{% block meta %}
    {{ headTitle('Thanh toán').setSeparator(' - ').setAutoEscape(false)|raw }}
    <meta name="keywords" content="Thanh toán">
    <meta name="description" content="Thanh toán">
    <link rel="canonical" href="{{ getCurrentUrl(true) }}" />
    <meta property="og:url" content="{{ getCurrentUrl(true) }}">
    <meta property="og:image" content="https://dummyimage.com/300x200/000/fff">
    <meta property="og:type" content="website">
    <meta property="og:title" content="Thanh toán">
{% endblock %}

```

### Xác nhận

Người dùng có thể xem chi tiết thông tin đơn hàng mà mình sắp thanh toán như Hình ảnh, Mô tả, Số lượng, Giá:

```
{% set products = serviceCart().productList %}
{% if (products) %}
    {% for p in products %}
        {% set discount = p.priceAfterDiscount(p.quantity) %}
        <img loading="lazy" src="{{ p.thumbnailUri }}" alt="{{ p.name }}">
        {{ p.quantity }}
        {% if(discount > 0) %}
            {{ discount|number_format(0) }} đ
            {{ p.price|number_format(0) }} đ                                                
        {% elseif(p.oldPrice > 0) %}
            {{ p.price|number_format(0) }} đ
            {{ p.oldPrice|number_format(0) }} đ                                                
        {% else %}
            {{ p.price|number_format(0) }} đ   
        {% endif %}
    {% endfor %}
{% endif %}

```

### Mã giảm giá

Người dùng có thể sử dụng mã giảm giá mỗi khi có chương trình để giảm giá trị đơn hàng

```
  <span>{{ translate('Mã giảm giá') }}</span>
  <p class="_couponPrice"></p>
  
   <input type="text" class="_txtCoupon" placeholder="Nhập mã ưu đãi">
   <a class="_couponBtn">{{ translate('Áp dụng') }}</a>

```

### Số tiền cần thanh toán

Số tiền cần thanh toán cho mỗi đơn hàng bao gồm số tiền tạm tính và phí vận chuyển

```
<span id="showTotalMoney" value="{{ totalCartMoney }}">
    {{ totalCartMoney |number_format(0) }} đ
</span>
```

### Thông tin giao hàng

Thông tin về người mua hàng sẽ được hiển thị chi tiết như: Tên, Số điện thoại, Email, Địa chỉ, Tỉnh thành phố, Quận huyện, Phường xã

```
<input aria-label="{{ translate('Họ và tên') }}" type="text" placeholder="{{ translate('Họ và tên') }}" class="validate[required] form-control" name="customerName" value="{{ user?user.fullname:'' }}">
<input aria-label="{{ translate('Điện thoại') }}" class="validate[required,custom[phone]] form-control" name="customerMobile" type="text" placeholder="{{ translate('Điện thoại') }}" value="{{ user ? (user.mobile | replace({'+84': '0'})):'' }}" required>
<input aria-label="Email" class="form-control" type="email" placeholder="Email" value="{{ user?user.email:'' }}" name="customerEmail">
<input aria-label="{{ translate('Địa chỉ') }}" type="text" placeholder="{{ translate('Địa chỉ') }}" class="validate[required] form-control" 
                                               value="{{ user?user.address:'' }}" name="customerAddress">
<select aria-label="city" name="customerCityId" id="customcityId" class="validate[required] form-control" tabindex="-1" aria-hidden="true">
     <option value="">{{ translate('Chọn Tỉnh/ thành phố') }}</option>
 </select>
 
 <select aria-label="district" name="customerDistrictId" id="customdistrictId"
        class="validate[required] form-control">
        <option>{{ translate('Chọn Quận/ Huyện') }}</option>
  </select>
  <select aria-label="ward" name="customerWardId" id="customerWardId"
         class="validate[required] form-control">
      <option>{{ translate('Chọn Phường/ Xã') }}</option>
    </select>
    <input type="hidden" name="selectIdWard">
    <textarea aria-label="description" name="description"  placeholder="{{ translate('Ghi chú đơn hàng') }}" rows="3" ></textarea>

```

### Phương thức vận chuyển

Người dùng có thể chọn các phương thức vận chuyển cũng như các hãng vận chuyển như: Liên vùng, Giao nhanh, Giao chậm, Giao hỏa tốc...

```
<span id="ship_fee" class="_ship_fee">0</span>
<span id="showCarrier"></span>
```

### Phương thức thanh toán

Người dùng có thể chọn các phương thức thanh toán mình muốn như: Thanh toán tại nhà, Thanh toán chuyển khoản, cũng như các nền tảng hộ trợ thanh toán online khác như VNPay hoặc MoMo.

```
{{ getPayments() | raw }}
```

<figure><img src="/files/5ffvqVqcHCP6PwVQJw9s" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://webdocs.nhanh.vn/page/don-hang/thanh-toan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
