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
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:
16
templates/_types/product/_added.html
Normal file
16
templates/_types/product/_added.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user