---
updatedAt: 2025-11-13T14:12:34.000Z
agentTools:
  siteIndex: https://docs.affirm.com/llms.txt
  projectIndex: https://docs.affirm.com/platforms/llms.txt
---

# Set a Price Floor for Checkout (Shopify Plus only)

Learn about setting a price floor to display Affirm as a payment option at checkout.

<HTMLBlock>{`
<style>
  .dropdown-menu {
    font-family: Arial, sans-serif;
    max-width: 250px;
    margin-left: auto; /* Align to the right */
  	margin-right: 0; /* Ensure it's flush to the right */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: #4A4AF4;
    overflow: hidden; /* Ensure the container grows with content */
  }

  .dropdown-item {
    margin-bottom: 10px;
  }

  .dropdown-toggle {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
  }

  .dropdown-toggle:hover {
    background: #f0f0f0;
  }

  .dropdown-content {
    display: none;
    margin-top: 5px;
    padding: 10px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  .dropdown-item.open .dropdown-content {
    display: block;
  }

  .flag-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
  }

  .product-item {
    margin-bottom: 5px;
  }

  .product-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
  }
  
  .country-title {
    font-family: Arial, sans-serif;
    font-size:20px;
    text-align: center;
    font-weight: bold;
    color: #ffffff;
  } 

</style>
  <div class="dropdown-menu">
    <p class="country-title" alt="Countries where this product is available">Country Availability</p>

    <div class="dropdown-item">
      <button class="dropdown-toggle" onclick="toggleDropdown(event)" alt="Drop down menu displaying the available countries for this product">
        <b>Country List</b> ⬇️
      </button>
      <div class="dropdown-content">
        <div class="product-item">
          <img src="https://files.readme.io/a4c8b3d6596d943e2b93c82cb1d432a2edaf6998667835c2e97ef4a31d460c7e-us-circle-01.png" alt="USA" class="flag-icon">
          USA
        </div>
        <div class="product-item">
          <img src="https://files.readme.io/3ca294a1b4b8b8506c3ff32876abc6e3e33d0e65a509dab81398915094bdbc5c-61TcZ33ZrJL._AC_UY1000_.jpg" alt="Canada" class="flag-icon">
          Canada
        </div>
      </div>
    </div>

  </div>
`}</HTMLBlock>

<br />

> ❗️ Retirement of checkout.liquid
>
> As of August 2024, Shopify retires the *checkout.liquid* file for customizing payment methods. \
> Instead, you can use the **Affirm pay-over-time messaging** Shopify app to control the appearance of the Affirm payment option at checkout for your Shopify store. For details, see [Manage Affirm payment customizations for Shopify stores](https://docs.affirm.com/platforms/docs/manage-affirm-payment-customizations-for-shopify-stores).

## Overview

Merchants using Shopify Plus can set a price floor that displays Affirm as a payment option when the customer's cart exceeds a minimum dollar amount.

***

## Configuration

1. Go to the <Anchor title="https://help.shopify.com/manual/apps/apps-by-shopify/script-editor" href="https://help.shopify.com/manual/apps/apps-by-shopify/script-editor">Shopify script editor</Anchor>.
2. Click **Create Script**.
3. Choose **Payment Gateway** for the script type.
4. Choose **Blank Template**.
5. Click **Create Script**.
6. In the **Title box**, enter **Affirm price** floor as the script name.
7. Click **Code** to open the Ruby source code console.
8. Paste the following code into the console (250 sets the floor to $250. You can change it to your desired price floor):

```ruby
available_gateways = Input.payment_gateways
cart = Input.cart
subtotal = cart.subtotal_price
unless cart.line_items.empty? or cart.discount_code.nil?
  case cart.discount_code
  when CartDiscount::Percentage
    if cart.subtotal_price >= cart.discount_code.minimum_order_amount
      subtotal = cart.subtotal_price * ((Decimal.new(100) - cart.discount_code.percentage) / 100)
    else
      subtotal = cart.subtotal_price
    end
  when CartDiscount::FixedAmount
    if cart.subtotal_price >= cart.discount_code.minimum_order_amount
      subtotal = cart.subtotal_price - cart.discount_code.amount
    else
      subtotal = cart.subtotal_price
    end
  else
    subtotal = cart.subtotal_price
  end
end
if subtotal < Money.new(cents:100) * 250
  available_gateways = available_gateways.delete_if do |payment_gateway|
    payment_gateway.name == "Affirm - Pay Over Time"
  end
end
Output.payment_gateways = available_gateways
```

9\.  Click **Run Script**.\
10\.  Click **Save and Publish**.

The price floor takes effect immediately. Test it by attempting a checkout for an item less than the price floor amount.

# Sibling pages

* [Connecting the Affirm Payments App](https://docs.affirm.com/platforms/docs/connecting-the-affirm-payments-app.md)
* [Using the Promotional Messaging App for Shopify](https://docs.affirm.com/platforms/docs/using-the-promotional-messaging-app.md)
* [Processing transactions in Shopify](https://docs.affirm.com/platforms/docs/processing-transactions-in-shopify.md)
* [Manage Affirm payment customizations for Shopify stores](https://docs.affirm.com/platforms/docs/manage-affirm-payment-customizations-for-shopify-stores.md)
* [ALA Messaging with Theme App Blocks](https://docs.affirm.com/platforms/docs/ala-messaging-with-theme-app-blocks.md)
* [Shopify FAQs](https://docs.affirm.com/platforms/docs/shopify-faq.md)
* [Uninstall the Affirm Payment Method](https://docs.affirm.com/platforms/docs/uninstall-the-existing-affirm-payment-method.md)