mirror of
https://github.com/kemko/liquid.git
synced 2026-01-04 01:05:40 +03:00
1.8 KiB
1.8 KiB
layout, title, nav
| layout | title | nav | ||
|---|---|---|---|---|
| default | discount |
|
discount
The discount object has the following attributes:
{% anchor_link "discount.id", "discount.id" %}
Returns the id of the discount.
{% anchor_link "discount.code", "discount-code" %}
Returns the code of the discount.
Input
{% highlight html %}{% raw %}
{{ discount.code }}
{% endraw %}{% endhighlight %}
Output
{% highlight html %}{% raw %}
SPRING14
{% endraw %}{% endhighlight %}
{% anchor_link "discount.amount", "discount-amount" %}
Returns the amount of the discount. Use one of the money filters to return the value in a monetary format.
Input
{% highlight html %}{% raw %}
{{ discount.amount | money }}
{% endraw %}{% endhighlight %}
Output
{% highlight html %}{% raw %}
$25
{% endraw %}{% endhighlight %}
{% anchor_link "discount.savings", "discount-savings" %}
Returns the amount of the discount's savings. The negative opposite of amount. Use one of the money filters to return the value in a monetary format.
Input
{% highlight html %}{% raw %}
{{ discount.savings | money }}
{% endraw %}{% endhighlight %}
Output
{% highlight html %}{% raw %}
$-25
{% endraw %}{% endhighlight %}
{% anchor_link "discount.type", "discount-type" %}
Returns the type of the discount. The possible values of discount.type are:
- FixedAmountDiscount
- PercentageDiscount
- ShippingDiscount