Skip to content

Commit 02f2b92

Browse files
committed
Promotional and sale pricing terminology
1 parent fa3ba30 commit 02f2b92

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

docs/commerce/5.x/system/products-variants.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,32 @@ Every variant has a _price_ and a _promotional price_. Both base prices are defi
263263

264264
Prices are defined for each [store](stores.md) a variant is available in; in the control panel, however, you will manage those differences on a per-_site_ basis. If two sites point to the same store, you will see the same price and input currency when editing the variant in either.
265265

266+
#### Promotional Price
267+
268+
When provided, a promotional price takes precedence over the base price in all calculations. This is also the case after Commerce evaluates pricing rules, but only when the promotional price ends up _less_ than the base price.
269+
270+
In a template, you can test whether a product has a promotional price (and it is less than its base price):
271+
272+
```twig{6-10}
273+
{% for variant in product.variants %}
274+
<label class="option">
275+
<input name="purchasableId" value="{{ variant.id }}" type="radio">
276+
<span class="label">{{ purchasable.title }}</label>
277+
<span class="price {{ variant.onPromotion ? 'price--has-promo' : null }}">
278+
<span class="price__base">{{ variant.price|commerceCurrency }}</span>
279+
280+
{% if variant.onPromotion %}
281+
<span class="price__promotional">{{ variant.promotionalPrice|commerceCurrency }}</span>
282+
{% endif %}
283+
</span>
284+
</label>
285+
{% endfor %}
286+
```
287+
288+
#### Sale Price
289+
290+
If you only want to advertise a single price, let Commerce reconcile the base and promotional price by using `variant.salePrice`.
291+
266292
### Stock
267293

268294
Commerce tracks inventory at the variant level, using **Inventory Items** that correspond to each unique SKU in the system.

0 commit comments

Comments
 (0)