basket bug fix
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
<td class="px-4 py-3">
|
||||
<a href="/shop/{{ item.slug }}" class="font-medium text-on-surface-strong hover:text-primary dark:text-on-surface-dark-strong dark:hover:text-primary-dark">{{ item.name }}</a>
|
||||
{% if item.variant_label %}<span class="block text-xs text-on-surface/60 dark:text-on-surface-dark/60">{{ item.variant_label }}</span>{% endif %}
|
||||
{% if item.out_of_stock %}<span class="mt-1 inline-flex items-center rounded-radius bg-danger/10 px-2 py-0.5 text-xs font-medium text-danger">{{ t(key="cart-out-of-stock", lang=lang | default(value='sk')) }}</span>{% endif %}
|
||||
</td>
|
||||
<td class="px-4 py-3 tabular-nums">
|
||||
{% if item.on_sale %}
|
||||
@@ -48,7 +49,7 @@
|
||||
class="w-20 rounded-radius border border-outline bg-surface-alt px-2 py-1 text-sm text-on-surface focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:cursor-not-allowed disabled:opacity-75 dark:border-outline-dark dark:bg-surface-dark-alt/50 dark:text-on-surface-dark dark:focus-visible:outline-primary-dark">
|
||||
</form>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right font-medium tabular-nums">{{ item.line_total }} {{ currency_symbol }}</td>
|
||||
<td class="px-4 py-3 text-right font-medium tabular-nums">{% if item.out_of_stock %}<span class="text-on-surface/40 dark:text-on-surface-dark/40">—</span>{% else %}{{ item.line_total }} {{ currency_symbol }}{% endif %}</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<form method="post" action="/cart/remove"
|
||||
hx-post="/cart/remove" hx-target="#cart-body" hx-swap="innerHTML">
|
||||
@@ -70,9 +71,17 @@
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% if has_unavailable %}
|
||||
<p role="alert" class="mt-4 rounded-radius border border-danger/40 bg-danger/10 p-3 text-sm text-on-surface dark:text-on-surface-dark">{{ t(key="cart-remove-unavailable", lang=lang | default(value='sk')) }}</p>
|
||||
{% endif %}
|
||||
|
||||
<div class="mt-6 flex flex-wrap justify-between gap-3">
|
||||
{{ ui::button(variant="outline-secondary", label=t(key="cart-continue", lang=lang | default(value='sk')), href="/shop") }}
|
||||
{% if has_unavailable %}
|
||||
{{ ui::button(label=t(key="cart-checkout", lang=lang | default(value='sk')), size="px-5 py-2 text-sm", attrs='disabled aria-disabled="true"', extra="opacity-50 cursor-not-allowed pointer-events-none") }}
|
||||
{% else %}
|
||||
{{ ui::button(label=t(key="cart-checkout", lang=lang | default(value='sk')), href="/checkout", size="px-5 py-2 text-sm", attrs='hx-boost="false"') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="rounded-radius border border-outline px-6 py-16 text-center dark:border-outline-dark">
|
||||
|
||||
Reference in New Issue
Block a user