> For the complete documentation index, see [llms.txt](https://tailieu.smax.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tailieu.smax.ai/bot-auto/trigger/facebook/messenger-shopping.md).

# Messenger Shopping

{% hint style="info" %}
Trigger <mark style="color:orange;">**Messenger Shopping**</mark> được sử dụng để chạy các kịch bản sau khi khách hàng đặt hàng trên Meta Catalogs
{% endhint %}

Để tạo trigger <mark style="color:orange;">**Messenger Shopping**</mark>, trong phần kịch bản chọn <mark style="color:orange;">**Tạo trigger mới**</mark> -> <mark style="color:orange;">**Catalog**</mark> và chọn <mark style="color:orange;">**Messenger Shopping**</mark>

{% hint style="warning" %}
Bạn cần tạo Catalogs và cổng thanh toán trước khi tạo trigger này

Xem hướng dẫn tạo Catalogs [<mark style="color:purple;">**tại đây**</mark>](/extend-modules/meta-catalogs.md)

Xem hướng dẫn thêm cổng thanh toán [<mark style="color:purple;">**tại đây**</mark>](/extend-modules/payment-hub.md)
{% endhint %}

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FiTf6aOFBuJMA5HxaFpXj%2FScreenshot%202024-07-04%20at%2011.35.08.png?alt=media&amp;token=4d93a5a7-8233-4d95-be6b-2cf3d4459bfc" alt=""><figcaption></figcaption></figure>

Sau đó, bạn cần đặt tên cho Trigger và chọn Catalogs sẽ áp dụng trigger này

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FKvGO1QMgzTAmiAHqERTW%2FScreenshot%202024-07-04%20at%2011.38.10.png?alt=media&amp;token=e73cb7b1-ad70-4d7f-a4b9-05a866225378" alt=""><figcaption></figcaption></figure>

Nếu bật tuỳ chọn <mark style="color:orange;">**Yêu cầu địa chỉ giao hàng**</mark>, chatbot sẽ tự động gửi thẻ Messenger Shipping Address để xin thông tin về địa chỉ nhận hàng của khách hàng

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FX4kfedV4CNFT8LN5DiTU%2Fimage.png?alt=media&amp;token=bd4aba1a-76f6-4e98-aadf-ad0d7645786e" alt="" width="360"><figcaption><p>Yêu cầu địa chỉ đơn hàng trên Messenger</p></figcaption></figure>

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FIpohci5AaJODi7gv4uap%2FScreenshot%202024-07-04%20at%2011.40.17.png?alt=media&amp;token=e7b466c2-7873-4a3a-8214-1a80d85ff3f3" alt=""><figcaption></figcaption></figure>

Bật tuỳ chọn Tạo đơn hàng sẽ tạo 1 đơn hàng trong module Quản lý đơn hàng:

* Lưu mã đơn hàng vào thuộc tính: Sau khi tạo đơn hàng, hệ thống sẽ tự động lưu lại mã đơn hàng vào thuộc tính để sử dụng trong luồng chatbot
* Gửi xác nhận đơn hàng: Chatbot sẽ tự động gửi 1 nội dung kèm theo nút bấm để mở webview, khách hàng có thể chỉnh sửa thông tin hoặc xác nhận thông tin tại webview này

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2F3XGtzVI0own90D6WU5ol%2Fimage.png?alt=media&amp;token=1f50f1b2-a085-473e-bf3c-5e93e6410178" alt="" width="360"><figcaption></figcaption></figure>

* Sử dụng trung tâm thanh toán: Tự động tạo mã QR và gửi cho khách hàng khi bấm xác nhậ đơn
* Gửi block khi thanh toán thành công hoặc thanh toán lỗi: Nội dung gửi cho khách hàng khi đã thanh toán

<figure><img src="https://1875681896-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fsr3EiPwgSuzEXI3u1tC1%2Fuploads%2FGAfgldLDNMEXQ04gUfnx%2Fimage.png?alt=media&amp;token=f0a04234-f41c-4328-91d1-b15a8e61769d" alt=""><figcaption></figcaption></figure>
