Black Friday: 79% off every plugin Shop the sale →

Selling with the Buy Button

The [lc_buy_button] shortcode#

Add the shortcode to any page, post or widget that accepts shortcodes. It renders a styled button that opens the Paddle overlay checkout for the given price.

[lc_buy_button price_id="pri_01hxyz…" label="Buy now"]
AttributeDescriptionDefault
price_idRequired. The Paddle price ID (pri_…) of a pricing package. Shown under the package name on the Products → Prices panel.—
labelButton text.Buy Now
colorBackground colour as a hex value.#6366f1
sizesmall, medium or large.medium
full_widthyes makes the button span its container.no
iconEmoji or short text shown before the label. Pass an empty string to hide it.🛒

Examples:

[lc_buy_button price_id="pri_01h…" label="Get the 3-site plan" color="#e67e22" size="large"]
[lc_buy_button price_id="pri_01h…" label="Start yearly subscription" full_width="yes" icon=""]

If price_id is missing the shortcode outputs an HTML comment instead of a button, so nothing broken appears on the page.

What happens on click#

  1. Paddle.js (loaded only when a client-side token is saved for the active environment) opens the checkout overlay for the price.
  2. The button passes a one-time checkout token as Paddle custom data and sets the success URL to your portal page.
  3. After payment Paddle redirects the buyer to the portal, which shows a “Preparing Your License” screen and refreshes every few seconds.
  4. As soon as the transaction.completed webhook has created the account and license, the same token logs the buyer in automatically and their dashboard appears with the new key.

The checkout token stays valid for 6 hours (filterable), so a buyer who finishes checkout slowly is still logged in.

Put several buttons on one pricing page, one per package. They all share a single checkout token per page view, so there is no extra database load.

Was this article helpful?