From 5346473f753eb6c9be28dfb41b92369cce225ae8 Mon Sep 17 00:00:00 2001 From: Vishal Sodani Date: Mon, 29 Aug 2016 23:00:08 +0530 Subject: [PATCH] Fix #180 -- Hide add to cart button if no products active or no quantity left (#200) * Hide add to cart button if no products active or no quantity left(#180) * Fix PEP errors and improve logic * Fix tests for add to cart change * Fix the logic for toggling the visibility of Add to Cart button --- src/pretix/presale/templates/pretixpresale/event/index.html | 2 +- src/pretix/presale/views/event.py | 5 ++++- src/tests/presale/test_event.py | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/pretix/presale/templates/pretixpresale/event/index.html b/src/pretix/presale/templates/pretixpresale/event/index.html index 911d828ca..b5adafad4 100644 --- a/src/pretix/presale/templates/pretixpresale/event/index.html +++ b/src/pretix/presale/templates/pretixpresale/event/index.html @@ -202,7 +202,7 @@ {% endfor %} {% endfor %} - {% if event.presale_is_running %} + {% if event.presale_is_running and display_add_to_cart %}