from django import template

from oscar.core.loading import get_class

register = template.Library()

LineSession = get_class("oscar.utils", "LineSession")


@register.simple_tag(takes_context=False)
def total_purchase_info_for_line(request, line):
    return {"price": LineSession(line), "stockrecord": line.stockrecord}
