Skip to content

Commit

Permalink
TQLG-277: Message and button when cart is empty (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
adnansaadeddine authored Dec 20, 2024
1 parent 177ce3e commit 7eba104
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
20 changes: 20 additions & 0 deletions components/Layout/Header/LayoutHeaderCart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,34 @@ const { cartItemsWithProduct, cartItemsCount } = storeToRefs(cartItemsStore);
</ul>
<CheckoutSummary :reduced-display="true" />
</div>
<template v-else>
<UtilityStaticNotification
id="empty-cart"
type="info"
:message="$t('checkout.cart.emptyCartMessage')"
class="mt-4"
/>
</template>

<LocaleLink
v-if="!isEmpty"
to="/checkout/cart"
class="mt-4 flex items-center justify-center rounded-md bg-brand-primary px-6 py-3 text-white"
@click="offcanvasCartController.close()"
>
{{ $t('checkout.offcanvasCart.toCartButtonLabel') }}
</LocaleLink>
<FormKit
v-else
type="submit"
ignore
:classes="{
'outer': 'mt-4'
}"
@click="offcanvasCartController.close()"
>
{{ $t('checkout.offcanvasCart.continueShopping') }}
</FormKit>
</template>
</LazyLayoutSidebar>
</template>
3 changes: 2 additions & 1 deletion i18n/de-DE/checkout.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"emptyCartMessage": "Ihr Warenkorb ist leer."
},
"offcanvasCart": {
"toCartButtonLabel": "Zum Warenkorb"
"toCartButtonLabel": "Zum Warenkorb",
"continueShopping": "Weiter einkaufen"
},
"confirm": {
"heading": "Kasse",
Expand Down
3 changes: 2 additions & 1 deletion i18n/en-GB/checkout.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"emptyCartMessage": "Your cart is empty."
},
"offcanvasCart": {
"toCartButtonLabel": "Go to cart"
"toCartButtonLabel": "Go to cart",
"continueShopping": "Continue shopping"
},
"confirm": {
"heading": "Checkout",
Expand Down

0 comments on commit 7eba104

Please sign in to comment.