From d41e5104835a54d0a7ee4cbd2e16518e3add5951 Mon Sep 17 00:00:00 2001 From: indykoning <15870933+indykoning@users.noreply.github.com> Date: Mon, 18 May 2026 10:30:44 +0200 Subject: [PATCH 1/3] Fixed attributeLabel is not a function --- resources/js/stores/useAttributes.js | 6 +++--- resources/views/cart/item.blade.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/js/stores/useAttributes.js b/resources/js/stores/useAttributes.js index e16ef9b6a..fca5b9f3d 100644 --- a/resources/js/stores/useAttributes.js +++ b/resources/js/stores/useAttributes.js @@ -38,8 +38,8 @@ export const attributes = computedAsync( { lazy: true, shallow: false }, ) -window.attributeLabel = computed((attributeCode) => { - return Object.values(attributes.value)?.find((attribute) => attribute.code === attributeCode)?.name -}) +window.attributeLabel = (attributeCode) => { + return computed(() => Object.values(attributes.value)?.find((attribute) => attribute.code === attributeCode)?.name) +} export default () => attributes diff --git a/resources/views/cart/item.blade.php b/resources/views/cart/item.blade.php index 34db0db5d..d0e3d388b 100644 --- a/resources/views/cart/item.blade.php +++ b/resources/views/cart/item.blade.php @@ -27,7 +27,7 @@ class="mx-auto"
@include('rapidez::cart.item.remove') From 67f51407643e79f0e0fe712cc542273249508fa7 Mon Sep 17 00:00:00 2001 From: indykoning <15870933+indykoning@users.noreply.github.com> Date: Mon, 18 May 2026 10:56:35 +0200 Subject: [PATCH 2/3] Use attribute code if label is missing --- resources/js/stores/useAttributes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/stores/useAttributes.js b/resources/js/stores/useAttributes.js index fca5b9f3d..bb227539b 100644 --- a/resources/js/stores/useAttributes.js +++ b/resources/js/stores/useAttributes.js @@ -39,7 +39,7 @@ export const attributes = computedAsync( ) window.attributeLabel = (attributeCode) => { - return computed(() => Object.values(attributes.value)?.find((attribute) => attribute.code === attributeCode)?.name) + return computed(() => Object.values(attributes.value)?.find((attribute) => attribute.code === attributeCode)?.name ?? attributeCode.replaceAll(/[_-]/g, ' ')) } export default () => attributes From 7414a93bb60b4b75830793ce4c07aee4cae35c6a Mon Sep 17 00:00:00 2001 From: indykoning Date: Mon, 18 May 2026 08:57:08 +0000 Subject: [PATCH 3/3] Apply fixes from Prettier --- resources/js/stores/useAttributes.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/resources/js/stores/useAttributes.js b/resources/js/stores/useAttributes.js index bb227539b..08c7d45db 100644 --- a/resources/js/stores/useAttributes.js +++ b/resources/js/stores/useAttributes.js @@ -39,7 +39,11 @@ export const attributes = computedAsync( ) window.attributeLabel = (attributeCode) => { - return computed(() => Object.values(attributes.value)?.find((attribute) => attribute.code === attributeCode)?.name ?? attributeCode.replaceAll(/[_-]/g, ' ')) + return computed( + () => + Object.values(attributes.value)?.find((attribute) => attribute.code === attributeCode)?.name ?? + attributeCode.replaceAll(/[_-]/g, ' '), + ) } export default () => attributes