redirect back to shop after adding something to an order, and make link to shopping cart bigger
This commit is contained in:
parent
8de597d5e5
commit
ca0ed4fb27
|
@ -16,21 +16,14 @@
|
|||
{% if user.creditnotes.exists %}
|
||||
<li class="pull-right"><a href="{% url 'shop:creditnote_list' %}">Credit Notes</a></li>
|
||||
{% endif %}
|
||||
<li class="pull-right"><a href="{% url 'shop:order_list' %}">Orders</a></li>
|
||||
{% if current_order %}
|
||||
<li class="pull-right no-before">
|
||||
|
||||
{% if current_order and current_order.get_number_of_items %}
|
||||
<a href="{% url 'shop:order_detail' pk=current_order.pk %}">
|
||||
{% endif %}
|
||||
|
||||
<i class="glyphicon glyphicon-shopping-cart"></i>
|
||||
<span class="badge">
|
||||
{{ current_order.get_number_of_items|default:0 }}
|
||||
</span>
|
||||
{% if current_order and current_order.get_number_of_items %}
|
||||
</a>
|
||||
{% endif %}
|
||||
<i class="glyphicon glyphicon-shopping-cart"></i> Shopping Cart ({{ current_order.get_number_of_items|default:0 }} items)</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="pull-right no-before"><a href="{% url 'shop:order_list' %}">Show Orders</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</ol>
|
||||
</div>
|
||||
|
|
|
@ -249,9 +249,7 @@ class ProductDetailView(FormView, DetailView):
|
|||
return super(ProductDetailView, self).form_valid(form)
|
||||
|
||||
def get_success_url(self):
|
||||
return Order.objects.get(
|
||||
user=self.request.user, open__isnull=False
|
||||
).get_absolute_url()
|
||||
return reverse("shop:index")
|
||||
|
||||
|
||||
class OrderListView(LoginRequiredMixin, ListView):
|
||||
|
|
Loading…
Reference in a new issue