Paddle Billing
Search

Prevent customers from removing a discount at checkout

Use a parameter or HTML data attribute when working with Paddle.js to hide the option to remove an applied discount at checkout.

What's new?

We added a new parameter to the Paddle.Checkout.open() method and Paddle.Initialize() methods that you can use to prevent customers from removing an applied discount at checkout when working with Paddle.js:

settingsobject

Set general checkout settings.

allowDiscountRemovalboolean or null

Whether the user can remove an applied discount at checkout. Defaults to true.

We also added a corresponding HTML data attribute:

data-allow-discount-removalboolean

Whether the user can remove an applied discount at checkout. Defaults to true.

How it works

Discounts let you reduce the amount that a customer has to pay by a percentage (e.g. -10%) or fixed amount (e.g. -$10) for an item, transaction, or subscription. You can set discounts up so that customers can apply them at checkout using a code, or automatically apply them by passing them to Paddle.js when opening a checkout.

When a discount is applied, Paddle Checkout includes an option to let customers remove an applied discount.

The new allowDiscountRemoval settings parameter and data-allow-discount-removal HTML data attribute let you prevent customers from removing an applied discount at checkout. When false, the message showing that a discount has been applied does not include the button to remove the discount.

When true (default)

When true (or if omitted), customers may remove the applied discount using the cross icon.

Screenshot of the top-left of an inline checkout. There is a message that says CHECKOUT DEMO applied. Next to the message, there is an x icon to remove the applied discount.

When false

When false, the applied discount is presented to the customer but they can't remove it.

Screenshot of the top-left of an inline checkout. There is a message that says CHECKOUT DEMO applied. There is no icon to remove the applied discount.

You can pass settings for opened checkouts using either Paddle.Checkout.open() or Paddle.Initialize(). Settings passed to Paddle.Initalize() are default settings, applied to all checkouts opened on a page.

This change removes the option for customers to remove a discount themselves, but you can still use the Paddle.Checkout.updateCheckout() method to remove a discount programmatically.

Examples

Next steps

This change is live in Paddle.js now, so you can start using allowDiscountRemoval or data-allow-discount-removal when you're ready.

You don't need to do anything to get the latest version of Paddle.js — we serve the latest version automatically.

Learn more