Prints the campaign's discount percentage or discount percentage range.

Kuvaus

The discount percentage is calculated automatically based on the discounts of products added to the campaign. In such case, the products' custom discounts that aren't based on the campaign's general discount percentage are taken into account too.

If the product has multiple discount prices, the tag will print a price range. The range is defined automatically based on the smallest and biggest discount.

The contents produced by the tag does not apply to the campaign's potential line discount but just to product discounts.

Syntaksi

{CampaignDiscount(
    mode: string,
    precision: int
)}

Näkyvyys

Toimii näkyvyydessä: kampanja

The required scope is always set in the following templates:

Templates
Campaign

Attribuutit

mode:

Defines the format in which the percentage discount should be printed.

Allowed values:

  • 'min': prints the campaign's smallest discount
  • 'max': prints the campaign's biggest discount
  • 'range': prints the range of campaign's discount percentages (e.g. 20–30%)
precision:

Defines the percentage to which the discount to be printed is rounded.

Allowed values: 1, 5 & 10. The default value is 1.

E.g. with a value of 1, exact percentages are printed, while with a value of 5, the percentage is rounded to the nearest ten or five.

before: / after:

With these two attributes, 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 before and after attributes will also not be displayed.

escape:

Adds escape characters to the content printed by the tag, making it easier to use the content in JavaScript code or JSON objects.

Sallitut arvot:
  • true: the attribute adds escape characters before quotation marks
  • false: the attribute does nothing
  • json: the attribute adds escape characters to the output, allowing the content to be used in JSON markup.
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.'