Skip to content

Commit 4e48792

Browse files
AlexanderDevitskyAlexander Devitsky
authored andcommitted
fix: configurable product should work when only one attribute is used (#540)
Co-authored-by: Alexander Devitsky <[email protected]>
1 parent 399a3bd commit 4e48792

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/composables/src/composables/useProduct/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ProductsSearchParams> = {
3737

3838
Logger.debug('[Result]:', { data: productDetailsResults });
3939

40-
return productDetailsResults.data.products;
40+
return productDetailsResults.data?.products;
4141

4242
case ProductsQueryType.List:
4343
default:
@@ -48,7 +48,7 @@ ProductsSearchParams> = {
4848

4949
Logger.debug('[Result]:', { data: productListResults });
5050

51-
return productListResults.data.products;
51+
return productListResults.data?.products;
5252
}
5353
},
5454
};

packages/theme/components/RelatedProducts.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<ProductsCarousel
3-
v-if="!loading && products.length > 0"
3+
v-if="!loading && products && products.length"
44
:products="products"
55
:title="$t('Match it with')"
66
/>

packages/theme/components/UpsellProducts.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<ProductsCarousel
3-
v-if="!loading && products.length > 0"
3+
v-if="!loading && products && products.length"
44
:products="products"
55
:title="$t('Other products you might like')"
66
/>

0 commit comments

Comments
 (0)