Skip to content

Commit b753781

Browse files
bartoszherbaMarcin Kwiatkowski
authored andcommitted
fix(theme): out of stock product will no longer break cart (#404)
* fix(theme): out of stock product will no longer break cart * fix(theme): remove cart load from layout * docs(theme): update tests for CartSidebar Co-authored-by: Bartosz Herba <[email protected]>
1 parent fd5dbb6 commit b753781

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/theme/components/CartSidebar.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,12 @@ export default defineComponent({
341341
const delayedUpdateItemQty = _debounce((params) => updateItemQty(params), 1000);
342342
const isInStock = (product) => cartGetters.getStockStatus(product) === stockStatusEnum.inStock;
343343
344+
const isInStock = (product) => cartGetters.getStockStatus(product) === stockStatusEnum.inStock;
345+
344346
return {
345347
sendToRemove,
346348
actionRemoveItem,
347-
loading,
349+
loading: computed(() => (!!loading.value)),
348350
isAuthenticated,
349351
products,
350352
removeItem,

packages/theme/components/Header/SearchBar/SearchResults.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
>
3737
<SfMenuItem
3838
:label="category.label"
39-
:link="localePath(th.getAgnosticCatLink(category))"
39+
:link="th.getAgnosticCatLink(category)"
4040
>
4141
<template #mobile-nav-icon>
4242
&#8203;
@@ -78,7 +78,7 @@
7878
:image="getMagentoImage(productGetters.getProductThumbnailImage(product))"
7979
:alt="productGetters.getName(product)"
8080
:title="productGetters.getName(product)"
81-
:link="localePath(`/p/${productGetters.getProductSku(product)}${productGetters.getSlug(product, product.categories[0])}`)"
81+
:link="`/p/${productGetters.getProductSku(product)}${productGetters.getSlug(product, product.categories[0])}`"
8282
:wishlist-icon="isAuthenticated ? 'heart' : ''"
8383
:is-in-wishlist-icon="isAuthenticated ? 'heart_fill' : ''"
8484
:is-in-wishlist="product.isInWishlist"
@@ -130,7 +130,7 @@
130130
:image="getMagentoImage(productGetters.getProductThumbnailImage(product))"
131131
:alt="productGetters.getName(product)"
132132
:title="productGetters.getName(product)"
133-
:link="localePath(`/p/${productGetters.getProductSku(product)}${productGetters.getSlug(product, product.categories[0])}`)"
133+
:link="`/p/${productGetters.getProductSku(product)}${productGetters.getSlug(product, product.categories[0])}`"
134134
:wishlist-icon="isAuthenticated ? 'heart' : ''"
135135
:is-in-wishlist-icon="isAuthenticated ? 'heart_fill' : ''"
136136
:is-in-wishlist="product.isInWishlist"

0 commit comments

Comments
 (0)