Commits

Kai Diefenbach committed 279d0ed

Added unit to price

Comments (0)

Files changed (3)

lfstheme/templates/lfs/cart/added_to_cart_items.html

     {% for cart_item in cart_items %}
         <tr>
             <td class="image">
-                <img src="{{cart_item.product.get_image.url_60x60}}"
-                     alt="{{cart_item.product.get_name}}"/>
+                <img src="{{ cart_item.product.get_image.url_60x60 }}"
+                     alt="{{ cart_item.product.get_name }}"/>
             </td>
             <td>
-                {{cart_item.product.get_name}}
+                {{ cart_item.product.get_name }}
                 {% for option in cart_item.product.get_options %}
                     {% if option.property.display_on_product %}
                         <div>
-                            {{option.property.name}} : {{option.value|option_name}} {{option.property.unit|safe}}
+                            {{ option.property.name }} : {{ option.value|option_name }} {{ option.property.unit|safe }}
                         </div>
                     {% endif %}
                 {% endfor %}
 
             </td>
             <td class="number">
-                {{cart_item.amount|quantity}}
+                {{ cart_item.amount|quantity }}
             </td>
             <td class="number">
-                {{cart_item.product.get_price|currency}}
+                {{ cart_item.product.get_price|currency }}
+                {% if cart_item.product.price_unit %}
+                    / {{ cart_item.product.price_unit }}
+                {% endif %}                
             </td>
             <td class="number">
-                ({{cart_item.product.get_tax|currency}})
+                ({{ cart_item.product.get_tax|currency }})
             </td>
             <td class="number last">
-                {{cart_item.get_price|currency}}
+                {{ cart_item.get_price|currency }}
             </td>
         </tr>
     {% endfor %}
     <tr class="total">
         <td colspan="3"></td>
         <td colspan="3" class="number total">
-            {% trans 'Total' %}: {{total|currency}}
+            {% trans 'Total' %}: {{ total|currency }}
         </td>
     </tr>
 </table>

lfstheme/templates/lfs/cart/cart_inline.html

                                 </div>
                             {% endif %}
                         {% endfor %}
-                        
+
                         {% if cart_item.product.is_configurable_product %}
                             {% for property in cart_item.properties.all %}
                                 <div>
                                 </div>
                             {% endfor %}
                         {% endif %}
-                        
+
                     </td>
                     <td class="number">
                         <input class="cart-amount"
                     <td class="number"
                         nowrap="nowrap">
                         {{ cart_item.product.get_price|currency }}
+                        {% if cart_item.product.price_unit %}
+                            / {{ cart_item.product.price_unit }}
+                        {% endif %}
                     </td>
                     <td class="number"
                         nowrap="nowrap">
                         1
                     </td>
                     <td class="number">
-                        
+
                     </td>
                     <td class="number">
                         {% if discount.tax %}
                         - {{ discount.price|currency }}
                     </td>
                     <td></td>
-                </tr>                
+                </tr>
             {% endfor %}
 
             {% if display_voucher %}
                             name="payment_method">
                         {% for payment_method in payment_methods %}
                             <option {% ifequal payment_method.id selected_payment_method.id  %}selected="selected"{% endifequal %}
-                                    value="{{payment_method.id}}">
+                                    value="{{ payment_method.id }}">
                                 {{ payment_method.name }}
                             </option>
                         {% endfor %}

lfstheme/templates/lfs/checkout/checkout_cart_inline.html

     {% for cart_item in cart.items %}
         <tr>
             <td class="image">
-                <a href="{{cart_item.product.get_absolute_url}}">
-                    <img src="{{cart_item.product.get_image.url_60x60}}"
-                         alt="{{cart_item.product.get_name}}"/>
+                <a href="{{ cart_item.product.get_absolute_url }}">
+                    <img src="{{ cart_item.product.get_image.url_60x60 }}"
+                         alt="{{ cart_item.product.get_name }}"/>
                 </a>
             </td>
             <td>
-                {{cart_item.product.get_name}}
+                {{ cart_item.product.get_name }}
                 {% for option in cart_item.product.get_options %}
                     {% if option.property.display_on_product %}
                         <div>
-                            {{option.property.name}} : {{option.value|option_name}} {{option.property.unit|safe}}
+                            {{ option.property.name }} : {{ option.value|option_name }} {{ option.property.unit|safe }}
                         </div>
                     {% endif %}
                 {% endfor %}
 
             </td>
             <td class="number">
-                {{cart_item.amount}}
+                {{ cart_item.amount }}
             </td>
             <td class="number">
-                {{cart_item.get_price|currency}}
+                {{ cart_item.product.get_price|currency }}
+                {% if cart_item.product.price_unit %}
+                    / {{ cart_item.product.price_unit }}
+                {% endif %}
             </td>
             <td class="number">
-                ({{cart_item.get_tax|currency}})
+                ({{ cart_item.get_tax|currency }})
             </td>
             <td class="number">
-                {{cart_item.get_price|currency}}
+                {{ cart_item.get_price|currency }}
             </td>
         </tr>
     {% endfor %}
                 1
             </td>
             <td class="number">
-                - {{ discount.price|currency }}                
+                - {{ discount.price|currency }}
             </td>
             <td class="number">
                 {% if discount.tax %}
                 - {{ discount.price|currency }}
             </td>
             <td></td>
-        </tr>                
+        </tr>
     {% endfor %}
 
     {% if display_voucher %}
     <tr>
         <td></td>
         <td>
-            {% trans 'Shipping' %} ({{selected_shipping_method.name}})
+            {% trans 'Shipping' %} ({{ selected_shipping_method.name }})
         </td>
         <td class="number">
             1
         </td>
         <td class="number">
-            {{shipping_price|currency}}
+            {{ shipping_price|currency }}
         </td>
         <td></td>
         <td class="number">
-            {{shipping_price|currency}}
+            {{ shipping_price|currency }}
         </td>
     </tr>
 
     <tr>
         <td></td>
         <td>
-            {% trans 'Payment' %} ({{selected_payment_method.name}})
+            {% trans 'Payment' %} ({{ selected_payment_method.name }})
         </td>
         <td class="number">
             1
         </td>
         <td class="number">
-            {{payment_price|currency}}
+            {{ payment_price|currency }}
         </td>
         <td></td>
         <td class="number">
-            {{payment_price|currency}}
+            {{ payment_price|currency }}
         </td>
     </tr>
 
         <td colspan="6"
             class="total number padding-top">
             <span class="total-label">{% trans 'Total' %}:</span>
-            {{cart_price|currency}}
+            {{ cart_price|currency }}
         </td>
     </tr>
     <tr>
         <td colspan="6"
             class="discreet number">
             <span class="total-label">{% trans 'Inclusive VAT' %}:</span>
-            {{cart_tax|currency}}
+            {{ cart_tax|currency }}
         </td>
     </tr>
 </table>