diff --git a/src/dashboard/views.py b/src/dashboard/views.py index 7f145c6..ae5d8e5 100644 --- a/src/dashboard/views.py +++ b/src/dashboard/views.py @@ -47,6 +47,7 @@ from core import ( OrderStatus ) from .forms import ( + ProductVariantUpdateForm, OrderLineFulfillForm, OrderLineFormset, OrderCancelForm, @@ -438,14 +439,7 @@ class ProductVariantUpdateView(SuccessMessageMixin, UpdateView): pk_url_kwarg = 'variant_pk' success_message = 'ProductVariant saved.' template_name = 'dashboard/variant_form.html' - fields = [ - 'name', - 'sku', - 'price', - 'weight', - 'track_inventory', - 'stock', - ] + form_class = ProductVariantUpdateForm context_object_name = 'variant' def get_context_data(self, **kwargs): diff --git a/src/storefront/templates/storefront/cart_detail.html b/src/storefront/templates/storefront/cart_detail.html index f5e0451..75679a1 100644 --- a/src/storefront/templates/storefront/cart_detail.html +++ b/src/storefront/templates/storefront/cart_detail.html @@ -13,7 +13,11 @@
{% with product=item.variant.product %}
+ {% if item.variant.image %} + {{item.variant.image.image}} + {% else %} {{product.get_first_img.image}} + {% endif %}

{{product.name}}

diff --git a/src/storefront/templates/storefront/order_detail.html b/src/storefront/templates/storefront/order_detail.html index edfe4b0..cdfe16d 100644 --- a/src/storefront/templates/storefront/order_detail.html +++ b/src/storefront/templates/storefront/order_detail.html @@ -23,7 +23,11 @@ {% with product=item.variant.product %} + {% if item.variant.image %} + {{item.variant.image.image}} + {% else %} {{product.get_first_img.image}} + {% endif %} {{ item.variant }}
diff --git a/src/storefront/templates/storefront/order_form.html b/src/storefront/templates/storefront/order_form.html index 4e782d3..2e24fdb 100644 --- a/src/storefront/templates/storefront/order_form.html +++ b/src/storefront/templates/storefront/order_form.html @@ -34,7 +34,11 @@
{% with product=item.variant.product %}
+ {% if item.variant.image %} + {{item.variant.image.image}} + {% else %} {{product.get_first_img.image}} + {% endif %}

{{product.name}}