Skip to content

Commit 6f824c9

Browse files
committed
Merge branch 'flow-builder' into develop
2 parents 2d3502e + 477ddee commit 6f824c9

1 file changed

Lines changed: 24 additions & 18 deletions

File tree

src/content/docs/version-3.0/paywall-product-block.mdx

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,9 @@ metadataTitle: "Set up purchases | Flow Builder | Adapty Docs"
66

77
import ZoomImage from '@site/src/components/ZoomImage';
88

9-
Setting up purchases requires two steps. Both must be in place before users can make a purchase.
9+
To set up purchases on a screen, add a purchase button and configure its **Purchase** action. The action can target a specific product or whichever product the user selects from a Products element on the screen.
1010

11-
1. [Add product elements](#2-add-product-elements)
12-
2. [Add a purchase button](#3-add-a-purchase-button)
13-
14-
## Set up purchases
15-
16-
### 1. Add product elements
11+
## Add products
1712

1813
A product element is a visual card that displays a product on the canvas.
1914

@@ -25,32 +20,43 @@ To add a product element:
2520

2621
<ZoomImage id="product-element.webp" width="500px" alt="Adding a product element to the canvas" />
2722

28-
4. When the element is placed:
29-
30-
- If products are already assigned to the screen, the first available product is selected by default, following the order in the Products panel. You can change this.
31-
- If no products are assigned yet, select each product card and assign it a product in the dropdown in the **Design** panel.
23+
4. Select each product card and assign it a product in the dropdown in the **Design** panel.
3224

3325
<ZoomImage id="product-card.webp" width="500px" alt="Adding a product element to the canvas" />
3426

35-
#### Product card rules
27+
:::note
28+
You can also attach a **Purchase** action directly to a product card's **On tap** interaction. Tapping the card then triggers the purchase, with no need for a separate purchase button.
29+
:::
3630

37-
- Product cards cannot be nested inside a selectable element.
38-
- If a Products group contains only one card, the card is no longer selectable and the Selected state is removed.
31+
## Add a purchase button
3932

40-
### 2. Add a purchase button
41-
42-
Products work only when the screen also has a purchase button with a configured Purchase action.
33+
A purchase button triggers a **Purchase** action when the user taps it.
4334

4435
To add a purchase button:
4536

4637
1. On the canvas, click **+** on the screen.
4738
2. Select **Button** and choose a button preset.
4839
3. With the button selected, open the **Interactions** tab in the right panel.
4940
4. Click **Add trigger** > **On tap**, then click **Add action**.
50-
5. Set **Action** to **Purchase** and **Product** to `products.selectedProduct`. The `products.selectedProduct` variable always resolves to the currently selected product on the screen.
41+
5. Set **Action** to **Purchase**, then set **Product** to one of:
42+
- `products.selectedProduct`: Buys whichever product the user has selected from a Products element on the screen.
43+
- A specific product: Always buys that product, regardless of any selection on the screen.
5144

5245
<ZoomImage id="flow-purchase-button.webp" width="500px" alt="Adding a purchase button to the canvas" />
5346

47+
### Show the price on the button
48+
49+
To insert the selected product's price into the button label, use a variable:
50+
51+
1. With the button selected, open the **Design** tab in the right panel.
52+
2. In the **Content** field, place the cursor where the price should appear.
53+
3. Click the variable icon, pick `products.selectedProduct`, then pick the `prod_price` attribute. The full variable resolves to `products.selectedProduct.prod_price`.
54+
4. Add static text around the variable — for example, `Subscribe for {prod_price}`.
55+
56+
The label updates as the user selects different products.
57+
58+
<ZoomImage id="plans-bottom-sheet-main-button-var.webp" width="500px" alt="Purchase button with the selected product's price variable in the label" />
59+
5460
## Restore purchases
5561

5662
To let users restore previous purchases, add a restore button or link to the screen.

0 commit comments

Comments
 (0)