Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Look for a custom template for subclassed Products.

  • Loading branch information...
commit 6ec055d21426a73980d7500d390b118e6465682f 1 parent 2dbe303
@AlexHill AlexHill authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 cartridge/shop/views.py
View
9 cartridge/shop/views.py
@@ -79,7 +79,14 @@ def product(request, slug, template="shop/product.html"):
for_user=request.user),
"add_product_form": add_product_form
}
- return render(request, template, context)
+
+ templates = []
+ # Check for a template matching the page's content model.
+ if product.content_model is not None:
+ templates.append(u"shop/products/%s.html" % product.content_model)
+ templates.append(template)
+
+ return render(request, templates, context)
@never_cache
Please sign in to comment.
Something went wrong with that request. Please try again.