|
|
@@ -5,13 +5,13 @@
|
|
5
|
5
|
{% load basket_tags %}
|
|
6
|
6
|
|
|
7
|
7
|
{% block header %}
|
|
8
|
|
- <h1>{{ item.get_title }}</h1>
|
|
|
8
|
+ <h1>{{ product.get_title }}</h1>
|
|
9
|
9
|
{% endblock header %}
|
|
10
|
10
|
|
|
11
|
11
|
|
|
12
|
12
|
{% block content %}
|
|
13
|
13
|
<div class="images">
|
|
14
|
|
- {% for image in item.images.all %}
|
|
|
14
|
+ {% for image in product.images.all %}
|
|
15
|
15
|
<img src="{{ imageurl }}" width="200" height="200">
|
|
16
|
16
|
{% if image.caption %}
|
|
17
|
17
|
<div class="caption">{{ image.caption }}</div>
|
|
|
@@ -22,30 +22,30 @@
|
|
22
|
22
|
<table>
|
|
23
|
23
|
<caption>Product details</caption>
|
|
24
|
24
|
<tr>
|
|
25
|
|
- <th>UPC</th><td>{{item.upc}}</td>
|
|
|
25
|
+ <th>UPC</th><td>{{ product.upc }}</td>
|
|
26
|
26
|
</tr>
|
|
27
|
27
|
<tr>
|
|
28
|
|
- <th>Product class</th><td>{{item.product_class.name}}</td>
|
|
|
28
|
+ <th>Product class</th><td>{{ product.product_class.name }}</td>
|
|
29
|
29
|
</tr>
|
|
30
|
|
- {% if item.stockrecord %}
|
|
|
30
|
+ {% if product.stockrecord %}
|
|
31
|
31
|
<tr>
|
|
32
|
|
- <th>Price (excl. tax)</th><td>{{item.stockrecord.price_incl_tax|currency}}</td>
|
|
|
32
|
+ <th>Price (excl. tax)</th><td>{{ product.stockrecord.price_incl_tax|currency }}</td>
|
|
33
|
33
|
</tr>
|
|
34
|
34
|
<tr>
|
|
35
|
|
- <th>Price (incl. tax)</th><td>{{item.stockrecord.price_excl_tax|currency}}</td>
|
|
|
35
|
+ <th>Price (incl. tax)</th><td>{{ product.stockrecord.price_excl_tax|currency }}</td>
|
|
36
|
36
|
</tr>
|
|
37
|
37
|
<tr>
|
|
38
|
38
|
<th>Availability</th>
|
|
39
|
|
- <td>{{ item.stockrecord.availability }}</td>
|
|
|
39
|
+ <td>{{ product.stockrecord.availability }}</td>
|
|
40
|
40
|
</tr>
|
|
41
|
41
|
{% endif %}
|
|
42
|
42
|
<tr>
|
|
43
|
43
|
<th>Product type</th>
|
|
44
|
44
|
<td>
|
|
45
|
|
- {% if item.is_group %}Product group{% else %}{% if item.is_variant %}Variant{% else %}Stand-alone{% endif %}{% endif %}
|
|
|
45
|
+ {% if product.is_group %}Product group{% else %}{% if product.is_variant %}Variant{% else %}Stand-alone{% endif %}{% endif %}
|
|
46
|
46
|
</td>
|
|
47
|
47
|
</tr>
|
|
48
|
|
- {% for attribute in item.attributes.all %}
|
|
|
48
|
+ {% for attribute in product.attributes.all %}
|
|
49
|
49
|
<tr>
|
|
50
|
50
|
<th>{{ attribute.type.name }}</th>
|
|
51
|
51
|
<td>{{ attribute.value }}</td>
|
|
|
@@ -62,9 +62,9 @@
|
|
62
|
62
|
|
|
63
|
63
|
</table>
|
|
64
|
64
|
|
|
65
|
|
-{% if item.stockrecord %}
|
|
|
65
|
+{% if product.stockrecord %}
|
|
66
|
66
|
|
|
67
|
|
-{% basket_form item as basket_form %}
|
|
|
67
|
+{% basket_form product as basket_form %}
|
|
68
|
68
|
|
|
69
|
69
|
<form action="{% url basket:add %}" method="post">
|
|
70
|
70
|
{% csrf_token %}
|
|
|
@@ -74,7 +74,7 @@
|
|
74
|
74
|
{% endif %}
|
|
75
|
75
|
|
|
76
|
76
|
<h2>Categories</h2>
|
|
77
|
|
-{% for category in item.categories.all %}
|
|
|
77
|
+{% for category in product.categories.all %}
|
|
78
|
78
|
<p>
|
|
79
|
79
|
{% for c in category.get_ancestors %}
|
|
80
|
80
|
{% if not forloop.first %} > {% endif %}<a href="{{ c.get_absolute_url }}">{{ c.name }}</a>
|
|
|
@@ -87,10 +87,10 @@
|
|
87
|
87
|
<h2>Customer Reviews</h2>
|
|
88
|
88
|
<p>Read customer reviews on this product. If you have read this book, why not post your own
|
|
89
|
89
|
review?</p>
|
|
90
|
|
-<p><a href="{% url catalogue:reviews-add item.slug item.id %}">Add a review</a></p>
|
|
|
90
|
+<p><a href="{% url catalogue:reviews-add product.slug product.id %}">Add a review</a></p>
|
|
91
|
91
|
|
|
92
|
92
|
|
|
93
|
|
-{% with item.reviews.all as reviews %}
|
|
|
93
|
+{% with product.reviews.all as reviews %}
|
|
94
|
94
|
{% if reviews %}
|
|
95
|
95
|
<div>
|
|
96
|
96
|
{% for review in reviews|slice:":3" %}
|
|
|
@@ -108,29 +108,29 @@
|
|
108
|
108
|
{% endif %}
|
|
109
|
109
|
</div>
|
|
110
|
110
|
{% endfor %}
|
|
111
|
|
- <p><a href="{% url catalogue:reviews-list item.slug item.id %}">See all reviews</a>.</p>
|
|
|
111
|
+ <p><a href="{% url catalogue:reviews-list product.slug product.id %}">See all reviews</a>.</p>
|
|
112
|
112
|
</div>
|
|
113
|
113
|
{% endif %}
|
|
114
|
114
|
{% endwith %}
|
|
115
|
115
|
|
|
116
|
116
|
{% endblock product_review %}
|
|
117
|
117
|
|
|
118
|
|
-{% if item.related_items.count %}
|
|
|
118
|
+{% if product.related_items.count %}
|
|
119
|
119
|
<div class="products">
|
|
120
|
120
|
<h4>Related items</h4>
|
|
121
|
121
|
<ul>
|
|
122
|
|
- {% for product in item.related_items.all %}
|
|
|
122
|
+ {% for product in product.related_items.all %}
|
|
123
|
123
|
<li><a href="{{ product.get_absolute_url }}">{{ product.get_title }}</a></li>
|
|
124
|
124
|
{% endfor %}
|
|
125
|
125
|
</ul>
|
|
126
|
126
|
</div>
|
|
127
|
127
|
{% endif %}
|
|
128
|
128
|
|
|
129
|
|
-{% if item.recommended_items.count %}
|
|
|
129
|
+{% if product.recommended_items.count %}
|
|
130
|
130
|
<div class="products">
|
|
131
|
131
|
<h4>Recommended items</h4>
|
|
132
|
132
|
<ul>
|
|
133
|
|
- {% for product in item.recommended_items.all %}
|
|
|
133
|
+ {% for product in product.recommended_items.all %}
|
|
134
|
134
|
<li><a href="{{ product.get_absolute_url }}">{{ product.get_title }}</a></li>
|
|
135
|
135
|
{% endfor %}
|
|
136
|
136
|
</ul>
|