The tag prints the product's discount percentage if the product is on sale through a campaign.
Kuvaus
The discount percentage can be determined in two ways:
- If the product is priced according to the general discount percentage of the campaign, the campaign discount percentage will be shown.
- If the product has a unique discount price in the campaign, the discount percentage is determined by the difference between the product's sale price and list price.
The discount percentage of products with variations is displayed if it is the same for all variations of the product. If the discount percentage, on the other hand, varies by variation, the tag does not display anything by default. By using the mode attribute, you can specify whether the smallest or largest discount percentage of the variations is displayed, or their range.
Syntaksi
{ProductDiscountPercent( mode: string, percentagesymbol: boolean )}Näkyvyys
Toimii näkyvyydessä: tuote
The required scope is always set in the following templates:
| Templates |
|---|
| Single product template |
| Product images |
Attribuutit
mode:The attribute determines what kind of discount information is displayed if there are variations of the product with varying discount percentages. (Without the attribute, nothing is displayed.)
Sallitut arvot:- min: the minimum discount percentage of variations (e.g., At least 20%)
- max: the highest discount percentage of variations (e.g., Up to 40%)
- range: range of discount percentages (e.g. 20% – 40%)
To add a complementary expression to a numerical value (such as At least or Even), use the
beforeorafterattribute.percentagesymbol:Determines whether a percentage sign is included after the numeric value.
Allowed values: true/false. The default value is false.
before/after:With the
beforeandafterattributes, you can define content that is output before or after the content produced by the tag.Allowed values: text that may contain HTML and Interface markup.
E.g.
before:'<p>This markup appears before the tag's own content.</p>'.after:'<p>This appears after the tag's own content.</p>'
If the tag does not produce any content, the content of the
beforeandafterattributes will also not be displayed.escape:Adds an escape character before quotation marks in the output. The attribute makes it easier to process the tag-produced content when using JavaScript.
Allowed values: true/false. The default value is false.
or:Defines alternative content that is displayed if the tag itself does not produce any content.
Allowed values: text that may contain HTML and Interface markup.
E.g.
or:'Content not found.'
