> For the complete documentation index, see [llms.txt](https://docs.roadmap.so/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roadmap.so/forms/link-form-to-product-purchase.md).

# Link form to product purchase

Attach a form to the purchase flow when the form must be tied to a product order.

Use this when the form is part of the buying journey.

Examples include personalisation, custom order details, and pre-purchase questions.

{% hint style="warning" %}
This feature requires theme-level code edits.
{% endhint %}

### When to use this setting

Enable this only when the form must be connected to a product purchase flow.

If the form is just a page form or lead form, keep this off.

> **Screenshot placeholder:** Form settings with **Link form to product purchase** enabled inside **Advance Settings**.

### Enable purchase linking

{% stepper %}
{% step %}

#### Open the form settings

From **Forms**, open **Settings** for the form.
{% endstep %}

{% step %}

#### Open Advance Settings

Expand the advanced options for the form.
{% endstep %}

{% step %}

#### Enable purchase linking

Check **Link form to product purchase**.
{% endstep %}

{% step %}

#### Apply the theme code changes

Add the required theme implementation before going live.
{% endstep %}

{% step %}

#### Test the full purchase flow

Confirm the form appears in the right place and the data is tied to the correct purchase.
{% endstep %}
{% endstepper %}

### Common use cases

* engraving or personalisation details
* compliance or eligibility questions
* trade or project reference capture
* order-specific notes that should stay with the purchase flow

### Recommended approach

Have your developer or support team implement the theme changes before launch.

Then test with a real product flow, not only in the editor.

### Troubleshooting

#### The form is enabled but nothing happens on the storefront

Check these first:

* the setting is enabled
* the form changes were saved
* the required theme code changes were applied

#### The form shows in the wrong place

Review the theme implementation and test the exact product template involved.

### Related guides

* [Building with forms](/forms/building-with-forms.md)
* [Add a form to your theme](/forms/add-a-form-to-your-theme.md)


---

# 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, and the optional `goal` query parameter:

```
GET https://docs.roadmap.so/forms/link-form-to-product-purchase.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
