diff --git a/templates/_types/product/_added.html b/templates/_types/product/_added.html index ad44b9d..3005e4e 100644 --- a/templates/_types/product/_added.html +++ b/templates/_types/product/_added.html @@ -1,8 +1,13 @@ {# HTMX response after add-to-cart: OOB-swap the mini cart + product buttons #} {% import '_types/product/_cart.html' as _cart %} -{# 1. Update mini cart via cart-mini fragment #} -{{ cart_mini_html | safe }} +{# 1. Update mini cart via cart-mini fragment (fallback to local macro) #} +{% if cart_mini_html %} + {{ cart_mini_html | safe }} +{% else %} + {% from '_types/cart/_mini.html' import mini with context %} + {{ mini(count=cart | sum(attribute="quantity")) }} +{% endif %} {# 2. Update add/remove buttons on the product #} {{ _cart.add(d.slug, cart, oob='true') }}