Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Show delivery group contents for address steps

Patryk Zawadzki387501c577cd
diff --git a/saleor/checkout/steps.py b/saleor/checkout/steps.py
index 422625cfc1..6988179940 100644
--- a/saleor/checkout/steps.py
+++ b/saleor/checkout/steps.py
@@ -202,6 +202,7 @@ class ShippingStep(BaseAddressStep):
def process(self, extra_context=None):
context = extra_context or {}
+ context['items'] = self.delivery_group
context['delivery_form'] = self.forms['delivery']
return super(ShippingStep, self).process(extra_context=context)
@@ -246,6 +247,7 @@ class DigitalDeliveryStep(BaseCheckoutStep):
def process(self, extra_context=None):
context = extra_context or {}
context['form'] = self.forms['email']
+ context['items'] = self.delivery_group
return super(DigitalDeliveryStep, self).process(extra_context=context)
diff --git a/saleor/checkout/templates/checkout/details.html b/saleor/checkout/templates/checkout/details.html
index 3d2d4807d7..61feb47b9a 100644
--- a/saleor/checkout/templates/checkout/details.html
+++ b/saleor/checkout/templates/checkout/details.html
@@ -30,6 +30,8 @@
<hr>
+{% block step_info %}{% endblock %}
+
{% block forms %}{% endblock %}
{% endblock content %}
diff --git a/saleor/checkout/templates/checkout/digitaldelivery.html b/saleor/checkout/templates/checkout/digitaldelivery.html
index 3c9231f046..12412c25df 100644
--- a/saleor/checkout/templates/checkout/digitaldelivery.html
+++ b/saleor/checkout/templates/checkout/digitaldelivery.html
@@ -2,6 +2,25 @@
{% load i18n %}
{% load as_horizontal_form from bootstrap %}
+{% block step_info %}
+ <h3>{% trans "Please provide an address for the following items:" %}</h3>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th class="col-sm-12">{% trans "Name" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for item in items %}
+ <tr>
+ <td class="col-sm-12">{{ item.product }}{% if item.quantity != 1 %} <em>×{{ item.quantity }}</em>{% endif %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <hr>
+{% endblock %}
+
{% block forms %}
<form method="post" class="form-horizontal">
{% csrf_token %}
diff --git a/saleor/checkout/templates/checkout/shipping.html b/saleor/checkout/templates/checkout/shipping.html
index 875bcd14a0..2e8d75dafa 100644
--- a/saleor/checkout/templates/checkout/shipping.html
+++ b/saleor/checkout/templates/checkout/shipping.html
@@ -1,8 +1,28 @@
{% extends "checkout/address.html" %}
{% load as_horizontal_form from bootstrap %}
{% load as_vertical_form from bootstrap %}
+{% load gross from prices %}
{% load i18n %}
+{% block step_info %}
+ <h3>{% trans "Please provide shipping information for the following items:" %}</h3>
+ <table class="table table-striped">
+ <thead>
+ <tr>
+ <th class="col-sm-12">{% trans "Name" %}</th>
+ </tr>
+ </thead>
+ <tbody>
+ {% for item in items %}
+ <tr>
+ <td class="col-sm-12">{{ item.product }}{% if item.quantity != 1 %} <em>×{{ item.quantity }}</em>{% endif %}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ <hr>
+{% endblock %}
+
{% block use_this_address %}
<button type="submit" class="btn {% if entry.is_default %}btn-primary{% else %}btn-default{% endif %} btn-lg col-sm-12">{% trans "Ship to this address" %}</button>
{% endblock %}