> For the complete documentation index, see [llms.txt](https://docs.wpsite.pro/wp/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wpsite.pro/wp/woocommerce-shang-dian-gou-wu-ju/ru-he-zuo-yi-ge-jia-ru-gou-wu-ju-de-an-niu-fang-zai-ren-yi-ye-mian-shang.md).

# 如何做一個加入購物車的按鈕放在任意頁面上

{% embed url="<https://www.youtube.com/watch?v=GvWwIW2mP2Y>" %}

**預設格式：**

[https://你的網址/?add-to-cart=商品編號](https://xn--6qqv5qbo2ac9f/?add-to-cart=%E5%95%86%E5%93%81%E7%B7%A8%E8%99%9F)

**到達指定頁面(例如checkout結帳頁)：**

[https://你的網址/checkout/?add-to-cart=商品編號](https://xn--6qqv5qbo2ac9f/checkout/?add-to-cart=%E5%95%86%E5%93%81%E7%B7%A8%E8%99%9F)

**指定數量：**

[https://你的網址/?add-to-cart=商品編號\&quantity=數量](https://xn--6qqv5qbo2ac9f/?add-to-cart=%E5%95%86%E5%93%81%E7%B7%A8%E8%99%9F\&quantity=%E6%95%B8%E9%87%8F)

**進階延伸：**

[一次加入多個商品(Group Product)](https://www.businessbloomer.com/woocommerce-custom-add-cart-urls-ultimate-guide/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.wpsite.pro/wp/woocommerce-shang-dian-gou-wu-ju/ru-he-zuo-yi-ge-jia-ru-gou-wu-ju-de-an-niu-fang-zai-ren-yi-ye-mian-shang.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.
