]> git.parisson.com Git - diggersdigest.git/commitdiff
fix price display
authorGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 24 Sep 2015 13:13:18 +0000 (15:13 +0200)
committerGuillaume Pellerin <guillaume.pellerin@ircam.fr>
Thu, 24 Sep 2015 13:13:18 +0000 (15:13 +0200)
app/templates/shop/includes/price.html
app/templates/shop/product.html

index 8df59a50bb06fa8d1f695ab789e06328b421b05c..adcf16737a6630c70b2a4f26751f4d0a73bd167a 100644 (file)
@@ -5,12 +5,15 @@
     <li id="variation-{{ variation.sku }}"
         {% if not variation.default %}style="display:none;"{% endif %}>
         {% if variation.has_price %}
-            {% if variation.on_sale %}
-                <span class="old-price">{{ variation.unit_price|currency }}</span>
-                {% trans "On sale:" %}
+            {% if product.available %}
+             {% if not variation.unit_price %}
+              <span class="price">{% trans "Price" %} : <a href="{% url 'page' 'about/contact-form' %}">{% trans "Make an offer" %}</a></span>
+             {% else %}
+              <span class="price">{% trans "Price" %} : {{ variation.unit_price|currency }}</span>
+             {% endif %}
             {% endif %}
-            <span class="price">{% trans "Price" %}: {{ variation.price|currency }}</span>
         {% else %}
+        oo
             {% if has_available_variations %}
             <span class="error-msg">
             {% trans "The selected options are currently unavailable." %}
index e49718b05577db15f292406496fafe43e1e40638..e04b80149e5b9820e606d12f09878128a6a1f14c 100644 (file)
@@ -97,16 +97,16 @@ $(function () {
   <li><strong>{{ product.record.artist }}</strong></li>
   <li><em>{{ product.record.title }}</em></li>
   <li>
-    {% trans "Label:" %}
+    {% trans "Label:" %} 
     {{ product.record.label }}
   </li>
   <li>
-    {% trans "Country:" %}
+    {% trans "Country" %}:
     {{ product.record.country }}
    </li>
   {% if product.record.release_year %}
   <li>
-    {% trans "Release year:" %}
+    {% trans "Release year" %}:
     {{ product.record.release_year }}
   </li>
   {% else %}
@@ -115,7 +115,7 @@ $(function () {
     {{ product.record.release_decade }}</li>
   {% endif %}
   <li>
-    {% trans "Cover:" %}
+    {% trans "Cover state" %}:
     <a class="badge" tabindex="0" role="button" data-toggle="popover" data-trigger="hover focus"
       title="{{ product.record.cover_condition.name }}"
     data-content="{{ product.record.cover_condition.description }}">
@@ -123,14 +123,19 @@ $(function () {
     </a>
   </li>
   <li>
-    {% trans " Vinyl:" %}
+    {% trans " Vinyl state" %}:
     <a class="badge" tabindex="0" role="button" data-toggle="popover" data-trigger="hover focus"
       title="{{ product.record.vinyl_condition.name }}"
     data-content="{{ product.record.cover_condition.description }}">
     {{ product.record.vinyl_condition.abbr }}
     </a>
   </li>
+  {% if product.available and has_available_variations %}
+  {% errors_for add_product_form %}
   <li>{% include "shop/includes/price.html" %}</li>
+  {% else %}
+  <li><span class="error-msg">{% trans "This product is currently unavailable." %}</span></li>
+  {% endif %}
 </ul>
 
 <div class="audio">
@@ -151,9 +156,7 @@ $(function () {
 </div>
 
 {% if product.available and has_available_variations %}
-
-{% errors_for add_product_form %}
-
+<br/>
 <form method="post" id="add-cart" class="shop-form">{% csrf_token %}
     <div style="display: none;">
     {% fields_for add_product_form %}
@@ -165,8 +168,6 @@ $(function () {
         {% endif %}
     </div>
 </form>
-{% else %}
-<p class="error-msg">{% trans "This product is currently unavailable." %}</p>
 {% endif %}
 
 {% if settings.SHOP_USE_RATINGS %}