Permalink
Browse files

Look for a custom template for subclassed Products.

  • Loading branch information...
1 parent 2dbe303 commit 6ec055d21426a73980d7500d390b118e6465682f @AlexHill AlexHill committed Aug 30, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 cartridge/shop/views.py
View
@@ -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

0 comments on commit 6ec055d

Please sign in to comment.