> ## Documentation Index
> Fetch the complete documentation index at: https://codebeans-gift-registry.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Add to Registry button

> Let customers add a product to their registry from the product page.

The **Registry Add Button** is an app block for your product page. When a customer clicks it, a window opens where they choose the quantity, pick one of their registries, add an optional note, and click **Add gift to my registry**.

![Add to Registry button below Add to cart and Buy it now on a product page](https://mintcdn.com/codebeans-gift-registry/LXlKw9108Zp2UigM/images/product-page-button.png?fit=max\&auto=format\&n=LXlKw9108Zp2UigM\&q=85\&s=a85ba63aa2206f2a6be0e3c95ea7bec2)

> [!NOTE]
>
> The button needs the [app embed](https://codebeans-gift-registry.mintlify.site/getting-started/enable-app-embed.md) to be on. The window it opens is loaded by the app embed.

## Add the block in the theme editor

**1. Open the product template**

Go to **Online Store → Themes → Customize**, then choose **Products → Default product** from the page menu at the top.

**2. Add the block**

In the product information section, click **Add block**, open the **Apps** tab and choose **Registry Add Button**.

You can also use the shortcut in the app: **Settings → Integrations & Theme → Customize Product Button**.

![The Apps tab of Add block in the theme editor, with Registry Add Button highlighted](https://mintcdn.com/codebeans-gift-registry/BGALGEd3ayzoJB-1/images/add-block-theme-editor.png?fit=max\&auto=format\&n=BGALGEd3ayzoJB-1\&q=85\&s=ecce1135f3ec784bf25adffb06ff13c3)

**3. Place it**

Drag the block next to your **Add to cart** button, then click **Save**.

## Block settings

![The theme editor with the Registry Add Button block below Buy buttons and its settings panel open on the right](https://mintcdn.com/codebeans-gift-registry/BGALGEd3ayzoJB-1/images/add-button-block-settings.png?fit=max\&auto=format\&n=BGALGEd3ayzoJB-1\&q=85\&s=85140d3489a8cd272c61821c44bedf36)

| Setting | Default | What it does |
| - | - | - |
| Button text | Add to Registry | The label on the button. |
| Icon image | — | An image shown before the text. Leave empty for text only. |
| Or paste SVG code | — | An SVG icon instead of an image. Only paste code you trust: it runs in your customers' browsers. |
| Icon Size (px) | 18 | Size of the icon. |
| Text Color | #FFFFFF | Button text colour. |
| Background Color | #212121 | Button colour. |
| Border Color | #212121 | Border colour. |
| Font Size (px) | 16 | Text size. |
| Border Radius (px) | 2 | Corner rounding. |
| Border Thickness (px) | 1 | Border width. |

The colour of the main button inside the window comes from the app embed setting **Launcher & Product Page Button Background**.

## How the button behaves

![The Add gift window with price, quantity, the registry to add to, and a note](https://mintcdn.com/codebeans-gift-registry/LXlKw9108Zp2UigM/images/add-gift-modal.png?fit=max\&auto=format\&n=LXlKw9108Zp2UigM\&q=85\&s=c4bb1a8db883b2fe2ebe3676ff818da5)

* **Signed-out customers** are taken to the registry home, where they are asked to sign in.
* **Customers with no registry** see **Create Your First Registry**.
* The **selected variant** is the one added. Sold-out variants can't be added.
* Adding the **same product and variant** twice shows "This product is already in your registry." Customers change the quantity from their registry instead.
* Only **product registries** are listed in the window.
* If you turn off **Offer Product registries** in [General settings](https://codebeans-gift-registry.mintlify.site/settings/general.md), the button is hidden from customers.

## Add the button by hand (theme code)

If the theme editor block does not fit your layout, paste this snippet into your product template, inside the product form, next to the **Add to cart** button:

```liquid theme={null}
<div data-registry-add-button
  data-cbgc-product-handle="{{ product.handle }}"
  data-cbgc-product-id="{{ product.id }}"
  data-cbgc-variant-id="{{ product.selected_or_first_available_variant.id }}">
</div>
```

| Attribute | Required | Description |
| - | - | - |
| `data-registry-add-button` | Yes | Marks where the button goes. |
| `data-cbgc-product-handle` | Yes | The product handle. The app finds the product by handle. |
| `data-cbgc-product-id` | No | The product ID. Looked up from the handle when left out. |
| `data-cbgc-variant-id` | No | The variant to add. Defaults to the first available variant. |

> [!TIP]
>
> Duplicate your theme before editing its code, so you can go back if something goes wrong.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.