From e9a340d9ca4d3dcb58907776a0af231ee0210b05 Mon Sep 17 00:00:00 2001 From: Raphael Michel Date: Wed, 1 May 2019 13:28:00 +0200 Subject: [PATCH] Refs #1128 -- Popover on disabled "add to cart" button --- src/pretix/static/pretixpresale/js/ui/main.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pretix/static/pretixpresale/js/ui/main.js b/src/pretix/static/pretixpresale/js/ui/main.js index 7ff44da4a..ca333b33e 100644 --- a/src/pretix/static/pretixpresale/js/ui/main.js +++ b/src/pretix/static/pretixpresale/js/ui/main.js @@ -197,7 +197,11 @@ $(function () { } }); } - $("#btn-add-to-cart").prop("disabled", !is_enabled); + if (!is_enabled) { + $("#btn-add-to-cart").prop("disabled", !is_enabled).popover({'content': gettext("Please enter a quantity for one of the ticket types."), 'placement': 'top', 'trigger': 'hover focus'}); + } else { + $("#btn-add-to-cart").prop("disabled", false).popover("destroy") + } }; update_cart_form(); $(".product-row input[type=checkbox], .variations input[type=checkbox], .product-row input[type=radio], .variations input[type=radio], .input-item-count").on("change mouseup keyup", update_cart_form);