# Plugin Tự enroll người dùng sau khi thanh toán

Plugin hoạt động được với woocommerce 5.6 và wordpress 5.8. Tham khảo [tại đây](https://drive.google.com/file/d/1740CJjWNln4SSH933-AUE13rgtEt0mcL/view?usp=sharing)

**Tính năng:​**

* Tự động tạo tài khoản trên lms sau khi thanh toán thành công với:&#x20;
  * Tài khoản: là email của khách hàng lúc thanh toán
  * Mật khẩu: mặc định do admin cấu hình.
* Tự động enroll người dùng vào khoá học với thời hạn học.

**Setup**

**Setup Plugin**

* Sau khi cài plugin, giao diện cài đặt sẽ nằm ở đường dẫn Woocommerce -> Settings (Cài đặt) -> Cohota Enrollment. Sau đó điền thông tin vào ô nhập liệu như hướng dẫn là hoàn tất quá trình cài đặt.

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXdxfkqV667NHcukOYfZVHIx4vL2CVtonbVh0U55VgVtUmHnYBp9qQ4mMWTDErrnVLvgN0QvkyU-MOMf9bNKyUhBdEHXA2Ls1sJyarVs_1pbbA6vGVNvJC-ZEsT_BlxiWs_yMgBZ62D6uvNgGQ3q2WyP2Dc?key=GpYvC1zsuY7YiRPg43ExZA" alt=""><figcaption><p>Hình minh hoạ 1</p></figcaption></figure>

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXerOd6KncZftotEtjAIReKUUQuvstBPcaqGGAtIT9wT_Y7lnHzileQpAEPzeAGYyTdS25Pu-AiK07rqXwHoNC2ox9P2G_zCsWbhBp7icTqCmeY7KP6sDnhlU7xUCfMByudPzM-uklmyAfCoapm3P7eE2ic?key=GpYvC1zsuY7YiRPg43ExZA" alt=""><figcaption><p>Hình minh hoạ 2</p></figcaption></figure>

#### Setup Product

Tạo sản phẩm với SKU (Mã sản phẩm) theo format *<mark style="color:blue;">\[course id]-\[note]</mark>*

Ví dụ:

Như hình là 227849-mienphi (mục đích khóa học là miễn phí, có mã khóa học (course id) là 227849 ). Sau này có thể tạo thêm sản phẩm 227849-traphi.

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXfTb8M9C8sc4NBaoU-aRMZJm15Mg_ibHEkcfEbryo3EU2m8OprOu-iosbttMQa_BDSqn62dyTY1vM3lIfegAN8jfMtia68XyzOeVOck6J-EI6UIzfHbwDBYCqxCSUwBhyE1vV6G5cqk_aD_OWFGr1f77TJa?key=GpYvC1zsuY7YiRPg43ExZA" alt=""><figcaption><p>Hình minh hoạ 3</p></figcaption></figure>

Thêm thuộc tính **amount\_of\_time** cho sản phẩm để cài đặt thời gian học của học viên tính theo ngày

<figure><img src="https://lh7-us.googleusercontent.com/docsz/AD_4nXfb5ia8JF4e7JFYED4wbmi-Sn6p7jZJ2fBbqwmmU5NQflI6h5uCgBrXx7GYVIZ34poVmU58QomULz7MLJ-hLBtMpDaslc7OUA_-V5geVta9EJ5wfgCnHfdlSZkfFdNfrNwV8C9wT_lGEgEgHTuKdm3Xw0ZR?key=GpYvC1zsuY7YiRPg43ExZA" alt=""><figcaption><p>Hình minh hoạ 4</p></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://docs.cohota.com/shopping-cart-gio-hang/plugin-tu-enroll-nguoi-dung-sau-khi-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.
