shuup.front.template_helpers package

Submodules

shuup.front.template_helpers.basket module

shuup.front.template_helpers.basket.get_properties_from_line(line: shuup.core.order_creator.SourceLine) → typing.Iterable[shuup.front.utils.order_source.LineProperty][source]

shuup.front.template_helpers.category module

shuup.front.template_helpers.category.get_manufacturers(context)[source]

shuup.front.template_helpers.general module

shuup.front.template_helpers.general.get_login_form(request, id_prefix='quick-login')[source]
shuup.front.template_helpers.general.get_listed_products(context, n_products, ordering=None, filter_dict=None, orderable_only=True, extra_filters=None)[source]

A cached version of _get_listed_products

shuup.front.template_helpers.general.get_best_selling_products(context, n_products=12, cutoff_days=30, orderable_only=True, supplier=None)[source]
shuup.front.template_helpers.general.get_newest_products(context, n_products=6, orderable_only=True)[source]
shuup.front.template_helpers.general.get_random_products(context, n_products=6, orderable_only=True)[source]
shuup.front.template_helpers.general.get_products_for_categories(context, categories, n_products=6, orderable_only=True)[source]
shuup.front.template_helpers.general.get_all_manufacturers(context)[source]
shuup.front.template_helpers.general.get_root_categories(context)[source]
shuup.front.template_helpers.general.get_pagination_variables(context, objects, limit)[source]

Get pagination variables for template

Parameters:
  • context – template context
  • objects – objects paginated
  • limit – per page limit
Returns:

variables to render object-list with pagination

shuup.front.template_helpers.general.get_shop_language_choices(context)[source]
shuup.front.template_helpers.general.is_shop_admin(context)[source]
shuup.front.template_helpers.general.is_company_registration_allowed(context, request=None)[source]
shuup.front.template_helpers.general.can_toggle_all_seeing(context)[source]
shuup.front.template_helpers.general.get_admin_edit_url(context, intance_or_model)[source]
shuup.front.template_helpers.general.get_powered_by_content(context)[source]
shuup.front.template_helpers.general.get_config(context)[source]
shuup.front.template_helpers.general.is_authenticated(user)[source]

shuup.front.template_helpers.order module

shuup.front.template_helpers.order.get_properties_from_line(line: shuup.core.models.OrderLine) → typing.Iterable[shuup.front.utils.order_source.LineProperty][source]

shuup.front.template_helpers.product module

shuup.front.template_helpers.product.get_visible_attributes(product)[source]
shuup.front.template_helpers.product.get_subscription_options_for_product(shop, product, supplier=None, user=None, **kwargs)[source]
shuup.front.template_helpers.product.get_products_bought_with(context, product, count=5)[source]
shuup.front.template_helpers.product.is_visible(context, product)[source]
shuup.front.template_helpers.product.get_product_cross_sells(context, product, relation_type=<ProductCrossSellType.RELATED: 2>, count=4, orderable_only=True, use_variation_parents=False)[source]
shuup.front.template_helpers.product.map_relation_type(relation_type)[source]

Map relation type to enum value.

Return type:ProductCrossSellType
Raises:LookupError if unknown string is given

shuup.front.template_helpers.urls module

shuup.front.template_helpers.urls.model_url(context, model, absolute=False, raise_when_not_found=True, **kwargs)[source]

Iterate over all front_model_url_resolver provides trying to find some url for the given model. The first value returned by the resolver will be used.

If no url is returned and raise_when_not_found is set to True (the default), an exception will be raised.

shuup.front.template_helpers.urls.get_url(url, *args, **kwargs)[source]

Try to get the reversed URL for the given route name, args and kwargs.

If reverse resolution fails, returns None (instead of throwing an exception).

Parameters:
Returns:

Reversed URL or None

Return type:

str|None

shuup.front.template_helpers.urls.has_url(url, *args, **kwargs)[source]

Try to get the reversed URL for the given route name, args and kwargs and return a success flag.

Parameters:
Returns:

Success flag

Return type:

bool

shuup.front.template_helpers.urls.get_logout_url(context, *args, **kwargs)[source]

Module contents