BrightLeaf Digital Code Snippet Library

Check out our growing library of code snippets for Gravity Forms!

Pricing Table Shortcode

BrightLeaf Pricing Table — Single-File Shortcode Snippet

Goal

  • Make it easy to add a clear, modern pricing table to any page with simple shortcodes.
  • Keep everything in one place: the layout, styles, and behavior live in this single file.
  • Optionally connect to Freemius for checkout and automatically load your plans and prices.

Features

  • Clean pricing cards with a Monthly/Annual toggle.
  • One or more plans, each with license tiers, a short description, and a feature list.
  • Site count selector that stays in sync across all plans.
  • Optional Freemius checkout (Buy and Trial buttons), including license count and billing cycle.
  • Optional "Automatic" mode to pull plans and prices from your Freemius account.
  • All CSS and JS are included right here and only appear once per page.

Requirements

  • WordPress page or post where you can paste shortcodes.
  • For Freemius checkout (manual plan entry): Public Key, Product ID, and each plan’s Plan ID.
  • For Freemius Automatic mode: Freemius Product ID and a token stored in a PHP constant.

How To Use

1) Parent Shortcode

Place the parent shortcode on the page. It controls product information, Freemius options, and overall behavior.

[gopricingtable
  public_key="pk_XXXX"
  product_name="Your Product"
  product_id="12345"
  freemius=""|"manual"|"automatic"
  buy_url="https://example.com/buy"
  trial_url="https://example.com/trial"
  product_prefix="your-product"
  currency="usd|eur|gbp"
  cache_ttl="21600"
  site_tiers_label="Single Site|Up to 3 Sites|Up to 10 Sites"
  bearer_constant="FS_API_TOKEN"
  coupon="123,456"
  discount="$10" | "15%"
]
...one or more child plan shortcodes...
[/gopricingtable]

Parent Attributes (Plain Language)

  • public_key — Your Freemius public key.
  • product_name — Shown in checkout and used for button IDs.
  • product_id — Freemius product ID.
  • freemius — Turns Freemius features on or off.
  • buy_url / trial_url — URL destinations when Freemius is off.
  • product_prefix — ID prefix for analytics/testing.
  • currency — usd (default), eur, gbp.
  • cache_ttl — Seconds to cache pricing (default: 21600).
  • coupon — Comma-separated Freemius coupon IDs.
  • discount — "$10" or "15%".
  • site_tiers_label — Pipe-separated tier labels.
  • bearer_constant — PHP constant name for your Freemius token.

2) Child Plan Shortcode

Add one child per plan (settings only—nothing prints alone).

[go_plan_column
  plan_name="Pro"
  plan_id="111"
  site_tiers_label="Single Site|Up to 3 Sites"
  site_tiers="1|3"
  monthly="9.99|14.99"
  annual="89.99|134.99"
  plan_desc="Great for individuals"
  plan_features="Feature A|Feature B|Feature C"
  best_value="true"
  has_trial="true"
]

Child Attributes

  • plan_name — Name shown on the card.
  • plan_id — Required when Freemius is on.
  • site_tiers_label — Pipe-separated labels.
  • site_tiers — Matching numeric tier counts.
  • monthly / annual — Prices (pipe-separated).
  • plan_desc — Optional description.
  • plan_features — Bullet list (pipe-separated).
  • best_value — Highlights plan.
  • has_trial — Show/hide trial button.

Examples

Manual Plans with Freemius Checkout

[gopricingtable public_key="pk_XXXX" product_name="My Add-on" product_id="12345" freemius="manual"]
[go_plan_column plan_name="Pro" plan_id="111" site_tiers_label="Single Site|Up to 3 Sites" site_tiers="1|3" monthly="9.99|14.99" annual="89.99|134.99" plan_desc="For individual sites" plan_features="Feature A|Feature B|Feature C"]
[go_plan_column plan_name="Premium" plan_id="222" best_value="true" site_tiers_label="Single Site|Up to 3 Sites" site_tiers="1|3" monthly="14.99|24.99" annual="134.99|224.99" plan_desc="For growing teams" plan_features="Everything in Pro|Priority support"]
[/gopricingtable]

Automatic Plans

[gopricingtable freemius="automatic" product_id="15834" currency="usd" bearer_constant="FS_API_TOKEN"]

Tip: Define your token once in wp-config.php.


Behavior Notes

  • Monthly/Annual toggle: Annual shows per-month savings.
  • Site tiers: Updating site count syncs across all plans.
  • Buttons: Freemius opens checkout with selected options.
  • Best Value badge: Highlights recommended plan.

Accessibility

  • Keyboard-friendly controls.
  • Clear labels and logical layout.
  • Strong color contrast.

Helpful Tips

  • Keep feature lists short.
  • Use consistent tiers across plans.
  • Omit monthly price if selling annual-only.
  • Set product_name for a polished checkout panel.
  • Use product_prefix for analytics.

Support & Troubleshooting

  • Ensure at least one child plan exists (unless automatic mode).
  • If buttons fail, confirm Freemius config or links.
  • In automatic mode, verify the token constant exists.
Install Using Code Snippets

This code is best installed directly on your site using the Code Snippets plugin.

Check Out the Code

Loading...

Code Copied!
Stay Updated On This Snippet

This entry has no reviews.