shuup.core.templatetags package
Submodules
shuup.core.templatetags.prices module
Template tags for displaying prices correctly.
Prefer these filters for rendering prices of products and basket lines
or total price of basket, since the will take price display options of
current template context into account (see PriceDisplayOptions
).
Especially, they convert prices to correct taxness.
There is also a global context function show_prices
which can be used
to render certain price container elements conditionally.
shuup.core.templatetags.shuup_common module
Common helpers for Shuup templates.
Note
In addition to these, also the price rendering tags from
shuup.core.templatetags.prices
module are available.
- shuup.core.templatetags.shuup_common.get_language_choices()[source]
Get language choices as code and text in two languages.
- shuup.core.templatetags.shuup_common.money(amount, digits=None, widen=0)[source]
Format money amount according to the current locale settings.
- Parameters:
amount (shuup.utils.money.Money) – Money or Price object to format.
digits (int|None) – Number of digits to use, by default use locale’s default.
widen (int) – Number of extra digits to add; for formatting with additional precision, e.g.
widen=3
will use 5 digits instead of the default 2.
- Returns:
Formatted string representing the given amount
- Return type:
- shuup.core.templatetags.shuup_common.datetime(value, kind='datetime', format='medium', tz=True)[source]
Format a
datetime
for human consumption.The currently active locale’s formatting rules are used. The output of this function is probably not machine-parseable.
- Parameters:
value (datetime.datetime) – datetime object to format
kind (str) – Format as ‘datetime’, ‘date’ or ‘time’.
format (str) – Format specifier or one of ‘full’, ‘long’, ‘medium’ or ‘short’.
Convert to current or given timezone. Accepted values are:
- True (default)
convert to the currently active timezone (as reported by
django.utils.timezone.get_current_timezone
)- False (or other false value like empty string)
do no convert to any timezone (use UTC)
- Other values (as str)
convert to a given timezone (e.g.
"US/Hawaii"
)
- shuup.core.templatetags.shuup_common.get_shop_configuration(context, name, default=None)[source]
Get configuration variable value for the current shop.