diff --git a/registrasion/templates/product_category.html b/registrasion/templates/product_category.html index 0e567bf0..fb54a58d 100644 --- a/registrasion/templates/product_category.html +++ b/registrasion/templates/product_category.html @@ -5,8 +5,6 @@

Product Category: {{ category.name }}

-

{{ category.description }}

-
{% csrf_token %} @@ -14,13 +12,37 @@ {{ voucher_form }} - +

+ {% if discounts %} +

Available Discounts

+ + {% endif %} + +

Available Products

+

{{ category.description }}

{{ form }}
- +

diff --git a/registrasion/views.py b/registrasion/views.py index da0eb657..83e80a0d 100644 --- a/registrasion/views.py +++ b/registrasion/views.py @@ -1,5 +1,6 @@ from registrasion import forms from registrasion import models as rego +from registrasion.controllers import discount from registrasion.controllers.cart import CartController from registrasion.controllers.invoice import InvoiceController from registrasion.controllers.product import ProductController @@ -175,8 +176,10 @@ def product_category(request, category_id): voucher_form = forms.VoucherForm(prefix=VOUCHERS_FORM_PREFIX) + discounts = discount.available_discounts(request.user, [], products) data = { "category": category, + "discounts": discounts, "form": cat_form, "voucher_form": voucher_form, }