More placeholders
{stock}, {sale_ends}, {attribute:…} and {sales}: units left, when a sale ends, an attribute's values and units sold.
Note
This is part of Labelline Pro.
Labelline Pro adds four placeholders. Like Labelline's, each is filled in for every product, and a label whose placeholder has nothing to show for a product is left off that product.
| Placeholder | Shows | Nothing to show when |
|---|---|---|
{stock} |
Units in stock: "Only {stock} left" → "Only 3 left". A variable product that tracks stock per variation shows them added up. | The product doesn't track stock, or none is left. |
{sale_ends} |
When the scheduled sale ends: "Ends today", "Ends tomorrow", "Ends in 3 days", counted in your site's calendar days. A variable product shows the first of its variations' end dates. | The product isn't on sale, or its sale has no end date. |
{attribute:pa_colour} |
An attribute's values, separated by commas: "Also in {attribute:pa_colour}" → "Also in Blue, Green". Use the attribute's slug after the colon: pa_ and the slug of a global attribute (Products → Attributes), or the name of a product's own attribute. |
The product doesn't have the attribute. |
{sales} |
Units sold, as WooCommerce counts them: "{sales} sold" → "1,250 sold". | Nothing sold yet. |
The insert buttons under the label's text add them for you; the {attribute:…} button inserts your first attribute's slug.
Combining them
- "Only {stock} left" with the condition Stock quantity from 1 to 5: a low-stock label that disappears when stock is replenished, or runs out.
- "{sale_ends}" with a clock icon and the Sale ending soon condition: a countdown for the last week of a sale.
- "{sales} sold" with the Best seller condition: social proof on your top products only.
{sale_ends} makes a label a sale label, like {discount}: WooCommerce's sale badge gives way to it (see Stockline, Discountline and the sale badge).
Note
Labels are worked out again within the hour, and when a product changes, so {sale_ends} moves on with the days. A page cache keeps whatever it stored; let it expire daily on pages with countdowns.