> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://docs.downpay.app/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Add Downpay in your theme

|| **Confirm you are using&#32;[a compatible payment gateway](/en/article/6g7o1k/)&#32;*before*&#32;adding Downpay to your theme. Note that the Downpay blocks will only appear on your storefront for products, variants, or tags for which you have created&#32;[Downpay purchase options](/en/article/1dt4jnn/), except for the&#160;[payment info block](#4-installing-downpay-payment-info-block-optional).**

**You will add Downpay to your theme by updating the product page. You can also update the cart page to display Downpay subtotals:**

1. **Product Page**
2. **Cart Page [Optional]**

**The following content blocks will be shown once Downpay is installed.**

![](https://storage.crisp.chat/users/helpdesk/website/81f235024a249800/cobmbined-2_igi32g.png)

###### On this page

[Downpay product page extension](#1-product-page)
* [Quick Install](#2-quick-install)
* [Manual install](#2-manual-install)

[Downpay buy button](#1-downpay-buy-button-optional) (optional)
* [Installation](#2-installation)
* [Configuration](#2-configuring-the-downpay-buy-button)

[Cart page](#1-cart-page-optional) (optional)
* [Install](#2-install)

[Cart drawer](#1-cart-drawer)

[Customization](#1-customization)
* [Modify placement of product or cart embeds](#2-modify-placement-of-product-or-cart-embeds)
* [Show Downpay Payment Info Block based on purchase option](#2-show-downpay-payment-info-block-based-on-purchase-option)
---
---

# Product Page

|| Scheduled or draft products will not display Downpay until they become active.

Products will show the following once Downpay is installed, if they have a purchase option:

![](https://storage.crisp.chat/users/helpdesk/website/-/8/1/f/2/81f235024a249800/product-block_1tdroul.png =800x505)

Optionally, they can also show this payment info disclaimer as well:

![](https://storage.crisp.chat/users/helpdesk/website/-/8/1/f/2/81f235024a249800/info-block-for-install_1fg6frg.png =800x505)

## Quick Install

|| The optional Downpay Payment Info block has to be [installed manually](#4-installing-downpay-payment-info-block-optional). 

In the in-app onboarding guide, click the button labelled **Enable product block** or **Open theme editor**.

*This will open your active theme in the Shopify theme editor and prompt you to add the Downpay product block.*

Click **Save** to change your changes in the theme editor.

## Manual Install

### If you are using a [2.0 theme](https://help.shopify.com/en/manual/online-store/themes/managing-themes/versions):

1. Click **Online Store** from your left navigation bar in the Shopify Admin.

2. Click **Customize** on your theme.

3. Navigate to the **Product page** template you are using from the dropdown menu at the top of the editor.

4. In the left navigation in the "Template > Product information" section, click **Add block**.

5. Select **Apps**.

6. Follow the instructions for [Downpay Product Block](#4-installing-downpay-product-block) or [Downpay Payment Info Block](#4-installing-downpay-payment-info-block-optional).

#### *Installing Downpay Product Block*

1. Select **Downpay Product Block**.

2. Drag the Downpay Product Block higher or lower depending on where you would like it to appear.

3. Click **Save** at the top right to finish setup.

#### *Installing Downpay Payment Info Block (Optional)*

|| The same Payment Info Block will appear for all products that use the same template, whether or not they have a Downpay purchase option. You can make the language broad, assign products with purchase options to a different template using the Shopify bulk editor, or [script when it shows up](#2-show-downpay-payment-info-block-based-on-purchase-option).

1. Select **Downpay Payment Info Block**.

2. Drag the Downpay Payment Info Block higher or lower depending on where you would like it to appear.

3. Click **Save** at the top right to finish setup.

### If you are using a [vintage theme](https://help.shopify.com/en/manual/online-store/themes/managing-themes/versions):

1. Click **Online Store** from your left navigation bar in Shopify Admin.

2. Click **Customize** on the theme you wish to add Downpay blocks to.

3. Navigate to the **Product page** template you are using from the dropdown menu at the top center area of the editor.

4. Navigate to the embed section of the editor on the left hand side and toggle the Downpay product embed on.

![Shopify embed menu and Downpay product embed](https://storage.crisp.chat/users/helpdesk/website/81f235024a249800/screenshot2023-11-02at83923am_1rbkgdn.png)

**7.** Click **Save** at the top right to finish setup.

||| Still not showing? You may need to [specify the placement](#2-modify-placement-of-product-or-cart-embeds) of the embed.
---
---

[Jump to top](#6-on-this-page)

# Cart Page (optional)

Optionally, Downpay's cart page embed displays the subtotals that will be paid at checkout and the remaining balance due. 

![](https://storage.crisp.chat/users/helpdesk/website/81f235024a249800/monosnap-your-shopping-cart-to_1ndrd1e.png)

## Install

||| Using a cart drawer? Try this [guide](#1-cart-drawer).

1. Click **Online Store** from your left navigation bar in Shopify Admin.

2. Click **Customize** on the theme you wish to add Downpay to.

3. Navigate to the **Cart page** template you are using from the dropdown menu at the top center area of the editor.

4. Navigate to the embed section of the editor on the left hand side. and toggle the Downpay cart embed on.

![](https://storage.crisp.chat/users/helpdesk/website/81f235024a249800/monosnap-todds-magic-playgroun_jab4uy.png)

5. Click **Save** at the top right.

|| The totals will display *only if* a deposit product is in your cart.

||| Still not showing? You may need to [specify the placement](#2-modify-placement-of-product-or-cart-embeds) of the embed.
---
---

[Jump to top](#6-on-this-page)

# Cart drawer

||| Dynamic cart drawers are not supported for this setup  guide at this time. If you choose to set up Downpay subtotals using this guide, the totals may not adjust with quantity changes until page refresh. This will be resolved in a future release of Downpay in 2025.

If you are using a cart drawer, this guide will help you add a subtotal line on your cart drawer liquid page for the `Balance due today`.

${youtube}[How to set up Downpay deposit total on cart drawer](h4yL_VpZ_jI)

1. Click **Online Store** from your left navigation bar in Shopify Admin.

2. Click the `...` beside your theme and open two tabs in your browser: a `Preview` of your theme, and the `Edit code` page. We recommend making a duplicate of your theme and working on the unpublished duplicate for easier testing without risking your main live template.

3. In the Preview tab of your theme: Add a Downpay deposit product to your cart and open the cart drawer. We will use this as a way to test our code.

4. In the Edit code tab: Search for `drawer` to find the cart-drawer.liquid or similar file which contains the code for the drawer. This can usually be found in snippets on 2.0 themes. If you don't find anything, you can also search for something like `quick-cart` which is also common.

5. Scroll through or search the file for the `subtotal` line and then duplicate of the elements that control the title of the line and the price. Click `Save`. We will be making changes to them, but for now we want to make sure a duplicate appears above our current subtotal line.

6. We will be incapsulating our duplicate subtotal line in an `if statement` and adjusting the copy and the subtotal that is displayed.

• The title of your subtotal line will be `Due today` or similar. You can also use the [guide below to add an entry to your Locale](#2-translate-due-today) to ensure the title is translated.
• The deposit subtotal will be {{ cart.checkout_charge_amount | money }}

Review the example below. Keep in mind that your classes may look different based on your theme's style.

```liquid
{%- liquid assign items_with_plans = cart.items | where: 'selling_plan_allocation'-%}    
{% if items_with_plans.size != 0 %}   
         <div class="drawer__bottom__meta body-size-3">
           <p class="totals__total">Due today</p>
           <p class="totals__total-value">{{ cart.checkout_charge_amount | money_with_currency }}</p>
         </div>
{% endif %}
```
7. Click save and refresh your preview to display the Due today total.

## Translate due today

This guide will teach you how to add a new entry to your locale file for the `Due today` title instead of having it hardcoded.

1. Click **Online Store** from your left navigation bar in Shopify Admin.

2. Click `...` beside the theme you wish to adjust and click `Edit code`.

3. Scroll down to the `Locales` folder of your theme and select your english locale. An example of the name would be `en.default.json`.

4. Scroll down to the `Cart` section of the file and add a new entry for the `checkout_charge_amount` in this format: `"checkout_charge_amount": "Due today",`

![](https://storage.crisp.chat/users/helpdesk/website/81f235024a249800/screenshot-2024-07-10-at-25209_yglk1t.png)

5. In your cart drawer where you have placed the `due today` subtotal, adjust the hard code "due today" to `{{ 'sections.cart.checkout_charge_amount' | t }}`. The location may be different depending on where you've placed your entry.

![](https://storage.crisp.chat/users/helpdesk/website/81f235024a249800/screenshot2024-07-10at25642-pm_gknctd.png)
---
---

[Jump to top](#6-on-this-page)

# Customization

Edit the appearance, placement, and content of the Downpay content by **adjusting the&#32;[theme settings](/en/article/downpay-theme-settings-iumzy0)**.

## Modify placement of product or cart embeds

||| This is *required* to get Downpay embeds to appear for some custom or less popular themes.

The **HTML element to insert after** setting will allow you to move the cart subtotals content block around the cart page. 

Modify content block placement by specifying a nearby unique element id or class. The format of element ids is `#id`, and the format for classes are `.class` 

![](https://storage.crisp.chat/users/helpdesk/website/81f235024a249800/monosnap-todds-magic-playgroun_28357a.png)


## Show Downpay Payment Info Block based on purchase option

By default, the payment info block will appear for all products that use the same template, but you can use this script to show it only for products that have Downpay purchase options:

```js
<script>
document.addEventListener("DOMContentLoaded", function () {
  var hasSellingPlan = {% if product.selling_plan_groups.size > 0 %}true{% else %}false{% endif %};
  
  var el = document.querySelector(".downpay-headline");
  if (!el) return;

  el.style.display = hasSellingPlan ? "flex" : "none";
});
</script>
```

Add this CSS as well to prevent the tooltip from flashing on page load:

```js
downpay-headline {
  display: none;
  flex-direction: row-reverse;
  gap: 10px;
  font-weight: 500;
}
```
---
---

# Downpay Buy Button (optional)

## Installation

### For Shopify 2.0 Themes

1. Click **Online Store** from your left navigation bar in the Shopify Admin.

2. Click **Customize** on your theme.

3. Navigate to any template where you want the button to appear, using the dropdown menu at the top of the editor.

4. In the left navigation, click **Add block** and select **Downpay buy button.**

5. Drag the Downpay block higher or lower depending on where you would like it to appear.

6. Click **Save** at the top right to finish setup.

## Configuring the Downpay Buy Button

After adding the Downpay App block to your product page, you need to configure it:

### Required settings

1. **Choose a product**: Select the product you want customers to be able to pay a deposit for. Your purchase option id will be automatically added after a product is selected.

### Button Customization

1. **Deposit Option Label**: Customize the text that appears on the buy button (default: "Buy with Deposit").

2. **Button Alignment**: Choose whether to align the button to the left, middle, or right of its container.

3. **Button Background Color**: Set a custom background color for the button to match your store's design.

4. **Button Text Color**: Choose a custom text color for the button.

5. **Button  Border Color**: Choose the border color for the button.

6. **Button Border Radius**: Adjust how round the corner of the button is.

7. **Custom CSS**: Add any additional CSS styling to further customize the appearance of the button.

## How It Works

After the Downpay buy button is fully configured, when a customer clicks on it:

1. The system recognizes the product and purchase option ID you've configured.

2. The customer is immediately directed to their cart with the product added.

3. The cart will show the deposit amount (as defined by the purchase option) instead of the full product price.

4. The customer can then proceed to checkout to pay only the deposit amount.

5. You can use this button in conjunction with the theme's regular "Add to cart" button, if you wish to offer the option to pay in full at the same time.

## Troubleshooting

* If the button doesn't appear, ensure you've selected a product and entered a valid purchase option ID.

* A warning message will appear in the theme editor if either the product or purchase option ID is missing.

* Ensure your theme is compatible with Shopify 2.0 for optimal functionality.

[Jump to top](#6-on-this-page)