Commits

Maciej Wiśniowski committed 3a3c3cb

fixed displaying invalid cart item price at management panel; fixed issue: #189

Comments (0)

Files changed (2)

lfs/cart/models.py

         """
         properties = []
         for property in self.product.get_properties():
+            price = ""
+
             try:
                 cipv = CartItemPropertyValue.objects.get(cart_item=self, property=property)
             except CartItemPropertyValue.DoesNotExist:
                     value = option.name
                     price = option.price
 
-            else:
+            elif property.is_number_field:
                 format_string = "%%.%sf" % property.decimal_places
                 try:
                     value = format_string % float(cipv.value)
                 except ValueError:
                     value = "%.2f" % float(cipv.value)
-
-                price = ""
+            else:
+                value = cipv.value
 
             properties.append({
                 "name": property.name,

lfs/templates/manage/cart/cart_inline.html

                 	{{ item.product.get_name }}
                 </td>
                 <td class="number">
-                    {{ item.product|get_price:request|currency:request }}
+                    {{ item|get_price:request|currency:request }}
                 </td>
                 <td class="number">
                     {{ item.amount }}