Replace shared _added.html with market-owned version using cart-mini fragment
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 53s

The shared _added.html imported _types/cart/_cart.html which only
exists in the cart app. Market now has its own _added.html that:
- Fetches cart-mini fragment for the OOB mini cart update
- Uses market's own _types/product/_cart.html macros
- Drops cart summary/show_cart (not visible on product pages)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
giles
2026-02-24 10:49:09 +00:00
parent d92d4840ed
commit 06e700820e
2 changed files with 27 additions and 7 deletions

View File

@@ -0,0 +1,16 @@
{# 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 }}
{# 2. Update add/remove buttons on the product #}
{{ _cart.add(d.slug, cart, oob='true') }}
{# 3. Update cart item row if visible #}
{% from '_types/product/_cart.html' import cart_item with context %}
{% if item and item.quantity > 0 %}
{{ cart_item(oob='true') }}
{% elif item %}
{{ cart_item(oob='delete') }}
{% endif %}