basket bug fix
This commit is contained in:
@@ -347,6 +347,8 @@ cart-total = Total
|
||||
cart-checkout = Proceed to checkout
|
||||
cart-remove = Remove
|
||||
cart-remove-confirm = Remove this item from the cart?
|
||||
cart-out-of-stock = Out of stock
|
||||
cart-remove-unavailable = Some items in your cart are out of stock. Remove them to continue to checkout.
|
||||
cart-update = Update
|
||||
cart-continue = Continue shopping
|
||||
checkout-title = Checkout
|
||||
|
||||
@@ -347,6 +347,8 @@ cart-total = Spolu
|
||||
cart-checkout = Pokračovať k pokladni
|
||||
cart-remove = Odstrániť
|
||||
cart-remove-confirm = Odstrániť túto položku z košíka?
|
||||
cart-out-of-stock = Vypredané
|
||||
cart-remove-unavailable = Niektoré položky v košíku sú vypredané. Pred pokračovaním na pokladňu ich odstráňte.
|
||||
cart-update = Aktualizovať
|
||||
cart-continue = Pokračovať v nákupe
|
||||
checkout-title = Pokladňa
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -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">
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
<div class="min-w-0 flex-1">
|
||||
<a href="/shop/{{ item.slug }}" class="block truncate text-sm 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 truncate text-xs text-on-surface/60 dark:text-on-surface-dark/60">{{ item.variant_label }}</span>{% endif %}
|
||||
<p class="mt-0.5 text-xs tabular-nums text-on-surface dark:text-on-surface-dark">{{ item.quantity }} × {{ item.price }} {{ currency_symbol }}</p>
|
||||
{% if item.out_of_stock %}<span class="mt-0.5 inline-flex items-center rounded-radius bg-danger/10 px-1.5 py-0.5 text-xs font-medium text-danger">{{ t(key="cart-out-of-stock", lang=lang | default(value='sk')) }}</span>
|
||||
{% else %}<p class="mt-0.5 text-xs tabular-nums text-on-surface dark:text-on-surface-dark">{{ item.quantity }} × {{ item.price }} {{ currency_symbol }}</p>{% endif %}
|
||||
</div>
|
||||
<span class="shrink-0 text-sm font-semibold tabular-nums text-on-surface-strong dark:text-on-surface-dark-strong">{{ item.line_total }} {{ currency_symbol }}</span>
|
||||
<span class="shrink-0 text-sm font-semibold tabular-nums text-on-surface-strong dark:text-on-surface-dark-strong">{% 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 %}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -22,7 +23,11 @@
|
||||
</div>
|
||||
<div class="flex gap-2">
|
||||
{{ ui::button(href="/cart", variant="outline-primary", label=t(key="cart-title", lang=lang | default(value='sk')), extra="flex-1", attrs='hx-boost="false"') }}
|
||||
{% if has_unavailable %}
|
||||
{{ ui::button(variant="primary", label=t(key="cart-checkout", lang=lang | default(value='sk')), extra="flex-1 opacity-50 cursor-not-allowed pointer-events-none", attrs='disabled aria-disabled="true"') }}
|
||||
{% else %}
|
||||
{{ ui::button(href="/checkout", variant="primary", label=t(key="cart-checkout", lang=lang | default(value='sk')), extra="flex-1", attrs='hx-boost="false"') }}
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% else %}
|
||||
|
||||
Reference in New Issue
Block a user