shoop.front.template_helpers package

Submodules

shoop.front.template_helpers.category module

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

shoop.front.template_helpers.general module

shoop.front.template_helpers.general.get_best_selling_products(context, n_products=12, cutoff_days=30, no_variation_children=False)[source]
shoop.front.template_helpers.general.get_newest_products(context, n_products=6)[source]
shoop.front.template_helpers.general.get_random_products(context, n_products=6)[source]
shoop.front.template_helpers.general.get_all_manufacturers(context)[source]
shoop.front.template_helpers.general.get_root_categories(context)[source]
shoop.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

shoop.front.template_helpers.product module

shoop.front.template_helpers.product.get_visible_attributes(product)[source]
shoop.front.template_helpers.product.get_products_bought_with(context, product, count=5)[source]
shoop.front.template_helpers.product.is_visible(context, product)[source]
shoop.front.template_helpers.product.get_product_cross_sells(context, product, relation_type='related', count=4)[source]

shoop.front.template_helpers.urls module

shoop.front.template_helpers.urls.model_url(context, model, absolute=False)[source]
shoop.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:
  • url (str) – URL name.
  • args (Iterable[object]) – URL args
  • kwargs (dict[str, object]) – URL kwargs
Returns:

Reversed URL or None

Return type:

str|None

shoop.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:
  • url (str) – URL name.
  • args (Iterable[object]) – URL args
  • kwargs (dict[str, object]) – URL kwargs
Returns:

Success flag

Return type:

bool

Module contents