Prices
A price is one plan, at one licence tier, on one billing cycle, rendered live from the copy of your Freemius pricing stored on your site.
Insert the Freemius price block, or write [pflp_price]. Both run the same
code, so a page built with blocks and a page built with shortcodes cannot drift
apart. Every attribute and every default is on the Reference
page; this page explains what each one is for.
What it renders
An inline span holding the figure:
[pflp_price] -> $25
[pflp_price plan="b2" licenses="3" cycle="annual"] -> $25
[pflp_price plan="b2" licenses="3" style="code"] -> USD 25
style is the Style control in the block, symbol or code.
Whole prices carry no decimals, anything else carries two, and thousands are
grouped in your site's language. Because it is inline, a price sits happily in
the middle of a sentence; align="left", "center" or "right" puts it on a
line of its own, which is what a figure at the top of a pricing card wants.
The span carries every currency and every billing cycle the tier sells, so both toggles are a swap in the visitor's browser with nothing asked of your server.
Nothing has to be chosen
Leave an attribute out and it is filled in:
- plan - the plan Freemius marks as featured, otherwise the first plan that has a price.
- licences - that plan's lowest numbered tier.
- billing cycle - your Default cycle from the Settings screen where the tier sells it, otherwise the first it does sell, trying yearly, then monthly, then lifetime.
- currency - whatever the visitor is reading.
An attribute you do write is never second-guessed. That is the point of writing
one: cycle="lifetime" on a card that must always show its lifetime figure
keeps showing it while a billing cycle toggle moves everything around it, and
currency="gbp" does the same for the currency toggle.
Text after the price
Nothing is printed after the figure unless you ask for it, so no page written before this feature existed changed when it arrived.
| You write | The page shows |
|---|---|
nothing, or suffix="none" | $25 |
suffix="auto" | $25 /year, using your Text after the price settings and following the cycle |
suffix="per seat" | $25 per seat, exactly as written, on every cycle |
auto is the one that moves: the three texts under Billing cycle on the
Settings screen (/month, /year and one-time to start with) are all carried
in the page, and the one shown changes with the toggle. Your own words are your
own words, so they stay put.
In the block this is the Text after the price control: None, Site default, or Custom text with a field.
The text is its own <span class="pflp-price-suffix"> with a space before it,
so a reader copying the price gets "$25 /year", and your CSS can size or hide it
without touching the figure.
When the plan does not sell that cycle
A tier that sells yearly and lifetime but not monthly has no monthly figure, and inventing one is the fault this plugin exists to remove. So the price says why.
| You write | What the page does |
|---|---|
nothing, or missing="text" | prints the reason: Yearly or Lifetime |
missing="hide" | prints nothing at all |
missing_text="Yearly plans only" | prints your words instead of the derived ones |
The derived wording is built from the cycles the tier does sell, in your own words for them from the Settings screen, in calendar order:
- one cycle: Yearly only
- two: Monthly or Yearly
- three: Monthly, Yearly or Lifetime
Derived rather than typed, so a plan that starts selling monthly stops saying it does not, with no edit to the page. Rename Yearly to Annual under Toggle labels and the sentence follows.
The words are written into the page whether or not they are needed at first, because a billing cycle toggle can land on that cycle at any moment and the answer has to be there already. The unavailable state is set smaller and lighter than a price, so it does not read as one; see Styling for the class.
In the block this is the If the plan does not sell this cycle control: Show why, Nothing, or Custom text.
One case is not this case. A cycle value that is not monthly, annual or
lifetime is a typo in the shortcode rather than a gap in your pricing, so it
renders an empty span and a line in the log, not "Yearly only".
When there is no row at all
A plan name that does not match, or a licence tier the plan does not sell,
renders an empty span. Never a 0, never another row's figure. The reason goes
to the log as a shortcode_row_missing line naming which shortcode asked and
what did not match, on the Logs tab of the Settings screen.
The quickest fix is the Shortcode builder on the product's own screen, which can only build combinations your product actually sells.
Screen readers
Every price span carries aria-live="polite", so a figure that changes under a
reader is announced once they have stopped moving, rather than silently or
immediately.